[libgetdata] 01/03: Upstream 0.7.3
Alastair McKinstry
mckinstry at moszumanska.debian.org
Mon Aug 17 16:12:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository libgetdata.
commit 05fca0504d55ba723753ac49ce315e5d01072ad5
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Sun Aug 16 05:25:10 2015 +0100
Upstream 0.7.3
---
AUTHORS | 30 +
COPYING | 504 +
COPYING.DOC | 397 +
ChangeLog | 4015 +++
INSTALL | 238 +
Makefile.am | 110 +
Makefile.in | 926 +
NEWS | 812 +
README | 265 +
TODO | 7 +
aclocal.m4 | 1184 +
bindings/Makefile.am | 52 +
bindings/Makefile.in | 719 +
bindings/cxx/Makefile.am | 57 +
bindings/cxx/Makefile.in | 840 +
bindings/cxx/bitentry.cpp | 126 +
bindings/cxx/carrayentry.cpp | 59 +
bindings/cxx/constentry.cpp | 48 +
bindings/cxx/dirfile.cpp | 442 +
bindings/cxx/divideentry.cpp | 59 +
bindings/cxx/entry.cpp | 198 +
bindings/cxx/fragment.cpp | 93 +
bindings/cxx/getdata/bitentry.h | 62 +
bindings/cxx/getdata/carrayentry.h | 57 +
bindings/cxx/getdata/constentry.h | 52 +
bindings/cxx/getdata/dirfile.h | 226 +
bindings/cxx/getdata/divideentry.h | 52 +
bindings/cxx/getdata/entry.h | 230 +
bindings/cxx/getdata/fragment.h | 97 +
bindings/cxx/getdata/indexentry.h | 40 +
bindings/cxx/getdata/lincomentry.h | 94 +
bindings/cxx/getdata/linterpentry.h | 53 +
bindings/cxx/getdata/multiplyentry.h | 52 +
bindings/cxx/getdata/phaseentry.h | 58 +
bindings/cxx/getdata/polynomentry.h | 75 +
bindings/cxx/getdata/rawentry.h | 59 +
bindings/cxx/getdata/recipentry.h | 69 +
bindings/cxx/getdata/sbitentry.h | 62 +
bindings/cxx/getdata/stringentry.h | 45 +
bindings/cxx/indexentry.cpp | 27 +
bindings/cxx/lincomentry.cpp | 228 +
bindings/cxx/linterpentry.cpp | 72 +
bindings/cxx/multiplyentry.cpp | 59 +
bindings/cxx/phaseentry.cpp | 82 +
bindings/cxx/polynomentry.cpp | 167 +
bindings/cxx/rawentry.cpp | 82 +
bindings/cxx/recipentry.cpp | 113 +
bindings/cxx/sbitentry.cpp | 125 +
bindings/cxx/stringentry.cpp | 36 +
bindings/cxx/test/Makefile.am | 48 +
bindings/cxx/test/Makefile.in | 668 +
bindings/cxx/test/big_test.cpp | 1331 +
bindings/f77/Makefile.am | 118 +
bindings/f77/Makefile.in | 891 +
bindings/f77/fgetdata.c | 2918 ++
bindings/f77/fgetdata.h | 562 +
bindings/f77/getdata.f.in | 293 +
bindings/f77/getdata.f90.in | 2121 ++
bindings/f77/test/Makefile.am | 65 +
bindings/f77/test/Makefile.in | 682 +
bindings/f77/test/big_test.f | 3987 +++
bindings/f77/test/big_test95.f90 | 4797 ++++
bindings/f77/test/gdcopn.f | 59 +
bindings/idl/Makefile.am | 98 +
bindings/idl/Makefile.in | 861 +
bindings/idl/getdata.c | 4739 +++
bindings/idl/makedlm.sh.in | 73 +
bindings/idl/test/Makefile.am | 40 +
bindings/idl/test/Makefile.in | 549 +
bindings/idl/test/big_test.pro | 1123 +
bindings/idl/test/getdata_idl_test_routines.pro | 64 +
bindings/make_parameters.c | 359 +
bindings/python/Makefile.am | 53 +
bindings/python/Makefile.in | 805 +
bindings/python/pydirfile.c | 2622 ++
bindings/python/pyentry.c | 2046 ++
bindings/python/pyfragment.c | 415 +
bindings/python/pygetdata.c | 617 +
bindings/python/pygetdata.h | 128 +
bindings/python/test/Makefile.am | 40 +
bindings/python/test/Makefile.in | 549 +
bindings/python/test/big_test.py | 1530 +
bindings/python/test/callback.py | 50 +
config.guess | 1501 +
config.sub | 1705 ++
configure | 33458 ++++++++++++++++++++++
configure.ac | 888 +
depcomp | 630 +
doc/Makefile.am | 47 +
doc/Makefile.in | 500 +
doc/README.cxx | 696 +
doc/README.f77 | 1786 ++
doc/README.f95 | 728 +
doc/README.idl | 813 +
doc/README.python | 23 +
doc/unclean_database_recovery.txt | 184 +
install-sh | 520 +
ltmain.sh | 9636 +++++++
m4/ax_compare_version.m4 | 174 +
m4/compiler.m4 | 253 +
m4/encoding.m4 | 133 +
m4/idl.m4 | 134 +
m4/libtool.m4 | 7831 +++++
m4/ltoptions.m4 | 369 +
m4/ltsugar.m4 | 123 +
m4/ltversion.m4 | 23 +
m4/lt~obsolete.m4 | 98 +
m4/python.m4 | 172 +
m4/version.m4 | 42 +
m4/win32.m4 | 43 +
man/Makefile.am | 110 +
man/Makefile.in | 702 +
man/checkdirfile.1 | 48 +
man/dirfile-encoding.5 | 193 +
man/dirfile-format.5 | 1108 +
man/dirfile.5 | 141 +
man/dirfile2ascii.1 | 144 +
man/gd_add.3 | 223 +
man/gd_add_bit.3 | 332 +
man/gd_add_spec.3 | 164 +
man/gd_alter_bit.3 | 297 +
man/gd_alter_encoding.3.in | 148 +
man/gd_alter_endianness.3.in | 158 +
man/gd_alter_entry.3 | 267 +
man/gd_alter_frameoffset.3.in | 141 +
man/gd_alter_protection.3 | 98 +
man/gd_alter_spec.3 | 169 +
man/gd_bof.3 | 109 +
man/gd_carray_len.3 | 80 +
man/gd_carrays.3 | 139 +
man/gd_cbopen.3 | 686 +
man/gd_close.3 | 112 +
man/gd_constants.3 | 105 +
man/gd_delete.3 | 148 +
man/gd_dirfile_standards.3 | 119 +
man/gd_dirfilename.3 | 61 +
man/gd_encoding.3 | 85 +
man/gd_endianness.3 | 78 +
man/gd_entry.3 | 768 +
man/gd_entry_type.3 | 87 +
man/gd_eof.3 | 135 +
man/gd_error.3 | 49 +
man/gd_error_string.3 | 75 +
man/gd_field_list.3 | 81 +
man/gd_field_list_by_type.3 | 108 +
man/gd_flush.3 | 91 +
man/gd_fragment_index.3 | 72 +
man/gd_fragmentname.3 | 78 +
man/gd_framenum_subset.3 | 176 +
man/gd_framenum_subset64.3 | 51 +
man/gd_frameoffset.3 | 71 +
man/gd_frameoffset64.3 | 61 +
man/gd_free_entry_strings.3 | 70 +
man/gd_get_carray_slice.3 | 192 +
man/gd_get_constant.3 | 162 +
man/gd_get_string.3 | 112 +
man/gd_getdata.3 | 289 +
man/gd_getdata64.3 | 50 +
man/gd_include.3 | 312 +
man/gd_invalid_dirfile.3 | 72 +
man/gd_madd_bit.3 | 283 +
man/gd_mcarrays.3 | 142 +
man/gd_mconstants.3 | 102 +
man/gd_metaflush.3 | 83 +
man/gd_mfield_list.3 | 84 +
man/gd_mfield_list_by_type.3 | 109 +
man/gd_move.3 | 127 +
man/gd_mstrings.3 | 95 +
man/gd_mvector_list.3 | 88 +
man/gd_native_type.3 | 156 +
man/gd_nfields.3 | 63 +
man/gd_nfields_by_type.3 | 77 +
man/gd_nfragments.3 | 63 +
man/gd_nframes.3 | 86 +
man/gd_nframes64.3 | 48 +
man/gd_nmfields.3 | 67 +
man/gd_nmfields_by_type.3 | 79 +
man/gd_nmvectors.3 | 68 +
man/gd_nvectors.3 | 67 +
man/gd_parent_fragment.3 | 66 +
man/gd_parser_callback.3 | 57 +
man/gd_protection.3 | 70 +
man/gd_put_carray_slice.3 | 186 +
man/gd_put_constant.3 | 159 +
man/gd_put_string.3 | 107 +
man/gd_putdata.3 | 226 +
man/gd_putdata64.3 | 50 +
man/gd_raw_filename.3 | 86 +
man/gd_reference.3 | 93 +
man/gd_rename.3 | 122 +
man/gd_rewrite_fragment.3 | 88 +
man/gd_spf.3 | 89 +
man/gd_strings.3 | 94 +
man/gd_uninclude.3 | 123 +
man/gd_validate.3 | 95 +
man/gd_vector_list.3 | 85 +
missing | 376 +
src/Makefile.am | 143 +
src/Makefile.in | 1029 +
src/add.c | 1809 ++
src/ascii.c | 447 +
src/bzip.c | 283 +
src/close.c | 123 +
src/common.c | 887 +
src/compat.c | 234 +
src/config.h.in | 486 +
src/constant.c | 372 +
src/debug.c | 50 +
src/del.c | 481 +
src/encoding.c | 651 +
src/endian.c | 223 +
src/entry.c | 546 +
src/errors.c | 330 +
src/field_list.c | 348 +
src/flimits.c | 593 +
src/flush.c | 944 +
src/fragment.c | 85 +
src/getdata.c | 1608 ++
src/getdata.h.in | 1053 +
src/getdata.pc.in | 13 +
src/getdata_legacy.h | 130 +
src/globals.c | 120 +
src/gzip.c | 149 +
src/include.c | 445 +
src/index.c | 299 +
src/internal.h | 780 +
src/legacy.c | 593 +
src/lzma.c | 334 +
src/meta_list.c | 392 +
src/mod.c | 1594 ++
src/move.c | 424 +
src/name.c | 290 +
src/nan.h | 34 +
src/native.c | 179 +
src/nfields.c | 95 +
src/nframes.c | 84 +
src/nmeta.c | 120 +
src/open.c | 380 +
src/parse.c | 1932 ++
src/protect.c | 94 +
src/putdata.c | 725 +
src/raw.c | 186 +
src/slim.c | 126 +
src/spf.c | 120 +
src/string.c | 89 +
src/types.c | 695 +
test/Makefile.am | 343 +
test/Makefile.in | 7364 +++++
test/add.c | 62 +
test/add_bit.c | 44 +
test/add_bit_bitnum.c | 33 +
test/add_bit_bitsize.c | 33 +
test/add_bit_invalid.c | 23 +
test/add_bit_numbits.c | 33 +
test/add_carray.c | 49 +
test/add_clincom.c | 66 +
test/add_code.c | 41 +
test/add_const.c | 45 +
test/add_cpolynom.c | 58 +
test/add_crecip.c | 48 +
test/add_crecip89.c | 46 +
test/add_divide.c | 42 +
test/add_divide_invalid.c | 22 +
test/add_duplicate.c | 49 +
test/add_format.c | 41 +
test/add_invalid.c | 31 +
test/add_lincom.c | 54 +
test/add_lincom_invalid.c | 26 +
test/add_lincom_nfields.c | 36 +
test/add_linterp.c | 43 +
test/add_linterp_invalid.c | 22 +
test/add_multiply.c | 43 +
test/add_multiply_invalid.c | 22 +
test/add_phase.c | 43 +
test/add_phase_invalid.c | 22 +
test/add_polynom.c | 48 +
test/add_protect.c | 48 +
test/add_raw.c | 45 +
test/add_raw_include.c | 49 +
test/add_raw_invalid.c | 22 +
test/add_raw_spf.c | 33 +
test/add_raw_type.c | 33 +
test/add_rdonly.c | 48 +
test/add_recip.c | 43 +
test/add_sbit.c | 44 +
test/add_scalar.c | 59 +
test/add_sort.c | 85 +
test/add_spec.c | 46 +
test/add_spec_directive.c | 37 +
test/add_spec_invalid.c | 23 +
test/add_spec_meta.c | 48 +
test/add_string.c | 45 +
test/add_type.c | 40 +
test/alter_bit_bitnum.c | 56 +
test/alter_bit_numbits.c | 56 +
test/alter_carray_len.c | 48 +
test/alter_carray_type.c | 48 +
test/alter_const.c | 44 +
test/alter_cpolynom.c | 73 +
test/alter_crecip.c | 62 +
test/alter_crecip89.c | 60 +
test/alter_crecip_zero.c | 62 +
test/alter_divide.c | 57 +
test/alter_entry.c | 57 +
test/alter_entry_recode.c | 73 +
test/alter_entry_scalar2a.c | 51 +
test/alter_entry_scalar2n.c | 59 +
test/alter_entry_scalar3.c | 50 +
test/alter_entry_scalar4.c | 51 +
test/alter_lincom_23.c | 60 +
test/alter_lincom_32.c | 60 +
test/alter_lincom_input.c | 58 +
test/alter_lincom_offset.c | 59 +
test/alter_lincom_slope.c | 59 +
test/alter_linterp.c | 78 +
test/alter_linterp_move.c | 71 +
test/alter_mspec.c | 56 +
test/alter_multiply.c | 57 +
test/alter_phase.c | 56 +
test/alter_polynom_coeff.c | 70 +
test/alter_polynom_input.c | 59 +
test/alter_polynom_ord.c | 59 +
test/alter_raw_spf.c | 68 +
test/alter_raw_type.c | 68 +
test/alter_recip.c | 57 +
test/alter_recip_zero.c | 57 +
test/alter_spec.c | 68 +
test/alter_spec_meta.c | 56 +
test/ascii_get.c | 51 +
test/ascii_get_get.c | 58 +
test/ascii_nframes.c | 46 +
test/ascii_put.c | 67 +
test/bof.c | 43 +
test/bof_lincom.c | 61 +
test/bof_phase.c | 64 +
test/bzip_get.c | 75 +
test/bzip_get_get.c | 75 +
test/bzip_move_from.c | 108 +
test/bzip_nframes.c | 72 +
test/close.c | 29 +
test/close_bad.c | 13 +
test/close_discard.c | 37 +
test/close_null.c | 12 +
test/convert_complex128_complex64.c | 71 +
test/convert_complex128_float64.c | 53 +
test/convert_complex128_int64.c | 52 +
test/convert_complex128_uint64.c | 52 +
test/convert_complex64_complex128.c | 70 +
test/convert_complex64_float64.c | 53 +
test/convert_complex64_int64.c | 52 +
test/convert_complex64_uint64.c | 52 +
test/convert_float32_complex128.c | 64 +
test/convert_float32_complex64.c | 64 +
test/convert_float32_float64.c | 54 +
test/convert_float32_int16.c | 53 +
test/convert_float32_int32.c | 53 +
test/convert_float32_int64.c | 53 +
test/convert_float32_int8.c | 53 +
test/convert_float32_uint16.c | 53 +
test/convert_float32_uint32.c | 53 +
test/convert_float32_uint64.c | 53 +
test/convert_float32_uint8.c | 53 +
test/convert_float64_complex128.c | 64 +
test/convert_float64_complex64.c | 64 +
test/convert_float64_float32.c | 54 +
test/convert_float64_int16.c | 54 +
test/convert_float64_int32.c | 54 +
test/convert_float64_int64.c | 54 +
test/convert_float64_int8.c | 54 +
test/convert_float64_uint16.c | 54 +
test/convert_float64_uint32.c | 54 +
test/convert_float64_uint64.c | 54 +
test/convert_float64_uint8.c | 54 +
test/convert_int16_complex128.c | 64 +
test/convert_int16_complex64.c | 64 +
test/convert_int16_float32.c | 54 +
test/convert_int16_float64.c | 54 +
test/convert_int16_int32.c | 53 +
test/convert_int16_int64.c | 53 +
test/convert_int16_int8.c | 53 +
test/convert_int16_uint16.c | 53 +
test/convert_int16_uint32.c | 53 +
test/convert_int16_uint64.c | 53 +
test/convert_int16_uint8.c | 53 +
test/convert_int32_complex128.c | 64 +
test/convert_int32_complex64.c | 64 +
test/convert_int32_float32.c | 54 +
test/convert_int32_float64.c | 54 +
test/convert_int32_int16.c | 54 +
test/convert_int32_int64.c | 54 +
test/convert_int32_int8.c | 54 +
test/convert_int32_uint16.c | 54 +
test/convert_int32_uint32.c | 54 +
test/convert_int32_uint64.c | 54 +
test/convert_int32_uint8.c | 54 +
test/convert_int64_complex128.c | 64 +
test/convert_int64_complex64.c | 64 +
test/convert_int64_float32.c | 54 +
test/convert_int64_float64.c | 54 +
test/convert_int64_int16.c | 54 +
test/convert_int64_int32.c | 54 +
test/convert_int64_int8.c | 54 +
test/convert_int64_uint16.c | 54 +
test/convert_int64_uint32.c | 54 +
test/convert_int64_uint64.c | 54 +
test/convert_int64_uint8.c | 54 +
test/convert_int8_complex128.c | 64 +
test/convert_int8_complex64.c | 64 +
test/convert_int8_float32.c | 54 +
test/convert_int8_float64.c | 54 +
test/convert_int8_int16.c | 53 +
test/convert_int8_int32.c | 53 +
test/convert_int8_int64.c | 53 +
test/convert_int8_uint16.c | 53 +
test/convert_int8_uint32.c | 53 +
test/convert_int8_uint64.c | 53 +
test/convert_int8_uint8.c | 53 +
test/convert_uint16_complex128.c | 64 +
test/convert_uint16_complex64.c | 64 +
test/convert_uint16_float32.c | 54 +
test/convert_uint16_float64.c | 54 +
test/convert_uint16_int16.c | 53 +
test/convert_uint16_int32.c | 53 +
test/convert_uint16_int64.c | 53 +
test/convert_uint16_int8.c | 53 +
test/convert_uint16_uint32.c | 53 +
test/convert_uint16_uint64.c | 53 +
test/convert_uint16_uint8.c | 53 +
test/convert_uint32_complex128.c | 64 +
test/convert_uint32_complex64.c | 64 +
test/convert_uint32_float32.c | 54 +
test/convert_uint32_float64.c | 54 +
test/convert_uint32_int16.c | 54 +
test/convert_uint32_int32.c | 54 +
test/convert_uint32_int64.c | 54 +
test/convert_uint32_int8.c | 54 +
test/convert_uint32_uint16.c | 54 +
test/convert_uint32_uint64.c | 54 +
test/convert_uint32_uint8.c | 54 +
test/convert_uint64_complex128.c | 64 +
test/convert_uint64_complex64.c | 64 +
test/convert_uint64_float32.c | 54 +
test/convert_uint64_float64.c | 54 +
test/convert_uint64_int16.c | 54 +
test/convert_uint64_int32.c | 54 +
test/convert_uint64_int64.c | 54 +
test/convert_uint64_int8.c | 54 +
test/convert_uint64_uint16.c | 54 +
test/convert_uint64_uint32.c | 54 +
test/convert_uint64_uint8.c | 54 +
test/convert_uint8_complex128.c | 64 +
test/convert_uint8_complex64.c | 64 +
test/convert_uint8_float32.c | 54 +
test/convert_uint8_float64.c | 54 +
test/convert_uint8_int16.c | 53 +
test/convert_uint8_int32.c | 53 +
test/convert_uint8_int64.c | 53 +
test/convert_uint8_int8.c | 53 +
test/convert_uint8_uint16.c | 54 +
test/convert_uint8_uint32.c | 54 +
test/convert_uint8_uint64.c | 54 +
test/creat.c | 29 +
test/creat_excl.c | 30 +
test/creat_rdonly.c | 29 +
test/cvlist.c | 48 +
test/cvlist_array.c | 54 +
test/cvlist_array_meta.c | 55 +
test/cvlist_invalid.c | 24 +
test/cvlist_meta.c | 47 +
test/cvlist_meta_invalid.c | 24 +
test/del.c | 55 +
test/del_carray.c | 39 +
test/del_carray_deref.c | 42 +
test/del_const.c | 39 +
test/del_const_deref.c | 42 +
test/del_const_force.c | 44 +
test/del_data.c | 53 +
test/del_derived.c | 38 +
test/del_derived_force.c | 38 +
test/del_meta.c | 44 +
test/del_meta_force.c | 47 +
test/dfes_bit.c | 36 +
test/dfes_divide.c | 35 +
test/dfes_lincom.c | 36 +
test/dfes_linterp.c | 36 +
test/dfes_multiply.c | 36 +
test/dfes_null.c | 16 +
test/dfes_phase.c | 36 +
test/dfes_raw.c | 36 +
test/dfes_recip.c | 35 +
test/dfes_zero.c | 18 +
test/encode_alter.c | 63 +
test/encode_get.c | 50 +
test/encode_move.c | 61 +
test/endian_alter.c | 77 +
test/endian_get.c | 68 +
test/endian_move.c | 77 +
test/entry_bad_code.c | 39 +
test/entry_bit.c | 48 +
test/entry_bit_scalar.c | 49 +
test/entry_invalid.c | 25 +
test/entry_lincom.c | 54 +
test/entry_lincom_scalar.c | 67 +
test/entry_linterp.c | 44 +
test/entry_multiply.c | 44 +
test/entry_phase.c | 44 +
test/entry_phase_scalar.c | 46 +
test/entry_polynom.c | 48 +
test/entry_polynom_scalar.c | 60 +
test/entry_raw.c | 44 +
test/entry_raw_scalar.c | 46 +
test/entry_raw_scalar_code.c | 39 +
test/entry_raw_scalar_type.c | 39 +
test/entry_scalar_repr.c | 53 +
test/entry_type.c | 39 +
test/eof.c | 44 +
test/eof_index.c | 60 +
test/eof_lincom.c | 58 +
test/eof_phase.c | 44 +
test/error.c | 33 +
test/error_error.c | 21 +
test/error_short.c | 31 +
test/file.c | 50 +
test/file_code.c | 49 +
test/file_type.c | 49 +
test/flist.c | 62 +
test/flist_invalid.c | 24 +
test/flist_meta.c | 58 +
test/flist_meta_invalid.c | 24 +
test/flist_type.c | 62 +
test/flist_type_invalid.c | 24 +
test/flist_type_meta.c | 61 +
test/flist_type_meta_invalid.c | 24 +
test/flush.c | 67 +
test/flush_all.c | 67 +
test/flush_bad_code.c | 37 +
test/flush_invalid.c | 23 +
test/flush_meta.c | 38 +
test/flush_spec.c | 73 +
test/foffs_alter.c | 54 +
test/foffs_get.c | 49 +
test/foffs_move.c | 54 +
test/fragment_index.c | 45 +
test/fragment_name.c | 50 +
test/fragment_name_oor.c | 49 +
test/get64.c | 54 +
test/get_bad_code.c | 39 +
test/get_bit.c | 50 +
test/get_carray.c | 42 +
test/get_carray_len.c | 40 +
test/get_carray_slice.c | 42 +
test/get_char.c | 50 +
test/get_clincom.c | 57 +
test/get_complex128.c | 69 +
test/get_complex64.c | 69 +
test/get_const.c | 41 +
test/get_const_complex.c | 51 +
test/get_const_repr.c | 41 +
test/get_cpolynom.c | 57 +
test/get_divide.c | 52 +
test/get_endian16.c | 66 +
test/get_endian32.c | 66 +
test/get_endian64.c | 66 +
test/get_endian8.c | 66 +
test/get_endian_complex128_arm.c | 205 +
test/get_endian_complex128_big.c | 204 +
test/get_endian_complex128_little.c | 204 +
test/get_endian_complex64_arm.c | 140 +
test/get_endian_complex64_big.c | 140 +
test/get_endian_complex64_little.c | 140 +
test/get_endian_float32_arm.c | 122 +
test/get_endian_float32_big.c | 122 +
test/get_endian_float32_little.c | 122 +
test/get_endian_float64_arm.c | 186 +
test/get_endian_float64_big.c | 186 +
test/get_endian_float64_little.c | 186 +
test/get_ff.c | 52 +
test/get_float32.c | 53 +
test/get_float64.c | 53 +
test/get_foffs.c | 50 +
test/get_fs.c | 53 +
test/get_int16.c | 54 +
test/get_int32.c | 54 +
test/get_int64.c | 55 +
test/get_int8.c | 52 +
test/get_invalid.c | 25 +
test/get_lincom1.c | 50 +
test/get_lincom2.c | 50 +
test/get_lincom3.c | 50 +
test/get_lincom_noin.c | 40 +
test/get_lincom_non.c | 50 +
test/get_linterp.c | 59 +
test/get_linterp_noin.c | 48 +
test/get_linterp_notab.c | 54 +
test/get_linterp_sort.c | 58 +
test/get_multiply.c | 50 +
test/get_multiply_noin.c | 50 +
test/get_nonexistent.c | 40 +
test/get_null.c | 48 +
test/get_off64.c | 62 +
test/get_phase.c | 63 +
test/get_polynom.c | 51 +
test/get_polynom_noin.c | 40 +
test/get_recip.c | 52 +
test/get_recip_const.c | 53 +
test/get_recurse.c | 40 +
test/get_sbit.c | 54 +
test/get_sf.c | 52 +
test/get_ss.c | 52 +
test/get_type.c | 51 +
test/get_uint16.c | 53 +
test/get_uint32.c | 54 +
test/get_uint64.c | 53 +
test/get_zero.c | 53 +
test/global_name.c | 41 +
test/global_ref.c | 41 +
test/global_ref_empty.c | 40 +
test/global_ref_set.c | 42 +
test/gzip_get.c | 78 +
test/gzip_get_get.c | 75 +
test/gzip_move_from.c | 108 +
test/gzip_nframes.c | 70 +
test/header_complex.c | 72 +
test/include.c | 46 +
test/include_accmode.c | 34 +
test/include_auto.c | 56 +
test/include_cb.c | 54 +
test/include_creat.c | 37 +
test/include_ignore.c | 53 +
test/include_index.c | 36 +
test/include_invalid.c | 36 +
test/include_nonexistent.c | 36 +
test/include_pc.c | 55 +
test/include_ref.c | 53 +
test/include_syntax.c | 44 +
test/index.c | 54 +
test/index_domain.c | 50 +
test/index_range.c | 50 +
test/legacy_get.c | 51 +
test/legacy_get_put.c | 56 +
test/legacy_get_rofs.c | 52 +
test/legacy_nframes.c | 44 +
test/legacy_nonexistent.c | 25 +
test/legacy_put.c | 56 +
test/legacy_spf.c | 37 +
test/lzma_get.c | 75 +
test/lzma_nframes.c | 70 +
test/madd.c | 58 +
test/madd_bit.c | 45 +
test/madd_bit_invalid.c | 23 +
test/madd_carray.c | 49 +
test/madd_clincom.c | 60 +
test/madd_const.c | 46 +
test/madd_cpolynom.c | 57 +
test/madd_crecip.c | 48 +
test/madd_crecip89.c | 46 +
test/madd_divide.c | 42 +
test/madd_lincom.c | 53 +
test/madd_lincom_invalid.c | 25 +
test/madd_linterp.c | 43 +
test/madd_linterp_invalid.c | 22 +
test/madd_multiply.c | 43 +
test/madd_multiply_invalid.c | 22 +
test/madd_phase.c | 43 +
test/madd_phase_invalid.c | 22 +
test/madd_polynom.c | 49 +
test/madd_recip.c | 43 +
test/madd_sbit.c | 44 +
test/madd_spec.c | 48 +
test/madd_spec_directive.c | 35 +
test/madd_spec_invalid.c | 22 +
test/madd_string.c | 45 +
test/move.c | 50 +
test/move_data_enc_ar.c | 80 +
test/move_data_enc_ra.c | 85 +
test/move_data_endian.c | 80 +
test/move_data_foffs.c | 69 +
test/move_data_nop.c | 60 +
test/move_index.c | 50 +
test/move_meta.c | 51 +
test/move_protect.c | 50 +
test/move_subdir.c | 63 +
test/name.c | 70 +
test/name_move.c | 70 +
test/nfields.c | 51 +
test/nfields_invalid.c | 24 +
test/nfields_type.c | 51 +
test/nfields_type_invalid.c | 24 +
test/nfragments.c | 42 +
test/nframes.c | 45 +
test/nframes64.c | 45 +
test/nframes_empty.c | 33 +
test/nframes_invalid.c | 23 +
test/nframes_off64.c | 53 +
test/nframes_spf.c | 55 +
test/nmeta.c | 51 +
test/nmeta_invalid.c | 23 +
test/nmeta_parent.c | 51 +
test/nmeta_type.c | 51 +
test/nmeta_type_invalid.c | 23 +
test/nmeta_type_parent.c | 51 +
test/nmeta_vectors.c | 51 +
test/nmeta_vectors_del.c | 60 +
test/nmeta_vectors_invalid.c | 23 +
test/nmeta_vectors_parent.c | 51 +
test/nvectors.c | 52 +
test/nvectors_invalid.c | 24 +
test/open.c | 29 +
test/open_cb_abort.c | 50 +
test/open_cb_cont.c | 49 +
test/open_cb_ignore.c | 46 +
test/open_cb_invalid.c | 50 +
test/open_cb_rescan.c | 51 +
test/open_eaccess.c | 39 +
test/open_nonexistent.c | 14 +
test/open_notdirfile.c | 26 +
test/parent.c | 52 +
test/parse_badline.c | 34 +
test/parse_bit.c | 34 +
test/parse_bit4.c | 34 +
test/parse_bit_bitnum.c | 34 +
test/parse_bit_bitsize.c | 34 +
test/parse_bit_ncols.c | 34 +
test/parse_bit_numbits.c | 34 +
test/parse_bit_scalar.c | 34 +
test/parse_carray.c | 34 +
test/parse_carray_long.c | 34 +
test/parse_const.c | 34 +
test/parse_const_ncols.c | 34 +
test/parse_divide.c | 34 +
test/parse_duplicate.c | 34 +
test/parse_duplicate_ignore.c | 34 +
test/parse_endian_bad.c | 34 +
test/parse_endian_big.c | 34 +
test/parse_endian_force.c | 34 +
test/parse_endian_little.c | 34 +
test/parse_endian_slash.c | 34 +
test/parse_eol.c | 34 +
test/parse_foffs.c | 34 +
test/parse_foffs_include.c | 80 +
test/parse_foffs_slash.c | 34 +
test/parse_include.c | 42 +
test/parse_include_absolute.c | 64 +
test/parse_include_absrel.c | 71 +
test/parse_include_nonexistent.c | 34 +
test/parse_include_relabs.c | 74 +
test/parse_include_relrel.c | 53 +
test/parse_include_slash.c | 42 +
test/parse_index.c | 34 +
test/parse_lincom.c | 34 +
test/parse_lincom_ncols1.c | 34 +
test/parse_lincom_ncols2.c | 34 +
test/parse_lincom_nfields.c | 34 +
test/parse_lincom_nofields.c | 34 +
test/parse_lincom_non.c | 34 +
test/parse_lincom_non_ncols.c | 34 +
test/parse_lincom_scalar.c | 36 +
test/parse_linterp.c | 34 +
test/parse_linterp_ncols.c | 34 +
test/parse_meta.c | 36 +
test/parse_meta_implicit.c | 43 +
test/parse_meta_implicit2.c | 36 +
test/parse_meta_index.c | 35 +
test/parse_meta_index2.c | 36 +
test/parse_meta_parent.c | 34 +
test/parse_meta_raw.c | 36 +
test/parse_multiply.c | 34 +
test/parse_multiply_ncols.c | 34 +
test/parse_name.c | 34 +
test/parse_name_dot.c | 34 +
test/parse_name_ext.c | 36 +
test/parse_name_pedantic.c | 34 +
test/parse_ncols.c | 34 +
test/parse_phase.c | 34 +
test/parse_phase_ncols.c | 34 +
test/parse_phase_scalar.c | 34 +
test/parse_polynom.c | 34 +
test/parse_polynom_ncols1.c | 34 +
test/parse_polynom_ncols2.c | 34 +
test/parse_polynom_scalar.c | 36 +
test/parse_protect_all.c | 34 +
test/parse_protect_bad.c | 34 +
test/parse_protect_data.c | 34 +
test/parse_protect_format.c | 34 +
test/parse_protect_none.c | 34 +
test/parse_quote.c | 34 +
test/parse_quote_mismatch.c | 34 +
test/parse_raw.c | 34 +
test/parse_raw_char.c | 34 +
test/parse_raw_ncols.c | 34 +
test/parse_raw_scalar.c | 34 +
test/parse_raw_spf.c | 34 +
test/parse_raw_type.c | 34 +
test/parse_recip.c | 34 +
test/parse_ref.c | 34 +
test/parse_ref_nonexistent.c | 34 +
test/parse_sbit.c | 34 +
test/parse_sort.c | 75 +
test/parse_string.c | 34 +
test/parse_string_ncols.c | 34 +
test/parse_string_null.c | 34 +
test/parse_version.c | 35 +
test/parse_version_include.c | 41 +
test/parse_version_permissive.c | 35 +
test/parse_version_slash.c | 35 +
test/parse_whitespace.c | 34 +
test/protect_alter.c | 51 +
test/protect_get.c | 48 +
test/put64.c | 68 +
test/put_bad_code.c | 38 +
test/put_bit.c | 63 +
test/put_bof.c | 39 +
test/put_carray.c | 42 +
test/put_carray_slice.c | 44 +
test/put_char.c | 42 +
test/put_complex128.c | 89 +
test/put_complex64.c | 89 +
test/put_const.c | 39 +
test/put_const_protect.c | 40 +
test/put_divide.c | 50 +
test/put_endian16.c | 63 +
test/put_endian32.c | 63 +
test/put_endian64.c | 63 +
test/put_endian8.c | 62 +
test/put_endian_complex128_arm.c | 65 +
test/put_endian_complex128_big.c | 65 +
test/put_endian_complex128_little.c | 65 +
test/put_endian_complex64_arm.c | 64 +
test/put_endian_complex64_big.c | 64 +
test/put_endian_complex64_little.c | 64 +
test/put_endian_float32_arm.c | 54 +
test/put_endian_float32_big.c | 54 +
test/put_endian_float32_little.c | 54 +
test/put_endian_float64_arm.c | 56 +
test/put_endian_float64_big.c | 56 +
test/put_endian_float64_little.c | 56 +
test/put_ff.c | 64 +
test/put_float32.c | 65 +
test/put_float64.c | 65 +
test/put_foffs.c | 64 +
test/put_fs.c | 64 +
test/put_int16.c | 64 +
test/put_int32.c | 64 +
test/put_int64.c | 64 +
test/put_int8.c | 64 +
test/put_invalid.c | 25 +
test/put_lincom1.c | 64 +
test/put_lincom2.c | 50 +
test/put_lincom_noin.c | 43 +
test/put_linterp.c | 73 +
test/put_linterp_noin.c | 52 +
test/put_linterp_nomono.c | 55 +
test/put_linterp_notab.c | 45 +
test/put_linterp_reverse.c | 73 +
test/put_multiply.c | 50 +
test/put_null.c | 38 +
test/put_off64.c | 74 +
test/put_phase.c | 64 +
test/put_phase_noin.c | 43 +
test/put_polynom1.c | 64 +
test/put_polynom2.c | 50 +
test/put_polynom_noin.c | 43 +
test/put_protect.c | 44 +
test/put_rdonly.c | 42 +
test/put_recip.c | 64 +
test/put_recurse.c | 39 +
test/put_repr.c | 48 +
test/put_rofs.c | 42 +
test/put_sbit.c | 63 +
test/put_sf.c | 64 +
test/put_ss.c | 64 +
test/put_string.c | 37 +
test/put_string_protect.c | 39 +
test/put_type.c | 38 +
test/put_uint16.c | 65 +
test/put_uint32.c | 64 +
test/put_uint64.c | 64 +
test/ref.c | 64 +
test/ref_none.c | 63 +
test/ref_two.c | 65 +
test/repr_a.c | 64 +
test/repr_float32.c | 63 +
test/repr_float64.c | 63 +
test/repr_i.c | 64 +
test/repr_int16.c | 63 +
test/repr_int32.c | 62 +
test/repr_int64.c | 62 +
test/repr_int8.c | 62 +
test/repr_m.c | 64 +
test/repr_r.c | 64 +
test/repr_real_a.c | 53 +
test/repr_real_i.c | 53 +
test/repr_real_m.c | 53 +
test/repr_real_r.c | 53 +
test/repr_uint16.c | 62 +
test/repr_uint32.c | 62 +
test/repr_uint64.c | 62 +
test/repr_uint8.c | 62 +
test/slim_get.c | 77 +
test/slim_nframes.c | 72 +
test/spf.c | 37 +
test/spf_divide.c | 37 +
test/spf_lincom.c | 38 +
test/spf_multiply.c | 38 +
test/spf_polynom.c | 37 +
test/spf_recip.c | 36 +
test/spf_recurse.c | 40 +
test/svlist.c | 60 +
test/svlist_invalid.c | 23 +
test/svlist_meta.c | 64 +
test/svlist_meta_invalid.c | 23 +
test/test.h | 101 +
test/trunc.c | 44 +
test/trunc_rdonly.c | 39 +
test/trunc_rofs.c | 38 +
test/unclude.c | 59 +
test/unclude_del.c | 59 +
test/unclude_move.c | 61 +
test/version_0.c | 62 +
test/version_0_write.c | 42 +
test/version_1.c | 63 +
test/version_1_write.c | 42 +
test/version_2.c | 65 +
test/version_2_write.c | 45 +
test/version_3.c | 70 +
test/version_3_write.c | 49 +
test/version_4.c | 69 +
test/version_4_write.c | 49 +
test/version_5.c | 70 +
test/version_5_strict.c | 84 +
test/version_5_write.c | 46 +
test/version_6.c | 63 +
test/version_6_strict.c | 87 +
test/version_6_write.c | 42 +
test/version_7.c | 63 +
test/version_7_strict.c | 77 +
test/version_7_write.c | 42 +
test/version_8.c | 66 +
test/version_8_strict.c | 85 +
test/version_8_write.c | 46 +
test/vlist.c | 58 +
test/vlist_invalid.c | 23 +
test/vlist_meta.c | 61 +
test/vlist_meta_invalid.c | 24 +
test/xz_get.c | 75 +
test/xz_nframes.c | 70 +
util/Makefile.am | 39 +
util/Makefile.in | 611 +
util/checkdirfile.c | 199 +
util/dirfile2ascii.c | 537 +
950 files changed, 193041 insertions(+)
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..8a39286
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,30 @@
+C. B. Netterfield <netterfield at astro.utoronto.ca> developed the original
+dirfile standard and created the first GetData library.
+
+D. V. Wiebe <dvw at ketiltrout.net> developed the "large dirfile extension"
+(AKA Standards Version 3) and currently maintains GetData and the dirfile
+standards.
+
+Ted Kisner <tskisner.public at gmail.com> wrote the PutData library
+(libdirfile).
+
+Matthew Truch <matt at truch.net> wrote the dirfile2ascii conversion utility.
+He also provides alpha-testing, bug fixes, and maintains the Fedora packages.
+
+Eli Fidler <eli at staikos.net> ported PutData to this version of the GetData
+library.
+
+Joseph Fowler <jfowler at princeton.edu> provided code which was adapted to
+create the slimlib encoding support.
+
+Peter Kümmel <syntheticpp at gmx.net> ported GetData to MSVC.
+
+George Staikos <staikos at kde.org> maintained the GetData library as part of
+kst.
+
+Adam Treat <treat at kde.org> wrote the code for the PHASE field type.
+
+Andrew Walker <arwalker at sumusltd.com> maintained the GetData library as
+part of kst.
+
+vi: tw=75
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..602bfc9
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/COPYING.DOC b/COPYING.DOC
new file mode 100644
index 0000000..4a0fe1c
--- /dev/null
+++ b/COPYING.DOC
@@ -0,0 +1,397 @@
+ 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.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..90f23bb
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,4015 @@
+2011-04-04 D. V. Wiebe <getdata at ketiltrout.net> svn:567
+ Merge from trunk, r561:
+
+ * util/checkdirfile.c: Zero-terminate option list. Patch from Matthew
+ Truch.
+
+2011-04-03 D. V. Wiebe <getdata at ketiltrout.net> svn:564
+ * 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.
+
+2011-03-30 D. V. Wiebe <getdata at ketiltrout.net> svn:563
+ * src/encoding.c (_GD_MissingFramework): Properly compute the module path.
+
+2011-03-29 D. V. Wiebe <getdata at ketiltrout.net> svn:562
+ * 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.
+
+2011-03-24 D. V. Wiebe <getdata at ketiltrout.net> svn:558
+ GetData-0.7.2 released.
+
+2011-03-24 D. V. Wiebe <getdata at ketiltrout.net> svn:555
+
+ * test/move_data_enc_ar.c test/entry_phase.c test/get_ss.c
+ test/alter_raw_type.c: Actually fail on error.
+
+2011-03-23 D. V. Wiebe <getdata at ketiltrout.net> svn:551
+ GetData-0.7.2rc3:
+
+ * m4/version.m4 configure.ac: Fix library soversion defines.
+
+2011-03-23 D. V. Wiebe <getdata at ketiltrout.net> svn:550
+ * test/test.h: Write paths properly under WIN32/WIN64.
+
+2011-03-23 D. V. Wiebe <getdata at ketiltrout.net> svn:549
+ * m4/python.m4: Use the BSD `jot' if the Linux/Plan 9 `seq' is not found.
+ Also, look for python2.7.
+
+2011-03-23 D. V. Wiebe <getdata at ketiltrout.net> svn:546
+ * src/include.c (_GD_Include): Handle WIN32 paths.
+
+2011-03-23 D. V. Wiebe <getdata at ketiltrout.net> svn:545
+ * 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.
+
+2011-03-22 Peter Kümmel <syntheticpp at gmx.net> svn:535-541
+ * backport MSVC support
+ * finish strtoll/strtoull replacement with gd_* functions
+ * update CMake instructions
+ * add CMake module which could be used by other CMake based projects
+
+2011-03-22 D. V. Wiebe <getdata at ketiltrout.net> svn:532
+ GetData-0.7.2rc2.
+
+2011-03-18 D. V. Wiebe <getdata at ketiltrout.net> svn:529
+ * m4/python.m4: Added --with-python-module-dir
+
+2011-03-18 D. V. Wiebe <getdata at ketiltrout.net> svn:527
+ * test/test.h: Explicitly use long long format types in the checks.
+
+ * 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.
+
+ * m4/encoding.m4: $1 is going to get overwritten, so save it early. Also,
+ don't define $5 and $6 to the same name.
+
+2011-03-17 Peter Kümmel <syntheticpp at gmx.net>
+ * 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-17 D. V. Wiebe <getdata at ketiltrout.net> svn:517
+ * 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... at 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.
+
+2011-03-16 D. V. Wiebe <getdata at ketiltrout.net> svn:516
+ * 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.
+
+2011-03-16 D. V. Wiebe <getdata at ketiltrout.net> svn:515
+ GetData-0.7.2rc1:
+
+ * src/parse.c (_GD_ParseFieldSpec): Fix GD_E_FORMAT_DUPLICATE error data.
+
+ Merged in changes from trunk, revision 514:
+
+ * src/internal.h: Define S_ISREG and S_ISDIR if missing.
+
+2011-03-14 D. V. Wiebe <getdata at ketiltrout.net> svn:513
+ * 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-03 D. V. Wiebe <getdata at ketiltrout.net> svn:510
+ * m4/idl.m4: Munge IDL_LIBS to convert "-m <arg>" into "-m<arg>" since
+ libtool seems to delete <arg> 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 <getdata at ketiltrout.net> 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 <syntheticpp at gmx.net> 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 <getdata at ketiltrout.net> svn:498
+ * src/getdata.h.in: Add meaningless stuff after #undef's to appease msys's
+ config.status.
+
+2010-12-08 D. V. Wiebe <getdata at ketiltrout.net> svn:497
+ * m4/encoding.m4: Replace TEST_<foo> AM_CONDITIONALs with a preprocessor
+ symbols.
+ * test/Makefile.am: Remove TEST_<foo> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:493
+ GetData-0.7.1 released.
+
+2010-11-30 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:486
+ * bindings/cxx/test/big_test.cpp: Delete stuff.
+
+2010-11-27 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:480
+ GetData 0.7.0 released.
+
+2010-11-20 D. V. Wiebe <getdata at ketiltrout.net> svn:478
+ * bindings/idl/getdata.c: Properly terminate IDL keyword lists.
+
+2010-11-17 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:468
+ * src/legacy.c (GetFormat): Fix counting of POLYNOM fields.
+
+2010-10-22 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:462
+ * configure.ac m4/encoding.m4: Compute PRIVATE_LIBS
+ * src/getdata.pc: Correct private libs.
+
+2010-10-22 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:456
+ GetData-0.7.0rc2:
+
+ * encoding.c (_GD_ResolveSymbol _GD_MissingFramework): Fix types for
+ USE_MODULES.
+
+2010-10-17 D. V. Wiebe <getdata at ketiltrout.net> svn:455
+ GetData-0.7.0rc1:
+
+ * configure.ac: update library interface numbers. Removed
+ --disable-checkdirfile.
+
+ * MEWS: Update.
+
+2010-10-16 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:446
+ * bindings/cxx/dirfile.cpp (Dirfile::EoF Dirfile::BoF): Renamed.
+
+2010-09-11 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:443
+ * src/common.c (_GD_BadInput): Check the propper entry for scalarness.
+
+2010-08-10 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:441
+ * src/flush.c (_GD_FlushMeta gd_metaflush gd_rewrite_fragment): Return error
+ on read-only dirfile.
+
+2010-07-20 D. V. Wiebe <getdata at ketiltrout.net> svn:440
+ * util/checkdirfile.c: Fix reporting of conformant Standards Versions.
+
+2010-07-20 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:435
+ The Great Renaming, part 2: removed get_ from many public function names.
+
+2010-07-10 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:432
+ * src/common.c (_GD_ReadLinterpFile): Only sort if necessary.
+
+2010-07-07 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:409
+ * configure.ac: Fix test for struct stat64. Restore accidentally deleted
+ AC_SUBST.
+
+2010-06-25 D. V. Wiebe <getdata at ketiltrout.net> 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 <io.h> 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 <getdata at ketiltrout.net> 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/checkdirifle.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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:379
+ * util/dirfile2ascii.c: Fix missing break statement per Matthew Truch.
+
+2010-02-19 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:362
+ * util/dirfile2ascii.c: Added Matthew Truch's ASCII conversion utility.
+
+2010-02-12 D. V. Wiebe <getdata at ketiltrout.net> svn:361
+ GetData 0.6.1 released.
+
+2010-02-09 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:349
+ * bindings/cxx/test/getdata.cpp: Also fix the mkdir() bug here.
+
+2010-02-03 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:345
+ * src/getdata.h.in: Don't include <complex.h>; use _Complex directly.
+
+2009-11-03 D. V. Wiebe <getdata at ketiltrout.net> svn:340
+ GetData 0.6.0 released.
+
+2009-11-01 D. V. Wiebe <getdata at ketiltrout.net> 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 <complex.h> 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 <getdata at ketiltrout.net> 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 <getdata at keiltrout.net> 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 <getdata at keiltrout.net> svn:329
+ * bindings/python/test/big_test.py: NumPy tests.
+
+ * configure.ac: Detect NumPy.
+
+ * bindings/python/pygetdata.h: #include <numpy/arrayobject.h>
+ * 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 <getdata at keiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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_<foo>_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_<foo>() 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:305
+ GetData license changed to GNU LGPLv2.1+. All documentation updated.
+
+2009-08-04 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <n> optional.
+
+2009-06-11 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:285
+ GetData 0.5.0 released.
+
+2009-01-13 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:274
+ * bindings/f77/getdata.f90.in doc/README.F95: Add Fortran 95 bindings for new
+ functions, and for the dirfile_[m]add_<field_type> functions.
+
+ * bindings/f77/getdata.f90.in: Fix call to gdadsp and gdmdsp
+
+2008-12-19 D. V. Wiebe <getdata at ketiltrout.net> svn:273
+ * src/protect.c (dirfile_protect): Swap order of arguments for consistency
+ with the dirfile_alter_<metadata> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:266
+ * bindings/cxx/dirfile.cpp (Dirfile::ReferenceFilename): Added.
+
+2008-12-10 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:263
+ * test/foffs_move.c test/foffs_get.c test/foffs_alter.c: Added.
+
+2008-12-08 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:243
+ * configure.ac: Fix pthread check.
+
+2008-11-24 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:216
+ Fork GetData-0.4.
+
+2008-11-07 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:206
+ GetData-0.4.0 released.
+
+2008-10-28 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:185
+ GetData-0.4.0rc1:
+
+ * src/include.c: Remove duplicate accessmode check.
+
+2008-10-21 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:169
+ * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Some encodings
+ need no endianness correction.
+
+2008-10-17 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:161
+ * src/meta_list.c src/nmeta.c: Fail if the specified parent is itself a
+ metafield.
+
+2008-10-16 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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_<foo>() 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:133
+ * src/open.c (_GD_Tokenise _GD_ParseFormatLine): Split tokeniser from line
+ parser.
+
+2008-10-10 D. V. Wiebe <getdata at ketiltrout.net> svn:132
+ * src/open.c (_GD_ParseFormatFile _GD_ParseFormatLine dirfile_open):
+ Properly propagate standards.
+
+2008-10-10 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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: Fixed all functions to get them working.
+ * 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:123
+ * src/add.c: Fix debugging messages
+
+2008-10-08 D. V. Wiebe <getdata at ketiltrout.net> svn:122
+ * man/Makefile.am: Fix install target (patch from Matthew Truch)
+
+2008-10-08 D. V. Wiebe <getdata at ketiltrout.net> svn:121
+ * src/getdata.h.in: Add forward declarations for public functions.
+
+2008-10-08 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:99
+ GetData-0.3.1 released.
+
+2008-09-22 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:94
+ * bindings/cxx/entry.cpp: Use <cstring> instead of <string>. Patch from
+ Matthew Truch.
+
+2008-09-18 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:86
+ * src/errors.c: Fix GD_E_RAW_IO error string.
+
+2008-09-15 D. V. Wiebe <getdata at ketiltrout.net> svn:84
+ GetData-0.3.0 released.
+
+2008-09-05 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:59
+ * configure.ac: disable all Fortran bindings with one option. Rename
+ the bindings options.
+
+2008-09-01 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:50
+ * man/dirfile-format.5: Fix a rather egregious omission
+
+2008-08-29 D. V. Wiebe <getdata at ketiltrout.net> svn:49
+ * src/getdata.h.in: Change GD_UNKNOWN
+
+2008-08-26 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:35
+ * bindings/f77/fgetdata.c (_GDF_ClearDirfile): Don't accidentally close
+ dirfile unit zero
+
+2008-08-21 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:33
+ * src/getdata.h.in: Be less clever defining stuff.
+
+2008-08-20 D. V. Wiebe <getdata at ketiltrout.net> svn:32
+ * bindings/f77/getdata.f: Add EXTERNAL function declarations
+
+2008-08-19 D. V. Wiebe <getdata at ketiltrout.net> svn:30
+ * bindings/f77/test/gdfget.f: Remove references to TRIM
+
+2008-08-19 D. V. Wiebe <getdata at ketiltrout.net> svn:26 svn:27
+ * README: add
+
+ * Makefile.am: Remove explicit -lm
+
+2008-08-19 D. V. Wiebe <getdata at ketiltrout.net> svn:25
+ * test/: Fix test suite for VPATH builds
+
+2008-08-18 D. V. Wiebe <getdata at ketiltrout.net> svn:24
+ * Makefile.am configure.ac bindings/: Add C++ and Fortran 77 bindings.
+
+2008-08-17 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:19
+ * Makefile.am configure.ac bin/Makefile.am bin/checkdirfile.c: add
+ checkdirfile util
+
+2008-08-17 D. V. Wiebe <getdata at ketiltrout.net> svn:18
+ * getdata_internal.h: If FILENAME_MAX is unreasonably small, still permit
+ roomy format file lines.
+
+2008-08-17 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:13
+ * src/getdata.c src/getdata.h.in: rm unused error codes
+
+2008-08-12 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> svn:7
+ * man/dirfile_open.3: modern symbol
+
+2008-08-12 D. V. Wiebe <getdata at ketiltrout.net> svn:6
+ * src/getdata.c (_GD_SetGetDataError): don't crash on NULL
+
+ * src/putdata.c (_GD_DoPhaseOut): add
+
+2008-08-12 D. V. Wiebe <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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 <getdata at ketiltrout.net> 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.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..b2899ce
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,238 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+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.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..7dcdf38
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,110 @@
+# 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
+#
+AUTOMAKE_OPTIONS = foreign dist-bzip2 check-news 1.10
+
+EXTRA_DIST = ChangeLog
+
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = src . test bindings util man doc
+
+dist_doc_DATA = COPYING.DOC
+
+clean-local:
+ rm -rf *~ m4/*~ README.txt
+
+%.sig: %
+ gpg -abo $@ $<
+
+DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" \
+ --with-python-module-dir="$$dc_install_base/python"
+
+# idl-only package
+idldist: $(DISTFILES)
+ rm -rf svn_export
+ svn export . svn_export
+ ( 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
+ tar -zxvf $<
+ cd idl_$(distdir) && ./configure && make dist && make distcheck
+ rm -rf idl_$(distdir)
+
+# windows source package
+windist: $(DISTFILES)
+ rm -rf crlf_export
+ cd man && $(MAKE) htmlman
+ svn --native-eol CRLF export . 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 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
+
+# package lists
+PACKAGES=$(distdir).tar.gz $(distdir).tar.bz2 idl_$(distdir).tar.gz \
+ idl_$(distdir).tar.bz2 getdata_win-$(PACKAGE_VERSION).zip
+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
+ rsync -avP -e ssh $^ $(SFUSER),getdata at frs.sourceforge.net:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..ade5e4f
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,926 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/configure AUTHORS COPYING COPYING.DOC ChangeLog \
+ INSTALL NEWS TODO config.guess config.sub depcomp install-sh \
+ ltmain.sh missing
+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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/config.h \
+ $(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(docdir)"
+DATA = $(dist_doc_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+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.bz2
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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, 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
+#
+AUTOMAKE_OPTIONS = foreign dist-bzip2 check-news 1.10
+EXTRA_DIST = ChangeLog
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src . test bindings util man doc
+dist_doc_DATA = COPYING.DOC
+DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" \
+ --with-python-module-dir="$$dc_install_base/python"
+
+
+# package lists
+PACKAGES = $(distdir).tar.gz $(distdir).tar.bz2 idl_$(distdir).tar.gz \
+ idl_$(distdir).tar.bz2 getdata_win-$(PACKAGE_VERSION).zip
+
+SIGS = $(addsuffix .sig,$(PACKAGES))
+all: all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(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)
+ test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
+ @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(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|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(docdir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+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 \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @$(am__cd) '$(distuninstallcheck_dir)' \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ clean-libtool clean-local ctags ctags-recursive dist dist-all \
+ dist-bzip2 dist-gzip dist-lzma 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-recursive \
+ uninstall uninstall-am uninstall-dist_docDATA
+
+
+clean-local:
+ rm -rf *~ m4/*~ README.txt
+
+%.sig: %
+ gpg -abo $@ $<
+
+# idl-only package
+idldist: $(DISTFILES)
+ rm -rf svn_export
+ svn export . svn_export
+ ( 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
+ tar -zxvf $<
+ cd idl_$(distdir) && ./configure && make dist && make distcheck
+ rm -rf idl_$(distdir)
+
+# windows source package
+windist: $(DISTFILES)
+ rm -rf crlf_export
+ cd man && $(MAKE) htmlman
+ svn --native-eol CRLF export . 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 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
+
+# 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
+ rsync -avP -e ssh $^ $(SFUSER),getdata at 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:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..dd1c903
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,812 @@
+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 duplicate 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<n>', where 'field' is the
+ field name and 'n' the element index in the CARRAY (and the angle brackets
+ are literal angle brackets). If the '<n>' 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 excercise
+ 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 existance 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 situtations. Most
+ noticably, they still prohibit ASCII control codes (bytes < 0x20) 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 bytes, 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 precision
+ 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_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().
+ * Pyhon: 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 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.
+ * 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.
+ * 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 advertises,
+ 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_<foo> 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 encoding
+ 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_<field-type>, 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 dirifle_madd_bit(3) manual page has been corrected to show
+ the correct order or parameters for all the dirfile_madd_<field_type>
+ 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 extensions.
+ The Standards still prohibit the full stop character in field names, and the
+ GD_PEDANTIC flag will disable this exception. Furthermore, 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 characters
+ 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
+ "<parent-field>/<subfield>".
+ * 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_<foo>() 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 completely
+ 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.
diff --git a/README b/README
new file mode 100644
index 0000000..d0fd75f
--- /dev/null
+++ b/README
@@ -0,0 +1,265 @@
+THE 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)
+ - Python (pygetdata)
+ - the Interactive Data Language (IDL; idl_getdata)
+
+Documentation for the various bindings, if present, can be found in files
+named `README.<language>' 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 8
+===========================
+
+The 0.7.0 release of the GetData Library (October 2010), was released in
+conjunction with a new version of the Dirfile Standards, known as Standards
+Version 8.
+
+Standards Version 8 introduces the following:
+ * Two new field types: DIVIDE, the quotient of two input vector fields,
+ and RECIP, the reciprocal of a vector field.
+ * Support for middle-endian ARM double-precision floating point data.
+ * Furthermore, several deprecated features have been removed. The old single
+ character type names are no longer accepted, and directives now require an
+ initial forward slash. (NB: these features are only removed from Standards
+ Version 8; GetData, which understands all Standards Versions, still can work
+ with these features.)
+
+This is the first update to the Dirfile Standards since Standards Version 7
+(October 2009). 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; and,
+- the lzma library, part of the XZ Utils suite by Lasse Collin, Ville Koskinen,
+ and Igor Pavlov.
+
+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.
+
+
+USING THE LIBRARY
+=================
+
+To use the library in C programs, the header file getdata.h should be included.
+This file declares both the new and legacy APIs. 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
+<other-libraries>'.
+
+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.<language> 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 <netterfield at astro.utoronto.ca>.
+
+Since Standards Version 3 (January 2006), the Dirfile Standards and GetData
+have been maintained by D. V. Wiebe <dvw at ketiltrout.net>.
+
+A full list of contributors is given in the file called `AUTHORS'.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..88d8b87
--- /dev/null
+++ b/TODO
@@ -0,0 +1,7 @@
+* Perl bindings
+* Locking
+* Hashed compressed files
+* streaming
+* linterp table path munging [MH]
+* Make webpage suck less
+* Handle RW dirfile on RO data better [JPF]
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..a1802c3
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1184 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.0 python2.5 python2.4 python2.3 python2.2 dnl
+python2.1 python2.0])
+
+ 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 >= $1])
+ AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_ERROR(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])
+
+
+ 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. distutils does not exist in
+ dnl Python 1.5, so we fall back to the hardcoded directory if it
+ dnl doesn't work.
+ 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 "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null ||
+ echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+ 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. distutils does not exist in
+ dnl Python 1.5, so we fall back to the hardcoded directory if it
+ dnl doesn't work.
+ 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 "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null ||
+ echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+ 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, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_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, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/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/idl.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/python.m4])
+m4_include([m4/win32.m4])
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
new file mode 100644
index 0000000..d562f99
--- /dev/null
+++ b/bindings/Makefile.am
@@ -0,0 +1,52 @@
+# Copyright (C) 2008-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
+#
+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_PYBINDINGS
+PY_SUBDIR=python
+endif
+
+noinst_PROGRAMS=make_parameters
+
+make_parameters_SOURCES = make_parameters.c
+nodist_make_parameters_SOURCES = ../src/getdata.h
+
+SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${PY_SUBDIR} ${IDL_SUBDIR}
+
+make_parameters$(EXEEXT): $(make_parameters_SOURCES) $(nodist_make_parameters_SOURCES)
+ ${BUILDCC} -I../src -o make_parameters$(EXEEXT) $(srcdir)/$(make_parameters_SOURCES)
+
+clean-local:
+ rm -rf *~
diff --git a/bindings/Makefile.in b/bindings/Makefile.in
new file mode 100644
index 0000000..0b7064a
--- /dev/null
+++ b/bindings/Makefile.in
@@ -0,0 +1,719 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = make_parameters$(EXEEXT)
+subdir = bindings
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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)
+DEFAULT_INCLUDES = -I. at 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(make_parameters_SOURCES) $(nodist_make_parameters_SOURCES)
+DIST_SOURCES = $(make_parameters_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = . f77 cxx python idl
+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@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at MAKE_CXXBINDINGS_TRUE@CXX_SUBDIR = cxx
+ at MAKE_F77BINDINGS_TRUE@F77_SUBDIR = f77
+ at MAKE_IDLBINDINGS_TRUE@IDL_SUBDIR = idl
+ at MAKE_PYBINDINGS_TRUE@PY_SUBDIR = python
+make_parameters_SOURCES = make_parameters.c
+nodist_make_parameters_SOURCES = ../src/getdata.h
+SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${PY_SUBDIR} ${IDL_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
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/make_parameters.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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 \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-local clean-noinstPROGRAMS ctags ctags-recursive \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am
+
+
+make_parameters$(EXEEXT): $(make_parameters_SOURCES) $(nodist_make_parameters_SOURCES)
+ ${BUILDCC} -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:
diff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am
new file mode 100644
index 0000000..98a6710
--- /dev/null
+++ b/bindings/cxx/Makefile.am
@@ -0,0 +1,57 @@
+# Copyright (C) 2008-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
+#
+AUTOMAKE_OPTIONS = foreign
+getdata_includedir = ${includedir}/getdata
+
+if CXX_WALL
+WALL=-Wall
+endif
+
+if CXX_WEXTRA
+WEXTRA=-Wextra
+endif
+
+INCLUDES = ${WALL} $(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
+
+lib_LTLIBRARIES=libgetdata++.la
+libgetdata___la_SOURCES = dirfile.cpp bitentry.cpp carrayentry.cpp \
+ constentry.cpp divideentry.cpp entry.cpp \
+ fragment.cpp indexentry.cpp lincomentry.cpp \
+ linterpentry.cpp multiplyentry.cpp phaseentry.cpp \
+ polynomentry.cpp rawentry.cpp recipentry.cpp \
+ sbitentry.cpp stringentry.cpp \
+ ${getdata_include_HEADERS}
+libgetdata___la_LIBADD=../../src/libgetdata.la
+libgetdata___la_LDFLAGS = -version-info @GETDATAXX_VERSION@
+
+clean-local:
+ rm -rvf *~ getdata/*~
diff --git a/bindings/cxx/Makefile.in b/bindings/cxx/Makefile.in
new file mode 100644
index 0000000..27f6d41
--- /dev/null
+++ b/bindings/cxx/Makefile.in
@@ -0,0 +1,840 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/cxx
+DIST_COMMON = $(getdata_include_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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__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 \
+ indexentry.lo lincomentry.lo linterpentry.lo multiplyentry.lo \
+ phaseentry.lo polynomentry.lo rawentry.lo recipentry.lo \
+ sbitentry.lo stringentry.lo $(am__objects_1)
+libgetdata___la_OBJECTS = $(am_libgetdata___la_OBJECTS)
+libgetdata___la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(libgetdata___la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at 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) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libgetdata___la_SOURCES)
+DIST_SOURCES = $(libgetdata___la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+HEADERS = $(getdata_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at CXX_WALL_TRUE@WALL = -Wall
+ at CXX_WEXTRA_TRUE@WEXTRA = -Wextra
+INCLUDES = ${WALL} $(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
+
+lib_LTLIBRARIES = libgetdata++.la
+libgetdata___la_SOURCES = dirfile.cpp bitentry.cpp carrayentry.cpp \
+ constentry.cpp divideentry.cpp entry.cpp \
+ fragment.cpp indexentry.cpp lincomentry.cpp \
+ linterpentry.cpp multiplyentry.cpp phaseentry.cpp \
+ polynomentry.cpp rawentry.cpp recipentry.cpp \
+ sbitentry.cpp stringentry.cpp \
+ ${getdata_include_HEADERS}
+
+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)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libgetdata++.la: $(libgetdata___la_OBJECTS) $(libgetdata___la_DEPENDENCIES)
+ $(libgetdata___la_LINK) -rpath $(libdir) $(libgetdata___la_OBJECTS) $(libgetdata___la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bitentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/carrayentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/constentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dirfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/divideentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/indexentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lincomentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/linterpentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/multiplyentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/phaseentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/polynomentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rawentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/recipentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sbitentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stringentry.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-getdata_includeHEADERS: $(getdata_include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(getdata_includedir)" || $(MKDIR_P) "$(DESTDIR)$(getdata_includedir)"
+ @list='$(getdata_include_HEADERS)'; test -n "$(getdata_includedir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(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|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(getdata_includedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(getdata_includedir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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 \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool clean-local ctags \
+ ctags-recursive distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-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-recursive uninstall uninstall-am \
+ uninstall-getdata_includeHEADERS uninstall-libLTLIBRARIES
+
+
+clean-local:
+ rm -rvf *~ 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:
diff --git a/bindings/cxx/bitentry.cpp b/bindings/cxx/bitentry.cpp
new file mode 100644
index 0000000..a7439be
--- /dev/null
+++ b/bindings/cxx/bitentry.cpp
@@ -0,0 +1,126 @@
+// Copyright (C) 2008-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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <cstring>
+#include <stdlib.h>
+
+using namespace GetData;
+
+BitEntry::BitEntry(const char* field_code, const char* in_field,
+ gd_bit_t bitnum, gd_bit_t 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(gd_bit_t 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(gd_bit_t num_bits)
+{
+ E.u.bit.numbits = num_bits;
+
+ if (D != NULL)
+ return gd_alter_entry(D->D, E.field, &E, 0);
+
+ return 0;
+}
+
+const char *BitEntry::Scalar(int index) const
+{
+ if (index != 0 && index != 1)
+ return NULL;
+
+ return E.scalar[index];
+}
+
+int BitEntry::ScalarIndex(int index) const
+{
+ if (index != 0 && index != 1)
+ return 0;
+
+ return E.scalar_ind[index];
+}
+
+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;
+}
diff --git a/bindings/cxx/carrayentry.cpp b/bindings/cxx/carrayentry.cpp
new file mode 100644
index 0000000..990c05e
--- /dev/null
+++ b/bindings/cxx/carrayentry.cpp
@@ -0,0 +1,59 @@
+// Copyright (C) 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <cstring>
+
+using namespace GetData;
+
+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;
+}
diff --git a/bindings/cxx/constentry.cpp b/bindings/cxx/constentry.cpp
new file mode 100644
index 0000000..9c77de0
--- /dev/null
+++ b/bindings/cxx/constentry.cpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2008, 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <cstring>
+
+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;
+}
diff --git a/bindings/cxx/dirfile.cpp b/bindings/cxx/dirfile.cpp
new file mode 100644
index 0000000..c9d52a1
--- /dev/null
+++ b/bindings/cxx/dirfile.cpp
@@ -0,0 +1,442 @@
+// Copyright (C) 2008-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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+
+#ifdef _MSC_VER
+#define __gd_unused
+#else
+#define __gd_unused __attribute__ (( unused ))
+#endif
+using namespace GetData;
+
+Dirfile::Dirfile()
+{
+ D = gd_invalid_dirfile();
+ error_string = 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;
+}
+
+Dirfile::Dirfile(DIRFILE* dirfile)
+{
+ D = dirfile;
+ error_string = NULL;
+}
+
+Dirfile::~Dirfile()
+{
+ if (error_string != NULL)
+ free(error_string);
+
+ 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 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);
+}
+
+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::CarrayLen(const char *field_code) const
+{
+ return gd_carray_len(D, 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);
+}
+
+off_t Dirfile::NFrames() const
+{
+ return gd_nframes(D);
+}
+
+off_t Dirfile::EoF(const char *field_code) const
+{
+ return gd_eof(D, field_code);
+}
+
+off_t Dirfile::BoF(const char *field_code) const
+{
+ return gd_bof(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, off_t first_frame,
+ off_t first_sample, size_t num_frames, size_t num_samples,
+ DataType type, void* data_out) const
+{
+ return gd_getdata(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, off_t first_frame,
+ off_t first_sample, size_t num_frames, size_t num_samples,
+ DataType type, const void* data_in) const
+{
+ return gd_putdata(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
+{
+ const char* ref = gd_reference(D, NULL);
+
+ if (ref == NULL)
+ return NULL;
+
+ return gd_raw_filename(D, ref);
+}
+
+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, int 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,
+ off_t frame_start, off_t frame_end) const
+{
+ return gd_framenum_subset(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);
+}
diff --git a/bindings/cxx/divideentry.cpp b/bindings/cxx/divideentry.cpp
new file mode 100644
index 0000000..d2a594e
--- /dev/null
+++ b/bindings/cxx/divideentry.cpp
@@ -0,0 +1,59 @@
+// Copyright (C) 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+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;
+}
diff --git a/bindings/cxx/entry.cpp b/bindings/cxx/entry.cpp
new file mode 100644
index 0000000..786d25d
--- /dev/null
+++ b/bindings/cxx/entry.cpp
@@ -0,0 +1,198 @@
+// Copyright (C) 2008-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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+using namespace GetData;
+
+Entry::Entry()
+{
+ memset(&E, 0, sizeof(E));
+ D = NULL;
+}
+
+Entry::Entry(const GetData::Dirfile *dirfile, const char* field_code)
+{
+ D = dirfile;
+ gd_entry(D->D, field_code, &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:
+ return 0;
+ case GD_LINCOM_ENTRY:
+ if (index > n_fields)
+ return 0;
+ break;
+ case GD_MULTIPLY_ENTRY:
+ case GD_DIVIDE_ENTRY:
+ if (index > 2)
+ return 0;
+ default:
+ if (index > 1)
+ return 0;
+ }
+
+ return 1;
+}
+
+int Entry::Move(int new_fragment, int move_data)
+{
+ int ret = -1;
+
+ if (D != NULL)
+ ret = gd_move(D->D, E.field, new_fragment, move_data);
+
+ if (!ret)
+ E.fragment_index = new_fragment;
+
+ return ret;
+}
+
+int Entry::Rename(const char* new_name, int move_data)
+{
+ char* ptr;
+ int ret = -1;
+
+ if (D != NULL)
+ ret = gd_rename(D->D, E.field, new_name, move_data);
+
+ if (ret) {
+ if (E.field == NULL) {
+ E.field = strdup(new_name);
+ } else {
+ 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:
+ if (index >= 2)
+ return 0;
+ break;
+ case GD_RAW_ENTRY:
+ case GD_PHASE_ENTRY:
+ case GD_RECIP_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:
+ 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;
+ }
+}
diff --git a/bindings/cxx/fragment.cpp b/bindings/cxx/fragment.cpp
new file mode 100644
index 0000000..0ba4784
--- /dev/null
+++ b/bindings/cxx/fragment.cpp
@@ -0,0 +1,93 @@
+// Copyright (C) 2008, 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+using namespace GetData;
+
+Fragment::Fragment(const GetData::Dirfile *dirfile, int index)
+{
+ D = dirfile;
+
+ ind = index;
+ enc = (GetData::EncodingScheme)gd_encoding(D->D, index);
+ end = gd_endianness(D->D, index);
+ off = gd_frameoffset(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);
+}
+
+Fragment::~Fragment()
+{
+ ;
+}
+
+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(off_t offset, int recode)
+{
+ int ret = gd_alter_frameoffset(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;
+}
diff --git a/bindings/cxx/getdata/bitentry.h b/bindings/cxx/getdata/bitentry.h
new file mode 100644
index 0000000..46dd2b5
--- /dev/null
+++ b/bindings/cxx/getdata/bitentry.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2008-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_BITENTRY_H
+#define GETDATA_BITENTRY_H
+
+#include <getdata/entry.h>
+
+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, gd_bit_t bitnum,
+ gd_bit_t numbits = 1, int fragment_index = 0);
+
+ virtual const char *Input() const { return E.in_fields[0]; };
+
+ virtual gd_bit_t FirstBit() const { return E.u.bit.bitnum; };
+
+ virtual gd_bit_t NumBits() const { return E.u.bit.numbits; };
+
+ int SetInput(const char* field);
+ int SetFirstBit(gd_bit_t first_bit);
+ int SetFirstBit(const char* first_bit);
+ int SetNumBits(gd_bit_t num_bits);
+ int SetNumBits(const char* num_bits);
+
+ virtual const char *Scalar(int index = 0) const;
+
+ virtual int ScalarIndex(int index = 0) const;
+
+ private:
+ BitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/carrayentry.h b/bindings/cxx/getdata/carrayentry.h
new file mode 100644
index 0000000..dc55ff5
--- /dev/null
+++ b/bindings/cxx/getdata/carrayentry.h
@@ -0,0 +1,57 @@
+// Copyright (C) 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_CARRAYENTRY_H
+#define GETDATA_CARRAYENTRY_H
+
+#include <getdata/entry.h>
+
+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
diff --git a/bindings/cxx/getdata/constentry.h b/bindings/cxx/getdata/constentry.h
new file mode 100644
index 0000000..1e4436d
--- /dev/null
+++ b/bindings/cxx/getdata/constentry.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2008, 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_CONSTENTRY_H
+#define GETDATA_CONSTENTRY_H
+
+#include <getdata/entry.h>
+
+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
diff --git a/bindings/cxx/getdata/dirfile.h b/bindings/cxx/getdata/dirfile.h
new file mode 100644
index 0000000..aa2de27
--- /dev/null
+++ b/bindings/cxx/getdata/dirfile.h
@@ -0,0 +1,226 @@
+// Copyright (C) 2008-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_DIRFILE_H
+#define GETDATA_DIRFILE_H
+
+// We don't want the legacy API since its symbols clash with us.
+#ifndef GD_NO_LEGACY_API
+# define GD_NO_LEGACY_API
+#endif
+
+// We 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 <getdata.h>
+
+#include <getdata/fragment.h>
+#include <getdata/entry.h>
+#include <getdata/rawentry.h>
+#include <getdata/lincomentry.h>
+#include <getdata/linterpentry.h>
+#include <getdata/bitentry.h>
+#include <getdata/sbitentry.h>
+#include <getdata/phaseentry.h>
+#include <getdata/indexentry.h>
+#include <getdata/polynomentry.h>
+#include <getdata/constentry.h>
+#include <getdata/carrayentry.h>
+#include <getdata/stringentry.h>
+#include <getdata/multiplyentry.h>
+#include <getdata/divideentry.h>
+#include <getdata/recipentry.h>
+
+namespace GetData {
+
+ class Entry;
+ class RawEntry;
+
+ 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 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 AddSpec(const char *spec, int fragment_index = 0) const;
+
+ int AlterSpec(const char* spec, int recode = 0) const;
+
+ off_t BoF(const char *field_code) const;
+
+ size_t CarrayLen(const char *field_code) const;
+
+ const gd_carray_t *Carrays(DataType type = Float64) const;
+
+ int Close();
+
+ const void *Constants(DataType type = Float64) const;
+
+ int Delete(const char* field_code, int flags = 0) const;
+
+ int Discard();
+
+ GetData::Entry* Entry(const char *field_code) const;
+
+ off_t EoF(const char *field_code) const;
+
+ int Error() const;
+
+ const char *ErrorString();
+ const char *ErrorString(size_t n) gd_deprecated;
+
+ 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,
+ off_t frame_start = 0, off_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, off_t first_frame,
+ off_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 Include(const char *file, int fragment_index = 0,
+ unsigned long flags = 0) const;
+
+ int MAdd(GetData::Entry &entry, const char *parent) 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;
+
+ const char **MStrings(const char *parent) const;
+
+ const char **MVectorList(const char *parent) 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;
+
+ off_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, off_t first_frame,
+ off_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;
+
+ GetData::RawEntry *Reference(const char* field_code = NULL) const;
+
+ const char *ReferenceFilename() const;
+
+ unsigned int SamplesPerFrame(const char *field_code) 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 UnInclude(int fragment_index, int del = 0) const;
+
+ int Validate(const char* field_code) const;
+
+ const char **VectorList() const;
+
+ private:
+ DIRFILE* D;
+
+ char *error_string;
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/divideentry.h b/bindings/cxx/getdata/divideentry.h
new file mode 100644
index 0000000..2b4a4e7
--- /dev/null
+++ b/bindings/cxx/getdata/divideentry.h
@@ -0,0 +1,52 @@
+// Copyright (C) 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_DIVIDEENTRY_H
+#define GETDATA_DIVIDEENTRY_H
+
+#include <getdata/entry.h>
+
+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 = 0) const {
+ return E.in_fields[(index == 0) ? 0 : 1];
+ };
+
+ int SetInput(const char* field, int index);
+
+ private:
+ DivideEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/entry.h b/bindings/cxx/getdata/entry.h
new file mode 100644
index 0000000..33f7d90
--- /dev/null
+++ b/bindings/cxx/getdata/entry.h
@@ -0,0 +1,230 @@
+// Copyright (C) 2008-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_ENTRY_H
+#define GETDATA_ENTRY_H
+
+#ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+#endif
+
+#ifndef GD_NO_LEGACY_API
+# define GD_NO_LEGACY_API
+#endif
+#ifndef GD_C89_API
+# define GD_C89_API
+#endif
+
+extern "C" {
+#include <getdata.h>
+}
+
+#include <complex>
+
+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
+ };
+
+ 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, int move_data = 0);
+
+ int Rename(const char* new_name, int move_data = 0);
+
+ /* Specific data */
+ virtual const char *Input(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.in_fields[index] : NULL;
+ };
+
+ virtual int ComplexScalars() const {
+ return (E.field_type == GD_LINCOM_ENTRY ||
+ E.field_type == GD_POLYNOM_ENTRY) ? E.comp_scal : 0;
+ }
+
+ virtual const char *Scalar(int index = 0) const;
+
+ virtual int ScalarIndex(int index = 0) const;
+
+ /* RAW methods */
+ virtual gd_spf_t 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 = 0) 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<double> CScale(int index = 0) const {
+ return (E.field_type == GD_LINCOM_ENTRY &&
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(E.u.lincom.cm[index][0],
+ E.u.lincom.cm[index][1]) : 0;
+ }
+
+ virtual double Offset(int index = 0) 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<double> COffset(int index = 0) const {
+ return (E.field_type == GD_LINCOM_ENTRY &&
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(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 gd_bit_t FirstBit() const {
+ return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.bitnum : -1;
+ };
+
+ virtual gd_bit_t 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 = 0) const {
+ return (E.field_type == GD_POLYNOM_ENTRY && index <=
+ E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
+ }
+
+ virtual std::complex<double> CCoefficient(int index = 0) const {
+ return (E.field_type == GD_POLYNOM_ENTRY && index <=
+ E.u.polynom.poly_ord) ?
+ std::complex<double>(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<double> CDividend() const {
+ return (E.field_type == GD_RECIP_ENTRY) ?
+ std::complex<double>(E.u.recip.cdividend[0], E.u.recip.cdividend[1]) :
+ 0;
+ };
+
+ 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
diff --git a/bindings/cxx/getdata/fragment.h b/bindings/cxx/getdata/fragment.h
new file mode 100644
index 0000000..dc0bee7
--- /dev/null
+++ b/bindings/cxx/getdata/fragment.h
@@ -0,0 +1,97 @@
+// Copyright (C) 2008, 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_FRAGMENT_H
+#define GETDATA_FRAGMENT_H
+
+#ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+#endif
+
+#ifndef GD_NO_LEGACY_API
+# define GD_NO_LEGACY_API
+#endif
+#ifndef GD_C89_API
+# define GD_C89_API
+#endif
+
+extern "C" {
+#include <getdata.h>
+}
+#include <sys/types.h>
+
+
+namespace GetData {
+
+ enum EncodingScheme {
+ AutoEncoding = GD_AUTO_ENCODED, RawEncoding = GD_UNENCODED,
+ TextEncoding = GD_TEXT_ENCODED, SlimEncoding = GD_SLIM_ENCODED,
+ GzipEncoding = GD_GZIP_ENCODED, Bzip2Encoding = GD_BZIP2_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; };
+
+ off_t FrameOffset() const { return (off_t)off; };
+
+ int Index() const { return ind; }
+
+ const char* Name() const { return name; }
+
+ int Parent() const { return parent; }
+
+ int Protection() const { return prot; }
+
+ int ReWrite() const;
+
+ 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 SetProtection(int protection_level);
+
+ protected:
+ Fragment(const Dirfile *dirfile, int index);
+
+ const Dirfile *D;
+ EncodingScheme enc;
+ unsigned long end;
+ int ind;
+ int prot;
+ off_t off;
+ const char* name;
+ int parent;
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/indexentry.h b/bindings/cxx/getdata/indexentry.h
new file mode 100644
index 0000000..35aa046
--- /dev/null
+++ b/bindings/cxx/getdata/indexentry.h
@@ -0,0 +1,40 @@
+// Copyright (C) 2008, 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_INDEXENTRY_H
+#define GETDATA_INDEXENTRY_H
+
+#include <getdata/entry.h>
+
+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
diff --git a/bindings/cxx/getdata/lincomentry.h b/bindings/cxx/getdata/lincomentry.h
new file mode 100644
index 0000000..b795140
--- /dev/null
+++ b/bindings/cxx/getdata/lincomentry.h
@@ -0,0 +1,94 @@
+// Copyright (C) 2008-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_LINCOMENTRY_H
+#define GETDATA_LINCOMENTRY_H
+
+#include <getdata/entry.h>
+
+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<double>* cm, std::complex<double>* cb,
+ int fragment_index = 0);
+
+ virtual const char *Input(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.in_fields[index] : NULL;
+ };
+
+ virtual int ComplexScalars() const { return E.comp_scal; }
+
+ virtual int NFields() const { return E.u.lincom.n_fields; };
+
+ virtual double Scale(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.u.lincom.m[index] : 0;
+ };
+
+ virtual std::complex<double> CScale(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(E.u.lincom.cm[index][0],
+ E.u.lincom.cm[index][1]) : 0;
+ };
+
+ virtual double Offset(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.u.lincom.b[index] : 0;
+ };
+
+ virtual std::complex<double> COffset(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(E.u.lincom.cb[index][0],
+ E.u.lincom.cb[index][1]) : 0;
+ };
+
+ virtual const char *Scalar(int index = 0) const;
+
+ virtual int ScalarIndex(int index = 0) const;
+
+ int SetNFields(int nfields);
+ int SetInput(const char* field, int index = 0);
+ int SetScale(double scale, int index = 0);
+ int SetScale(const char* scale, int index = 0);
+ int SetScale(std::complex<double> scale, int index = 0);
+ int SetOffset(double offset, int index = 0);
+ int SetOffset(const char* scale, int index = 0);
+ int SetOffset(std::complex<double> offset, int index = 0);
+
+ private:
+ LincomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/linterpentry.h b/bindings/cxx/getdata/linterpentry.h
new file mode 100644
index 0000000..48151db
--- /dev/null
+++ b/bindings/cxx/getdata/linterpentry.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2008, 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_LINTERPENTRY_H
+#define GETDATA_LINTERPENTRY_H
+
+#include <getdata/entry.h>
+
+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() const { return E.in_fields[0]; };
+
+ 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
diff --git a/bindings/cxx/getdata/multiplyentry.h b/bindings/cxx/getdata/multiplyentry.h
new file mode 100644
index 0000000..b589050
--- /dev/null
+++ b/bindings/cxx/getdata/multiplyentry.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2008, 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_MULTIPLYENTRY_H
+#define GETDATA_MULTIPLYENTRY_H
+
+#include <getdata/entry.h>
+
+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 = 0) const {
+ return E.in_fields[(index == 0) ? 0 : 1];
+ };
+
+ int SetInput(const char* field, int index);
+
+ private:
+ MultiplyEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/phaseentry.h b/bindings/cxx/getdata/phaseentry.h
new file mode 100644
index 0000000..14f0bc7
--- /dev/null
+++ b/bindings/cxx/getdata/phaseentry.h
@@ -0,0 +1,58 @@
+// Copyright (C) 2008-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_PHASEENTRY_H
+#define GETDATA_PHASEENTRY_H
+
+#include <getdata/entry.h>
+
+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() const { return E.in_fields[0]; };
+
+ 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);
+
+ const char *Scalar() const { return E.scalar[0]; };
+
+ virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+ private:
+ PhaseEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/polynomentry.h b/bindings/cxx/getdata/polynomentry.h
new file mode 100644
index 0000000..1d6630e
--- /dev/null
+++ b/bindings/cxx/getdata/polynomentry.h
@@ -0,0 +1,75 @@
+// 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
+//
+
+#ifndef GETDATA_POLYNOMENTRY_H
+#define GETDATA_POLYNOMENTRY_H
+
+#include <getdata/entry.h>
+
+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<double>* ca, int fragment_index = 0);
+
+ virtual const char *Input() const { return E.in_fields[0]; };
+
+ virtual int ComplexScalars() const { return E.comp_scal; }
+
+ virtual int PolyOrd() const { return E.u.polynom.poly_ord; };
+
+ virtual double Coefficient(int index = 0) const {
+ return (index <= E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
+ };
+
+ virtual std::complex<double> CCoefficient(int index = 0) const {
+ return (index <= E.u.polynom.poly_ord)
+ ? std::complex<double>(E.u.polynom.ca[index][0],
+ E.u.polynom.ca[index][1]) : 0;
+ };
+
+ virtual const char *Scalar(int index = 0) const;
+
+ virtual int ScalarIndex(int index = 0) const;
+
+ int SetPolyOrd(int poly_ord);
+ int SetInput(const char* field);
+ int SetCoefficient(double coeff, int index = 0);
+ int SetCoefficient(const char* coeff, int index = 0);
+ int SetCoefficient(std::complex<double> coeff, int index = 0);
+
+ private:
+ PolynomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/rawentry.h b/bindings/cxx/getdata/rawentry.h
new file mode 100644
index 0000000..4ba3705
--- /dev/null
+++ b/bindings/cxx/getdata/rawentry.h
@@ -0,0 +1,59 @@
+// Copyright (C) 2008-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_RAWENTRY_H
+#define GETDATA_RAWENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+ class Dirfile;
+
+ class RawEntry : public Entry {
+ friend class Dirfile;
+
+ public:
+ RawEntry() : Entry() { E.field_type = GD_RAW_ENTRY; };
+
+ RawEntry(const char* field_code, DataType data_type, gd_spf_t spf,
+ int fragment_index = 0);
+
+ virtual gd_spf_t SamplesPerFrame() const { return E.u.raw.spf; };
+
+ virtual DataType RawType() const { return (DataType)E.u.raw.data_type; };
+
+ const char* FileName();
+ int SetSamplesPerFrame(gd_spf_t spf, int recode = 0);
+ int SetSamplesPerFrame(const char *spf, int recode = 0);
+ int SetType(DataType type, int recode = 0);
+
+ virtual const char *Scalar() const { return E.scalar[0]; };
+
+ virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+ private:
+ RawEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/recipentry.h b/bindings/cxx/getdata/recipentry.h
new file mode 100644
index 0000000..3d87417
--- /dev/null
+++ b/bindings/cxx/getdata/recipentry.h
@@ -0,0 +1,69 @@
+// Copyright (C) 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_RECIPENTRY_H
+#define GETDATA_RECIPENTRY_H
+
+#include <getdata/entry.h>
+
+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<double> cdividend, int fragment_index = 0);
+
+ virtual const char *Input() const { return E.in_fields[0]; };
+
+ virtual const char *Scalar() const { return E.scalar[0]; }
+
+ virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+ virtual int ComplexScalars() const { return E.comp_scal; }
+
+ virtual double Dividend() const { return E.u.recip.dividend; };
+
+ virtual std::complex<double> CDividend() const {
+ return std::complex<double>(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<double> coeff);
+
+ private:
+ RecipEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/sbitentry.h b/bindings/cxx/getdata/sbitentry.h
new file mode 100644
index 0000000..8f3e1c8
--- /dev/null
+++ b/bindings/cxx/getdata/sbitentry.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2008-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_SBITENTRY_H
+#define GETDATA_SBITENTRY_H
+
+#include <getdata/entry.h>
+
+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, gd_bit_t bitnum,
+ gd_bit_t numbits = 1, int fragment_index = 0);
+
+ virtual const char *Input() const { return E.in_fields[0]; };
+
+ virtual gd_bit_t FirstBit() const { return E.u.bit.bitnum; };
+
+ virtual gd_bit_t NumBits() const { return E.u.bit.numbits; };
+
+ int SetInput(const char* field);
+ int SetFirstBit(gd_bit_t first_bit);
+ int SetFirstBit(const char* first_bit);
+ int SetNumBits(gd_bit_t num_bits);
+ int SetNumBits(const char* num_bits);
+
+ virtual const char *Scalar(int index = 0) const;
+
+ virtual int ScalarIndex(int index = 0) const;
+
+ private:
+ SBitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+ Entry(dirfile, field_code) { };
+ };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/stringentry.h b/bindings/cxx/getdata/stringentry.h
new file mode 100644
index 0000000..1b3662f
--- /dev/null
+++ b/bindings/cxx/getdata/stringentry.h
@@ -0,0 +1,45 @@
+// Copyright (C) 2008, 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_STRINGENTRY_H
+#define GETDATA_STRINGENTRY_H
+
+#include <getdata/entry.h>
+
+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
diff --git a/bindings/cxx/indexentry.cpp b/bindings/cxx/indexentry.cpp
new file mode 100644
index 0000000..ef6b5ca
--- /dev/null
+++ b/bindings/cxx/indexentry.cpp
@@ -0,0 +1,27 @@
+// Copyright (C) 2008, 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+using namespace GetData;
diff --git a/bindings/cxx/lincomentry.cpp b/bindings/cxx/lincomentry.cpp
new file mode 100644
index 0000000..52826a7
--- /dev/null
+++ b/bindings/cxx/lincomentry.cpp
@@ -0,0 +1,228 @@
+// Copyright (C) 2008-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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+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.comp_scal = 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<double>* cm, std::complex<double>* 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.comp_scal = 1;
+ 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<double> 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.comp_scal = 1;
+
+ 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<double> 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.comp_scal = 1;
+
+ 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];
+}
diff --git a/bindings/cxx/linterpentry.cpp b/bindings/cxx/linterpentry.cpp
new file mode 100644
index 0000000..9ab297c
--- /dev/null
+++ b/bindings/cxx/linterpentry.cpp
@@ -0,0 +1,72 @@
+// Copyright (C) 2008, 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+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;
+}
diff --git a/bindings/cxx/multiplyentry.cpp b/bindings/cxx/multiplyentry.cpp
new file mode 100644
index 0000000..74c5759
--- /dev/null
+++ b/bindings/cxx/multiplyentry.cpp
@@ -0,0 +1,59 @@
+// Copyright (C) 2008, 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+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;
+}
diff --git a/bindings/cxx/phaseentry.cpp b/bindings/cxx/phaseentry.cpp
new file mode 100644
index 0000000..193cd00
--- /dev/null
+++ b/bindings/cxx/phaseentry.cpp
@@ -0,0 +1,82 @@
+// Copyright (C) 2008-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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+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;
+}
diff --git a/bindings/cxx/polynomentry.cpp b/bindings/cxx/polynomentry.cpp
new file mode 100644
index 0000000..beaa8ca
--- /dev/null
+++ b/bindings/cxx/polynomentry.cpp
@@ -0,0 +1,167 @@
+// 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+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.comp_scal = 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<double>* 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.comp_scal = 1;
+ 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<double> 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.comp_scal = 1;
+
+ 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];
+}
diff --git a/bindings/cxx/rawentry.cpp b/bindings/cxx/rawentry.cpp
new file mode 100644
index 0000000..0398be9
--- /dev/null
+++ b/bindings/cxx/rawentry.cpp
@@ -0,0 +1,82 @@
+// Copyright (C) 2008-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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <cstring>
+#include <stdlib.h>
+#include <stdint.h>
+
+using namespace GetData;
+
+RawEntry::RawEntry(const char* field_code, DataType data_type, gd_spf_t 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;
+}
+
+int RawEntry::SetSamplesPerFrame(gd_spf_t 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()
+{
+ return gd_raw_filename(D->D, E.field);
+}
diff --git a/bindings/cxx/recipentry.cpp b/bindings/cxx/recipentry.cpp
new file mode 100644
index 0000000..f5fa271
--- /dev/null
+++ b/bindings/cxx/recipentry.cpp
@@ -0,0 +1,113 @@
+// Copyright (C) 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <stdlib.h>
+#include <cstring>
+
+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.comp_scal = 0;
+ E.fragment_index = fragment_index;
+}
+
+RecipEntry::RecipEntry(const char* field_code, const char* in_field1,
+ std::complex<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.real();
+ E.u.recip.cdividend[1] = dividend.imag();
+ E.comp_scal = 1;
+ 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<double> dividend)
+{
+ E.u.recip.dividend = E.u.recip.cdividend[0] = dividend.real();
+ E.u.recip.cdividend[1] = dividend.imag();
+ E.comp_scal = 1;
+
+ if (D != NULL)
+ return gd_alter_entry(D->D, E.field, &E, 0);
+
+ return 0;
+}
diff --git a/bindings/cxx/sbitentry.cpp b/bindings/cxx/sbitentry.cpp
new file mode 100644
index 0000000..41a2d0f
--- /dev/null
+++ b/bindings/cxx/sbitentry.cpp
@@ -0,0 +1,125 @@
+// Copyright (C) 2008-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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <cstring>
+#include <stdlib.h>
+
+using namespace GetData;
+
+SBitEntry::SBitEntry(const char* field_code, const char* in_field,
+ gd_bit_t bitnum, gd_bit_t 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(gd_bit_t 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(gd_bit_t num_bits)
+{
+ E.u.bit.numbits = num_bits;
+
+ if (D != NULL)
+ return gd_alter_entry(D->D, E.field, &E, 0);
+
+ return 0;
+}
+
+const char *SBitEntry::Scalar(int index) const
+{
+ if (index != 0 && index != 1)
+ return NULL;
+
+ return E.scalar[index];
+}
+
+int SBitEntry::ScalarIndex(int index) const
+{
+ if (index != 0 && index != 1)
+ return 0;
+
+ return E.scalar_ind[index];
+}
+
+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;
+}
diff --git a/bindings/cxx/stringentry.cpp b/bindings/cxx/stringentry.cpp
new file mode 100644
index 0000000..9d8308a
--- /dev/null
+++ b/bindings/cxx/stringentry.cpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2008, 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
+//
+#ifdef HAVE_CONFIG_H
+#include "../../src/config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <cstring>
+
+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;
+}
diff --git a/bindings/cxx/test/Makefile.am b/bindings/cxx/test/Makefile.am
new file mode 100644
index 0000000..54f8f35
--- /dev/null
+++ b/bindings/cxx/test/Makefile.am
@@ -0,0 +1,48 @@
+# Copyright (C) 2008-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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CXX_WALL
+WALL=-Wall
+endif
+
+if CXX_WEXTRA
+WEXTRA=-Wextra
+endif
+
+INCLUDES = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src -D__TEST__=\"$@\"
+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 -rvf *odirfile
+
+clean-local:
+ $(MAKE) getdata-clean-dirs
+ rm -rf *~
diff --git a/bindings/cxx/test/Makefile.in b/bindings/cxx/test/Makefile.in
new file mode 100644
index 0000000..5fda571
--- /dev/null
+++ b/bindings/cxx/test/Makefile.in
@@ -0,0 +1,668 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+TESTS = big_test$(EXEEXT)
+check_PROGRAMS = $(am__EXEEXT_1)
+subdir = bindings/cxx/test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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
+DEFAULT_INCLUDES = -I. at 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) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(big_test_SOURCES)
+DIST_SOURCES = $(big_test_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at CXX_WALL_TRUE@WALL = -Wall
+ at CXX_WEXTRA_TRUE@WEXTRA = -Wextra
+INCLUDES = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src -D__TEST__=\"$@\"
+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)
+ @rm -f big_test$(EXEEXT)
+ $(CXXLINK) $(big_test_OBJECTS) $(big_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/big_test.Po at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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; 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 \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-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 all all-am check check-TESTS check-am check-local \
+ clean clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-local ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+# clean up after the tests
+check-local: check-TESTS
+ $(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+ rm -rvf *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:
diff --git a/bindings/cxx/test/big_test.cpp b/bindings/cxx/test/big_test.cpp
new file mode 100644
index 0000000..2bd4d7a
--- /dev/null
+++ b/bindings/cxx/test/big_test.cpp
@@ -0,0 +1,1331 @@
+// 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
+//
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#undef GETDATA_LEGACY_API
+#endif
+
+#include "getdata/dirfile.h"
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <iostream>
+#include <math.h>
+
+#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;
+
+#define CHECK_ERRORb(d,t,g) \
+ e = d->Error(); if (e != (g)) { ne++; cerr << "e[" << t << "] = " << e << endl; }
+#define CHECK_ERROR2b(d,t,n,g) \
+ e = d->Error(); if (e != (g)) { \
+ ne++; cerr << "e[" << t << ", " << n << "] = " << e << endl; }
+#define CHECK_ERROR(t,g) CHECK_ERRORb(d,t,g)
+#define CHECK_ERROR2(t,n,g) CHECK_ERROR2b(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) \
+ if ((v) == NULL) { ne++; cerr << "p[" << t << "] = " << (v) << endl; }
+
+#define CHECK_INT(t,v,g) \
+ if ((v) != (g)) { ne++; cerr << "n[" << t << "] = " << (v) << endl; }
+#define CHECK_INT2(t,n,v,g) \
+ if ((v) != (g)) { \
+ ne++; cerr << "n[" << t << ", " << n << "] = " << (v) << endl; }
+#define CHECK_INT_ARRAY(t,m,v,g) \
+ for (i = 0; i < m; ++i) if ((v) != (g)) { \
+ ne++; cerr << "n(" << i << ")[" << t << "] = " << (int)v << endl; }
+
+#define CHECK_DOUBLE(t,v,g) \
+ if (fabs((v) - (g)) > 1e-10) { \
+ ne++; cerr << "d[" << t << "] = " << (v) << endl; }
+#define CHECK_DOUBLE2(t,m,v,g) \
+ if (fabs((v) - (g)) > 1e-10) { \
+ ne++; cerr << "d[" << t << ", " << m << "] = " << (v) << endl; }
+#define CHECK_DOUBLE_ARRAY(t,m,n,v,g) \
+ for (i = 0; i < n; ++i) if (fabs((v) - (g)) > 1e-10) { \
+ ne++; cerr << "d(" << i << ")[" << t << ", " << m << "] = " << (v) << endl; }
+
+#define CHECK_STRING(t,v,g) \
+ if (strcmp((v), (g))) { ne++; cerr << "s[" << t << "] = " << (v) << endl; }
+#define CHECK_STRING2(t,m,v,g) \
+ if (strcmp((v), (g))) { \
+ ne++; cerr << "s[" << t << ", " << m << "] = " << (v) << endl; }
+#define CHECK_STRING_ARRAY(t,m,v,g) \
+ for (i = 0; i < m; ++i) if (strcmp((v), (g))) { \
+ ne++; cerr << "s(" << i << ")[" << t << "] = " << (v) << endl; }
+
+#define CHECK_COMPLEX2(t,m,v,g) \
+ if (abs((v) - (g)) > 1e-10) { \
+ ne++; cerr << "c[" << t << ", " << m << "] = " << (v).real() << ";" \
+ << (v).imag() << endl; }
+#define CHECK_COMPLEX_ARRAY(t,m,v,g) \
+ for (i = 0; i < m; ++i) if (abs((v) - (g)) > 1e-10) { \
+ ne++; cerr << "c(" << i << ")[" << t << "] = " << v.real() \
+ << ";" << v.imag() << endl; }
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* form2 = __TEST__ "dirfile/form2";
+ const char* new1 = __TEST__ "dirfile/new1";
+ const char* data = __TEST__ "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 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 /look/up/file\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"
+ "mult MULTIPLY data sbit\n"
+ "div DIVIDE mult bit\n"
+ "recip RECIP div 6.5;4.3\n"
+ "phase PHASE data 11\n"
+ "string STRING \"Zaphod Beeblebrox\"\n";
+ const char* form2_data = "const2 CONST INT8 -19\n";
+ const int nfields = 14;
+ unsigned char c[8];
+ unsigned char data_data[80];
+ signed char sc;
+ int n, i, e, ne = 0;
+ float fl;
+ double dp, p[6], q[6];
+ complex<double> cq[6];
+ const char **list;
+ const char* str;
+ 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;
+ Fragment *frag;
+
+ char* fields[nfields + 7] = {(char*)"INDEX", (char*)"bit", (char*)"carray",
+ (char*)"const", (char*)"data", (char*)"div", (char*)"lincom",
+ (char*)"linterp", (char*)"mult", (char*)"phase", (char*)"polynom",
+ (char*)"recip", (char*)"sbit", (char*)"string", NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL};
+
+ // 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);
+
+ // 0: Dirfile::Error check
+ d = new Dirfile("x");
+ CHECK_ERROR(0, GD_E_OPEN);
+ delete d;
+
+ // 1: Dirfile::Dirfile check
+ d = new Dirfile(filedir, GD_RDWR);
+ CHECK_OK(1);
+
+ // 2: Dirfile::GetData check
+ n = d->GetData("data", 5, 0, 1, 0, UInt8, c);
+ CHECK_OK(2);
+ CHECK_INT(2,n,8);
+ CHECK_INT_ARRAY(2,8,c[i],41 + i);
+
+ // 3: Dirfile::GetConstant check
+ n = d->GetConstant("const", Float64, &dp);
+ CHECK_OK(3);
+ CHECK_INT(3,n,0);
+ CHECK_DOUBLE(3,dp,5.5);
+
+ // 6: Dirfile::NFields check
+ n = d->NFields();
+ CHECK_OK(6);
+ CHECK_INT(6,n,nfields);
+
+ // 8: Dirfile::FieldList check
+ list = d->FieldList();
+ CHECK_OK(8);
+ CHECK_STRING_ARRAY(8,n,list[i],fields[i]);
+
+ // 9: Dirfile::NFields check
+ n = d->NMFields("data");
+ CHECK_OK(9);
+ CHECK_INT(9,n,3);
+
+ // 10: Dirfile::MFieldList check
+ fields[0] = (char*)"mstr";
+ fields[1] = (char*)"mconst";
+ fields[2] = (char*)"mlut";
+ list = d->MFieldList("data");
+ CHECK_OK(10);
+ CHECK_STRING_ARRAY(10,n,list[i],fields[i]);
+
+ // 11: Dirfile::NFrames check
+ n = d->NFrames();
+ CHECK_OK(11);
+ CHECK_INT(11,n,10);
+
+ // 12: Dirfile::SamplesPerFrame check
+ n = d->SamplesPerFrame("data");
+ CHECK_OK(12);
+ CHECK_INT(12,n,8);
+
+ // 13: 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(13,1);
+ CHECK_INT2(13,1,n,4);
+
+ n = d->GetData("data", 5, 0, 1, 0, UInt8, c);
+ CHECK_OK2(13,2);
+ CHECK_INT2(13,2,n,8);
+ CHECK_INT_ARRAY(13,8,c[i],(i == 0 || i > 4) ? 41 + i : 12 + i);
+
+ // 14: Dirfile::ErrorString check
+ d->GetData("x", 5, 0, 1, 0, Null, NULL);
+ str = d->ErrorString();
+ CHECK_STRING(14,str,"Field not found: x");
+
+ // 16: Dirfile::Entry / RawEntry check
+ ent = d->Entry("data");
+ CHECK_OK(16);
+ CHECK_INT2(16,1,ent->Type(),RawEntryType);
+ CHECK_INT2(16,2,ent->FragmentIndex(),0);
+ CHECK_INT2(16,3,ent->SamplesPerFrame(),8);
+ CHECK_INT2(16,4,ent->RawType(),Int8);
+ delete ent;
+
+ // 18: Dirfile::Entry / LincomEntry check
+ cq[0] = 1.1;
+ cq[1] = 2.2;
+ cq[2] = 2.2;
+ cq[3] = complex<double>(3.3, 4.4);
+ cq[4] = 5.5;
+ cq[5] = 5.5;
+ ent = d->Entry("lincom");
+ CHECK_OK(18);
+ CHECK_INT2(18,1,ent->Type(),LincomEntryType);
+ CHECK_INT2(18,2,ent->NFields(),3);
+ CHECK_INT2(18,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(18,4,ent->Input(0),"data");
+ CHECK_STRING2(18,5,ent->Input(1),"INDEX");
+ CHECK_STRING2(18,6,ent->Input(2),"linterp");
+ CHECK_INT2(18,7,ent->ComplexScalars(),1);
+ CHECK_COMPLEX_ARRAY(18,3,ent->CScale(i),cq[i * 2]);
+ CHECK_COMPLEX_ARRAY(18,3,ent->COffset(i),cq[i * 2 + 1]);
+ delete ent;
+
+ // 20: Dirfile::Entry / PolynomEntry check
+ ent = d->Entry("polynom");
+ CHECK_OK(20);
+ CHECK_INT2(20,1,ent->Type(),PolynomEntryType);
+ CHECK_INT2(20,2,ent->PolyOrd(),5);
+ CHECK_INT2(20,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(20,4,ent->Input(),"data");
+ CHECK_INT2(20,7,ent->ComplexScalars(),1);
+ CHECK_COMPLEX_ARRAY(20,6,ent->CCoefficient(i),cq[i]);
+ delete ent;
+
+ // 21: Dirfile::Entry / LinterpEntry check
+ ent = d->Entry("linterp");
+ CHECK_OK(21);
+ CHECK_INT2(21,1,ent->Type(),LinterpEntryType);
+ CHECK_INT2(21,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(21,3,ent->Input(),"data");
+ CHECK_STRING2(21,4,ent->Table(),"/look/up/file");
+ delete ent;
+
+ // 22: Dirfile::Entry / BitEntry check
+ ent = d->Entry("bit");
+ CHECK_OK(22);
+ CHECK_INT2(22,1,ent->Type(),BitEntryType);
+ CHECK_INT2(22,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(22,3,ent->Input(),"data");
+ CHECK_INT2(22,4,ent->NumBits(),4);
+ CHECK_INT2(22,5,ent->FirstBit(),3);
+ delete ent;
+
+ // 23: Dirfile::Entry / SBitEntry check
+ ent = d->Entry("sbit");
+ CHECK_OK(23);
+ CHECK_INT2(23,1,ent->Type(),SBitEntryType);
+ CHECK_INT2(23,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(23,3,ent->Input(),"data");
+ CHECK_INT2(23,4,ent->NumBits(),6);
+ CHECK_INT2(23,5,ent->FirstBit(),5);
+ delete ent;
+
+ // 24: Dirfile::Entry / MultiplyEntry check
+ ent = d->Entry("mult");
+ CHECK_OK(24);
+ CHECK_INT2(24,1,ent->Type(),MultiplyEntryType);
+ CHECK_INT2(24,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(24,3,ent->Input(0),"data");
+ CHECK_STRING2(24,4,ent->Input(1),"sbit");
+ delete ent;
+
+ // 25: Dirfile::Entry / PhaseEntry check
+ ent = d->Entry("phase");
+ CHECK_OK(25);
+ CHECK_INT2(25,1,ent->Type(),PhaseEntryType);
+ CHECK_INT2(25,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(25,3,ent->Input(),"data");
+ CHECK_INT2(25,4,ent->Shift(),11);
+ delete ent;
+
+ // 26: Dirfile::Entry / ConstEntry check
+ ent = d->Entry("const");
+ CHECK_OK(26);
+ CHECK_INT2(26,1,ent->Type(),ConstEntryType);
+ CHECK_INT2(26,2,ent->FragmentIndex(),0);
+ CHECK_INT2(26,3,ent->ConstType(),Float64);
+ delete ent;
+
+ // 134: Dirfile::Entry / StringEntry check
+ ent = d->Entry("string");
+ CHECK_OK(134);
+ CHECK_INT2(134,1,ent->Type(),StringEntryType);
+ CHECK_INT2(134,2,ent->FragmentIndex(),0);
+ delete ent;
+
+ // 27: Dirfile::FragmentIndex check
+ n = d->FragmentIndex("data");
+ CHECK_OK(27);
+ CHECK_INT(27,n,0);
+
+ // 28: Dirfile::Add / RawEntry check
+ rent.SetName("new1");
+ rent.SetFragmentIndex(0);
+ rent.SetSamplesPerFrame(3);
+ rent.SetType(Float64);
+ d->Add(rent);
+ CHECK_OK2(28,1);
+
+ ent = d->Entry("new1");
+ CHECK_OK2(28,2);
+ CHECK_INT2(28,1,ent->Type(),RawEntryType);
+ CHECK_INT2(28,2,ent->FragmentIndex(),0);
+ CHECK_INT2(28,3,ent->SamplesPerFrame(),3);
+ CHECK_INT2(28,4,ent->RawType(),Float64);
+ delete ent;
+
+ // 29: 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(29,1);
+
+ ent = d->Entry("new2");
+ CHECK_OK2(29,2);
+ CHECK_INT2(29,1,ent->Type(),LincomEntryType);
+ CHECK_INT2(29,2,ent->NFields(),2);
+ CHECK_INT2(29,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(29,4,ent->Input(0),"in1");
+ CHECK_STRING2(29,5,ent->Input(1),"in2");
+ CHECK_INT2(29,6,ent->ComplexScalars(),0);
+ CHECK_DOUBLE_ARRAY(29,7,2,ent->Scale(i),q[i * 2]);
+ CHECK_DOUBLE_ARRAY(29,8,2,ent->Offset(i),q[i * 2 + 1]);
+ delete ent;
+
+ // 30: Dirfile::Add / LincomEntry check
+ cq[0] = complex<double>(1.1, 1.2);
+ cq[1] = complex<double>(1.3, 1.4);
+ cq[2] = complex<double>(1.4, 1.5);
+ cq[3] = complex<double>(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(30,1);
+
+ ent = d->Entry("new3");
+ CHECK_OK2(30,2);
+ CHECK_INT2(30,1,ent->Type(),LincomEntryType);
+ CHECK_INT2(30,2,ent->NFields(),2);
+ CHECK_INT2(30,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(30,4,ent->Input(0),"in1");
+ CHECK_STRING2(30,5,ent->Input(1),"in2");
+ CHECK_INT2(30,6,ent->ComplexScalars(),1);
+ CHECK_COMPLEX_ARRAY(30,2,ent->CScale(i),cq[i * 2]);
+ CHECK_COMPLEX_ARRAY(30,2,ent->COffset(i),cq[i * 2 + 1]);
+ delete ent;
+
+ // 31: 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(31,1);
+
+ ent = d->Entry("new4");
+ CHECK_OK2(31,2);
+ CHECK_INT2(31,1,ent->Type(),PolynomEntryType);
+ CHECK_INT2(31,2,ent->PolyOrd(),3);
+ CHECK_INT2(31,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(31,4,ent->Input(),"in1");
+ CHECK_INT2(31,5,ent->ComplexScalars(),0);
+ CHECK_DOUBLE_ARRAY(31,6,4,ent->Coefficient(i),q[i]);
+ delete ent;
+
+ // 32: Dirfile::Add / PolynomEntry check
+ cq[0] = complex<double>(3.1, 7);
+ cq[1] = complex<double>(4.2, 8);
+ cq[2] = complex<double>(5.2, 9);
+ cq[3] = complex<double>(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(32,1);
+
+ ent = d->Entry("new5");
+ CHECK_OK2(32,2);
+ CHECK_INT2(32,1,ent->Type(),PolynomEntryType);
+ CHECK_INT2(32,2,ent->PolyOrd(),3);
+ CHECK_INT2(32,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(32,4,ent->Input(),"in2");
+ CHECK_INT2(32,7,ent->ComplexScalars(),1);
+ CHECK_COMPLEX_ARRAY(32,4,ent->CCoefficient(i),cq[i]);
+ delete ent;
+
+ // 33: Dirfile::Add / LinterpEntry check
+ nent.SetName("new6");
+ nent.SetFragmentIndex(0);
+ nent.SetInput("in");
+ nent.SetTable("./some/table");
+ d->Add(nent);
+ CHECK_OK2(33,1);
+
+ ent = d->Entry("new6");
+ CHECK_OK2(33,2);
+ CHECK_INT2(33,1,ent->Type(),LinterpEntryType);
+ CHECK_INT2(33,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(33,3,ent->Input(),"in");
+ CHECK_STRING2(33,4,ent->Table(),"./some/table");
+ delete ent;
+
+ // 34: Dirfile::Add / BitEntry check
+ bent.SetName("new7");
+ bent.SetFragmentIndex(0);
+ bent.SetInput("in1");
+ bent.SetFirstBit(13);
+ bent.SetNumBits(12);
+ d->Add(bent);
+ CHECK_OK2(34,1);
+
+ ent = d->Entry("new7");
+ CHECK_OK(34);
+ CHECK_INT2(34,1,ent->Type(),BitEntryType);
+ CHECK_INT2(34,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(34,3,ent->Input(),"in1");
+ CHECK_INT2(34,4,ent->NumBits(),12);
+ CHECK_INT2(34,5,ent->FirstBit(),13);
+ delete ent;
+
+ // 35: Dirfile::Add / SBitEntry check
+ sent.SetName("new8");
+ sent.SetFragmentIndex(0);
+ sent.SetInput("in2");
+ sent.SetFirstBit(14);
+ sent.SetNumBits(15);
+ d->Add(sent);
+ CHECK_OK2(35,1);
+
+ ent = d->Entry("new8");
+ CHECK_OK(35);
+ CHECK_INT2(35,1,ent->Type(),SBitEntryType);
+ CHECK_INT2(35,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(35,3,ent->Input(),"in2");
+ CHECK_INT2(35,4,ent->NumBits(),15);
+ CHECK_INT2(35,5,ent->FirstBit(),14);
+ delete ent;
+
+ // 36: Dirfile::Add / MultiplyEntry check
+ ment.SetName("new9");
+ ment.SetFragmentIndex(0);
+ ment.SetInput("in1", 0);
+ ment.SetInput("in2", 1);
+ d->Add(ment);
+ CHECK_OK2(36,1);
+
+ ent = d->Entry("new9");
+ CHECK_OK2(36,2);
+ CHECK_INT2(36,1,ent->Type(),MultiplyEntryType);
+ CHECK_INT2(36,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(36,3,ent->Input(0),"in1");
+ CHECK_STRING2(36,4,ent->Input(1),"in2");
+ delete ent;
+
+ // 37: Dirfile::Add / PhaseEntry check
+ pent.SetName("new10");
+ pent.SetFragmentIndex(0);
+ pent.SetInput("in1");
+ pent.SetShift(22);
+ d->Add(pent);
+ CHECK_OK2(37,1);
+
+ ent = d->Entry("new10");
+ CHECK_OK(37);
+ CHECK_INT2(37,1,ent->Type(),PhaseEntryType);
+ CHECK_INT2(37,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(37,3,ent->Input(),"in1");
+ CHECK_INT2(37,4,ent->Shift(),22);
+ delete ent;
+
+ // 38: Dirfile::Add / ConstEntry check
+ cent.SetName("new11");
+ cent.SetFragmentIndex(0);
+ cent.SetType(Float64);
+ d->Add(cent);
+ CHECK_OK2(38,1);
+
+ ent = d->Entry("new11");
+ CHECK_OK2(38,2);
+ CHECK_INT2(38,1,ent->Type(),ConstEntryType);
+ CHECK_INT2(38,2,ent->FragmentIndex(),0);
+ CHECK_INT2(38,3,ent->ConstType(),Float64);
+ delete ent;
+
+ // 39: Fragment check
+ frag = d->Fragment(0);
+ CHECK_OK(39);
+ CHECK_STRING(39,frag->Name(),__TEST__ "dirfile/format");
+ delete frag;
+
+ // 40: Dirfile::NFragments check
+ n = d->NFragments();
+ CHECK_OK(40);
+ CHECK_INT(40,n,1);
+
+ // 41: Dirfile::Include check
+ n = d->Include("form2");
+ CHECK_OK2(41,1);
+ CHECK_INT2(41,1,n,1);
+ n = d->GetConstant("const2", Int8, &sc);
+ CHECK_OK2(41,2);
+ CHECK_INT2(41,2,sc,-19);
+
+ // 42: Dirfile::NFieldsByType check
+ n = d->NFieldsByType(LincomEntryType);
+ CHECK_OK(42);
+ CHECK_INT(42,n,3);
+
+ // 43: Dirfile::FieldListByType check
+ fields[0] = (char*)"lincom";
+ fields[1] = (char*)"new2";
+ fields[2] = (char*)"new3";
+ list = d->FieldListByType(LincomEntryType);
+ CHECK_OK(43);
+ CHECK_STRING_ARRAY(43,n,list[i],fields[i]);
+
+ // 44: Dirfile::NVectors check
+ n = d->NVectors();
+ CHECK_OK(44);
+ CHECK_INT(44,n,21);
+
+ // 45: Dirfile::VectorList check
+ 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*)"mult";
+ fields[7] = (char*)"new1";
+ fields[8] = (char*)"new10";
+ fields[9] = (char*)"new2";
+ fields[10] = (char*)"new3";
+ fields[11] = (char*)"new4";
+ fields[12] = (char*)"new5";
+ fields[13] = (char*)"new6";
+ fields[14] = (char*)"new7";
+ fields[15] = (char*)"new8";
+ fields[16] = (char*)"new9";
+ fields[17] = (char*)"phase";
+ fields[18] = (char*)"polynom";
+ fields[19] = (char*)"recip";
+ fields[20] = (char*)"sbit";
+ list = d->VectorList();
+ CHECK_OK(45);
+ CHECK_STRING_ARRAY(45,n,list[i],fields[i]);
+
+ // 126: Dirfile::MAdd check
+ q[0] = 9.9;
+ q[1] = 8.8;
+ q[2] = 7.7;
+ q[3] = 6.6;
+ lent.Dissociate();
+ lent.SetName("mnew1");
+ 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(126,1);
+
+ ent = d->Entry("data/mnew1");
+ CHECK_OK2(126,2);
+ CHECK_INT2(126,1,ent->Type(),LincomEntryType);
+ CHECK_INT2(126,2,ent->NFields(),2);
+ CHECK_INT2(126,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(126,4,ent->Input(0),"in1");
+ CHECK_STRING2(126,5,ent->Input(1),"in2");
+ CHECK_INT2(126,6,ent->ComplexScalars(),0);
+ CHECK_DOUBLE_ARRAY(126,7,2,ent->Scale(i),q[i * 2]);
+ CHECK_DOUBLE_ARRAY(126,8,2,ent->Offset(i),q[i * 2 + 1]);
+ delete ent;
+
+ // 56: Dirfile::GetString check
+ n = d->GetString("string", GD_MAX_LINE_LENGTH, buf);
+ CHECK_OK(56);
+ CHECK_INT(56,n,18);
+ CHECK_STRING(56,buf,"Zaphod Beeblebrox");
+
+ // 57: Dirfile::Add / StringEntry check
+ gent.SetName("new12");
+ gent.SetFragmentIndex(0);
+ d->Add(gent);
+ CHECK_OK2(57,1);
+
+ ent = d->Entry("new12");
+ CHECK_OK2(57,2);
+ CHECK_INT2(57,1,ent->Type(),StringEntryType);
+ CHECK_INT2(57,2,ent->FragmentIndex(),0);
+ delete ent;
+
+ n = d->GetString("new12", GD_MAX_LINE_LENGTH, buf);
+ CHECK_OK2(57,3);
+ CHECK_INT(57,n,1);
+ CHECK_STRING(57,buf,"");
+
+ // 59: Dirfile::AddSpec check
+ d->AddSpec("lorem STRING \"Lorem ipsum\"", 0);
+ CHECK_OK2(59,1);
+
+ n = d->GetString("lorem", GD_MAX_LINE_LENGTH, buf);
+ CHECK_OK2(59,2);
+ CHECK_INT(59,n,12);
+ CHECK_STRING(59,buf,"Lorem ipsum");
+
+ // 60: Dirfile::MAddSpec check
+ d->MAddSpec("ipsum STRING \"dolor sit amet.\"", "lorem");
+ CHECK_OK2(60,1);
+
+ n = d->GetString("lorem/ipsum", GD_MAX_LINE_LENGTH, buf);
+ CHECK_OK2(60,2);
+ CHECK_INT(60,n,16);
+ CHECK_STRING(60,buf,"dolor sit amet.");
+
+ // 61: Dirfile::PutConstant check
+ sc = 61;
+ n = d->PutConstant("const", Int8, &sc);
+ CHECK_OK2(61,1);
+ CHECK_INT2(61,1,n,0);
+
+ n = d->GetConstant("const", Float32, &fl);
+ CHECK_OK2(61,2);
+ CHECK_INT2(61,2,n,0);
+ CHECK_DOUBLE2(61,3,fl,61);
+
+ // 62: Dirfile::PutString check
+ n = d->PutString("string", "Arthur Dent");
+ CHECK_OK2(62,1);
+ CHECK_INT2(62,1,n,12);
+
+ n = d->GetString("string", GD_MAX_LINE_LENGTH, buf);
+ CHECK_OK2(62,2);
+ CHECK_INT2(62,2,n,12);
+ CHECK_STRING(62,buf,"Arthur Dent");
+
+ // 63: Dirfile::NMFieldsByType check
+ n = d->NMFieldsByType("data", LincomEntryType);
+ CHECK_OK(63);
+ CHECK_INT(63,n,1);
+
+ // 64: Dirfile::MFieldListByType check
+ fields[0] = (char*)"mnew1";
+ list = d->MFieldListByType("data", LincomEntryType);
+ CHECK_OK(64);
+ CHECK_STRING_ARRAY(64,n,list[i],fields[i]);
+
+ // 65: Dirfile::NMVectors check
+ n = d->NMVectors("data");
+ CHECK_OK(65);
+ CHECK_INT(65,n,2);
+
+ // 66: Dirfile::MVectorList check
+ fields[0] = (char*)"mlut";
+ fields[1] = (char*)"mnew1";
+ list = d->MVectorList("data");
+ CHECK_OK(66);
+ CHECK_STRING_ARRAY(66,n,list[i],fields[i]);
+
+ // 67: RawEntry check
+ rep = reinterpret_cast<RawEntry*>(d->Entry("new1"));
+ CHECK_OK2(67,1);
+ rep->SetType(Int32,0);
+ CHECK_OK2(67,2);
+ rep->SetSamplesPerFrame(4,0);
+ CHECK_OK2(67,3);
+
+ ent = d->Entry("new1");
+ CHECK_OK2(67,4);
+ CHECK_INT2(67,1,ent->Type(),RawEntryType);
+ CHECK_INT2(67,2,ent->FragmentIndex(),0);
+ CHECK_INT2(67,3,ent->SamplesPerFrame(),4);
+ CHECK_INT2(67,4,ent->RawType(),Int32);
+ delete ent;
+
+ // 68: LincomEntry check
+ lep = reinterpret_cast<LincomEntry*>(d->Entry("new2"));
+ CHECK_OK2(68,1);
+ lep->SetNFields(3);
+ CHECK_OK2(68,2);
+ lep->SetInput("in4",2);
+ CHECK_OK2(68,3);
+ lep->SetScale(1.96,2);
+ CHECK_OK2(68,4);
+ lep->SetOffset(0.22,2);
+ CHECK_OK2(68,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(68,6);
+ CHECK_INT2(68,1,ent->Type(),LincomEntryType);
+ CHECK_INT2(68,2,ent->NFields(),3);
+ CHECK_INT2(68,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(68,4,ent->Input(0),"in1");
+ CHECK_STRING2(68,5,ent->Input(1),"in2");
+ CHECK_STRING2(68,6,ent->Input(2),"in4");
+ CHECK_INT2(68,7,ent->ComplexScalars(),0);
+ CHECK_DOUBLE_ARRAY(68,8,3,ent->Scale(i),q[i * 2]);
+ CHECK_DOUBLE_ARRAY(68,9,3,ent->Offset(i),q[i * 2 + 1]);
+ delete ent;
+
+ // 70: PolynomEntry check
+ yep = reinterpret_cast<PolynomEntry*>(d->Entry("new4"));
+ CHECK_OK2(70,1);
+ yep->SetInput("in4");
+ CHECK_OK2(70,2);
+ yep->SetPolyOrd(4);
+ CHECK_OK2(70,3);
+ yep->SetCoefficient(55.5,4);
+ CHECK_OK2(70,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(70,5);
+ CHECK_INT2(70,1,ent->Type(),PolynomEntryType);
+ CHECK_INT2(70,2,ent->PolyOrd(),4);
+ CHECK_INT2(70,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(70,4,ent->Input(),"in4");
+ CHECK_INT2(70,5,ent->ComplexScalars(),0);
+ CHECK_DOUBLE_ARRAY(70,6,5,ent->Coefficient(i),q[i]);
+ delete ent;
+
+ // 72: LinterpEntry check
+ nep = reinterpret_cast<LinterpEntry*>(d->Entry("new6"));
+ CHECK_OK2(72,1);
+ nep->SetInput("in3");
+ CHECK_OK2(72,2);
+ nep->SetTable("./other/table");
+ CHECK_OK2(72,3);
+ delete nep;
+
+ ent = d->Entry("new6");
+ CHECK_OK2(72,2);
+ CHECK_INT2(72,1,ent->Type(),LinterpEntryType);
+ CHECK_INT2(72,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(72,3,ent->Input(),"in3");
+ CHECK_STRING2(72,4,ent->Table(),"./other/table");
+ delete ent;
+
+ // 73: BitEntry check
+ bep = reinterpret_cast<BitEntry*>(d->Entry("new7"));
+ CHECK_OK2(73,1);
+ bep->SetInput("in3");
+ CHECK_OK2(73,2);
+ bep->SetFirstBit(3);
+ CHECK_OK2(73,3);
+ bep->SetNumBits(2);
+ CHECK_OK2(73,4);
+ delete bep;
+
+ ent = d->Entry("new7");
+ CHECK_OK(73);
+ CHECK_INT2(73,1,ent->Type(),BitEntryType);
+ CHECK_INT2(73,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(73,3,ent->Input(),"in3");
+ CHECK_INT2(73,4,ent->NumBits(),2);
+ CHECK_INT2(73,5,ent->FirstBit(),3);
+ delete ent;
+
+ // 74: SBitEntry check
+ sep = reinterpret_cast<SBitEntry*>(d->Entry("new8"));
+ CHECK_OK2(74,1);
+ sep->SetInput("in4");
+ CHECK_OK2(74,2);
+ sep->SetFirstBit(1);
+ CHECK_OK2(74,3);
+ sep->SetNumBits(22);
+ CHECK_OK2(74,4);
+ delete sep;
+
+ ent = d->Entry("new8");
+ CHECK_OK(74);
+ CHECK_INT2(74,1,ent->Type(),SBitEntryType);
+ CHECK_INT2(74,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(74,3,ent->Input(),"in4");
+ CHECK_INT2(74,4,ent->NumBits(),22);
+ CHECK_INT2(74,5,ent->FirstBit(),1);
+ delete ent;
+
+ // 75: MultiplyEntry check
+ mep = reinterpret_cast<MultiplyEntry*>(d->Entry("new9"));
+ CHECK_OK2(75,1);
+ mep->SetInput("in4",0);
+ CHECK_OK2(75,2);
+ mep->SetInput("in5",1);
+ CHECK_OK2(75,3);
+ delete mep;
+
+ ent = d->Entry("new9");
+ CHECK_OK2(75,2);
+ CHECK_INT2(75,1,ent->Type(),MultiplyEntryType);
+ CHECK_INT2(75,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(75,3,ent->Input(0),"in4");
+ CHECK_STRING2(75,4,ent->Input(1),"in5");
+ delete ent;
+
+ // 76: PhsaeEntry check
+ pep = reinterpret_cast<PhaseEntry*>(d->Entry("new10"));
+ CHECK_OK2(76,1);
+ pep->SetInput("in2");
+ CHECK_OK2(76,2);
+ pep->SetShift(8);
+ CHECK_OK2(76,3);
+ delete pep;
+
+ ent = d->Entry("new10");
+ CHECK_OK(76);
+ CHECK_INT2(76,1,ent->Type(),PhaseEntryType);
+ CHECK_INT2(76,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(76,3,ent->Input(),"in2");
+ CHECK_INT2(76,4,ent->Shift(),8);
+ delete ent;
+
+ // 77: ConstEntry check
+ cep = reinterpret_cast<ConstEntry*>(d->Entry("new11"));
+ CHECK_OK2(77,1);
+ cep->SetType(Float32);
+ CHECK_OK2(77,2);
+ delete cep;
+
+ ent = d->Entry("new11");
+ CHECK_OK2(77,2);
+ CHECK_INT2(77,1,ent->Type(),ConstEntryType);
+ CHECK_INT2(77,2,ent->FragmentIndex(),0);
+ CHECK_INT2(77,3,ent->ConstType(),Float32);
+ delete ent;
+
+ // 78: Fragment::Encoding check
+ frag = d->Fragment(0);
+ CHECK_OK(78);
+ CHECK_INT(78,frag->Encoding(),RawEncoding);
+
+ // 79: Fragment::Endianness check
+ CHECK_INT(79,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
+ delete frag;
+
+ // 80: Dirfile::Name check
+ str = d->Name();
+ CHECK_OK(80);
+ CHECK_STRING(80,str,__TEST__ "dirfile");
+
+ // 81: Fragment::Parent check
+ frag = d->Fragment(1);
+ CHECK_OK(81);
+ CHECK_INT(81,frag->Parent(),0);
+
+ // 82: Fragment::SetProtection check
+ frag->SetProtection(GD_PROTECT_DATA);
+ CHECK_OK(82);
+ delete frag;
+
+ // 83: Fragment::Protection check
+ frag = d->Fragment(1);
+ CHECK_OK(83);
+ CHECK_INT(83,frag->Protection(),GD_PROTECT_DATA);
+
+ // 84: RawEntry::FileName check
+ str = rep->FileName();
+ CHECK_OK(84);
+ CHECK_STRING(84,str,__TEST__ "dirfile/new1");
+ delete rep;
+
+ // 85: Dirfile::Reference check
+ rep = d->Reference("new1");
+ CHECK_OK(85);
+ CHECK_STRING(85,rep->Name(),"new1");
+ delete rep;
+
+ // 135: Dirfile::ReferenceFilename check
+ str = d->ReferenceFilename();
+ CHECK_OK(135);
+ CHECK_STRING(135,str,__TEST__ "dirfile/new1");
+
+ // 87: Fragment::SetEncoding check
+ frag->SetEncoding(SlimEncoding,0);
+ CHECK_OK(87);
+ CHECK_INT(87,frag->Encoding(),SlimEncoding);
+
+ // 88: Fragment::SetEndianness check
+ frag->SetEndianness(GD_BIG_ENDIAN,0);
+ CHECK_OK(88);
+ CHECK_INT(88,frag->Endianness(),GD_BIG_ENDIAN);
+ delete frag;
+
+ // 89: Dirfile::AlterSpec check
+ d->AlterSpec("new10 PHASE in1 3");
+ CHECK_OK2(89,1);
+
+ ent = d->Entry("new10");
+ CHECK_OK2(89,2);
+ CHECK_INT2(89,1,ent->Type(),PhaseEntryType);
+ CHECK_INT2(89,2,ent->FragmentIndex(),0);
+ CHECK_STRING2(89,3,ent->Input(),"in1");
+ CHECK_INT2(89,4,ent->Shift(),3);
+ delete ent;
+
+ // 90: Dirfile::Delete check
+ d->Delete("new10", 0);
+ CHECK_OK2(90,1);
+
+ ent = d->Entry("new10");
+ CHECK_ERROR2(90,2,GD_E_BAD_CODE);
+ delete ent;
+
+ // 91: Dirfile::MAlterSpec check
+ d->MAlterSpec("mnew1 LINCOM 2 in4 1 2 in5 3 4", "data", 0);
+ CHECK_OK2(91,1);
+
+ ent = d->Entry("data/mnew1");
+ CHECK_OK2(91,2);
+ CHECK_INT2(91,1,ent->Type(),LincomEntryType);
+ CHECK_INT2(91,2,ent->NFields(),2);
+ CHECK_INT2(91,3,ent->FragmentIndex(),0);
+ CHECK_STRING2(91,4,ent->Input(0),"in4");
+ CHECK_STRING2(91,5,ent->Input(1),"in5");
+ CHECK_INT2(91,6,ent->ComplexScalars(),0);
+ CHECK_DOUBLE_ARRAY(91,7,2,ent->Scale(i),i * 2 + 1);
+ CHECK_DOUBLE_ARRAY(91,8,2,ent->Offset(i),i * 2 + 2);
+ delete ent;
+
+ // 92: Entry::Move check
+ ent = d->Entry("new9");
+ CHECK_OK2(92,1);
+ ent->Move(1,0);
+ CHECK_OK2(92,2);
+ CHECK_INT(92,ent->FragmentIndex(),1);
+
+ // 93: Entry::Rename check
+ ent->Rename("newer",0);
+ CHECK_OK2(93,1);
+ delete ent;
+
+ ent = d->Entry("new9");
+ CHECK_ERROR2(93,2,GD_E_BAD_CODE);
+ delete ent;
+
+ ent = d->Entry("newer");
+ CHECK_OK2(93,3);
+ CHECK_INT2(93,1,ent->Type(),MultiplyEntryType);
+ CHECK_INT2(93,2,ent->FragmentIndex(),1);
+ CHECK_STRING2(93,3,ent->Input(0),"in4");
+ CHECK_STRING2(93,4,ent->Input(1),"in5");
+ delete ent;
+
+ // 94: Dirfile::UnInclude check
+ d->UnInclude(1,0);
+ CHECK_OK2(94,1);
+
+ ent = d->Entry("newer");
+ CHECK_ERROR2(94,2,GD_E_BAD_CODE);
+ delete ent;
+
+ // 95: Fragment::FrameOffset check
+ frag = d->Fragment(0);
+ CHECK_OK(95);
+ CHECK_INT(95,frag->FrameOffset(),0);
+
+ // 96: Fragment::SetFrameOffset check
+ frag->SetFrameOffset(33,0);
+ CHECK_OK(96);
+ CHECK_INT(96,frag->FrameOffset(),33);
+
+ // 97: Dirfile::NativeType check
+ n = d->NativeType("data");
+ CHECK_OK(97);
+ CHECK_INT(97,n,Int8);
+
+ // 99: Dirfile::Validate check
+ n = d->Validate("new7");
+ CHECK_ERROR(99,GD_E_BAD_CODE);
+ CHECK_INT(99,n,-1);
+
+ // 101: Dirfile::FrameNum check
+ delete d->Reference("data");
+ dp = d->FrameNum("data", 33.3, 6);
+ CHECK_OK(101);
+ CHECK_DOUBLE(101,dp,37.0375);
+
+ // 86: Dirfile::EoF check
+ n = d->EoF("lincom");
+ CHECK_OK(86);
+ CHECK_INT(86,n,344);
+
+ // 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<double>(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<double>(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<double>(33.3,44.4));
+ delete ent;
+
+ // 152: DivideEntry check
+ dep = reinterpret_cast<DivideEntry*>(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<RecipEntry*>(d->Entry("new15"));
+ CHECK_OK2(153,1);
+ oep->SetInput("in1");
+ CHECK_OK2(153,2);
+ oep->SetDividend(complex<double>(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<double>(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();
+ CHECK_ERROR2b(id,156,1,GD_E_OK);
+ id->NFragments();
+ CHECK_ERROR2b(id,156,2,GD_E_BAD_DIRFILE);
+ delete id;
+
+ // 157: Dirfile::Standards check
+ n = d->Standards();
+ CHECK_OK2(157,1);
+ CHECK_INT(157,n,8);
+ d->Standards(0);
+ CHECK_ERROR2(157,2,GD_E_BAD_VERSION);
+
+ // 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
+ const gd_carray_t *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_carray_len
+ n = (int)d->CarrayLen("carray");
+ CHECK_OK(177);
+ CHECK_INT(177,n,6);
+
+ // 178 gd_entry (CARRAY)
+ ent = d->Entry("const");
+ CHECK_OK(178);
+ CHECK_INT2(178,1,ent->Type(),ConstEntryType);
+ CHECK_INT2(178,2,ent->FragmentIndex(),0);
+ CHECK_INT2(178,3,ent->ConstType(),Float64);
+ 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;
+
+ // 181 gd_alter_carray
+ aep = reinterpret_cast<CarrayEntry*>(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;
+
+
+
+ // ===================================================================
+ d->Discard();
+ delete d;
+ unlink(data);
+ unlink(new1);
+ unlink(format);
+ unlink(form2);
+ rmdir(filedir);
+
+ if (ne) {
+ cerr << "ne = " << ne << endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/bindings/f77/Makefile.am b/bindings/f77/Makefile.am
new file mode 100644
index 0000000..3d0e934
--- /dev/null
+++ b/bindings/f77/Makefile.am
@@ -0,0 +1,118 @@
+# Copyright (C) 2008-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
+#
+AUTOMAKE_OPTIONS = foreign
+
+SED = @SED@
+DIFF = @DIFF@
+
+if FC_WEXTRA
+FC_WEXTRA=-Wextra
+endif
+
+if FC_WALL
+FC_WALL=-Wall
+endif
+
+if CC_WEXTRA
+CC_WEXTRA=-Wextra
+endif
+
+if CC_WALL
+CC_WALL=-Wall
+endif
+
+if MAKE_F95BINDINGS
+F95_INC=getdata.mod
+F95_LIB=libf95getdata.la
+endif
+
+if GETDATA_DEBUG
+DEBUG_C = ../../src/debug.c
+endif
+
+FCFLAGS += $(FC_WALL) $(FC_WEXTRA)
+INCLUDES = -I$(top_srcdir)/src
+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 = ${CC_WALL} $(CC_WEXTRA)
+libfgetdata_la_SOURCES = fgetdata.c fgetdata.h $(DEBUG_C)
+libfgetdata_la_LIBADD=../../src/libgetdata.la
+libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@
+
+nodist_libf95getdata_la_SOURCES=getdata.f90
+libf95getdata_la_LIBADD=libfgetdata.la ../../src/libgetdata.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) $<; \
+ 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 $< > $@
+ chmod a-w $@
+
+getdata.f90: $(srcdir)/getdata.f90.in make_parameters.sed
+ rm -f $@
+ $(SED) -f make_parameters.sed $< > $@
+ chmod a-w $@
diff --git a/bindings/f77/Makefile.in b/bindings/f77/Makefile.in
new file mode 100644
index 0000000..aaf9d39
--- /dev/null
+++ b/bindings/f77/Makefile.in
@@ -0,0 +1,891 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/f77
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libf95getdata_la_DEPENDENCIES = libfgetdata.la ../../src/libgetdata.la
+nodist_libf95getdata_la_OBJECTS = getdata.lo
+libf95getdata_la_OBJECTS = $(nodist_libf95getdata_la_OBJECTS)
+libf95getdata_la_LINK = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libf95getdata_la_LDFLAGS) $(LDFLAGS) -o $@
+ at MAKE_F95BINDINGS_TRUE@am_libf95getdata_la_rpath = -rpath $(libdir)
+libfgetdata_la_DEPENDENCIES = ../../src/libgetdata.la
+am__libfgetdata_la_SOURCES_DIST = fgetdata.c fgetdata.h \
+ ../../src/debug.c
+ at GETDATA_DEBUG_TRUE@am__objects_1 = libfgetdata_la-debug.lo
+am_libfgetdata_la_OBJECTS = libfgetdata_la-fgetdata.lo \
+ $(am__objects_1)
+libfgetdata_la_OBJECTS = $(am_libfgetdata_la_OBJECTS)
+libfgetdata_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libfgetdata_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(nodist_libf95getdata_la_SOURCES) $(libfgetdata_la_SOURCES)
+DIST_SOURCES = $(am__libfgetdata_la_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+HEADERS = $(nodist_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@ $(FC_WALL) $(FC_WEXTRA)
+FFLAGS = @FFLAGS@
+FGETDATA_VERSION = @FGETDATA_VERSION@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at FC_WEXTRA_TRUE@FC_WEXTRA = -Wextra
+ at FC_WALL_TRUE@FC_WALL = -Wall
+ at CC_WEXTRA_TRUE@CC_WEXTRA = -Wextra
+ at CC_WALL_TRUE@CC_WALL = -Wall
+ at MAKE_F95BINDINGS_TRUE@F95_INC = getdata.mod
+ at MAKE_F95BINDINGS_TRUE@F95_LIB = libf95getdata.la
+ at GETDATA_DEBUG_TRUE@DEBUG_C = ../../src/debug.c
+INCLUDES = -I$(top_srcdir)/src
+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 = ${CC_WALL} $(CC_WEXTRA)
+libfgetdata_la_SOURCES = fgetdata.c fgetdata.h $(DEBUG_C)
+libfgetdata_la_LIBADD = ../../src/libgetdata.la
+libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@
+nodist_libf95getdata_la_SOURCES = getdata.f90
+libf95getdata_la_LIBADD = libfgetdata.la ../../src/libgetdata.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)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libf95getdata.la: $(libf95getdata_la_OBJECTS) $(libf95getdata_la_DEPENDENCIES)
+ $(libf95getdata_la_LINK) $(am_libf95getdata_la_rpath) $(libf95getdata_la_OBJECTS) $(libf95getdata_la_LIBADD) $(LIBS)
+libfgetdata.la: $(libfgetdata_la_OBJECTS) $(libfgetdata_la_DEPENDENCIES)
+ $(libfgetdata_la_LINK) -rpath $(libdir) $(libfgetdata_la_OBJECTS) $(libfgetdata_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfgetdata_la-debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfgetdata_la-fgetdata.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libfgetdata_la-fgetdata.lo: fgetdata.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --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
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfgetdata_la-fgetdata.Tpo $(DEPDIR)/libfgetdata_la-fgetdata.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fgetdata.c' object='libfgetdata_la-fgetdata.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --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
+
+libfgetdata_la-debug.lo: ../../src/debug.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfgetdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libfgetdata_la-debug.lo -MD -MP -MF $(DEPDIR)/libfgetdata_la-debug.Tpo -c -o libfgetdata_la-debug.lo `test -f '../../src/debug.c' || echo '$(srcdir)/'`../../src/debug.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libfgetdata_la-debug.Tpo $(DEPDIR)/libfgetdata_la-debug.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../../src/debug.c' object='libfgetdata_la-debug.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfgetdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libfgetdata_la-debug.lo `test -f '../../src/debug.c' || echo '$(srcdir)/'`../../src/debug.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+ @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(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|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(includedir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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 \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+ ctags-recursive install install-am install-strip \
+ tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool clean-local ctags \
+ ctags-recursive distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-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-recursive 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) $<; \
+ fi
+
+ at HAVE_DIFF_TRUE@make_parameters.stamp: make_parameters.sed.in
+ at HAVE_DIFF_TRUE@ @if $(DIFF) make_parameters.sed make_parameters.sed.in >/dev/null 2>&1; then \
+ at HAVE_DIFF_TRUE@ echo "make_parameters.sed is unchanged"; \
+ at HAVE_DIFF_TRUE@ else \
+ at HAVE_DIFF_TRUE@ rm -f make_parameters.sed; \
+ at HAVE_DIFF_TRUE@ cp make_parameters.sed.in make_parameters.sed; \
+ at HAVE_DIFF_TRUE@ fi; \
+ at HAVE_DIFF_TRUE@ touch make_parameters.stamp
+
+ at HAVE_DIFF_FALSE@make_parameters.stamp: make_parameters.sed.in
+ at HAVE_DIFF_FALSE@ @rm -f make_parameters.sed; \
+ at HAVE_DIFF_FALSE@ cp make_parameters.sed.in make_parameters.sed; \
+ at HAVE_DIFF_FALSE@ touch make_parameters.stamp
+
+getdata.f: $(srcdir)/getdata.f.in make_parameters.sed
+ rm -f $@
+ $(SED) -f make_parameters.sed $< > $@
+ chmod a-w $@
+
+getdata.f90: $(srcdir)/getdata.f90.in make_parameters.sed
+ rm -f $@
+ $(SED) -f make_parameters.sed $< > $@
+ 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:
diff --git a/bindings/f77/fgetdata.c b/bindings/f77/fgetdata.c
new file mode 100644
index 0000000..e4c8f30
--- /dev/null
+++ b/bindings/f77/fgetdata.c
@@ -0,0 +1,2918 @@
+/* Copyright (C) 2008-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
+ */
+
+#include "fgetdata.h"
+
+#ifdef GD_NO_C99_API
+# define crealp creal
+# define cimagp creal
+#else
+# define crealp(x) creal(*x)
+# define cimagp(x) cimag(*x)
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/* 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;
+
+/* 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);
+
+ 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 i;
+
+ dtrace("%p", D);
+
+ if (!f77dirfiles_initialised)
+ _GDF_InitDirfiles();
+
+ for (i = 1; i < GDF_N_DIRFILES; ++i)
+ if (f77dirfiles[i] == NULL) {
+ f77dirfiles[i] = D;
+ dreturn("%i", i);
+ return i;
+ }
+
+ /* out of f77dirfiles space: complain and abort */
+ fputs("libfgetdata: DIRFILE space exhausted.", stderr);
+ abort();
+}
+
+/* delete the supplied dirfile */
+static void _GDF_ClearDirfile(int d)
+{
+ dtrace("%i", d);
+
+ if (d != 0)
+ f77dirfiles[d] = NULL;
+
+ dreturnvoid();
+}
+
+/* create a Fortran space padded string */
+static int _GDF_FString(char* dest, int *dlen, const char* src)
+{
+ int i, slen;
+
+ dtrace("%p, %i, \"%s\"", dest, *dlen, src);
+
+ slen = strlen(src);
+
+ if (src == NULL) {
+ *dlen = 0;
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ 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)
+{
+ int unit;
+ int r = GD_SYNTAX_ABORT;
+
+ dtrace("%p, %p", pdata, f77_callback);
+
+ if (f77_callback != NULL) {
+ unit = _GDF_SetDirfile((DIRFILE*)pdata->dirfile);
+
+ (*(void(*)(int*, const int*, const int*, char*, const int*,
+ const char*))f77_callback)(&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) (int* dirfile, const char* dirfilename,
+ const int* dirfilename_l, const int* flags)
+{
+ char* out = (char *)malloc(*dirfilename_l + 1);
+
+ *dirfile = _GDF_SetDirfile(gd_open(_GDF_CString(out, dirfilename,
+ *dirfilename_l), *flags));
+
+ free(out);
+}
+
+/* gd_close wrapper */
+void F77_FUNC(gdclos, GDCLOS) (const int* dirfile)
+{
+ if (*dirfile != 0) {
+ gd_close(_GDF_GetDirfile(*dirfile));
+
+ _GDF_ClearDirfile(*dirfile);
+ }
+}
+
+/* gd_flush wrapper */
+void F77_FUNC(gdflsh, GDFLSH) (const int* dirfile, const char* field_code,
+ const int* field_code_l)
+{
+ if (field_code_l == 0)
+ gd_flush(_GDF_GetDirfile(*dirfile), NULL);
+ else {
+ char *out = (char *)malloc(*field_code_l + 1);
+ gd_flush(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ *field_code_l));
+ free(out);
+ }
+}
+
+/* gd_getdata wrapper */
+void F77_FUNC(gdgetd, GDGETD) (int* n_read, const int* dirfile,
+ const char* field_code, const int* field_code_l,
+ const int* first_frame, const int* first_sample,
+ const int* num_frames, const int* num_samples, const int* return_type,
+ void* data_out)
+{
+ char* out = (char *)malloc(*field_code_l + 1);
+
+ *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);
+}
+
+/* Return the maximum field name length */
+void F77_FUNC(gdfdnx, GDFDNX) (int* max, const int* dirfile)
+{
+ const char **fl;
+ size_t len = 0;
+ DIRFILE* D = _GDF_GetDirfile(*dirfile);
+ unsigned int i, nfields = gd_nfields(D);
+
+ if (D->error)
+ return;
+
+ fl = gd_field_list(D);
+
+ for (i = 0; i < nfields; ++i)
+ if (strlen(fl[i]) > len)
+ len = strlen(fl[i]);
+
+ *max = len;
+}
+
+/* Return the maximum field name length for a meta list */
+void F77_FUNC(gdmfnx, GDMFNX) (int* max, const int* dirfile, const char* parent,
+ const int* parent_l)
+{
+ const char **fl;
+ unsigned int i, nfields;
+ size_t len = 0;
+ DIRFILE* D = _GDF_GetDirfile(*dirfile);
+ char* pa = (char *)malloc(*parent_l + 1);
+
+ _GDF_CString(pa, parent, *parent_l);
+
+ nfields = gd_nmfields(D, pa);
+
+ if (D->error) {
+ free(pa);
+ return;
+ }
+
+ 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);
+}
+
+/* gd_field_list wrapper -- this only returns one field name */
+void F77_FUNC(gdfldn, GDFLDN) (char* name, int* name_l, const int* dirfile,
+ const int* field_num)
+{
+ const char** fl;
+ DIRFILE* D = _GDF_GetDirfile(*dirfile);
+ unsigned int nfields = gd_nfields(D);
+ if (D->error)
+ return;
+
+ if (*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;
+}
+
+/* gd_mfield_list wrapper -- this only returns one field name */
+void F77_FUNC(gdmfdn, GDMFDN) (char* name, int* name_l, const int* dirfile,
+ const char* parent, const int* parent_l, const int* field_num)
+{
+ const char** fl;
+ unsigned int nfields;
+ DIRFILE* D = _GDF_GetDirfile(*dirfile);
+ char* pa = (char *)malloc(*parent_l + 1);
+
+ _GDF_CString(pa, parent, *parent_l);
+
+ nfields = gd_nmfields(D, pa);
+ if (D->error) {
+ free(pa);
+ return;
+ }
+
+ if (*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);
+}
+
+/* gd_nfields wrapper */
+void F77_FUNC(gdnfld, GDNFLD) (int* nfields, const int* dirfile)
+{
+ *nfields = gd_nfields(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_bof wrapper */
+void F77_FUNC(gdgbof, GDGBOF) (int* bof, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char *fc = (char *)malloc(*field_code_l + 1);
+ *bof = gd_bof(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l));
+ free(fc);
+}
+
+/* gd_eof wrapper */
+void F77_FUNC(gdgeof, GDGEOF) (int* eof, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char *fc = (char *)malloc(*field_code_l + 1);
+ *eof = gd_eof(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l));
+ free(fc);
+}
+
+/* gd_nframes wrapper */
+void F77_FUNC(gdnfrm, GDNFRM) (int* nframes, const int* dirfile)
+{
+ *nframes = gd_nframes(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_spf wrapper */
+void F77_FUNC(gdgspf, GDGSPF) (int* spf, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char* out = (char *)malloc(*field_code_l + 1);
+ *spf = gd_spf(_GDF_GetDirfile(*dirfile),
+ _GDF_CString(out, field_code, *field_code_l));
+ free(out);
+}
+
+/* gd_putdata wrapper */
+void F77_FUNC(gdputd, GDPUTD) (int* n_wrote, const int* dirfile,
+ const char* field_code, const int* field_code_l, const int* first_frame,
+ const int* first_sample, const int* num_frames, const int* num_samples,
+ const int* data_type, const void* data_in)
+{
+ char* out = (char *)malloc(*field_code_l + 1);
+ *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);
+}
+
+/* return the error number */
+void F77_FUNC(gderor, GDEROR) (int* error, const int* dirfile)
+{
+ dtrace("%p, %i", error, *dirfile);
+
+ *error = gd_error(_GDF_GetDirfile(*dirfile));
+
+ dreturn("%i", *error);
+}
+
+/* gd_error_string wrapper */
+void F77_FUNC(gdestr, GDESTR) (const int* dirfile, char* buffer, const int* 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) (int* type, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char *fc;
+
+ dtrace("%p, %i, %p, %i", type, *dirfile, field_code, *field_code_l);
+
+ fc = (char *)malloc(*field_code_l + 1);
+
+ *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) (int* spf, int* dtype, int* fragment_index,
+ const int* dirfile, const char* field_code, const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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) (int* nfields,
+ char* infield1, int* infield1_l, double* m1, double* b1,
+ char* infield2, int* infield2_l, double* m2, double* b2,
+ char* infield3, int* infield3_l, double* m3, double* b3,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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) (int* nfields,
+ char* infield1, int* infield1_l, GD_DCOMPLEXP(m1), GD_DCOMPLEXP(b1),
+ char* infield2, int* infield2_l, GD_DCOMPLEXP(m2), GD_DCOMPLEXP(b2),
+ char* infield3, int* infield3_l, GD_DCOMPLEXP(m3), GD_DCOMPLEXP(b3),
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* 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);
+
+ fc = (char *)malloc(*field_code_l + 1);
+
+ 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_c2cp(m1, E.EN(lincom,cm)[0]);
+ _gd_c2cp(b1, E.EN(lincom,cb)[0]);
+
+ if (E.EN(lincom,n_fields) > 1) {
+ _GDF_FString(infield2, infield2_l, E.in_fields[1]);
+ _gd_c2cp(m2, E.EN(lincom,cm)[1]);
+ _gd_c2cp(b2, E.EN(lincom,cb)[1]);
+ }
+
+ if (E.EN(lincom,n_fields) > 2) {
+ _GDF_FString(infield3, infield3_l, E.in_fields[2]);
+ _gd_c2cp(m3, E.EN(lincom,cm)[2]);
+ _gd_c2cp(b3, E.EN(lincom,cb)[2]);
+ }
+ gd_free_entry_strings(&E);
+ }
+
+ free(fc);
+
+ dreturnvoid();
+}
+
+/* gd_entry wrapper for POLYNOM */
+void F77_FUNC(gdgepn, GDGEPN) (int* poly_ord, char* infield, int* infield_l,
+ double* a0, double* a1, double* a2, double* a3, double* a4, double* a5,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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) (int* poly_ord, char* infield, int* infield_l,
+ GD_DCOMPLEXP(a0), GD_DCOMPLEXP(a1), GD_DCOMPLEXP(a2),
+ GD_DCOMPLEXP(a3), GD_DCOMPLEXP(a4), GD_DCOMPLEXP(a5),
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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_c2cp(a5, E.EN(polynom,ca)[5]);
+ case 4:
+ _gd_c2cp(a4, E.EN(polynom,ca)[4]);
+ case 3:
+ _gd_c2cp(a3, E.EN(polynom,ca)[3]);
+ case 2:
+ _gd_c2cp(a2, E.EN(polynom,ca)[2]);
+ case 1:
+ _gd_c2cp(a1, E.EN(polynom,ca)[1]);
+ _gd_c2cp(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, int* in_field_l, char* table,
+ int* table_l, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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, int* in_field_l, int* bitnum,
+ int* numbits, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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, int* in_field_l, int* bitnum,
+ int* numbits, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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();
+}
+
+/* gd_entry wrapper for MULTIPLY */
+void F77_FUNC(gdgemt, GDGEMT) (char* in_field1, int* in_field1_l,
+ char* in_field2, int* in_field2_l, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char *out;
+ gd_entry_t E;
+
+ 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ *field_code_l), &E) || E.field_type != GD_MULTIPLY_ENTRY)
+ *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 DIVIDE */
+void F77_FUNC(gdgedv, GDGEDV) (char* in_field1, int* in_field1_l,
+ char* in_field2, int* in_field2_l, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char *out;
+ gd_entry_t E;
+
+ 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ *field_code_l), &E) || E.field_type != GD_DIVIDE_ENTRY)
+ *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 RECIP */
+void F77_FUNC(gdgerc, GDGERC) (char* in_field, int* in_field_l,
+ double* dividend, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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, int* in_field_l,
+ GD_DCOMPLEXP(cdividend), int* fragment_index, const int* dirfile,
+ const char* field_code, const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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_c2cp(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, int* in_field_l, int* shift,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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) (int* data_type, int* fragment_index,
+ const int* dirfile, const char* field_code, const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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) (int* data_type, int *array_len,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* 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);
+
+ out = (char *)malloc(*field_code_l + 1);
+
+ 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) (int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ *fragment_index = gd_fragment_index(_GDF_GetDirfile(*dirfile),
+ _GDF_CString(fc, field_code, *field_code_l));
+
+ free(fc);
+}
+
+/* gd_add_raw wrapper */
+void F77_FUNC(gdadrw, GDADRW) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* data_type, const int* spf,
+ const int* fragment_index)
+{
+ char* out = (char *)malloc(*field_code_l + 1);
+ gd_add_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ *field_code_l), (gd_type_t)(*data_type), (gd_spf_t)*spf,
+ *fragment_index);
+ free(out);
+}
+
+/* gd_add_lincom wrapper */
+void F77_FUNC(gdadlc, GDADLC) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const double* m1, const double* b1,
+ const char* in_field2, const int* in_field2_l, const double* m2,
+ const double* b2, const char* in_field3, const int* in_field3_l,
+ const double* m3, const double* b3, const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in_fields[3] = {NULL, NULL, NULL};
+ double m[3] = {0, 0, 0};
+ double b[3] = {0, 0, 0};
+ int nf = *n_fields;
+
+ if (nf > 0) {
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
+ _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ m[0] = *m1;
+ b[0] = *b1;
+ }
+
+ if (nf > 1) {
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
+ _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ m[1] = *m2;
+ b[1] = *b2;
+ }
+
+ if (nf > 2) {
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
+ _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]);
+}
+
+void F77_FUNC(gdadcl, GDADCL) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+ const char* in_field2, const int* in_field2_l, const GD_DCOMPLEXP(m2),
+ const GD_DCOMPLEXP(b2), const char* in_field3, const int* in_field3_l,
+ const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3),
+ const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ 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
+ int nf = *n_fields;
+
+ if (nf > 0) {
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
+ _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ _gd_cp2ca(cm, 0, m1);
+ _gd_cp2ca(cb, 0, b1);
+ }
+
+ if (nf > 1) {
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
+ _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ _gd_cp2ca(cm, 1, m2);
+ _gd_cp2ca(cb, 1, b2);
+ }
+
+ if (nf > 2) {
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
+ _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]);
+}
+
+/* gd_add_polynom wrapper */
+void F77_FUNC(gdadpn, GDADPN) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* in_field_l, const double* a0, const double* a1, const double* a2,
+ const double* a3, const double* a4, const double* a5,
+ const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* inf = NULL;
+ double a[6] = {0, 0, 0, 0, 0, 0};
+ int po = *poly_ord;
+ if (po > 5)
+ po = 5;
+
+ inf = (char *)malloc(*in_field_l + 1);
+ _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);
+}
+
+void F77_FUNC(gdadcp, GDADCP) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* 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 int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* inf = NULL;
+#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;
+
+ inf = (char *)malloc(*in_field_l + 1);
+ _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);
+}
+
+/* gd_add_linterp wrapper */
+void F77_FUNC(gdadlt, GDADLT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const char* table, const int* table_l, const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+ char* tab = (char *)malloc(*table_l + 1);
+
+ 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);
+}
+
+/* gd_add_bit wrapper */
+void F77_FUNC(gdadbt, GDADBT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* bitnum, const int* numbits, const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ gd_add_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), _GDF_CString(in, in_field, *in_field_l),
+ (gd_bit_t)*bitnum, (gd_bit_t)*numbits, *fragment_index);
+ free(fc);
+ free(in);
+}
+
+/* gd_add_sbit wrapper */
+void F77_FUNC(gdadsb, GDADSB) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* bitnum, const int* numbits, const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ gd_add_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), _GDF_CString(in, in_field, *in_field_l),
+ (gd_bit_t)*bitnum, (gd_bit_t)*numbits, *fragment_index);
+ free(fc);
+ free(in);
+}
+
+/* gd_add_multiply wrapper */
+void F77_FUNC(gdadmt, GDADMT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* in_field2_l, const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in1 = (char *)malloc(*in_field1_l + 1);
+ char* in2 = (char *)malloc(*in_field2_l + 1);
+
+ 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);
+}
+
+/* gd_add_divide wrapper */
+void F77_FUNC(gdaddv, GDADDV) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* in_field2_l, const int* 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);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ in1 = (char *)malloc(*in_field1_l + 1);
+ in2 = (char *)malloc(*in_field2_l + 1);
+
+ 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 int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const double* dividend, const int* 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);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ in = (char *)malloc(*in_field_l + 1);
+
+ 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 int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const GD_DCOMPLEXP(cdividend), const int* 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, crealp(cdividend), cimagp(cdividend),
+ *fragment_index);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ in = (char *)malloc(*in_field_l + 1);
+
+#ifdef GD_NO_C99_API
+ 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);
+#else
+ gd_add_crecip(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), _GDF_CString(in, in_field, *in_field_l), *cdividend,
+ *fragment_index);
+#endif
+
+ free(fc);
+ free(in);
+
+ dreturnvoid();
+}
+
+/* gd_add_phase wrapper */
+void F77_FUNC(gdadph, GDADPH) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* shift, const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ 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);
+}
+
+/* gd_fragmentname wrapper */
+void F77_FUNC(gdfrgn, GDFRGN) (char* filename, int* filename_l,
+ const int* dirfile, const int* index)
+{
+ _GDF_FString(filename, filename_l, gd_fragmentname(_GDF_GetDirfile(*dirfile),
+ *index));
+}
+
+/* gd_nfragments wrapper */
+void F77_FUNC(gdnfrg, GDNFRG) (int* nformats, const int* dirfile)
+{
+ *nformats = gd_nfragments(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_metaflush wrapper */
+void F77_FUNC(gdmfls, GDMFLS) (const int* dirfile)
+{
+ gd_metaflush(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_rewrite_fragment wrapper */
+void F77_FUNC(gdrfrg, GDRFRG) (const int* dirfile, const int* fragment)
+{
+ dtrace("%i, %i", *dirfile, *fragment);
+
+ gd_rewrite_fragment(_GDF_GetDirfile(*dirfile), *fragment);
+
+ dreturnvoid();
+}
+
+/* gd_include wrapper */
+void F77_FUNC(gdincl, GDINCL) (const int* dirfile, const char* file,
+ const int* file_l, const int* fragment_index, const int* flags)
+{
+ char* fi = (char *)malloc(*file_l + 1);
+
+ gd_include(_GDF_GetDirfile(*dirfile), _GDF_CString(fi, file, *file_l),
+ *fragment_index, *flags);
+
+ free(fi);
+}
+
+/* gd_nfield_by_type wrapper */
+void F77_FUNC(gdnfdt, GDNFDT) (int* nfields, const int* dirfile,
+ const int* type)
+{
+ *nfields = gd_nfields_by_type(_GDF_GetDirfile(*dirfile), (gd_entype_t)*type);
+}
+
+/* gd_nvectors wrapper */
+void F77_FUNC(gdnvec, GDNVEC) (int* nvectors, const int* 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, int* name_l, const int* dirfile,
+ const int* type, const int* field_num)
+{
+ const char** fl;
+ DIRFILE* D = _GDF_GetDirfile(*dirfile);
+ unsigned int nfields = gd_nfields_by_type(D, (gd_entype_t)*type);
+ if (D->error)
+ return;
+
+ if (*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;
+}
+
+/* gd_vector_list wrapper -- this only returns one field name */
+void F77_FUNC(gdvecn, GDVECN) (char* name, int* name_l, const int* dirfile,
+ const int* 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 (D->error)
+ return;
+
+ if (*field_num <= (int)nfields) {
+ fl = gd_vector_list(D);
+ _GDF_FString(name, name_l, fl[*field_num - 1]);
+ } else
+ *name_l = 0;
+
+ dreturnvoid();
+}
+
+/* gd_mfield_list_by_type wrapper -- this only returns one field name */
+void F77_FUNC(gdmfdt, GDMFDT) (char* name, int* name_l, const int* dirfile,
+ const char* parent, const int* parent_l, const int* type,
+ const int* field_num)
+{
+ const char** fl;
+ unsigned int nfields;
+ DIRFILE* D = _GDF_GetDirfile(*dirfile);
+ char* pa = (char *)malloc(*parent_l + 1);
+
+ _GDF_CString(pa, parent, *parent_l);
+
+ nfields = gd_nmfields_by_type(D, pa, (gd_entype_t)*type);
+ if (D->error) {
+ free(pa);
+ return;
+ }
+
+ if (*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);
+}
+
+/* gd_mvector_list wrapper -- this only returns one field name */
+void F77_FUNC(gdmven, GDMVEN) (char* name, int* name_l, const int* dirfile,
+ const char* parent, const int* parent_l, const int* field_num)
+{
+ const char** fl;
+ unsigned int nfields;
+ DIRFILE* D = _GDF_GetDirfile(*dirfile);
+ char* pa = (char *)malloc(*parent_l + 1);
+
+ _GDF_CString(pa, parent, *parent_l);
+
+ nfields = gd_nmvectors(D, pa);
+ if (D->error) {
+ free(pa);
+ return;
+ }
+
+ if (*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);
+}
+
+/* gd_madd_lincom wrapper */
+void F77_FUNC(gdmdlc, GDMDLC) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* n_fields, const char* in_field1, const int* in_field1_l,
+ const double* m1, const double* b1, const char* in_field2,
+ const int* in_field2_l, const double* m2, const double* b2,
+ const char* in_field3, const int* in_field3_l, const double* m3,
+ const double* b3)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in_fields[3] = {NULL, NULL, NULL};
+ double m[3] = {0, 0, 0};
+ double b[3] = {0, 0, 0};
+ int nf = *n_fields;
+
+ if (nf > 0) {
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
+ _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ m[0] = *m1;
+ b[0] = *b1;
+ }
+
+ if (nf > 1) {
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
+ _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ m[1] = *m2;
+ b[1] = *b2;
+ }
+
+ if (nf > 2) {
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
+ _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]);
+}
+
+void F77_FUNC(gdmdcl, GDMDCL) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* n_fields, const char* in_field1, const int* in_field1_l,
+ const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char* in_field2,
+ const int* in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2),
+ const char* in_field3, const int* in_field3_l, const GD_DCOMPLEXP(m3),
+ const GD_DCOMPLEXP(b3))
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ 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
+ int nf = *n_fields;
+
+ if (nf > 0) {
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
+ _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ _gd_cp2ca(cm, 0, m1);
+ _gd_cp2ca(cb, 0, b1);
+ }
+
+ if (nf > 1) {
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
+ _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ _gd_cp2ca(cm, 1, m2);
+ _gd_cp2ca(cb, 1, b2);
+ }
+
+ if (nf > 2) {
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
+ _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]);
+}
+
+/* gd_madd_polynom wrapper */
+void F77_FUNC(gdmdpn, GDMDPN) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* poly_ord, const char* in_field, const int* in_field_l,
+ const double* a0, const double* a1, const double* a2, const double* a3,
+ const double* a4, const double* a5)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* inf = NULL;
+ double a[6] = {0, 0, 0, 0, 0, 0};
+ int po = *poly_ord;
+ if (po > 5)
+ po = 5;
+
+ inf = (char *)malloc(*in_field_l + 1);
+ _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_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);
+}
+
+void F77_FUNC(gdmdcp, GDMDCP) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* poly_ord, const char* in_field, const int* 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 = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* inf = NULL;
+#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;
+
+ inf = (char *)malloc(*in_field_l + 1);
+ _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);
+}
+
+/* gd_madd_linterp wrapper */
+void F77_FUNC(gdmdlt, GDMDLT) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const char* table,
+ const int* table_l)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+ char* tab = (char *)malloc(*table_l + 1);
+
+ 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);
+}
+
+/* gd_madd_bit wrapper */
+void F77_FUNC(gdmdbt, GDMDBT) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const int* bitnum,
+ const int* numbits)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ 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), (gd_bit_t)*bitnum,
+ (gd_bit_t)*numbits);
+ free(pa);
+ free(fc);
+ free(in);
+}
+
+/* gd_madd_sbit wrapper */
+void F77_FUNC(gdmdsb, GDMDSB) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const int* bitnum,
+ const int* numbits)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ 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), (gd_bit_t)*bitnum,
+ (gd_bit_t)*numbits);
+ free(pa);
+ free(fc);
+ free(in);
+}
+
+/* gd_madd_multiply wrapper */
+void F77_FUNC(gdmdmt, GDMDMT) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field1, const int* in_field1_l, const char* in_field2,
+ const int* in_field2_l)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in1 = (char *)malloc(*in_field1_l + 1);
+ char* in2 = (char *)malloc(*in_field2_l + 1);
+
+ 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);
+}
+
+/* gd_madd_divide wrapper */
+void F77_FUNC(gdmddv, GDMDDV) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field1, const int* in_field1_l, const char* in_field2,
+ const int* 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);
+
+ pa = (char *)malloc(*parent_l + 1);
+ fc = (char *)malloc(*field_code_l + 1);
+ in1 = (char *)malloc(*in_field1_l + 1);
+ in2 = (char *)malloc(*in_field2_l + 1);
+
+ 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 int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* 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);
+
+ pa = (char *)malloc(*parent_l + 1);
+ fc = (char *)malloc(*field_code_l + 1);
+ in1 = (char *)malloc(*in_field_l + 1);
+
+ 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 int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* 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));
+
+ pa = (char *)malloc(*parent_l + 1);
+ fc = (char *)malloc(*field_code_l + 1);
+ in1 = (char *)malloc(*in_field_l + 1);
+
+#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 int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const int* shift)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ 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);
+}
+
+/* gd_add_const wrapper */
+void F77_FUNC(gdadco, GDADCO) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* const_type, const int* data_type,
+ const void* value, const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ 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);
+}
+
+/* gd_madd_const wrapper */
+void F77_FUNC(gdmdco, GDMDCO) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* const_type, const int* data_type, const void* value)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ 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);
+}
+
+/* gd_add_carray wrapper */
+void F77_FUNC(gdadca, GDADCA) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *const_type, int *array_len,
+ const int *data_type, const void *value, const int *fragment_index)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %x, %i, %x, %p, %i", *dirfile, field_code,
+ *field_code_l, *const_type, *array_len, *data_type, value,
+ *fragment_index);
+
+ fc = (char *)malloc(*field_code_l + 1);
+
+ 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 int *dirfile, const char *parent,
+ const int *parent_l, const char *field_code, const int *field_code_l,
+ const int *const_type, const int *array_len, const int *data_type,
+ const void *value)
+{
+ char *pa, *fc;
+
+ dtrace("%i, %p, %i, %p, %i, %x, %i, %x, %p", *dirfile, parent, *parent_l,
+ field_code, *field_code_l, *const_type, *array_len, *data_type, value);
+
+ pa = (char *)malloc(*parent_l + 1);
+ fc = (char *)malloc(*field_code_l + 1);
+
+ 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 int* dirfile, const char* field_code,
+ const int* field_code_l, const char* value, const int* value_l,
+ const int* fragment_index)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* va = (char *)malloc(*value_l + 1);
+
+ 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);
+}
+
+/* gd_madd_string wrapper */
+void F77_FUNC(gdmdst, GDMDST) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* value, const int* value_l)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* va = (char *)malloc(*value_l + 1);
+
+ 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);
+}
+
+/* gd_add_spec wrapper */
+void F77_FUNC(gdadsp, GDADSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const int* fragment_index)
+{
+ char* sp = (char *)malloc(*spec_l + 1);
+
+ gd_add_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(sp, spec, *spec_l),
+ *fragment_index);
+
+ free(sp);
+}
+
+/* gd_madd_spec wrapper */
+void F77_FUNC(gdmdsp, GDMDSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const char *parent, const int* parent_l)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ char* sp = (char *)malloc(*spec_l + 1);
+
+ gd_madd_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(sp, spec,
+ *spec_l), _GDF_CString(pa, parent, *parent_l));
+
+ free(pa);
+ free(sp);
+}
+
+/* gd_get_constant wrapper */
+void F77_FUNC(gdgtco, GDGTCO) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *return_type, void *data_out)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %i, %p", *dirfile, field_code, *field_code_l,
+ *return_type, data_out);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ 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 int *dirfile, const char *field_code,
+ const int *field_code_l, const int *return_type, void *data_out)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l,
+ *return_type, data_out);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ 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 int *dirfile, const char *field_code,
+ const int *field_code_l, const int *start, const int *n,
+ const int *return_type, void *data_out)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %i, %i, %x, %p", *dirfile, field_code, *field_code_l,
+ *start, *n, *return_type, data_out);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ 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 */
+void F77_FUNC(gdcaln, GDCALN) (int *len, const int *dirfile,
+ const char *field_code, const int *field_code_l)
+{
+ char *fc;
+
+ dtrace("%p, %i, %p, %i", len, *dirfile, field_code, *field_code_l);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ *len = gd_carray_len(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l));
+ free(fc);
+
+ dreturnvoid();
+}
+
+/* gd_get_string wrapper */
+void F77_FUNC(gdgtst, GDGTST) (int *size, const int *dirfile,
+ const char *field_code, const int *field_code_l, const int *len,
+ char *data_out)
+{
+ char *fc = (char *)malloc(*field_code_l + 1);
+ char *out = (char *)malloc(*len + 1);
+ int l = *len;
+
+ *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);
+}
+
+/* gd_put_constant wrapper */
+void F77_FUNC(gdptco, GDPTCO) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *data_type, const void *data_in)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l, *data_type,
+ data_in);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ 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 int *dirfile, const char *field_code,
+ const int *field_code_l, const int *data_type, const void *data_in)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l, *data_type,
+ data_in);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ 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 int *dirfile, const char *field_code,
+ const int *field_code_l, const int *start, const int *n,
+ const int *data_type, const void *data_in)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %i, %i, %x, %p", *dirfile, field_code, *field_code_l,
+ *start, *n, *data_type, data_in);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ 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) (int* n_wrote, const int* dirfile,
+ const char* field_code, const int* field_code_l, const int* len,
+ const char* data_in)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*len + 1);
+ *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);
+}
+
+/* gd_nmfields wrapper */
+void F77_FUNC(gdnmfd, GDNMFD) (int* nfields, const int* dirfile,
+ const char* parent, const int* parent_l)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ *nfields = gd_nmfields(_GDF_GetDirfile(*dirfile), _GDF_CString(pa, parent,
+ *parent_l));
+ free(pa);
+}
+
+/* gd_nmfields_by_type wrapper */
+void F77_FUNC(gdnmft, GDNMFT) (int* nfields, const int* dirfile,
+ const char* parent, const int* parent_l, const int* type)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ *nfields = gd_nmfields_by_type(_GDF_GetDirfile(*dirfile), _GDF_CString(pa,
+ parent, *parent_l), (gd_entype_t)*type);
+ free(pa);
+}
+
+/* gd_nmvectors wrapper */
+void F77_FUNC(gdnmve, GDNMVE) (int* nvectors, const int* dirfile,
+ const char* parent, const int* parent_l)
+{
+ char* pa = (char *)malloc(*parent_l + 1);
+ *nvectors = gd_nmvectors(_GDF_GetDirfile(*dirfile), _GDF_CString(pa, parent,
+ *parent_l));
+ free(pa);
+}
+
+/* gd_discard wrapper */
+void F77_FUNC(gddscd, GDDSCD) (const int* dirfile)
+{
+ dtrace("%i", *dirfile);
+
+ if (*dirfile != 0) {
+ gd_discard(_GDF_GetDirfile(*dirfile));
+
+ _GDF_ClearDirfile(*dirfile);
+ }
+
+ dreturnvoid();
+}
+
+/* gd_cbopen wrapper */
+void F77_FUNC(gdcopn, GDCOPN) (int* dirfile, const char* dirfilename,
+ const int* dirfilename_l, const int* flags, const void* callback)
+{
+ char *out;
+
+ dtrace("%p, %p, %i, %x, %p", dirfile, dirfilename, *dirfilename_l, *flags,
+ callback);
+
+ out = (char *)malloc(*dirfilename_l + 1);
+
+ *dirfile = _GDF_SetDirfile(gd_cbopen(_GDF_CString(out, dirfilename,
+ *dirfilename_l), *flags, (callback == 0) ? NULL : _GDF_Callback,
+ (callback == 0) ? NULL : (void*)callback));
+
+ free(out);
+ dreturn("%i", *dirfile);
+}
+
+/* gd_parser_callback wrapper */
+void F77_FUNC(gdclbk, GDCLBK) (const int* dirfile, const void* callback)
+{
+ dtrace("%i, %p", *dirfile, callback);
+
+ gd_parser_callback(_GDF_GetDirfile(*dirfile), (callback == 0) ? NULL
+ : _GDF_Callback, (callback == 0) ? NULL : (void*)callback);
+
+ dreturnvoid();
+}
+
+/* gd_alter_bit wrapper */
+void F77_FUNC(gdalbt, GDALBT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ int* bitnum, int* numbits)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ gd_alter_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), _GDF_CString(in, in_field, *in_field_l),
+ (gd_bit_t)*bitnum, (gd_bit_t)*numbits);
+
+ free(fc);
+ free(in);
+}
+
+/* gd_alter_sbit wrapper */
+void F77_FUNC(gdalsb, GDALSB) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ int* bitnum, int* numbits)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ gd_alter_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), _GDF_CString(in, in_field, *in_field_l),
+ (gd_bit_t)*bitnum, (gd_bit_t)*numbits);
+
+ free(fc);
+ free(in);
+}
+
+/* gd_alter_const wrapper */
+void F77_FUNC(gdalco, GDALCO) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* const_type)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ gd_alter_const(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), (gd_type_t)*const_type);
+
+ free(fc);
+}
+
+/* gd_alter_carray wrapper */
+void F77_FUNC(gdalca, GDALCA) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* const_type, const int *array_len)
+{
+ char *fc;
+
+ dtrace("%i, %p, %i, %x, %i", *dirfile, field_code, *field_code_l, *const_type,
+ *array_len);
+
+ fc = (char *)malloc(*field_code_l + 1);
+
+ 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 int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const double* m1, const double* b1,
+ const char* in_field2, const int* in_field2_l, const double* m2,
+ const double* b2, const char* in_field3, const int* in_field3_l,
+ const double* m3, const double* b3)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in_fields[3] = {NULL, NULL, NULL};
+ double m[3] = {0, 0, 0};
+ double b[3] = {0, 0, 0};
+ int nf = *n_fields;
+
+ if (nf > 0) {
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
+ _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ m[0] = *m1;
+ b[0] = *b1;
+ }
+
+ if (nf > 1) {
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
+ _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ m[1] = *m2;
+ b[1] = *b2;
+ }
+
+ if (nf > 2) {
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
+ _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]);
+}
+
+/* gd_alter_clincom wrapper */
+void F77_FUNC(gdalcl, GDALCL) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+ const char* in_field2, const int* in_field2_l, const GD_DCOMPLEXP(m2),
+ const GD_DCOMPLEXP(b2), const char* in_field3, const int* in_field3_l,
+ const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3))
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ 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
+ int nf = *n_fields;
+
+ if (nf > 0) {
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
+ _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ _gd_cp2ca(cm, 0, m1);
+ _gd_cp2ca(cb, 0, b1);
+ }
+
+ if (nf > 1) {
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
+ _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ _gd_cp2ca(cm, 1, m2);
+ _gd_cp2ca(cb, 1, b2);
+ }
+
+ if (nf > 2) {
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
+ _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]);
+}
+
+/* gd_alter_polynom wrapper */
+void F77_FUNC(gdalpn, GDALPN) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* in_field_l, const double* a0, const double* a1, const double* a2,
+ const double* a3, const double* a4, const double* a5)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* inf = NULL;
+ double a[6] = {0, 0, 0, 0, 0, 0};
+ int po = *poly_ord;
+ if (po > 5)
+ po = 5;
+
+ inf = (char *)malloc(*in_field_l + 1);
+ _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_alter_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), po, inf, a);
+ free(fc);
+ free(inf);
+}
+
+/* gd_alter_cpolynom wrapper */
+void F77_FUNC(gdalcp, GDALCP) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* 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 = (char *)malloc(*field_code_l + 1);
+ char* inf = NULL;
+#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;
+
+ inf = (char *)malloc(*in_field_l + 1);
+ _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_alter_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), po, inf, ca);
+ free(fc);
+ free(inf);
+}
+
+/* gd_alter_multiply wrapper */
+void F77_FUNC(gdalmt, GDALMT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* in_field2_l)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in1 = (char *)malloc(*in_field1_l + 1);
+ char* in2 = (char *)malloc(*in_field2_l + 1);
+
+ 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);
+}
+
+/* gd_alter_divide wrapper */
+void F77_FUNC(gdaldv, GDALDV) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* 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);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ in1 = (char *)malloc(*in_field1_l + 1);
+ in2 = (char *)malloc(*in_field2_l + 1);
+
+ 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 int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* 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);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ in1 = (char *)malloc(*in_field1_l + 1);
+
+ 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 int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* 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));
+
+ fc = (char *)malloc(*field_code_l + 1);
+ in1 = (char *)malloc(*in_field1_l + 1);
+
+#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 int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* shift)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+
+ 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);
+}
+
+/* gd_encoding wrapper */
+void F77_FUNC(gdgenc, GDGENC) (int* encoding, const int* dirfile,
+ const int* fragment)
+{
+ *encoding = gd_encoding(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_endianness wrapper */
+void F77_FUNC(gdgend, GDGEND) (int* endianness, const int* dirfile,
+ const int* fragment)
+{
+ *endianness = gd_endianness(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* dirfilename wrapper */
+void F77_FUNC(gdname, GDNAME) (char* name, int* name_l, const int* dirfile)
+{
+ const char* dn = gd_dirfilename(_GDF_GetDirfile(*dirfile));
+ _GDF_FString(name, name_l, dn);
+}
+
+/* gd_parent_fragment wrapper */
+void F77_FUNC(gdpfrg, GDPFRG) (int* parent, const int* dirfile,
+ const int* fragment)
+{
+ *parent = gd_parent_fragment(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_alter_protection wrapper */
+void F77_FUNC(gdaprt, GDAPRT) (const int* dirfile, const int* protection_level,
+ const int* fragment)
+{
+ gd_alter_protection(_GDF_GetDirfile(*dirfile), *protection_level, *fragment);
+}
+
+/* gd_protection wrapper */
+void F77_FUNC(gdgprt, GDGPRT) (int* protection_level, const int* dirfile,
+ const int* fragment)
+{
+ *protection_level = gd_protection(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_raw_filename wrapper */
+void F77_FUNC(gdrwfn, GDRWFN) (char* name, int* name_l, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ const char* fn = gd_raw_filename(_GDF_GetDirfile(*dirfile), _GDF_CString(fc,
+ field_code, *field_code_l));
+
+ _GDF_FString(name, name_l, fn);
+
+ free(fc);
+}
+
+/* gd_reference wrapper */
+void F77_FUNC(gdrefe, GDREFE) (char* name, int* name_l, const int* dirfile,
+ const char* field_code, const int *field_code_l)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ const char* ref = gd_reference(_GDF_GetDirfile(*dirfile),
+ _GDF_CString(fc, field_code, *field_code_l));
+
+ _GDF_FString(name, name_l, ref);
+
+ free(fc);
+}
+
+/* gd_alter_encoding wrapper */
+void F77_FUNC(gdaenc, GDAENC) (const int* dirfile, const int* encoding,
+ const int* fragment, const int* recode)
+{
+ gd_alter_encoding(_GDF_GetDirfile(*dirfile), *encoding, *fragment,
+ *recode);
+}
+
+/* gd_alter_endianness wrapper */
+void F77_FUNC(gdaend, GDAEND) (const int* dirfile, const int* endianness,
+ const int* fragment, const int* recode)
+{
+ gd_alter_endianness(_GDF_GetDirfile(*dirfile), *endianness, *fragment,
+ *recode);
+}
+
+/* gd_alter_linterp wrapper */
+void F77_FUNC(gdallt, GDALLT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const char* table, const int* table_l, const int* recode)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+ char* tab = (char *)malloc(*table_l + 1);
+
+ 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);
+}
+
+/* gd_alter_raw wrapper */
+void F77_FUNC(gdalrw, GDALRW) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* data_type, const int* spf,
+ const int* recode)
+{
+ char* out = (char *)malloc(*field_code_l + 1);
+ gd_alter_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ *field_code_l), (gd_type_t)(*data_type), (gd_spf_t)*spf, *recode);
+ free(out);
+}
+
+/* gd_alter_spec wrapper */
+void F77_FUNC(gdalsp, GDALSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const int* move)
+{
+ char* sp = (char *)malloc(*spec_l + 1);
+
+ gd_alter_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(sp, spec, *spec_l),
+ *move);
+
+ free(sp);
+}
+
+/* gd_delete wrapper */
+void F77_FUNC(gddele, GDDELE) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* flags)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ gd_delete(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), *flags);
+
+ free(fc);
+}
+
+/* gd_malter_spec wrapper */
+void F77_FUNC(gdmlsp, GDMLSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const char* parent, const int* parent_l,
+ const int* move)
+{
+ char* sp = (char *)malloc(*spec_l + 1);
+ char* pa = (char *)malloc(*parent_l + 1);
+
+ gd_malter_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(sp, spec,
+ *spec_l), _GDF_CString(pa, parent, *parent_l), *move);
+
+ free(pa);
+ free(sp);
+}
+
+/* gd_move wrapper */
+void F77_FUNC(gdmove, GDMOVE) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* new_fragment, const int* move_data)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ gd_move(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), *new_fragment, *move_data);
+
+ free(fc);
+}
+
+/* gd_rename wrapper */
+void F77_FUNC(gdrenm, GDRENM) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* new_name, const int* new_name_l,
+ const int* move_data)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* nn = (char *)malloc(*new_name_l + 1);
+
+ gd_rename(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ *field_code_l), _GDF_CString(nn, new_name, *new_name_l), *move_data);
+
+ free(nn);
+ free(fc);
+}
+
+/* gd_uninclude wrapper */
+void F77_FUNC(gduinc, GDUINC) (const int* dirfile, const int* fragment,
+ const int* del)
+{
+ gd_uninclude(_GDF_GetDirfile(*dirfile), *fragment, *del);
+}
+
+/* gd_alter_frameoffset wrapper */
+void F77_FUNC(gdafof, GDAFOF) (const int* dirfile, const int* offset,
+ const int* fragment, const int* recode)
+{
+ gd_alter_frameoffset(_GDF_GetDirfile(*dirfile), *offset, *fragment,
+ *recode);
+}
+
+/* gd_frameoffset wrapper */
+void F77_FUNC(gdgfof, GDGFOF) (int* offset, const int* dirfile,
+ const int* fragment)
+{
+ *offset = gd_frameoffset(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_native_type wrapper */
+void F77_FUNC(gdntyp, GDNTYP) (int* type, const int* dirfile,
+ const char* field_code, const int* field_code_l)
+{
+ char* fc = (char *)malloc(*field_code_l + 1);
+
+ *type = gd_native_type(_GDF_GetDirfile(*dirfile), _GDF_CString(fc,
+ field_code, *field_code_l));
+
+ free(fc);
+}
+
+/* returns the value of the comp_scal member */
+void F77_FUNC(gdcscl, GDCSCL) (int *comp_scal, const int *dirfile,
+ const char *field_code, const int *field_code_l)
+{
+ char *fc;
+ gd_entry_t E;
+ DIRFILE *D;
+
+ dtrace("%p, %i, %p, %i", comp_scal, *dirfile, field_code, *field_code_l);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ D = _GDF_GetDirfile(*dirfile);
+
+ *comp_scal = 0;
+
+ gd_entry(D, _GDF_CString(fc, field_code, *field_code_l), &E);
+
+ if (!gd_error(D) && (E.field_type == GD_LINCOM_ENTRY ||
+ E.field_type == GD_POLYNOM_ENTRY || E.field_type == GD_RECIP_ENTRY))
+ *comp_scal = E.comp_scal;
+
+ gd_free_entry_strings(&E);
+ free(fc);
+
+ dreturn("%i", *comp_scal);
+}
+
+/* gd_validate wrapper */
+void F77_FUNC(gdvldt, GDVLDT) (int *valid, const int *dirfile,
+ const char *field_code, const int *field_code_l)
+{
+ char *fc = (char *)malloc(*field_code_l + 1);
+
+ *valid = gd_validate(_GDF_GetDirfile(*dirfile),
+ _GDF_CString(fc, field_code, *field_code_l));
+
+ free(fc);
+}
+
+/* gd_framenum wrapper */
+void F77_FUNC(gdfnum, GDFNUM) (double *framenum, const int *dirfile,
+ const char *field_code, const int *field_code_l, const double *value)
+{
+ char *fc = (char *)malloc(*field_code_l + 1);
+
+ *framenum = gd_framenum(_GDF_GetDirfile(*dirfile),
+ _GDF_CString(fc, field_code, *field_code_l), *value);
+
+ free(fc);
+}
+
+/* gd_framenum_subset wrapper */
+void F77_FUNC(gdfnss, GDFNSS) (double *framenum, const int *dirfile,
+ const char *field_code, const int *field_code_l, const double *value,
+ const int *start, const int *end)
+{
+ char *fc;
+
+ dtrace("%p, %i, %p, %i, %g, %i, %i", framenum, *dirfile, field_code,
+ *field_code_l, *value, *start, *end);
+ fc = (char *)malloc(*field_code_l + 1);
+
+ *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, int* scalar_l, int *scalar_index,
+ const int* dirfile, const char* field_code, const int *field_code_l,
+ const int* 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);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ 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_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:
+ if (*index > 2)
+ ok = 0;
+ break;
+ case GD_RECIP_ENTRY:
+ case GD_RAW_ENTRY:
+ case GD_PHASE_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] : "");
+ *scalar_index = E.scalar_ind[*index - 1];
+
+ gd_free_entry_strings(&E);
+
+ dreturnvoid();
+}
+
+/* set a scalar parameter */
+void F77_FUNC(gdasca, GDASCA) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *index, const char *scalar,
+ const int *scalar_l, int *scalar_index, int *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);
+
+ fc = (char *)malloc(*field_code_l + 1);
+ D = _GDF_GetDirfile(*dirfile);
+
+ if (*index < 1) {
+ dreturnvoid();
+ return;
+ }
+
+ gd_entry(D, _GDF_CString(fc, field_code, *field_code_l), &E);
+
+ switch (E.field_type) {
+ case GD_NO_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:
+ if (*index > 2)
+ ok = 0;
+ break;
+ case GD_RAW_ENTRY:
+ case GD_PHASE_ENTRY:
+ case GD_RECIP_ENTRY:
+ if (*index > 1)
+ ok = 0;
+ break;
+ }
+
+ if (!ok || gd_error(D)) {
+ dreturnvoid();
+ return;
+ }
+
+ free(E.scalar[*index - 1]);
+ E.scalar[*index - 1] = (char *)malloc(*scalar_l + 1);
+ _GDF_CString(E.scalar[*index - 1], scalar, *scalar_l);
+ 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) (int *dirfile)
+{
+ dtrace("%p", dirfile);
+
+ *dirfile = _GDF_SetDirfile(gd_invalid_dirfile());
+
+ dreturn("%i", *dirfile);
+}
+
+/* gd_dirfile_standards wrapper */
+void F77_FUNC(gdstdv, GDSTDV) (int *vers, const int *dirfile)
+{
+ dtrace("%p, %i", vers, *dirfile);
+
+ *vers = gd_dirfile_standards(_GDF_GetDirfile(*dirfile), *vers);
+
+ dreturn("%i", *vers);
+}
diff --git a/bindings/f77/fgetdata.h b/bindings/f77/fgetdata.h
new file mode 100644
index 0000000..885a409
--- /dev/null
+++ b/bindings/f77/fgetdata.h
@@ -0,0 +1,562 @@
+/* Copyright (C) 2008, 2009 D. V. Wiebe
+ *
+ *************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General 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
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../../src/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
+/* Forward declarations to keep icc happy */
+void F77_FUNC(gdopen, GDOPEN) (int* dirfile, const char* dirfilename,
+ const int* dirfilename_l, const int* flags);
+
+void F77_FUNC(gdclos, GDCLOS) (const int* dirfile);
+
+void F77_FUNC(gdflsh, GDFLSH) (const int* dirfile, const char* field_code,
+ const int* field_code_l);
+
+void F77_FUNC(gdgetd, GDGETD) (int* n_read, const int* dirfile,
+ const char* field_code, const int* field_code_l,
+ const int* first_frame, const int* first_sample,
+ const int* num_frames, const int* num_samples, const int* return_type,
+ void* data_out);
+
+void F77_FUNC(gdfdnx, GDFDNX) (int* max, const int* dirfile);
+
+void F77_FUNC(gdfldn, GDFLDN) (char* name, int* name_l, const int* dirfile,
+ const int* field_num);
+
+void F77_FUNC(gdnfld, GDNFLD) (int* nfields, const int* dirfile);
+
+void F77_FUNC(gdnfrm, GDNFRM) (int* nframes, const int* dirfile);
+
+void F77_FUNC(gdgspf, GDGSPF) (int* spf, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdputd, GDPUTD) (int* n_wrote, const int* dirfile,
+ const char* field_code, const int* field_code_l, const int* first_frame,
+ const int* first_sample, const int* num_frames, const int* num_samples,
+ const int* data_type, const void* data_in);
+
+void F77_FUNC(gderor, GDEROR) (int* error, const int* dirfile);
+
+void F77_FUNC(gdestr, GDESTR) (const int* dirfile, char* buffer,
+ const int* len);
+
+void F77_FUNC(gdenty, GDENTY) (int* type, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgecl, GDGECL) (int* nfields,
+ char* infield1, int* infield1_l, GD_DCOMPLEXP(m1), GD_DCOMPLEXP(b1),
+ char* infield2, int* infield2_l, GD_DCOMPLEXP(m2), GD_DCOMPLEXP(b2),
+ char* infield3, int* infield3_l, GD_DCOMPLEXP(m3), GD_DCOMPLEXP(b3),
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* field_code_l);
+
+void F77_FUNC(gdgecp, GDGECP) (int* poly_ord,
+ char* infield, int* infield_l, GD_DCOMPLEXP(a0), GD_DCOMPLEXP(a1),
+ GD_DCOMPLEXP(a2), GD_DCOMPLEXP(a3), GD_DCOMPLEXP(a4),
+ GD_DCOMPLEXP(a5), int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgerw, GDGERW) (int* spf, int* dtype, int* fragment_index,
+ const int* dirfile, const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgelc, GDGELC) (int* nfields,
+ char* infield1, int* infield1_l, double* m1, double* b1,
+ char* infield2, int* infield2_l, double* m2, double* b2,
+ char* infield3, int* infield3_l, double* m3, double* b3,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* field_code_l);
+
+void F77_FUNC(gdgepn, GDGEPN) (int* nfields, char* infield, int* infield_l,
+ double* a0, double* a1, double* a2, double* a3, double* a4, double* a5,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* field_code_l);
+
+void F77_FUNC(gdgelt, GDGELT) (char* in_field, int* in_field_l, char* table,
+ int* table_l, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgebt, GDGEBT) (char* in_field, int* in_field_l, int* bitnum,
+ int* numbits, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgesb, GDGESB) (char* in_field, int* in_field_l, int* bitnum,
+ int* numbits, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgemt, GDGEMT) (char* in_field1, int* in_field1_l,
+ char* in_field2, int* in_field2_l, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgeph, GDGEPH) (char* in_field, int* in_field_l, int* shift,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* field_code_l);
+
+void F77_FUNC(gdadrw, GDADRW) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* data_type, const int* spf,
+ const int* fragment_index);
+
+void F77_FUNC(gdadlc, GDADLC) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const double* m1, const double* b1,
+ const char* in_field2, const int* in_field2_l, const double* m2,
+ const double* b2, const char* in_field3, const int* in_field3_l,
+ const double* m3, const double* b3, const int* fragment_index);
+
+void F77_FUNC(gdadpn, GDADPN) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* in_field_l, const double* a0, const double* a1, const double* a2,
+ const double* a3, const double* a4, const double* a5,
+ const int* fragment_index);
+
+void F77_FUNC(gdadlt, GDADLT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const char* table, const int* table_l, const int* fragment_index);
+
+void F77_FUNC(gdadbt, GDADBT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* bitnum, const int* numbits, const int* fragment_index);
+
+void F77_FUNC(gdadmt, GDADMT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* in_field2_l, const int* fragment_index);
+
+void F77_FUNC(gdadph, GDADPH) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* shift, const int* fragment_index);
+
+void F77_FUNC(gdfrgn, GDFRGN) (char* filename, int* filename_l,
+ const int* dirfile, const int* index);
+
+void F77_FUNC(gdnfrg, GDNFRG) (int* nformats, const int* dirfile);
+
+void F77_FUNC(gdmfls, GDMFLS) (const int* dirfile);
+
+void F77_FUNC(gdincl, GDINCL) (const int* dirfile, const char* file,
+ const int* file_l, const int* fragment_index, const int* flags);
+
+void F77_FUNC(gdnfdt, GDNFDT) (int* nfields, const int* dirfile,
+ const int* type);
+
+void F77_FUNC(gdnvec, GDNVEC) (int* nvectors, const int* dirfile);
+
+void F77_FUNC(gdfdnt, GDFDNT) (char* name, int* name_l, const int* dirfile,
+ const int* type, const int* field_num);
+
+void F77_FUNC(gdvecn, GDVECN) (char* name, int* name_l, const int* dirfile,
+ const int* field_num);
+
+void F77_FUNC(gdmdlc, GDMDLC) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* n_fields, const char* in_field1, const int* in_field1_l,
+ const double* m1, const double* b1, const char* in_field2,
+ const int* in_field2_l, const double* m2, const double* b2,
+ const char* in_field3, const int* in_field3_l, const double* m3,
+ const double* b3);
+
+void F77_FUNC(gdmdpn, GDMDPN) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* poly_ord, const char* in_field, const int* 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 int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const char* table,
+ const int* table_l);
+
+void F77_FUNC(gdmdbt, GDMDBT) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const int* bitnum,
+ const int* numbits);
+
+void F77_FUNC(gdmdsb, GDMDSB) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const int* bitnum,
+ const int* numbits);
+
+void F77_FUNC(gdmdmt, GDMDMT) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field1, const int* in_field1_l, const char* in_field2,
+ const int* in_field2_l);
+
+void F77_FUNC(gdmdph, GDMDPH) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const int* shift);
+
+void F77_FUNC(gdadco, GDADCO) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* const_type, const int* data_type,
+ const void* value, const int* fragment_index);
+
+void F77_FUNC(gdmdco, GDMDCO) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* const_type, const int* data_type, const void* value);
+
+void F77_FUNC(gdadst, GDADST) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* value, const int* value_l,
+ const int* fragment_index);
+
+void F77_FUNC(gdmdst, GDMDST) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* value, const int* value_l);
+
+void F77_FUNC(gdadsp, GDADSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const int* fragment_index);
+
+void F77_FUNC(gdmdsp, GDMDSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const char *parent, const int* parent_l);
+
+void F77_FUNC(gdfrgi, GDFRGI) (int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgtco, GDGTCO) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *return_type, void *data_out);
+
+void F77_FUNC(gdgtca, GDGTCA) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *return_type, void *data_out);
+
+void F77_FUNC(gdcaln, GDCALN) (int *len, const int *dirfile,
+ const char *field_code, const int *field_code_l);
+
+void F77_FUNC(gdgcas, GDGCAS) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *start, const int *n,
+ const int *return_type, void *data_out);
+
+void F77_FUNC(gdgtst, GDGTST) (int *size, const int *dirfile,
+ const char *field_code, const int *field_code_l, const int *len,
+ char *data_out);
+
+void F77_FUNC(gdptco, GDPTCO) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *data_type, const void *data_in);
+
+void F77_FUNC(gdptca, GDPTCA) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *data_type, const void *data_in);
+
+void F77_FUNC(gdptst, GDPTST) (int* n_read, const int* dirfile,
+ const char* field_code, const int* field_code_l, const int* len,
+ const char* data_out);
+
+void F77_FUNC(gdnmfd, GDNMFD) (int* nfields, const int* dirfile,
+ const char* parent, const int* parent_l);
+
+void F77_FUNC(gdnmft, GDNMFT) (int* nfields, const int* dirfile,
+ const char* parent, const int* parent_l, const int* type);
+
+void F77_FUNC(gdnmve, GDNMVE) (int* nvectors, const int* dirfile,
+ const char* parent, const int* parent_l);
+
+void F77_FUNC(gdgeco, GDGECO) (int* data_type, int* fragment_index,
+ const int* dirfile, const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdmfnx, GDMFNX) (int* max, const int* dirfile, const char* parent,
+ const int* parent_l);
+
+void F77_FUNC(gdmfdn, GDMFDN) (char* name, int* name_l, const int* dirfile,
+ const char* parent, const int* parent_l, const int* field_num);
+
+void F77_FUNC(gdmfdt, GDMFDT) (char* name, int* name_l, const int* dirfile,
+ const char* parent, const int* parent_l, const int* type,
+ const int* field_num);
+
+void F77_FUNC(gdmven, GDMVEN) (char* name, int* name_l, const int* dirfile,
+ const char* parent, const int* parent_l, const int* field_num);
+
+void F77_FUNC(gddscd, GDDSCD) (const int* dirfile);
+
+void F77_FUNC(gdcopn, GDCOPN) (int* dirfile, const char* dirfilename,
+ const int* dirfilename_l, const int* flags, const void* callback);
+
+void F77_FUNC(gdclbk, GDCLBK) (const int* dirfile, const void* callback);
+
+void F77_FUNC(gdalbt, GDALBT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ int* bitnum, int* numbits);
+
+void F77_FUNC(gdalco, GDALCO) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* const_type);
+
+void F77_FUNC(gdalca, GDALCA) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* const_type, const int *array_len);
+
+void F77_FUNC(gdallc, GDALLC) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const double* m1, const double* b1,
+ const char* in_field2, const int* in_field2_l, const double* m2,
+ const double* b2, const char* in_field3, const int* in_field3_l,
+ const double* m3, const double* b3);
+
+void F77_FUNC(gdalpn, GDALPN) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* 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 int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* in_field2_l);
+
+void F77_FUNC(gdalph, GDALPH) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* shift);
+
+void F77_FUNC(gdgenc, GDGENC) (int* encoding, const int* dirfile,
+ const int* fragment);
+
+void F77_FUNC(gdgend, GDGEND) (int* endianness, const int* dirfile,
+ const int* fragment);
+
+void F77_FUNC(gdname, GDNAME) (char* name, int* name_l, const int* dirfile);
+
+void F77_FUNC(gdpfrg, GDPFRG) (int* parent, const int* dirfile,
+ const int* fragment);
+
+void F77_FUNC(gdprot, GDPROT) (const int* dirfile, const int* fragment,
+ const int* protection_level);
+
+void F77_FUNC(gdgprt, GDGPRT) (int* protection_level, const int* dirfile,
+ const int* fragment);
+
+void F77_FUNC(gdrwfn, GDRWFN) (char* name, int* name_l, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdrefe, GDREFE) (char* name, int* name_l, const int* dirfile,
+ const char* field_code, const int *field_code_l);
+
+void F77_FUNC(gdaenc, GDAENC) (const int* dirfile, const int* encoding,
+ const int* fragment, const int* recode);
+
+void F77_FUNC(gdaend, GDAEND) (const int* dirfile, const int* endianness,
+ const int* fragment, const int* recode);
+
+void F77_FUNC(gdallt, GDALLT) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const char* table, const int* table_l, const int* recode);
+
+void F77_FUNC(gdalrw, GDALRW) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* data_type, const int* spf,
+ const int* recode);
+
+void F77_FUNC(gdalsp, GDALSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const int* fragment_index);
+
+void F77_FUNC(gddele, GDDELE) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* flags);
+
+void F77_FUNC(gdmlsp, GDMLSP) (const int* dirfile, const char* spec,
+ const int* spec_l, const char* parent, const int* parent_l,
+ const int* recode);
+
+void F77_FUNC(gdmove, GDMOVE) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* new_fragment, const int* move_data);
+
+void F77_FUNC(gdrenm, GDRENM) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* new_name, const int* new_name_l,
+ const int* move_data);
+
+void F77_FUNC(gduinc, GDUINC) (const int* dirfile, const int* fragment,
+ const int* del);
+
+void F77_FUNC(gdafof, GDAFOF) (const int* dirfile, const int* offset,
+ const int* fragment, const int* recode);
+
+void F77_FUNC(gdgfof, GDGFOF) (int* offset, const int* dirfile,
+ const int* fragment);
+
+void F77_FUNC(gdadcl, GDADCL) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+ const char* in_field2, const int* in_field2_l, const GD_DCOMPLEXP(m2),
+ const GD_DCOMPLEXP(b2), const char* in_field3, const int* in_field3_l,
+ const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3),
+ const int* fragment_index);
+
+void F77_FUNC(gdadcp, GDADCP) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* 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 int* fragment_index);
+
+void F77_FUNC(gdmdcl, GDMDCL) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* n_fields, const char* in_field1, const int* in_field1_l,
+ const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char* in_field2,
+ const int* in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2),
+ const char* in_field3, const int* in_field3_l, const GD_DCOMPLEXP(m3),
+ const GD_DCOMPLEXP(b3));
+
+void F77_FUNC(gdmdcp, GDMDCP) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const int* poly_ord, const char* in_field, const int* 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) (int* type, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdalcl, GDALCL) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* n_fields, const char* in_field1,
+ const int* in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+ const char* in_field2, const int* in_field2_l, const GD_DCOMPLEXP(m2),
+ const GD_DCOMPLEXP(b2), const char* in_field3, const int* in_field3_l,
+ const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3));
+
+void F77_FUNC(gdalcp, GDALCP) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const int* poly_ord, const char* in_field,
+ const int* 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(gdcscl, GDCSCL) (int *comp_scal, const int *dirfile,
+ const char *field_code, const int *field_code_l);
+
+void F77_FUNC(gdvldt, GDVLDT) (int *valid, const int *dirfile,
+ const char *field_code, const int *field_code_l);
+
+void F77_FUNC(gdfnum, GDFNUM) (double *framenum, const int *dirfile,
+ const char *field_code, const int *field_code_l, const double *value);
+
+void F77_FUNC(gdfnss, GDFNSS) (double *framenum, const int *dirfile,
+ const char *field_code, const int *field_code_l, const double *value,
+ const int *start, const int *end);
+
+void F77_FUNC(gdgsca, GDGSCA) (char* scalar, int* scalar_l, int *scalar_index,
+ const int* dirfile, const char* field_code, const int *field_code_l,
+ const int* index);
+
+void F77_FUNC(gdasca, GDASCA) (const int* dirfile, const char* field_code,
+ const int *field_code_l, const int *index, const char *scalar,
+ const int *scalar_l, int *scalar_index, int* recode);
+
+void F77_FUNC(gdalsb, GDALSB) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ int* bitnum, int* numbits);
+
+void F77_FUNC(gdadsb, GDADSB) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const int* bitnum, const int* numbits, const int* fragment_index);
+
+void F77_FUNC(gdinvd, GDINVD) (int *dirfile);
+
+void F77_FUNC(gdstdv, GDSTDV) (int *vers, const int *dirfile);
+
+void F77_FUNC(gdgbof, GDGBOF) (int* bof, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgeof, GDGEOF) (int* eof, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgedv, GDGEDV) (char* in_field1, int* in_field1_l,
+ char* in_field2, int* in_field2_l, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgerc, GDGERC) (char* in_field, int* in_field_l,
+ double* dividend, int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdgecr, GDGECR) (char* in_field, int* in_field_l,
+ GD_DCOMPLEXP(cdividend), int* fragment_index, const int* dirfile,
+ const char* field_code, const int* field_code_l);
+
+void F77_FUNC(gdaddv, GDADDV) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* in_field2_l, const int* fragment_index);
+
+void F77_FUNC(gdadrc, GDADRC) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const double* dividend, const int* fragment_index);
+
+void F77_FUNC(gdadcr, GDADCR) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field, const int* in_field_l,
+ const GD_DCOMPLEXP(cdividend), const int* fragment_index);
+
+void F77_FUNC(gdmddv, GDMDDV) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field1, const int* in_field1_l, const char* in_field2,
+ const int* in_field2_l);
+
+void F77_FUNC(gdrfrg, GDRFRG) (const int* dirfile, const int* fragment);
+
+void F77_FUNC(gdmdrc, GDMDRC) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l, const double* dividend);
+
+void F77_FUNC(gdmdcr, GDMDCR) (const int* dirfile, const char* parent,
+ const int* parent_l, const char* field_code, const int* field_code_l,
+ const char* in_field, const int* in_field_l,
+ const GD_DCOMPLEXP(cdividend));
+
+void F77_FUNC(gdaldv, GDALDV) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const char* in_field2, const int* in_field2_l);
+
+void F77_FUNC(gdalrc, GDALRC) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const double* dividend);
+
+void F77_FUNC(gdalcr, GDALCR) (const int* dirfile, const char* field_code,
+ const int* field_code_l, const char* in_field1, const int* in_field1_l,
+ const GD_DCOMPLEXP(cdividend));
+
+void F77_FUNC(gdaprt, GDAPRT) (const int* dirfile, const int* protection_level,
+ const int* fragment);
+
+void F77_FUNC(gdgeca, GDGECA) (int* data_type, int *array_len,
+ int* fragment_index, const int* dirfile, const char* field_code,
+ const int* field_code_l);
+
+void F77_FUNC(gdadca, GDADCA) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *const_type, int *array_len,
+ const int *data_type, const void *value, const int *fragment_index);
+
+void F77_FUNC(gdmdca, GDMDCA) (const int *dirfile, const char *parent,
+ const int *parent_l, const char *field_code, const int *field_code_l,
+ const int *const_type, const int *array_len, const int *data_type,
+ const void *value);
+
+void F77_FUNC(gdpcas, GDPCAS) (const int *dirfile, const char *field_code,
+ const int *field_code_l, const int *start, const int *n,
+ const int *data_type, const void *data_in);
+#ifdef __cplusplus
+}
+#endif
diff --git a/bindings/f77/getdata.f.in b/bindings/f77/getdata.f.in
new file mode 100644
index 0000000..4df9b20
--- /dev/null
+++ b/bindings/f77/getdata.f.in
@@ -0,0 +1,293 @@
+C Copyright (C) 2008-2010 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_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_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 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 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 Corresponding to gd_alter_protection(3)
+ EXTERNAL GDAPRT
+C Alter a scalar parameter
+ EXTERNAL GDASCA
+C Corresponding to gd_carray_len(3)
+ EXTERNAL GDCALN
+C Corresponding to gd_parser_callback(3)
+ EXTERNAL GDCLBK
+C Corresponding to gd_close(3)
+ EXTERNAL GDCLOS
+C Corresponding to gd_copen(3)
+ EXTERNAL GDCOPN
+C Check whether an entry contains complex scalars
+ EXTERNAL GDCSCL
+C Correpsonding to gd_delete(3)
+ EXTERNAL GDDELE
+C Corresponding to gd_discard(3)
+ EXTERNAL GDDSCD
+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_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_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 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_include(3)
+ EXTERNAL GDINCL
+C Corresponding to gd_invalid_dirfile(3)
+ EXTERNAL GDINVD
+C Corresponding to gd_madd_bit(3)
+ EXTERNAL GDMDBT
+C Corresponding to gd_madd_carray(3)
+ EXTERNAL GDMDCA
+C Corresponding to complex valued 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_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_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_mvector_list(3) (sort of)
+ EXTERNAL GDMVEN
+C Corresponding to gd_dirfilename(3)
+ EXTERNAL GDNAME
+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 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_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_dirfile_standards(3)
+ EXTERNAL GDSTDV
+C Corresponding to gd_uninclude(3)
+ EXTERNAL GDUINC
+C Corresponding to gd_vector_list(3) (sort of)
+ EXTERNAL GDVECN
+C Corresponding to gd_validate(3)
+ EXTERNAL GDVLDT
diff --git a/bindings/f77/getdata.f90.in b/bindings/f77/getdata.f90.in
new file mode 100644
index 0000000..a8c0913
--- /dev/null
+++ b/bindings/f77/getdata.f90.in
@@ -0,0 +1,2121 @@
+! Copyright (C) 2008-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
+!
+! -*- F95 -*-
+
+module getdata
+implicit none
+
+ at 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, comp_scal, poly_ord, array_len
+ 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
+ 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
+
+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))
+
+ 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
+ call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+ if (ent%comp_scal .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(1), 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
+ call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+ if (ent%comp_scal .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(1), dirfile, &
+ TRIM(field_code), LEN_TRIM(field_code), i)
+ end do
+ else if (fgd_entry .EQ. GD_RECIP_ENTRY) then
+ ! recip
+ call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+ if (ent%comp_scal .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_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 gdadrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ ent%data_type, ent%spf, ent%fragment_index)
+ else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
+ if (ent%comp_scal .EQ. 0) then
+ call gdadlc(dirfile, 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), ent%fragment_index)
+ else
+ call gdadcl(dirfile, 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), 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 gdadbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits, &
+ ent%fragment_index)
+ else if (ent%field_type .EQ. GD_SBIT_ENTRY) then
+ call gdadsb(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits, &
+ 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 gdadph(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift, ent%fragment_index)
+ else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then
+ if (ent%comp_scal .EQ. 0) then
+ call gdadpn(dirfile, 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), ent%fragment_index)
+ else
+ call gdadcp(dirfile, 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), ent%fragment_index)
+ end if
+ else if (ent%field_type .EQ. GD_RECIP_ENTRY) then
+ if (ent%comp_scal .EQ. 0) then
+ call gdadcr(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%dividend, &
+ ent%fragment_index)
+ else
+ call gdadrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cdividend, &
+ ent%fragment_index)
+ end if
+ 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 (ent%comp_scal .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 (ent%comp_scal .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 (ent%comp_scal .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_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))
+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, move_data)
+ integer, intent(in) :: dirfile, new_fragment, move_data
+ character (len=*), intent(in) :: field_code
+
+ call gdmove (dirfile, TRIM(field_code), LEN_TRIM(field_code), new_fragment, &
+ move_data)
+end subroutine
+
+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
+
+ if (ent%field_type .EQ. GD_RAW_ENTRY) then
+ call gdalrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ ent%data_type, ent%spf, recode)
+ else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
+ if (ent%comp_scal .NE. 0) then
+ call gdalcl(dirfile, 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 gdallc(dirfile, 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 gdallt(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)), recode)
+ else if (ent%field_type .EQ. GD_BIT_ENTRY) then
+ call gdalbt(dirfile, 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 gdalsb(dirfile, 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 gdalmt(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)))
+ else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then
+ call gdaldv(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)))
+ else if (ent%field_type .EQ. GD_PHASE_ENTRY) then
+ call gdalph(dirfile, 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_POLYNOM_ENTRY) then
+ if (ent%comp_scal .NE. 0) then
+ call gdalcp(dirfile, 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 gdalpn(dirfile, 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 (ent%comp_scal .NE. 0) then
+ call gdalcr(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cdividend)
+ else
+ call gdalrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+ TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), ent%dividend)
+ end if
+ 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, move_data)
+ integer, intent(in) :: dirfile, move_data
+ 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), move_data)
+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_carray_len (dirfile, field_code)
+ integer :: fgd_carray_len
+ integer, intent(in) :: dirfile
+ character (len=*), intent(in) :: field_code
+
+ ! call f77 library
+ call gdcaln(fgd_carray_len, dirfile, TRIM(field_code), LEN_TRIM(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
+ integer*1, dimension(array_len) :: zero
+
+ zero = 0
+
+ call gdalca(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, &
+ array_len)
+end subroutine
+
+end module
diff --git a/bindings/f77/test/Makefile.am b/bindings/f77/test/Makefile.am
new file mode 100644
index 0000000..da94ebf
--- /dev/null
+++ b/bindings/f77/test/Makefile.am
@@ -0,0 +1,65 @@
+# Copyright (C) 2008-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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if FC_WALL
+FC_WALL=-Wall
+endif
+
+if F77_WALL
+F77_WALL=-Wall
+endif
+
+if INTEL_F77_COMPILER
+F77_ASSUME=-assume byterecl
+endif
+
+if INTEL_FC_COMPILER
+FC_ASSUME=-assume byterecl
+endif
+
+if MAKE_F95BINDINGS
+F95TESTS=big_test95
+endif
+
+FFLAGS += -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME)
+FCFLAGS += -I.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
+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 *~
diff --git a/bindings/f77/test/Makefile.in b/bindings/f77/test/Makefile.in
new file mode 100644
index 0000000..f87ecb7
--- /dev/null
+++ b/bindings/f77/test/Makefile.in
@@ -0,0 +1,682 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+TESTS = gdcopn$(EXEEXT) big_test$(EXEEXT) $(am__EXEEXT_1)
+check_PROGRAMS = $(am__EXEEXT_2)
+subdir = bindings/f77/test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/config.h \
+ $(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+ at 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_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)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src
+F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
+LTF77COMPILE = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
+F77LD = $(F77)
+F77LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(big_test_SOURCES) $(big_test95_SOURCES) \
+ $(nodist_big_test95_SOURCES) $(gdcopn_SOURCES)
+DIST_SOURCES = $(big_test_SOURCES) $(big_test95_SOURCES) \
+ $(gdcopn_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
+FFLAGS = @FFLAGS@ -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME)
+FGETDATA_VERSION = @FGETDATA_VERSION@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at FC_WALL_TRUE@FC_WALL = -Wall
+ at F77_WALL_TRUE@F77_WALL = -Wall
+ at INTEL_F77_COMPILER_TRUE@F77_ASSUME = -assume byterecl
+ at INTEL_FC_COMPILER_TRUE@FC_ASSUME = -assume byterecl
+ at MAKE_F95BINDINGS_TRUE@F95TESTS = big_test95
+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):
+
+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)
+ @rm -f big_test$(EXEEXT)
+ $(F77LINK) $(big_test_OBJECTS) $(big_test_LDADD) $(LIBS)
+big_test95$(EXEEXT): $(big_test95_OBJECTS) $(big_test95_DEPENDENCIES)
+ @rm -f big_test95$(EXEEXT)
+ $(FCLINK) $(big_test95_OBJECTS) $(big_test95_LDADD) $(LIBS)
+gdcopn$(EXEEXT): $(gdcopn_OBJECTS) $(gdcopn_DEPENDENCIES)
+ @rm -f gdcopn$(EXEEXT)
+ $(F77LINK) $(gdcopn_OBJECTS) $(gdcopn_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f.o:
+ $(F77COMPILE) -c -o $@ $<
+
+.f.obj:
+ $(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f.lo:
+ $(LTF77COMPILE) -c -o $@ $<
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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; 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 \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-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 all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool clean-local \
+ ctags distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+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:
diff --git a/bindings/f77/test/big_test.f b/bindings/f77/test/big_test.f
new file mode 100644
index 0000000..f26bbd5
--- /dev/null
+++ b/bindings/f77/test/big_test.f
@@ -0,0 +1,3987 @@
+C Copyright (C) 2009-2010 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 GDFLSH
+C GDDSCD GDCLBK GDCLOS (although this last one is used)
+
+ PROGRAM BIGTST
+ INCLUDE "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 = 7)
+ INTEGER nfields
+ PARAMETER (nfields = 14)
+
+ CHARACTER*7 fields(nfields + 7)
+ CHARACTER*7 fn
+ CHARACTER*20 str
+ INTEGER*1 c(8)
+ INTEGER*1 datdat(80)
+ INTEGER*1 k
+ INTEGER i
+ INTEGER d
+ INTEGER e
+ INTEGER m
+ INTEGER n
+ INTEGER l
+ 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) = 'bit '
+ fields(3) = 'carray '
+ fields(4) = 'const '
+ fields(5) = 'data '
+ fields(6) = 'div '
+ fields(7) = 'lincom '
+ fields(8) = 'linterp'
+ fields(9) = 'mult '
+ fields(10) = 'phase '
+ fields(11) = 'polynom'
+ fields(12) = 'recip '
+ fields(13) = 'sbit '
+ fields(14) = 'string '
+
+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 /look/up/file'
+ 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, *) '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, *) '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')
+
+C 0: GDEROR check
+ CALL GDOPEN(d, "x", 1, GD_RO)
+ CALL GDEROR(e, d)
+
+ ne = 0
+ IF (e .NE. GD_EOP) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 0, e
+ ENDIF
+
+C 1: GDOPEN check
+ CALL GDOPEN(d, fildir, 12, GD_RW)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 1, e
+ ENDIF
+
+C 2: GDGETD check
+ CALL GDGETD(n, d, 'data', 4, 5, 0, 1, 0, GD_I8, c)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 2, e
+ ENDIF
+
+ IF (n .NE. 8) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 2, n
+ ENDIF
+
+ DO 20 i = 1, 8
+ IF (c(i) .NE. 40 + i) THEN
+ ne = ne + 1
+ WRITE(*, 2004) i, 2, c(i)
+ ENDIF
+ 20 CONTINUE
+
+C 3: GDGTCO check
+ CALL GDGTCO(d, 'const', 5, GD_F32, fl)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 3, e
+ ENDIF
+
+ IF (abs(fl - 5.5) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2005) 3, fl
+ ENDIF
+
+C 4: GDFDNX check
+ CALL GDFDNX(i, d)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 4, e
+ ENDIF
+
+ IF (i .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 4, i
+ ENDIF
+
+C 5: GDMFNX check
+ CALL GDMFNX(i, d, 'data', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 5, e
+ ENDIF
+
+ IF (i .NE. 6) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 5, i
+ ENDIF
+
+C 6: GDNFLD check
+ CALL GDNFLD(n, d)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 6, e
+ ENDIF
+
+ IF (n .NE. nfields) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 6, n
+ ENDIF
+
+C 7: This is a check of (one of many instances of) _GDF_FString
+ l = 2
+ CALL GDFLDN(fn, l, d, 1)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 7, e
+ ENDIF
+
+ IF (l .NE. 5) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 7, l
+ ENDIF
+
+C 8: GDFLDN check
+ DO 80 i = 1, n
+ l = flen
+ CALL GDFLDN(fn, l, d, i)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 8, i, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 8, i, l
+ ENDIF
+
+ IF (fn .NE. fields(i)) THEN
+ ne = ne + 1
+ WRITE(*, 2008) i, 8, fn
+ ENDIF
+ 80 CONTINUE
+
+C 9: GDNMFD check
+ CALL GDNMFD(n, d, 'data', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 9, e
+ ENDIF
+
+ IF (n .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 9, n
+ ENDIF
+
+C 10: GDMFDN check
+ fields(1) = 'mstr'
+ fields(2) = 'mconst'
+ fields(3) = 'mlut'
+ DO 100 i = 1, n
+ l = flen
+ CALL GDMFDN(fn, l, d, 'data', 4, i)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 10, i, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 10, i, l
+ ENDIF
+
+ IF (fn .NE. fields(i)) THEN
+ ne = ne + 1
+ WRITE(*, 2008) i, 10, fn
+ ENDIF
+ 100 CONTINUE
+
+C 11: GDNFRM check
+ CALL GDNFRM(n, d)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 11, e
+ ENDIF
+
+ IF (n .NE. 10) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 11, n
+ ENDIF
+
+C 12: GDGSPF check
+ CALL GDGSPF(n, d, 'data', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 12, e
+ ENDIF
+
+ IF (n .NE. 8) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 12, n
+ ENDIF
+
+C 13: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 13, e
+ ENDIF
+
+ IF (n .NE. 4) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 13, n
+ ENDIF
+
+ CALL GDGETD(n, d, 'data', 4, 5, 0, 1, 0, GD_I8, c)
+
+ DO 130 i = 1, 8
+ IF (((i .EQ. 1 .OR. i .GT. 5) .AND. c(i) .NE. 40 + i) .OR.
+ +(i .GT. 1 .AND. i .LT. 6) .AND. c(i) .NE. 11 + i) THEN
+ ne = ne + 1
+ WRITE(*, 2004) i, 13, c(i)
+ ENDIF
+ 130 CONTINUE
+
+C 14: GDESTR check
+ CALL GDGETD(n, d, 'x', 1, 5, 0, 1, 0, GD_I8, c)
+ CALL GDESTR(d, str, 20)
+
+ IF (str .NE. 'Field not found: x ') THEN
+ ne = ne + 1
+ WRITE(*, 2009) 14, str
+ ENDIF
+
+C 15: GDENTY check
+ CALL GDENTY(n, d, 'data', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 15, e
+ ENDIF
+
+ IF (n .NE. GD_RWE) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 15, n
+ ENDIF
+
+C 16: GDGERW check
+ CALL GDGERW(l, i, n, d, 'data', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 16, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 16, 1, n
+ ENDIF
+
+ IF (l .NE. 8) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 16, 2, l
+ ENDIF
+
+ IF (i .NE. GD_I8) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 16, 3, i
+ ENDIF
+
+C 17: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 17, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 17, 1, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 17, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 17, 3, n
+ ENDIF
+
+ IF (fields(1) .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 17, 4, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'INDEX') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 17, 5, fields(2)
+ ENDIF
+
+ IF (fields(3) .NE. 'linterp') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 17, 6, fields(3)
+ ENDIF
+
+ 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 170 i=1,6
+ IF (abs(p(i) - q(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 17, p(i)
+ ENDIF
+ 170 CONTINUE
+
+C 18: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 18, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 18, 1, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 18, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 18, 3, n
+ ENDIF
+
+ IF (fields(1) .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 18, 4, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'INDEX') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 18, 5, fields(2)
+ ENDIF
+
+ IF (fields(3) .NE. 'linterp') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 18, 6, fields(3)
+ ENDIF
+
+ cq(1) = cmplx(1.1, 0.0)
+ cq(2) = cmplx(2.2, 0.0)
+ cq(3) = cmplx(2.2, 0.0)
+ cq(4) = cmplx(3.3, 4.4)
+ cq(5) = cmplx(5.5, 0.0)
+ cq(6) = cmplx(5.5, 0.0)
+ DO 180 i=1,6
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 18, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 180 CONTINUE
+
+C 19: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 19, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 19, 1, l
+ ENDIF
+
+ IF (i .NE. 5) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 19, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 19, 3, n
+ ENDIF
+
+ IF (fn .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 19, 4, fn
+ ENDIF
+
+ 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 190 i=1,6
+ IF (abs(p(i) - q(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 19, p(i)
+ ENDIF
+ 190 CONTINUE
+
+C 20: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 20, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 20, 1, l
+ ENDIF
+
+ IF (i .NE. 5) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 20, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 20, 3, n
+ ENDIF
+
+ IF (fn .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 20, 4, fn
+ ENDIF
+
+ cq(1) = cmplx(1.1, 0.0)
+ cq(2) = cmplx(2.2, 0.0)
+ cq(3) = cmplx(2.2, 0.0)
+ cq(4) = cmplx(3.3, 4.4)
+ cq(5) = cmplx(5.5, 0.0)
+ cq(6) = cmplx(5.5, 0.0)
+ DO 200 i=1,6
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 30, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 200 CONTINUE
+
+C 21: GDGELT check
+ l = flen
+ CALL GDGELT(fn, l, str, 20, n, d, 'linterp', 7)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 21, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 21, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 21, 2, n
+ ENDIF
+
+ IF (fn .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 21, 3, fn
+ ENDIF
+
+ IF (str .NE. '/look/up/file') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 21, 4, str
+ ENDIF
+
+C 22: GDGEBT check
+ l = flen
+ CALL GDGEBT(fn, l, m, i, n, d, 'bit', 3)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 22, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 22, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 22, 2, n
+ ENDIF
+
+ IF (i .NE. 4) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 22, 3, i
+ ENDIF
+
+ IF (m .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 22, 4, m
+ ENDIF
+
+ IF (fn .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 22, 5, fn
+ ENDIF
+
+C 23: GDGESB check
+ l = flen
+ CALL GDGESB(fn, l, m, i, n, d, 'sbit', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 23, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 23, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 23, 2, n
+ ENDIF
+
+ IF (i .NE. 6) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 23, 3, i
+ ENDIF
+
+ IF (m .NE. 5) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 23, 4, m
+ ENDIF
+
+ IF (fn .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 23, 5, fn
+ ENDIF
+
+C 24: GDGEMT check
+ l = flen
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'mult', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 24, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 24, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 24, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 24, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'sbit') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 24, 4, fields(2)
+ ENDIF
+
+C 25: GDGEPH check
+ l = flen
+ CALL GDGEPH(fn, l, i, n, d, 'phase', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 25, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 25, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 25, 2, n
+ ENDIF
+
+ IF (i .NE. 11) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 25, 3, i
+ ENDIF
+
+ IF (fn .NE. 'data') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 25, 4, fn
+ ENDIF
+
+C 26: GDGECO check
+ CALL GDGECO(i, n, d, 'const', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 26, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 26, 1, n
+ ENDIF
+
+ IF (i .NE. GD_F64) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 26, 2, i
+ ENDIF
+
+C 27: GDFRGI check
+ CALL GDFRGI(n, d, 'const', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 27, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 27, n
+ ENDIF
+
+C 28: GDADRW check
+ CALL GDADRW(d, 'new1', 4, GD_F64, 3, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 28, 1, e
+ ENDIF
+
+ CALL GDGERW(l, i, n, d, 'new1', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 28, 2, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 28, 3, n
+ ENDIF
+
+ IF (l .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 28, 4, l
+ ENDIF
+
+ IF (i .NE. GD_F64) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 28, 5, i
+ ENDIF
+
+C 29: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 29, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 29, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 29, 3, l
+ ENDIF
+
+ IF (i .NE. 2) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 29, 4, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 29, 5, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 29, 6, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 29, 7, fields(2)
+ ENDIF
+
+ q(1) = 9.9
+ q(2) = 8.8
+ q(3) = 7.7
+ q(4) = 6.6
+ q(5) = 5.5
+ q(6) = 5.5
+ DO 290 i=1,4
+ IF (abs(p(i) - q(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 29, p(i)
+ ENDIF
+ 290 CONTINUE
+
+C 30: GDADCL check
+ cq(1) = cmplx(1.1, 1.2)
+ cq(2) = cmplx(1.3, 1.4)
+ cq(3) = cmplx(1.4, 1.5)
+ cq(4) = cmplx(1.6, 1.7)
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 30, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 30, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 30, 1, l
+ ENDIF
+
+ IF (i .NE. 2) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 30, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 30, 3, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 30, 4, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 30, 5, fields(2)
+ ENDIF
+
+ cq(1) = cmplx(1.1, 1.2)
+ cq(2) = cmplx(1.3, 1.4)
+ cq(3) = cmplx(1.4, 1.5)
+ cq(4) = cmplx(1.6, 1.7)
+ DO 300 i=1,4
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 30, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 300 CONTINUE
+
+C 31: GDADPN check
+ CALL GDADPN(d, 'new4', 4, 3, 'in1', 3, 3d3, 4d4, 5d5, 6d6, 0d0,
+ +0d0, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 31, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
+ +n, d, 'new4', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 31, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 31, 1, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 31, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 31, 3, n
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 31, 4, fn
+ ENDIF
+
+ q(1) = 3d3
+ q(2) = 4d4
+ q(3) = 5d5
+ q(4) = 6d6
+ q(5) = 5.5d0
+ q(6) = 5.5d0
+
+ DO 310 i=1,4
+ IF (abs(p(i) - q(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 31, p(i)
+ ENDIF
+ 310 CONTINUE
+
+C 32: GDADCP check
+ cq(1) = cmplx(3.1, 7.0)
+ cq(2) = cmplx(4.2, 8.0)
+ cq(3) = cmplx(5.2, 9.0)
+ cq(4) = cmplx(6.3, 4.4)
+ CALL GDADCP(d, 'new5', 4, 3, 'in1', 3, cq(1), cq(2), cq(3), cq(4),
+ +cq(5), cq(6), 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 32, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
+ +n, d, 'new5', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 32, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 32, 1, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 32, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 32, 3, n
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 32, 4, fn
+ ENDIF
+
+ cq(1) = cmplx(3.1, 7.0)
+ cq(2) = cmplx(4.2, 8.0)
+ cq(3) = cmplx(5.2, 9.0)
+ cq(4) = cmplx(6.3, 4.4)
+ DO 320 i=1,4
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 32, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 320 CONTINUE
+
+C 33: GDADLT check
+ CALL GDADLT(d, "new6", 4, "in", 2, "./some/table", 12, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 33, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGELT(fn, l, str, 20, n, d, 'new6', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 33, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 33, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 33, 2, n
+ ENDIF
+
+ IF (fn .NE. 'in') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 33, 3, fn
+ ENDIF
+
+ IF (str .NE. './some/table') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 33, 4, str
+ ENDIF
+
+C 34: GDADBT check
+ CALL GDADBT(d, "new7", 4, "in", 2, 13, 12, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 34, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEBT(fn, l, m, i, n, d, 'new7', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 34, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 34, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 34, 2, n
+ ENDIF
+
+ IF (i .NE. 12) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 34, 3, i
+ ENDIF
+
+ IF (m .NE. 13) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 34, 4, m
+ ENDIF
+
+ IF (fn .NE. 'in') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 34, 5, fn
+ ENDIF
+
+C 35: GDADSB check
+ CALL GDADSB(d, "new8", 4, "in", 2, 13, 12, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 35, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGESB(fn, l, m, i, n, d, 'new8', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 35, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 35, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 35, 2, n
+ ENDIF
+
+ IF (i .NE. 12) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 35, 3, i
+ ENDIF
+
+ IF (m .NE. 13) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 35, 4, m
+ ENDIF
+
+ IF (fn .NE. 'in') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 35, 5, fn
+ ENDIF
+
+C 36: GDADMT check
+ CALL GDADMT(d, 'new9', 4, 'in1', 3, 'in2', 3, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 36, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 36, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 36, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 36, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 36, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 36, 4, fields(2)
+ ENDIF
+
+C 37: GDADPH check
+ CALL GDADPH(d, 'new10', 5, 'in1', 3, 22, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 37, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 37, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 37, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 37, 2, n
+ ENDIF
+
+ IF (i .NE. 22) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 37, 3, i
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 37, 4, fn
+ ENDIF
+
+C 38: GDADCO check
+ CALL GDADCO(d, 'new11', 5, GD_F64, GD_F32, -8.1, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 38, 1, e
+ ENDIF
+
+ CALL GDGECO(i, n, d, 'new11', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 38, 2, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 38, 1, n
+ ENDIF
+
+ IF (i .NE. GD_F64) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 38, 2, i
+ ENDIF
+
+ CALL GDGTCO(d, 'new11', 5, GD_F32, fl)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 38, 3, e
+ ENDIF
+
+ IF (abs(fl + 8.1) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2005) 38, fl
+ ENDIF
+
+C 39: GDFRGN check
+ CALL GDFRGN(str, 20, d, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 39, e
+ ENDIF
+
+ IF (str .NE. 'test_dirfile/format') THEN
+ ne = ne + 1
+ WRITE(*, 2009), 39, str
+ ENDIF
+
+C 40: GDNFRG check
+ CALL GDNFRG(n, d)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 40, e
+ ENDIF
+
+ IF (n .NE. 1) THEN
+ ne = ne + 1
+ WRITE(*, 2002), 40, n
+ ENDIF
+
+C 41: GDINCL check
+ CALL GDINCL(d, 'form2', 5, 0, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 41, 3, e
+ ENDIF
+
+ CALL GDGTCO(d, 'const2', 6, GD_I8, c(1))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 41, 3, e
+ ENDIF
+
+ IF (c(1) .NE. -19) THEN
+ ne = ne + 1
+ WRITE(*, 2004) 1, 41, c(1)
+ ENDIF
+
+C 42: GDNFDT check
+ CALL GDNFDT(n, d, GD_LCE)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 42, e
+ ENDIF
+
+ IF (n .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2002), 42, n
+ ENDIF
+
+C 43: GDFDNT check
+ fields(1) = 'lincom'
+ fields(2) = 'new2'
+ fields(3) = 'new3'
+ DO 430 i = 1, n
+ l = flen
+ CALL GDFDNT(fn, l, d, GD_LCE, i)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 43, i, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 43, i, l
+ ENDIF
+
+ IF (fn .NE. fields(i)) THEN
+ ne = ne + 1
+ WRITE(*, 2008) i, 43, fn
+ ENDIF
+ 430 CONTINUE
+
+C 44: GDNVEC check
+ CALL GDNVEC(n, d)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 44, e
+ ENDIF
+
+ IF (n .NE. 21) THEN
+ ne = ne + 1
+ WRITE(*, 2002), 44, n
+ ENDIF
+
+C 45: GDVECN check
+ fields(1) = 'INDEX '
+ fields(2) = 'bit '
+ fields(3) = 'data '
+ fields(4) = 'div '
+ fields(5) = 'lincom '
+ fields(6) = 'linterp'
+ fields(7) = 'mult '
+ fields(8) = 'new1 '
+ fields(9) = 'new10 '
+ fields(10) = 'new2 '
+ fields(11) = 'new3 '
+ fields(12) = 'new4 '
+ fields(13) = 'new5 '
+ fields(14) = 'new6 '
+ fields(15) = 'new7 '
+ fields(16) = 'new8 '
+ fields(17) = 'new9 '
+ fields(18) = 'phase '
+ fields(19) = 'polynom'
+ fields(20) = 'recip '
+ fields(21) = 'sbit '
+ DO 450 i = 1, n
+ l = flen
+ CALL GDVECN(fn, l, d, i)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 45, i, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 45, i, l
+ ENDIF
+
+ IF (fn .NE. fields(i)) THEN
+ ne = ne + 1
+ WRITE(*, 2008) i, 45, fn
+ ENDIF
+ 450 CONTINUE
+
+C 46: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 46, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 46, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 46, 3, l
+ ENDIF
+
+ IF (i .NE. 2) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 46, 4, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 46, 5, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 46, 6, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 46, 7, fields(2)
+ ENDIF
+
+ q(1) = 9.9
+ q(2) = 8.8
+ q(3) = 7.7
+ q(4) = 6.6
+ q(5) = 5.5
+ q(6) = 5.5
+ DO 460 i=1,4
+ IF (abs(p(i) - q(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 46, p(i)
+ ENDIF
+ 460 CONTINUE
+
+C 47: GDMDCL check
+ cq(1) = cmplx(1.1, 1.2)
+ cq(2) = cmplx(1.3, 1.4)
+ cq(3) = cmplx(1.4, 1.5)
+ cq(4) = cmplx(1.6, 1.7)
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 47, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 47, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 47, 1, l
+ ENDIF
+
+ IF (i .NE. 2) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 47, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 47, 3, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 47, 4, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 47, 5, fields(2)
+ ENDIF
+
+ cq(1) = cmplx(1.1, 1.2)
+ cq(2) = cmplx(1.3, 1.4)
+ cq(3) = cmplx(1.4, 1.5)
+ cq(4) = cmplx(1.6, 1.7)
+ DO 470 i=1,4
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 47, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 470 CONTINUE
+
+C 48: GDMDPN check
+ CALL GDMDPN(d, 'data', 4, 'mnew3', 5, 3, 'in1', 3, 3d3, 4d4, 5d5,
+ +6d6, 0d0, 0d0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 48, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 48, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 48, 1, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 48, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 48, 3, n
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 48, 4, fn
+ ENDIF
+
+ q(1) = 3d3
+ q(2) = 4d4
+ q(3) = 5d5
+ q(4) = 6d6
+ q(5) = 5.5d0
+ q(6) = 5.5d0
+ DO 480 i=1,4
+ IF (abs(p(i) - q(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 48, p(i)
+ ENDIF
+ 480 CONTINUE
+
+C 49: GDMDCP check
+ cq(1) = cmplx(1.1, 0.0)
+ cq(2) = cmplx(2.2, 0.0)
+ cq(3) = cmplx(2.2, 0.0)
+ cq(4) = cmplx(3.3, 4.4)
+ CALL GDMDCP(d, 'data', 4, 'mnew5', 5, 3, 'in1', 3, cq(1), cq(2),
+ +cq(3), cq(4), cq(5), cq(6))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 49, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 49, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 49, 1, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 49, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 49, 3, n
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 49, 4, fn
+ ENDIF
+
+ cq(1) = cmplx(1.1, 0.0)
+ cq(2) = cmplx(2.2, 0.0)
+ cq(3) = cmplx(2.2, 0.0)
+ cq(4) = cmplx(3.3, 4.4)
+ DO 490 i=1,4
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 49, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 490 CONTINUE
+
+C 50: GDMDLT check
+ CALL GDMDLT(d, "data", 4, "mnew6", 5, "in", 2, "./more/table", 12)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 50, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGELT(fn, l, str, 20, n, d, 'data/mnew6', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 50, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 50, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 50, 2, n
+ ENDIF
+
+ IF (fn .NE. 'in') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 50, 3, fn
+ ENDIF
+
+ IF (str .NE. './more/table') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 50, 4, str
+ ENDIF
+
+C 51: GDMDBT check
+ CALL GDMDBT(d, "data", 4, "mnew7", 5, "in", 2, 13, 12)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 51, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEBT(fn, l, m, i, n, d, 'data/mnew7', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 51, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 51, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 51, 2, n
+ ENDIF
+
+ IF (i .NE. 12) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 51, 3, i
+ ENDIF
+
+ IF (m .NE. 13) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 51, 4, m
+ ENDIF
+
+ IF (fn .NE. 'in') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 51, 5, fn
+ ENDIF
+
+C 52: GDMDSB check
+ CALL GDMDSB(d, "data", 4, "mnew8", 5, "in", 2, 13, 12)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 52, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGESB(fn, l, m, i, n, d, 'data/mnew8', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 52, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 52, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 52, 2, n
+ ENDIF
+
+ IF (i .NE. 12) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 52, 3, i
+ ENDIF
+
+ IF (m .NE. 13) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 52, 4, m
+ ENDIF
+
+ IF (fn .NE. 'in') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 52, 5, fn
+ ENDIF
+
+C 53: GDMDMT check
+ CALL GDMDMT(d, 'data', 4, 'mnew9', 5, 'in1', 3, 'in2', 3)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 53, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'data/mnew9', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 53, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 53, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 53, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 53, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 53, 4, fields(2)
+ ENDIF
+
+C 54: GDMDPH check
+ CALL GDMDPH(d, 'data', 4, 'mnew10', 6, 'in1', 3, 22)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 54, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPH(fn, l, i, n, d, 'data/mnew10', 11)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 54, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 54, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 54, 2, n
+ ENDIF
+
+ IF (i .NE. 22) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 54, 3, i
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 54, 4, fn
+ ENDIF
+
+C 55: GDMDCO check
+ CALL GDMDCO(d, 'data', 4, 'mnew11', 6, GD_F64, GD_F32, -8.1)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 55, 1, e
+ ENDIF
+
+ CALL GDGECO(i, n, d, 'data/mnew11', 11)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 55, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 55, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 55, 2, n
+ ENDIF
+
+ IF (i .NE. GD_F64) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 55, 3, i
+ ENDIF
+
+ CALL GDGTCO(d, 'data/mnew11', 11, GD_F32, fl)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 55, 3, e
+ ENDIF
+
+ IF (abs(fl + 8.1) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2005) 55, fl
+ ENDIF
+
+C 56: GDGTST check
+ CALL GDGTST(n, d, 'string', 6, 20, str)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 56, e
+ ENDIF
+
+ IF (n .NE. 17) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 56, n
+ ENDIF
+
+ IF (str .NE. "Zaphod Beeblebrox") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 56, str
+ ENDIF
+
+C 57: GDADST check
+ CALL GDADST(d, 'new12', 5, "---string---", 12, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 57, 1, e
+ ENDIF
+
+ CALL GDGTST(n, d, 'new12', 5, 20, str)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 57, 2, e
+ ENDIF
+
+ IF (str .NE. "---string---") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 57, str
+ ENDIF
+
+C 58: GDMDST check
+ CALL GDMDST(d, "data", 4, 'mnew12', 6, "kai su, technon;", 16)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 58, 1, e
+ ENDIF
+
+ CALL GDGTST(n, d, 'data/mnew12', 11, 20, str)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 58, 2, e
+ ENDIF
+
+ IF (str .NE. "kai su, technon;") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 58, str
+ ENDIF
+
+C 59: GDADSP check
+ CALL GDADSP(d, 'lorem STRING "Lorem ipsum"', 26, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 59, 1, e
+ ENDIF
+
+ CALL GDGTST(n, d, 'lorem', 5, 20, str)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 59, 2, e
+ ENDIF
+
+ IF (str .NE. "Lorem ipsum") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 59, str
+ ENDIF
+
+C 60: GDMDSP check
+ CALL GDMDSP(d, 'ipsum STRING "dolor sit amet."', 30, 'lorem', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 60, 1, e
+ ENDIF
+
+ CALL GDGTST(n, d, 'lorem/ipsum', 11, 20, str)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 60, 2, e
+ ENDIF
+
+ IF (str .NE. "dolor sit amet.") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 60, str
+ ENDIF
+
+C 61: GDPTCO check
+ CALL GDPTCO(d, 'const', 5, GD_I32, 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 61, 1, e
+ ENDIF
+
+ CALL GDGTCO(d, 'const', 5, GD_F32, fl)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 61, 2, e
+ ENDIF
+
+ IF (abs(fl - 10) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2005) 61, fl
+ ENDIF
+
+C 62: GDPTST check
+ CALL GDPTST(n, d, 'string', 6, 11, "Arthur Dent")
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 62, 1, e
+ ENDIF
+
+ IF (n .NE. 11) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 62, n
+ ENDIF
+
+ CALL GDGTST(n, d, 'string', 6, 20, str)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 62, 2, e
+ ENDIF
+
+ IF (str .NE. "Arthur Dent") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 62, str
+ ENDIF
+
+C 63: GDNMFT check
+ CALL GDNMFT(n, d, "data", 4, GD_LCE)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 63, e
+ ENDIF
+
+ IF (n .NE. 2) THEN
+ ne = ne + 1
+ WRITE(*, 2002), 63, n
+ ENDIF
+
+C 64: GDMFDT check
+ fields(1) = 'mnew1'
+ fields(2) = 'mnew2'
+ DO 640 i = 1, n
+ l = flen
+ CALL GDMFDT(fn, l, d, "data", 4, GD_LCE, i)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 64, i, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 64, i, l
+ ENDIF
+
+ IF (fn .NE. fields(i)) THEN
+ ne = ne + 1
+ WRITE(*, 2008) i, 64, fn
+ ENDIF
+ 640 CONTINUE
+
+C 65: GDNMVE check
+ CALL GDNMVE(n, d, "data", 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 65, e
+ ENDIF
+
+ IF (n .NE. 10) THEN
+ ne = ne + 1
+ WRITE(*, 2002), 65, n
+ ENDIF
+
+C 66: 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 660 i = 1, n
+ l = flen
+ CALL GDMVEN(fn, l, d, "data", 4, i)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 66, i, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 66, i, l
+ ENDIF
+
+ IF (fn .NE. fields(i)) THEN
+ ne = ne + 1
+ WRITE(*, 2008) i, 66, fn
+ ENDIF
+ 660 CONTINUE
+
+C 67: GDALRW check
+ CALL GDALRW(d, 'new1', 4, GD_I32, 4, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 67, 1, e
+ ENDIF
+
+ CALL GDGERW(l, i, n, d, 'new1', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 67, 2, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 67, 3, n
+ ENDIF
+
+ IF (l .NE. 4) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 67, 4, l
+ ENDIF
+
+ IF (i .NE. GD_I32) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 67, 5, i
+ ENDIF
+
+C 68: 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 68, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 68, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 68, 3, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 68, 4, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 68, 5, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 68, 6, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in5') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 68, 7, fields(2)
+ ENDIF
+
+ IF (fields(3) .NE. 'in6') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 68, 8, fields(3)
+ ENDIF
+
+ 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 680 i=1,6
+ IF (abs(p(i) - q(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 68, p(i)
+ ENDIF
+ 680 CONTINUE
+
+C 69: GDALCL check
+ cq(1) = cmplx(0.1, 0.2)
+ cq(2) = cmplx(0.3, 0.4)
+ cq(3) = cmplx(0.4, 0.5)
+ cq(4) = cmplx(0.6, 0.7)
+ CALL GDALCL(d, 'new3', 4, 2, 'in4', 3, cq(1), cq(2), 'in3', 3,
+ +cq(3), cq(4), '', 0, cq(5), cq(6))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 69, 1, e
+ ENDIF
+
+ 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 GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 69, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 69, 1, l
+ ENDIF
+
+ IF (i .NE. 2) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 69, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 69, 3, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 69, 4, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in3') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 69, 5, fields(2)
+ ENDIF
+
+ cq(1) = cmplx(0.1, 0.2)
+ cq(2) = cmplx(0.3, 0.4)
+ cq(3) = cmplx(0.4, 0.5)
+ cq(4) = cmplx(0.6, 0.7)
+ DO 690 i=1,4
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 69, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 690 CONTINUE
+
+C 70: GDALPN check
+ CALL GDALPN(d, 'new4', 4, 4, 'in1', 3, 3d0, 4d0, 5d0, 6d0, 7d0,
+ +0d0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 70, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
+ +n, d, 'new4', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 70, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 70, 1, l
+ ENDIF
+
+ IF (i .NE. 4) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 70, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 70, 3, n
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 70, 4, fn
+ ENDIF
+
+ DO 700 i=1,5
+ IF (abs(p(i) - 2d0 - i) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) i, 70, p(i)
+ ENDIF
+ 700 CONTINUE
+
+C 71: GDALCP check
+ cq(1) = cmplx(1.1, 5.0)
+ cq(2) = cmplx(1.2, 4.0)
+ cq(3) = cmplx(1.2, 3.0)
+ cq(4) = cmplx(1.3, 2.4)
+ CALL GDALCP(d, 'new5', 4, 3, 'in1', 3, cq(1), cq(2), cq(3), cq(4),
+ +cq(5), cq(6))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 71, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
+ +n, d, 'new5', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 71, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 71, 1, l
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 71, 2, i
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 71, 3, n
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 71, 4, fn
+ ENDIF
+
+ cq(1) = cmplx(1.1, 5.0)
+ cq(2) = cmplx(1.2, 4.0)
+ cq(3) = cmplx(1.2, 3.0)
+ cq(4) = cmplx(1.3, 2.4)
+ DO 710 i=1,4
+ IF (abs(cp(i) - cq(i)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2011) i, 71, REAL(REAL(cp(i))), REAL(AIMAG(cp(i)))
+ ENDIF
+ 710 CONTINUE
+
+C 72: GDALLT check
+ CALL GDALLT(d, "new6", 4, "in3", 3, "./other/table", 13, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 72, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGELT(fn, l, str, 20, n, d, 'new6', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 72, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 72, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 72, 2, n
+ ENDIF
+
+ IF (fn .NE. 'in3') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 72, 3, fn
+ ENDIF
+
+ IF (str .NE. './other/table') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 72, 4, str
+ ENDIF
+
+C 73: GDALBT check
+ CALL GDALBT(d, "new7", 4, "in3", 3, 3, 2)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 73, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEBT(fn, l, m, i, n, d, 'new7', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 73, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 73, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 73, 2, n
+ ENDIF
+
+ IF (i .NE. 2) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 73, 3, i
+ ENDIF
+
+ IF (m .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 73, 4, m
+ ENDIF
+
+ IF (fn .NE. 'in3') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 73, 5, fn
+ ENDIF
+
+C 74: GDALSB check
+ CALL GDALSB(d, "new8", 4, "out", 3, 1, 22)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 74, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGESB(fn, l, m, i, n, d, 'new8', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 74, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 74, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 74, 2, n
+ ENDIF
+
+ IF (i .NE. 22) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 74, 3, i
+ ENDIF
+
+ IF (m .NE. 1) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 74, 4, m
+ ENDIF
+
+ IF (fn .NE. 'out') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 74, 5, fn
+ ENDIF
+
+C 75: GDALMT check
+ CALL GDALMT(d, 'new9', 4, 'in6', 3, 'in4', 3)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 75, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 75, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 75, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 75, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in6') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 75, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 75, 4, fields(2)
+ ENDIF
+
+C 76: GDALPH check
+ CALL GDALPH(d, 'new10', 5, 'in2', 3, 8)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 76, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 76, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 76, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 76, 2, n
+ ENDIF
+
+ IF (i .NE. 8) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 76, 3, i
+ ENDIF
+
+ IF (fn .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 76, 4, fn
+ ENDIF
+
+C 77: GDALCO check
+ CALL GDALCO(d, 'new11', 5, GD_F32)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 77, 1, e
+ ENDIF
+
+ CALL GDGECO(i, n, d, 'new11', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 77, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 77, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 77, 2, n
+ ENDIF
+
+ IF (i .NE. GD_F32) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 77, 3, i
+ ENDIF
+
+ CALL GDGTCO(d, 'new11', 5, GD_F32, fl)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 77, 3, e
+ ENDIF
+
+ IF (abs(fl + 8.1) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2005) 77, fl
+ ENDIF
+
+C 78: GDGENC check
+ CALL GDGENC(n, d, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 78, e
+ ENDIF
+
+ IF (n .NE. GD_EN) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 78, n
+ ENDIF
+
+C 79: GDGEND check
+ CALL GDGEND(n, d, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 79, e
+ ENDIF
+
+ IF (n .NE. (GD_LE + GD_NA)) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 79, n
+ ENDIF
+
+C 80: GDNAME check
+ l = 20
+ CALL GDNAME(str, l, d, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 80, e
+ ENDIF
+
+ IF (l .NE. 20) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 80, l
+ ENDIF
+
+ IF (str .NE. 'test_dirfile') THEN
+ ne = ne + 1
+ WRITE(*, 2009) 80, str
+ ENDIF
+
+C 81: GDPFRG check
+ CALL GDPFRG(n, d, 1)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 81, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 81, n
+ ENDIF
+
+C 82: GDAPRT check
+ CALL GDAPRT(d, GDPR_D, 1)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 82, e
+ ENDIF
+
+C 83: GDGPRT check
+ CALL GDGPRT(n, d, 1)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 83, e
+ ENDIF
+
+ IF (n .NE. GDPR_D) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 83, n
+ ENDIF
+
+C 84: GDRWFN check
+ l = 20
+ CALL GDRWFN(str, l, d, "data", 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 84, e
+ ENDIF
+
+ IF (l .NE. 20) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 84, l
+ ENDIF
+
+ IF (str .NE. 'test_dirfile/data') THEN
+ ne = ne + 1
+ WRITE(*, 2009) 84, str
+ ENDIF
+
+C 85: GDREFE check
+ l = 20
+ CALL GDREFE(str, l, d, "new1", 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 85, e
+ ENDIF
+
+ IF (l .NE. 20) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 85, l
+ ENDIF
+
+ IF (str .NE. 'new1') THEN
+ ne = ne + 1
+ WRITE(*, 2009) 85, str
+ ENDIF
+
+C 87: GDAENC check
+ CALL GDAENC(d, GD_ES, 1, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 87, 1, e
+ ENDIF
+
+ CALL GDGENC(n, d, 1)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 87, 2, e
+ ENDIF
+
+ IF (n .NE. GD_ES) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 87, n
+ ENDIF
+
+C 88: GDAEND check
+ CALL GDAEND(d, GD_BE, 1, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 88, 1, e
+ ENDIF
+
+ CALL GDGEND(n, d, 1)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 88, 2, e
+ ENDIF
+
+ IF (n .NE. GD_BE) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 88, n
+ ENDIF
+
+C 89: GDALSP check
+ CALL GDALSP(d, 'new10 PHASE in1 3', 17, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 89, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 89, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 89, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 89, 2, n
+ ENDIF
+
+ IF (i .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 89, 3, i
+ ENDIF
+
+ IF (fn .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 89, 4, fn
+ ENDIF
+
+C 90: GDDELE check
+ CALL GDDELE(d, 'new10', 5, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 90, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EBC) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 90, 2, e
+ ENDIF
+
+C 91: GDMLSP check
+ CALL GDMLSP(d, 'mnew10 PHASE in4 11', 19, 'data', 4, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 91, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEPH(fn, l, i, n, d, 'data/mnew10', 11)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 91, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 91, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 91, 2, n
+ ENDIF
+
+ IF (i .NE. 11) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 91, 3, i
+ ENDIF
+
+ IF (fn .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 91, 4, fn
+ ENDIF
+
+C 92: GDMOVE check
+ CALL GDMOVE(d, 'new9', 4, 1, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 92, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 92, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 92, 1, l
+ ENDIF
+
+ IF (n .NE. 1) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 92, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in6') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 92, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 92, 4, fields(2)
+ ENDIF
+
+C 93: GDRENM check
+ CALL GDRENM(d, 'new9', 4, 'newer', 5, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 93, 1, e
+ ENDIF
+
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EBC) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 93, 2, e
+ ENDIF
+
+ l = flen
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'newer', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 93, 3, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 93, 1, l
+ ENDIF
+
+ IF (n .NE. 1) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 93, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in6') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 93, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 93, 4, fields(2)
+ ENDIF
+
+C 94: GDUINC check
+ CALL GDUINC(d, 1, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 94, 1, e
+ ENDIF
+
+ CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'newer', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EBC) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 94, 2, e
+ ENDIF
+
+C 95: GDGFOF check
+ CALL GDGFOF(n, d, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 95, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 95, n
+ ENDIF
+
+C 96: GDAFOF check
+ CALL GDAFOF(d, 33, 0, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 96, e
+ ENDIF
+
+ CALL GDGFOF(n, d, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 96, e
+ ENDIF
+
+ IF (n .NE. 33) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 96, n
+ ENDIF
+
+C 97: GDNTYP check
+ CALL GDNTYP(n, d, 'data', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 97, e
+ ENDIF
+
+ IF (n .NE. GD_I8) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 97, n
+ ENDIF
+
+C 98: GDCSCL check
+ CALL GDCSCL(n, d, 'polynom', 7)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 98, e
+ ENDIF
+
+ IF (n .NE. 1) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 98, n
+ ENDIF
+
+C 99: GDVLDT check
+ CALL GDVLDT(n, d, 'new7', 4)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EBC) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 99, e
+ ENDIF
+
+ IF (n .NE. -1) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 99, n
+ ENDIF
+
+C 100: GDFNUM check
+ l = 20
+ CALL GDREFE(str, l, d, "data", 4)
+ CALL GDFNUM(dp, d, 'INDEX', 5, 33.3d0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 100, e
+ ENDIF
+
+ IF (abs(dp - 33.3) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2012) 100, dp
+ ENDIF
+
+C 101: GDFNSS check
+ CALL GDFNSS(dp, d, 'data', 4, 33.3d0, 6, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 101, e
+ ENDIF
+
+ IF (abs(dp - 37.0375) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2012) 101, dp
+ ENDIF
+
+C 138: GDGSCA check
+ l = 20
+ CALL GDGSCA(str, l, n, d, 'lincom', 6, 6)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 138, e
+ ENDIF
+
+ IF (n .NE. -1) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 138, n
+ ENDIF
+
+ IF (str .NE. "const") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 138, str
+ ENDIF
+
+C 139: GDASCA check
+ CALL GDASCA(d, 'lincom', 6, 6, 'new11', 5, -1, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 139, 1, e
+ ENDIF
+
+ l = 20
+ CALL GDGSCA(str, l, n, d, 'lincom', 6, 6)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 139, 2, e
+ ENDIF
+
+ IF (n .NE. -1) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 139, n
+ ENDIF
+
+ IF (str .NE. "new11") THEN
+ ne = ne + 1
+ WRITE(*, 2009) 139, str
+ ENDIF
+
+C 86: GDGEOF check
+ CALL GDGEOF(n, d, 'lincom', 6)
+ CALL GDEROR(e, d)
+
+ IF (e. NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 86, e
+ ENDIF
+
+ IF (n .NE. 344) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 86, n
+ ENDIF
+
+C 142: GDGBOF check
+ CALL GDGBOF(n, d, 'lincom', 6)
+ CALL GDEROR(e, d)
+
+ IF (e. NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 142, e
+ ENDIF
+
+ IF (n .NE. 264) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 142, n
+ ENDIF
+
+C 143: GDGEDV check
+ l = flen
+ CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'div', 3)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 143, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 143, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 143, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'mult') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 143, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'bit') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 143, 4, fields(2)
+ ENDIF
+
+C 144: GDGERC check
+ l = flen
+ CALL GDGERC(fields(1), l, dp, n, d, 'recip', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 144, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 144, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 144, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'div') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 144, 3, fields(1)
+ ENDIF
+
+ IF (abs(dp - 6.5) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2012) 144, dp
+ ENDIF
+
+C 145: GDGECR check
+ l = flen
+ CALL GDGECR(fields(1), l, dc, n, d, 'recip', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 145, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 145, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 145, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'div') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 145, 3, fields(1)
+ ENDIF
+
+ IF (abs(dc - cmplx(6.5, 4.3)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2013) 145, REAL(REAL(dc)), REAL(AIMAG(dc))
+ ENDIF
+
+C 146: GDADDV check
+ CALL GDADDV(d, 'new14', 5, 'in1', 3, 'in2', 3, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 146, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'new14', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 146, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 146, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 146, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 146, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in2') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 146, 4, fields(2)
+ ENDIF
+
+C 147: GDADRC check
+ p(1) = 31.9
+ CALL GDADRC(d, 'new15', 5, 'in1', 3, p(1), 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 147, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGERC(fields(1), l, dp, n, d, 'new15', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 147, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 147, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 147, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 147, 3, fields(1)
+ ENDIF
+
+ IF (abs(dp - p(1)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2012) 147, dp
+ ENDIF
+
+C 148: GDADCR check
+ cp(1) = cmplx(31.9, 38.2)
+ CALL GDADCR(d, 'new16', 5, 'in1', 3, cp(1), 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 148, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGECR(fields(1), l, dc, n, d, 'new16', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 148, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 148, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 148, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in1') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 148, 3, fields(1)
+ ENDIF
+
+ IF (abs(dc - cp(1)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2013) 148, dc
+ ENDIF
+
+C 149: GDMDDV check
+ CALL GDMDDV(d, 'data', 4, 'new14', 5, 'in3', 3, 'in4', 3)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 149, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'data/new14', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 149, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 149, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 149, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in3') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 149, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 149, 4, fields(2)
+ ENDIF
+
+C 150: GDMDRC check
+ p(1) = 95.5
+ CALL GDMDRC(d, 'data', 4, 'new15', 5, 'in0', 3, p(1))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 150, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGERC(fields(1), l, dp, n, d, 'data/new15', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 150, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 150, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 150, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in0') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 150, 3, fields(1)
+ ENDIF
+
+ IF (abs(dp - p(1)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2012) 150, dp
+ ENDIF
+
+C 151: GDADCR check
+ cp(1) = cmplx(8.47, 6.22)
+ CALL GDMDCR(d,'data', 4, 'new16', 5, 'in3', 3, cp(1))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 151, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGECR(fields(1), l, dc, n, d, 'data/new16', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 151, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 151, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 151, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in3') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 151, 3, fields(1)
+ ENDIF
+
+ IF (abs(dc - cp(1)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2013) 151, dc
+ ENDIF
+
+C 152: GDALDV check
+ CALL GDALDV(d, 'new14', 5, 'in6', 3, 'in4', 3)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 152, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'new14', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 152, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 152, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 152, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in6') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 152, 3, fields(1)
+ ENDIF
+
+ IF (fields(2) .NE. 'in4') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 152, 4, fields(2)
+ ENDIF
+
+C 153: GDALRC check
+ p(1) = 0.187
+ CALL GDALRC(d, 'new15', 5, 'in5', 3, p(1))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 153, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGERC(fields(1), l, dp, n, d, 'new15', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 153, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 153, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 153, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in5') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 153, 3, fields(1)
+ ENDIF
+
+ IF (abs(dp - p(1)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2012) 153, dp
+ ENDIF
+
+C 154: GDALCR check
+ cp(1) = cmplx(4.3, 81.81)
+ CALL GDALCR(d, 'new16', 5, 'in6', 3, cp(1))
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 154, 1, e
+ ENDIF
+
+ l = flen
+ CALL GDGECR(fields(1), l, dc, n, d, 'new16', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 154, 2, e
+ ENDIF
+
+ IF (l .NE. flen) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 154, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 154, 2, n
+ ENDIF
+
+ IF (fields(1) .NE. 'in6') THEN
+ ne = ne + 1
+ WRITE(*, 2008) 154, 3, fields(1)
+ ENDIF
+
+ IF (abs(dc - cp(1)) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2013) 154, dc
+ ENDIF
+
+C 155: GDRFRG check
+ CALL GDRFRG(d, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001), 155, e
+ ENDIF
+
+C 156: GDINVD check
+ CALL GDINVD(m)
+ CALL GDEROR(e, m)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006), 156, 1, e
+ ENDIF
+
+ CALL GDNFRG(n, m)
+ CALL GDEROR(e, m)
+
+ IF (e .NE. GD_EBD) THEN
+ ne = ne + 1
+ WRITE(*, 2006), 156, 2, e
+ ENDIF
+
+ CALL GDCLOS(m)
+
+C 157: GDSTDV check
+ n = GDSV_C
+ CALL GDSTDV(n, d)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006), 157, 1, e
+ ENDIF
+
+ IF (n .NE. 8) THEN
+ ne = ne + 1
+ WRITE(*, 2002), 157, n
+ ENDIF
+
+ n = 0
+ CALL GDSTDV(n, d)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EVR) THEN
+ ne = ne + 1
+ WRITE(*, 2006), 157, 2, e
+ ENDIF
+
+C 158: GDGTCA check
+ CALL GDGTCA(d, 'carray', 6, GD_F64, p)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 158, e
+ ENDIF
+
+ DO 1580 i=1,6
+ IF (abs(p(i) - 1.1 * i) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) 158, i, p(i)
+ ENDIF
+ 1580 CONTINUE
+
+C 159: GDGCAS check
+ CALL GDGCAS(d, 'carray', 6, 3, 2, GD_F64, p)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 159, e
+ ENDIF
+
+ DO 1590 i=1,2
+ IF (abs(p(i) - 2.2 - 1.1 * i) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) 159, i, p(i)
+ ENDIF
+ 1590 CONTINUE
+
+C 168: GDPTCA check
+ p(1) = 9.6
+ p(2) = 8.5
+ p(3) = 7.4
+ p(4) = 6.3
+ p(5) = 5.2
+ p(6) = 4.1
+ CALL GDPTCA(d, 'carray', 6, GD_F64, p)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 168, 1, e
+ ENDIF
+
+ CALL GDGTCA(d, 'carray', 6, GD_F64, q)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 168, 2, e
+ ENDIF
+
+ DO 1680 i=1,6
+ IF (abs(q(i) - 10.7 + 1.1 * i) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) 168, i, p(i)
+ ENDIF
+ 1680 CONTINUE
+
+C 169: GDGCAS check
+ p(1) = 5.5
+ p(2) = 5.6
+ p(3) = 5.7
+ p(4) = 5.8
+ p(5) = 5.9
+ p(6) = 6.0
+ CALL GDPCAS(d, 'carray', 6, 3, 2, GD_F64, p)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 169, 1, e
+ ENDIF
+
+ CALL GDGTCA(d, 'carray', 6, GD_F64, q)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 169, 2, e
+ ENDIF
+
+ DO 1690 i=1,6
+ IF (i .eq. 3 .or. i .eq. 4) THEN
+ IF (abs(q(i) - 5.2 - 0.1 * i) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) 169, i, p(i)
+ ENDIF
+ ELSE
+ IF (abs(q(i) - 10.7 + 1.1 * i) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2010) 169, i, p(i)
+ ENDIF
+ ENDIF
+ 1690 CONTINUE
+
+C 177: GDCALN check
+ CALL GDCALN(n, d, 'carray', 6)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 177, e
+ ENDIF
+
+ IF (n .NE. 6) THEN
+ ne = ne + 1
+ WRITE(*, 2002) 177, n
+ ENDIF
+
+C 178: GDGECA check
+ CALL GDGECA(i, l, n, d, 'carray', 6)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2001) 178, e
+ ENDIF
+
+ IF (l .NE. 6) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 178, 1, l
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 178, 2, n
+ ENDIF
+
+ IF (i .NE. GD_F64) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 178, 3, i
+ ENDIF
+
+C 179: GDADCA check
+ p(1) = 1.2
+ p(2) = 3.4
+ p(3) = 5.6
+ p(4) = 7.8
+ CALL GDADCA(d, 'new17', 5, GD_F64, 4, GD_F64, p, 0)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 179, 1, e
+ ENDIF
+
+ CALL GDGECA(i, l, n, d, 'new17', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 179, 2, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 179, 1, n
+ ENDIF
+
+ IF (i .NE. GD_F64) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 179, 2, i
+ ENDIF
+
+ IF (l .NE. 4) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 179, 3, l
+ ENDIF
+
+ CALL GDGTCA(d, 'new17', 5, GD_F64, q)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 179, 3, e
+ ENDIF
+
+ DO 1790 i=1,4
+ IF (abs(q(i) + 1.0 - i * 2.2) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2005) 179, fl
+ ENDIF
+ 1790 CONTINUE
+
+C 180: GDMDCA check
+ p(1) = 3.2
+ p(2) = 5.4
+ p(3) = 7.6
+ p(4) = 9.8
+ CALL GDMDCA(d, 'data', 4, 'new17', 5, GD_F64, 4, GD_F64, p)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 180, 1, e
+ ENDIF
+
+ CALL GDGECA(i, l, n, d, 'data/new17', 10)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 180, 2, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 180, 1, n
+ ENDIF
+
+ IF (i .NE. GD_F64) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 180, 2, i
+ ENDIF
+
+ IF (l .NE. 4) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 180, 3, l
+ ENDIF
+
+ CALL GDGTCA(d, 'data/new17', 10, GD_F64, q)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 180, 3, e
+ ENDIF
+
+ DO 1800 i=1,4
+ IF (abs(q(i) - 1.0 - i * 2.2) .gt. 0.001) THEN
+ ne = ne + 1
+ WRITE(*, 2005) 180, fl
+ ENDIF
+ 1800 CONTINUE
+
+C 181: GDALCA check
+ CALL GDALCA(d, 'new17', 5, GD_F32, 3)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 181, 1, e
+ ENDIF
+
+ CALL GDGECA(i, l, n, d, 'new17', 5)
+ CALL GDEROR(e, d)
+
+ IF (e .NE. GD_EOK) THEN
+ ne = ne + 1
+ WRITE(*, 2006) 181, 2, e
+ ENDIF
+
+ IF (n .NE. 0) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 181, 1, n
+ ENDIF
+
+ IF (i .NE. GD_F32) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 181, 2, i
+ ENDIF
+
+ IF (l .NE. 3) THEN
+ ne = ne + 1
+ WRITE(*, 2007) 181, 3, l
+ ENDIF
+
+
+
+
+
+
+
+
+
+
+C ===============================================================
+C Cleanup
+ CALL GDDSCD(d)
+
+ CALL SYSTEM ( 'rm -rf ' // fildir )
+
+ IF (ne .GT. 0) THEN
+ WRITE(*, 2003) ne
+ CALL EXIT(1)
+ ENDIF
+
+ 2001 FORMAT('e[', i3, '] = ', i4)
+ 2002 FORMAT('n[', i3, '] = ', i4)
+ 2003 FORMAT('ne = ', i8)
+ 2004 FORMAT('c(', i3, ')[', i3, '] = ', i2)
+ 2005 FORMAT('fl[', i3, '] = ', f0.16)
+ 2006 FORMAT('e[', i3, ', ', i3, '] = ', i4)
+ 2007 FORMAT('n[', i3, ', ', i3, '] = ', i4)
+ 2008 FORMAT('fn(', i3, ')[', i3, '] = "', a, '"')
+ 2009 FORMAT('s[', i3, '] = "', a, '"')
+ 2010 FORMAT('p(', i3, ')[', i3, '] = ', d16.10)
+ 2011 FORMAT('p(', i3, ')[', i3, '] = ', d16.10, ';', d16.10)
+ 2012 FORMAT('d[', i3, '] = ', d16.10)
+ 2013 FORMAT('x[', i3, '] = ', d16.10, ';', d16.10)
+
+ STOP
+ END
diff --git a/bindings/f77/test/big_test95.f90 b/bindings/f77/test/big_test95.f90
new file mode 100644
index 0000000..af28bd2
--- /dev/null
+++ b/bindings/f77/test/big_test95.f90
@@ -0,0 +1,4797 @@
+! 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
+!
+! -*- F95 -*-
+
+! General test
+!
+! This very large test checks almost every procedure defined by the F95
+! bindings. Procedures not tested include: fgd_copen fgd_metaflush
+! fgd_flush fgd_discard fgd_callback fgd_close
+! (although this last one is used)
+
+program big_test
+ use getdata
+ 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 = 7
+ integer, parameter :: nfields = 14
+
+ character (len=flen), dimension(nfields + 8) :: fields
+ character (len=flen), dimension(nfields + 8) :: flist
+ character (len=GD_FIELD_LEN) :: str
+ integer(1), dimension(80) :: datadata
+ integer :: i, d, e, n, l, ne
+ real :: fl
+ double precision :: dp
+ 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 ', 'bit ', 'carray ', 'const ', 'data ', 'div ', &
+ 'lincom ', 'linterp', 'mult ', 'phase ', 'polynom', 'recip ', 'sbit ', &
+ 'string ', ' ', ' ', ' ', ' ', ' ', ' ', &
+ ' ', ' ' /)
+
+ 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 /look/up/file'
+ 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, *) '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, *) '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')
+
+! fgd_error check
+ d = fgd_open('x', GD_RDONLY)
+ e = fgd_error(d)
+
+ ne = 0
+ if (e .ne. GD_E_OPEN) then
+ ne = ne + 1
+ write(*, 2001), 0, e
+ end if
+
+! 1: fgd_open check
+ d = fgd_open(fildir, GD_RDWR)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 1, e
+ end if
+
+! 2: fgd_getdata_i1 check
+ n = fgd_getdata_i1(d, 'data', 5, 0, 1, 0, ci1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 2, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 2, n
+ end if
+
+ do i=1,8
+ if (ci1(i) .ne. 40 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 2, ci1(i)
+ end if
+ end do
+
+! 102: fgd_getdata_i2 check
+ n = fgd_getdata_i2(d, 'data', 5, 0, 1, 0, ci2)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 102, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 102, n
+ end if
+
+ do i=1,8
+ if (ci2(i) .ne. 40 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 102, ci2(i)
+ end if
+ end do
+
+! 103: fgd_getdata_i4 check
+ n = fgd_getdata_i4(d, 'data', 5, 0, 1, 0, ci4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 103, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 103, n
+ end if
+
+ do i=1,8
+ if (ci4(i) .ne. 40 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 103, ci4(i)
+ end if
+ end do
+
+! 104: fgd_getdata_i8 check
+ n = fgd_getdata_i8(d, 'data', 5, 0, 1, 0, ci8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 104, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 104, n
+ end if
+
+ do i=1,8
+ if (ci8(i) .ne. 40 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 104, ci8(i)
+ end if
+ end do
+
+! 105: fgd_getdata_r4 check
+ n = fgd_getdata_r4(d, 'data', 5, 0, 1, 0, cr4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 105, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 105, n
+ end if
+
+ do i=1,8
+ if (abs(cr4(i) - 40 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2010) i, 105, cr4(i)
+ end if
+ end do
+
+! 106: fgd_getdata_r8 check
+ n = fgd_getdata_r8(d, 'data', 5, 0, 1, 0, cr8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 106, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 106, n
+ end if
+
+ do i=1,8
+ if (abs(cr8(i) - 40 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2010) i, 106, cr8(i)
+ end if
+ end do
+
+! 107: fgd_getdata_c8 check
+ n = fgd_getdata_c8(d, 'data', 5, 0, 1, 0, cc8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 107, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 107, n
+ end if
+
+ do i=1,8
+ if (abs(cc8(i) - 40 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2011) i, 107, real(real(cc8(i))), real(aimag(cc8(i)))
+ end if
+ end do
+
+! 108: fgd_getdata_c16 check
+ n = fgd_getdata_c16(d, 'data', 5, 0, 1, 0, cc16)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 108, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 108, n
+ end if
+
+ do i=1,8
+ if (abs(cc16(i) - 40 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2011) i, 107, real(real(cc16(i))), real(aimag(cc16(i)))
+ end if
+ end do
+
+! 109: fgd_getdata_n check
+ n = fgd_getdata_n(d, 'data', 5, 0, 1, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 109, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 109, n
+ end if
+
+! 3: fgd_get_constant_i1 check
+ call fgd_get_constant_i1(d, 'const', ci1(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 3, e
+ end if
+
+ if (ci1(1) .ne. 5) then
+ ne = ne + 1
+ write(*, 2002) 3, ci1(1)
+ end if
+
+! 110: fgd_get_constant_i2 check
+ call fgd_get_constant_i2(d, 'const', ci2(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 110, e
+ end if
+
+ if (ci2(1) .ne. 5) then
+ ne = ne + 1
+ write(*, 2002) 110, ci2(1)
+ end if
+
+! 111: fgd_get_constant_i4 check
+ call fgd_get_constant_i4(d, 'const', ci4(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 111, e
+ end if
+
+ if (ci4(1) .ne. 5) then
+ ne = ne + 1
+ write(*, 2002) 111, ci4(1)
+ end if
+
+! 112: fgd_get_constant_i8 check
+ call fgd_get_constant_i8(d, 'const', ci8(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 112, e
+ end if
+
+ if (ci8(1) .ne. 5) then
+ ne = ne + 1
+ write(*, 2002) 112, ci8(1)
+ end if
+
+! 113: fgd_get_constant_r4 check
+ call fgd_get_constant_r4(d, 'const', cr4(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 113, e
+ end if
+
+ if (abs(cr4(1) - 5.5) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2005) 113, cr4(1)
+ end if
+
+! 114: fgd_get_constant_r8 check
+ call fgd_get_constant_r8(d, 'const', cr8(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 114, e
+ end if
+
+ if (abs(cr8(1) - 5.5) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2012) 114, cr8(1)
+ end if
+
+! 115: fgd_get_constant_c8 check
+ call fgd_get_constant_c8(d, 'const', cc8(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 115, e
+ end if
+
+ if (abs(cc8(1) - 5.5) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2013) 115, real(real(cc8(i))), real(aimag(cc8(i)))
+ end if
+
+! 116: fgd_get_constant_c16 check
+ call fgd_get_constant_c16(d, 'const', cc16(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 116, e
+ end if
+
+ if (abs(cc16(1) - 5.5) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2013) 116, real(real(cc16(i))), real(aimag(cc16(i)))
+ end if
+
+! 117: fgd_get_constant_n check
+ call fgd_get_constant_n(d, 'const')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 117, e
+ end if
+
+! 4: fgd_field_name_max check
+ i = fgd_field_name_max(d)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 4, e
+ end if
+
+ if (i .ne. flen) then
+ ne = ne + 1
+ write(*, 2002) 4, i
+ end if
+
+! 5: fgd_mfield_name_max check
+ i = fgd_mfield_name_max(d, 'data')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 5, e
+ end if
+
+ if (i .ne. 6) then
+ ne = ne + 1
+ write(*, 2002) 5, i
+ end if
+
+! 6: fgd_nfields check
+ n = fgd_nfields(d)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 6, e
+ end if
+
+ if (n .ne. nfields) then
+ ne = ne + 1
+ write(*, 2002) 6, n
+ end if
+
+! 8: fgd_field_list check
+ l = flen
+ call fgd_field_list(flist, d, l)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 8, e
+ end if
+
+ if (l .ne. flen) then
+ ne = ne + 1
+ write(*, 2002) 8, l
+ end if
+
+ do i = 1, n
+ if (flist(i) .ne. fields(i)) then
+ ne = ne + 1
+ write(*, 2008) i, 8, flist(i)
+ end if
+ end do
+
+! 9: fgd_nmfields check
+ n = fgd_nmfields(d, 'data')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 9, e
+ end if
+
+ if (n .ne. 3) then
+ ne = ne + 1
+ write(*, 2002) 9, n
+ end if
+
+! 10: fgd_mfield_list check
+ fields(1) = 'mstr'
+ fields(2) = 'mconst'
+ fields(3) = 'mlut'
+
+ l = flen
+ call fgd_mfield_list(flist, d, 'data', l)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 10, i, e
+ end if
+
+ if (l .ne. flen) then
+ ne = ne + 1
+ write(*, 2007) 10, i, l
+ end if
+
+ DO i = 1, n
+ if (flist(i) .ne. fields(i)) then
+ ne = ne + 1
+ write(*, 2008) i, 10, flist(i)
+ end if
+ end do
+
+! 11: fgd_nframes check
+ n = fgd_nframes(d)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 11, e
+ end if
+
+ if (n .ne. 10) then
+ ne = ne + 1
+ write(*, 2002) 11, n
+ end if
+
+! 12: fgd_spf check
+ n = fgd_spf(d, 'data')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 12, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002) 12, n
+ end if
+
+! 13: fgd_putdata_i1 check
+ ci1 = (/ 13_1, 14_1, 15_1, 16_1, 17_1, 18_1, 19_1, 20_1 /)
+ n = fgd_putdata_i1(d, 'data', 5, 1, 0, 4, ci1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 13, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 13, n
+ end if
+
+ n = fgd_getdata_i1(d, 'data', 5, 0, 1, 0, ci1)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. ci1(i) .ne. 40 + i) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. ci1(i) .ne. 11 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 13, ci1(i)
+ end if
+ end do
+
+! 118: 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 118, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 118, n
+ end if
+
+ n = fgd_getdata_i2(d, 'data', 5, 0, 1, 0, ci2)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. ci2(i) .ne. 40 + i) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. ci2(i) .ne. 21 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 118, ci2(i)
+ end if
+ end do
+
+! 119: fgd_putdata_i4 check
+ ci4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /)
+ n = fgd_putdata_i4(d, 'data', 5, 1, 0, 4, ci4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 119, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 119, n
+ end if
+
+ n = fgd_getdata_i4(d, 'data', 5, 0, 1, 0, ci4)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. ci4(i) .ne. 40 + i) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. ci4(i) .ne. 31 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 119, ci4(i)
+ end if
+ end do
+
+! 120: fgd_putdata_i8 check
+ ci8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /)
+ n = fgd_putdata_i8(d, 'data', 5, 1, 0, 4, ci8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 120, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 120, n
+ end if
+
+ n = fgd_getdata_i8(d, 'data', 5, 0, 1, 0, ci8)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. ci8(i) .ne. 40 + i) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. ci8(i) .ne. 41 + i) then
+ ne = ne + 1
+ write(*, 2004) i, 120, ci8(i)
+ end if
+ end do
+
+! 121: fgd_putdata_r4 check
+ cr4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /)
+ n = fgd_putdata_r4(d, 'data', 5, 1, 0, 4, cr4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 121, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 121, n
+ end if
+
+ n = fgd_getdata_r4(d, 'data', 5, 0, 1, 0, cr4)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. abs(cr4(i) - 40 - i) .gt. 1e-5) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. abs(cr4(i) - 31 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2010) i, 121, cr4(i)
+ end if
+ end do
+
+! 122: fgd_putdata_r8 check
+ cr8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /)
+ n = fgd_putdata_r8(d, 'data', 5, 1, 0, 4, cr8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 122, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 122, n
+ end if
+
+ n = fgd_getdata_r8(d, 'data', 5, 0, 1, 0, cr8)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. abs(cr8(i) - 40 - i) .gt. 1e-5) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. abs(cr8(i) - 41 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2010) i, 122, cr8(i)
+ end if
+ end do
+
+! 123: fgd_putdata_c8 check
+ cc8 = (/ 53, 54, 55, 56, 57, 58, 59, 60 /)
+ n = fgd_putdata_c8(d, 'data', 5, 1, 0, 4, cc8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 123, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 123, n
+ end if
+
+ n = fgd_getdata_c8(d, 'data', 5, 0, 1, 0, cc8)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. abs(cc8(i) - 40 - i) .gt. 1e-5) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. abs(cc8(i) - 51 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2011) i, 123, real(real(cc8(i))), real(aimag(cc8(i)))
+ end if
+ end do
+
+! 124: fgd_putdata_c16 check
+ cc16 = (/ 63, 64, 65, 66, 67, 68, 69, 70 /)
+ n = fgd_putdata_c16(d, 'data', 5, 1, 0, 4, cc16)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 124, e
+ end if
+
+ if (n .ne. 4) then
+ ne = ne + 1
+ write(*, 2002) 124, n
+ end if
+
+ n = fgd_getdata_c16(d, 'data', 5, 0, 1, 0, cc16)
+
+ DO i = 1, 8
+ if (((i .EQ. 1 .OR. i .GT. 5) .AND. abs(cc16(i) - 40 - i) .gt. 1e-5) .OR. &
+ (i .GT. 1 .AND. i .LT. 6) .AND. abs(cc16(i) - 61 - i) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2011) i, 124, real(real(cc16(i))), real(aimag(cc16(i)))
+ end if
+ end do
+
+! 14: fgd_error_string check
+ n = fgd_getdata_n(d, 'x', 5, 0, 1, 0)
+ call fgd_error_string(d, str, GD_FIELD_LEN)
+
+ if (str .ne. 'Field not found: x') then
+ ne = ne + 1
+ write(*, 2009) 14, str
+ end if
+
+! 15: fgd_entry_type check
+ n = fgd_entry_type(d, 'data')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 15, e
+ end if
+
+ if (n .ne. GD_RAW_ENTRY) then
+ ne = ne + 1
+ write(*, 2002) 15, n
+ end if
+
+! 16: fgd_entry (raw) check
+ n = fgd_entry(d, 'data', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 16, e
+ end if
+
+ if (n .ne. GD_RAW_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 16, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 16, 2, ent%fragment_index
+ end if
+
+ if (ent%spf .ne. 8) then
+ ne = ne + 1
+ write(*, 2007) 16, 3, ent%spf
+ end if
+
+ if (ent%data_type .ne. GD_INT8) then
+ ne = ne + 1
+ write(*, 2007) 16, 4, ent%data_type
+ end if
+
+! 18: fgd_entry (lincom) check
+ n = fgd_entry(d, 'lincom', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 18, e
+ end if
+
+ if (n .ne. GD_LINCOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 18, 1, n
+ end if
+
+ if (ent%n_fields .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 18, 2, ent%n_fields
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 18, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'data') then
+ ne = ne + 1
+ write(*, 2008) 18, 4, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'INDEX') then
+ ne = ne + 1
+ write(*, 2008) 18, 5, ent%field(2)
+ end if
+
+ if (ent%field(3) .ne. 'linterp') then
+ ne = ne + 1
+ write(*, 2008) 18, 6, ent%field(3)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 18, 7, ent%comp_scal
+ end if
+
+ if (ent%scalar(3) .ne. 'const') then
+ ne = ne + 1
+ write(*, 2008) 18, 8, ent%scalar(3)
+ end if
+
+ if (ent%scalar(6) .ne. 'const') then
+ ne = ne + 1
+ write(*, 2008) 18, 9, ent%scalar(6)
+ end if
+
+ 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)
+ cq(5) = dcmplx(5.5, 0.0)
+ cq(6) = dcmplx(5.5, 0.0)
+ DO i=1,3
+ if (abs(ent%cm(i) - cq(i * 2 - 1)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2 - 1, 18, ent%m(i)
+ end if
+ if (abs(ent%cb(i) - cq(i * 2)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2, 18, ent%b(i)
+ end if
+ end do
+
+! 20: fgd_entry (polynom) check
+ n = fgd_entry(d, 'polynom', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 20, e
+ end if
+
+ if (n .ne. GD_POLYNOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 20, 1, n
+ end if
+
+ if (ent%poly_ord .ne. 5) then
+ ne = ne + 1
+ write(*, 2007) 20, 2, ent%n_fields
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 20, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'data') then
+ ne = ne + 1
+ write(*, 2008) 20, 4, ent%field(1)
+ end if
+
+ 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)
+ cq(5) = dcmplx(5.5, 0.0)
+ cq(6) = dcmplx(5.5, 0.0)
+ DO i=1,6
+ if (abs(ent%ca(i) - cq(i)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i, 30, real(real(ent%ca(i))), real(aimag(ent%ca(i)))
+ end if
+ end do
+
+! 21: fgd_entry (linterp) check
+ n = fgd_entry(d, 'linterp', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 21, e
+ end if
+
+ if (n .ne. GD_LINTERP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 21, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 21, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'data') then
+ ne = ne + 1
+ write(*, 2008) 21, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. '/look/up/file') then
+ ne = ne + 1
+ write(*, 2008) 21, 4, ent%field(2)
+ end if
+
+! 22: fgd_entry (bit) check
+ n = fgd_entry(d, 'bit', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 22, e
+ end if
+
+ if (n .ne. GD_BIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 22, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 22, 2, ent%fragment_index
+ end if
+
+ if (ent%bitnum .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 22, 3, ent%bitnum
+ end if
+
+ if (ent%numbits .ne. 4) then
+ ne = ne + 1
+ write(*, 2007) 22, 4, ent%numbits
+ end if
+
+ if (ent%field(1) .ne. 'data') then
+ ne = ne + 1
+ write(*, 2008) 22, 5, ent%field(1)
+ end if
+
+! 23: fgd_entry (Sbit) check
+ n = fgd_entry(d, 'sbit', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 23, e
+ end if
+
+ if (n .ne. GD_SBIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 23, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 23, 2, ent%fragment_index
+ end if
+
+ if (ent%numbits .ne. 6) then
+ ne = ne + 1
+ write(*, 2007) 23, 3, ent%numbits
+ end if
+
+ if (ent%bitnum .ne. 5) then
+ ne = ne + 1
+ write(*, 2007) 23, 4, ent%bitnum
+ end if
+
+ if (ent%field(1) .ne. 'data') then
+ ne = ne + 1
+ write(*, 2008) 23, 5, ent%field(1)
+ end if
+
+! 24: fgd_entry (multiply) check
+ n = fgd_entry(d, 'mult', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 24, e
+ end if
+
+ if (n .ne. GD_MULTIPLY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 24, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 24, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'data') then
+ ne = ne + 1
+ write(*, 2008) 24, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'sbit') then
+ ne = ne + 1
+ write(*, 2008) 24, 4, ent%field(2)
+ end if
+
+! 25: fgd_entry (phase) check
+ n = fgd_entry(d, 'phase', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 25, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 25, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 25, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 11) then
+ ne = ne + 1
+ write(*, 2007) 25, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'data') then
+ ne = ne + 1
+ write(*, 2008) 25, 4, ent%field(1)
+ end if
+
+! 26: fgd_entry (const) check
+ n = fgd_entry(d, 'const', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 26, e
+ end if
+
+ if (n .ne. GD_CONST_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 26, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 26, 2, ent%fragment_index
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT64) then
+ ne = ne + 1
+ write(*, 2007) 26, 3, ent%data_type
+ end if
+
+! 27: fgd_fragment_index check
+ n = fgd_fragment_index(d, 'const')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 27, e
+ end if
+
+ if (n .ne. 0) then
+ ne = ne + 1
+ write(*, 2002) 27, n
+ end if
+
+! 28: fgd_add_raw check
+ call fgd_add_raw(d, 'new1', GD_FLOAT64, 3, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 28, 1, e
+ end if
+
+ n = fgd_entry(d, 'new1', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 28, 2, e
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 28, 3, ent%fragment_index
+ end if
+
+ if (ent%spf .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 28, 4, ent%spf
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT64) then
+ ne = ne + 1
+ write(*, 2007) 28, 5, i
+ end if
+
+ if (n .ne. GD_RAW_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 28, 6, n
+ end if
+
+! 29: fgd_add_lincom check
+ call fgd_add_lincom(d, 'new2', 2, 'in1', 9.9d0, 8.8d0, &
+ 'in2', 7.7d0, 6.6d0, '', 0d0, 0d0, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 29, 1, e
+ end if
+
+ n = fgd_entry(d, 'new2', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 29, 2, e
+ end if
+
+ if (n .ne. GD_LINCOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 29, 3, n
+ end if
+
+ if (ent%n_fields .ne. 2) then
+ ne = ne + 1
+ write(*, 2007) 29, 4, ent%n_fields
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 29, 5, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 29, 6, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 29, 7, ent%field(2)
+ end if
+
+ if (ent%comp_scal .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 29, 8, ent%comp_scal
+ end if
+
+ q = (/ 9.9, 8.8, 7.7, 6.6, 5.5, 5.5 /)
+ do i=1,2
+ if (abs(ent%m(i) - q(i * 2 - 1)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2 - 1, 29, ent%m(i)
+ end if
+ if (abs(ent%b(i) - q(i * 2)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2, 29, ent%b(i)
+ end if
+ end do
+
+! 30: 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 30, 1, e
+ end if
+
+ n = fgd_entry(d, 'new3', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 30, 2, e
+ end if
+
+ if (ent%n_fields .ne. 2) then
+ ne = ne + 1
+ write(*, 2007) 30, 1, ent%n_fields
+ end if
+
+ if (n .ne. GD_LINCOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 30, 2, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 30, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 30, 4, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 30, 5, ent%field(2)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 30, 6, ent%comp_scal
+ end if
+
+ 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
+ if (abs(ent%cm(i) - cq(i * 2 - 1)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i * 2 - 1, 30, real(real(ent%cm(i))), real(aimag(ent%cm(i)))
+ end if
+ if (abs(ent%cb(i) - cq(i * 2)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i * 2, 30, real(real(ent%cb(i))), real(aimag(ent%cb(i)))
+ end if
+ end do
+
+! 31: fgd_add_polynom check
+ call fgd_add_polynom(d, 'new4', 3, 'in1', 3d3, 4d4, 5d5, 6d6, 0d0, 0d0, &
+ 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 31, 1, e
+ end if
+
+ n = fgd_entry(d, 'new4', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 31, 2, e
+ end if
+
+ if (n .ne. GD_POLYNOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 31, 1, n
+ end if
+
+ if (ent%poly_ord .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 31, 2, ent%poly_ord
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 31, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 31, 4, ent%field(1)
+ end if
+
+ if (ent%comp_scal .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 31, 5, ent%comp_scal
+ end if
+
+ q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /)
+ DO i=1,4
+ if (abs(ent%a(i) - q(i)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i, 31, ent%a(i)
+ end if
+ end do
+
+! 32: 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 32, 1, e
+ end if
+
+ n = fgd_entry(d, 'new5', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 32, 2, e
+ end if
+
+ if (n .ne. GD_POLYNOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 32, 1, n
+ end if
+
+ if (ent%poly_ord .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 32, 2, ent%poly_ord
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 32, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 32, 4, ent%field(1)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 31, 5, ent%comp_scal
+ end if
+
+ 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
+ if (abs(ent%ca(i) - cq(i)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i, 32, real(real(ent%ca(i))), real(aimag(ent%ca(i)))
+ end if
+ end do
+
+! 33: fgd_add_linterp check
+ call fgd_add_linterp(d, "new6", "in", "./some/table", 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 33, 1, e
+ end if
+
+ n = fgd_entry(d, 'new6', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 33, 2, e
+ end if
+
+ if (n .ne. GD_LINTERP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 33, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 33, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in') then
+ ne = ne + 1
+ write(*, 2008) 33, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. './some/table') then
+ ne = ne + 1
+ write(*, 2008) 33, 4, ent%field(2)
+ end if
+
+! 34: fgd_add_bit check
+ call fgd_add_bit(d, "new7", "in", 13, 12, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 34, 1, e
+ end if
+
+ n = fgd_entry(d, 'new7', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 34, 2, e
+ end if
+
+ if (n .ne. GD_BIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 34, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 34, 2, ent%fragment_index
+ end if
+
+ if (ent%numbits .ne. 12) then
+ ne = ne + 1
+ write(*, 2007) 34, 3, ent%numbits
+ end if
+
+ if (ent%bitnum .ne. 13) then
+ ne = ne + 1
+ write(*, 2007) 34, 4, ent%bitnum
+ end if
+
+ if (ent%field(1) .ne. 'in') then
+ ne = ne + 1
+ write(*, 2008) 34, 5, ent%field(1)
+ end if
+
+! 35: fgd_add_sbit check
+ call fgd_add_sbit(d, "new8", "in", 13, 12, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 35, 1, e
+ end if
+
+ n = fgd_entry(d, "new8", ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 35, 2, e
+ end if
+
+ if (n .ne. GD_SBIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 35, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 35, 2, ent%fragment_index
+ end if
+
+ if (ent%numbits .ne. 12) then
+ ne = ne + 1
+ write(*, 2007) 35, 3, ent%numbits
+ end if
+
+ if (ent%bitnum .ne. 13) then
+ ne = ne + 1
+ write(*, 2007) 35, 4, ent%bitnum
+ end if
+
+ if (ent%field(1) .ne. 'in') then
+ ne = ne + 1
+ write(*, 2008) 35, 5, ent%field(1)
+ end if
+
+! 36: fgd_add_multiply check
+ call fgd_add_multiply(d, 'new9', 'in1', 'in2', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 36, 1, e
+ end if
+
+ n = fgd_entry(d, 'new9', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 36, 2, e
+ end if
+
+ if (n .ne. GD_MULTIPLY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 36, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 36, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 36, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 36, 4, ent%field(2)
+ end if
+
+! 37: fgd_add_phase check
+ call fgd_add_phase(d, 'new10', 'in1', 22, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 37, 1, e
+ end if
+
+ n = fgd_entry(d, 'new10', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 37, 2, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 37, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 37, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 22) then
+ ne = ne + 1
+ write(*, 2007) 37, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 37, 4, ent%field(1)
+ end if
+
+! 38: fgd_add_const check
+ call fgd_add_const(d, 'new11', GD_FLOAT64, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 38, 1, e
+ end if
+
+ n = fgd_entry(d, 'new11', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 38, 2, e
+ end if
+
+ if (n .ne. GD_CONST_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 38, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 38, 2, ent%fragment_index
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT64) then
+ ne = ne + 1
+ write(*, 2007) 38, 3, ent%data_type
+ end if
+
+ call fgd_get_constant_r4(d, 'new11', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 38, 3, e
+ end if
+
+ if (abs(fl) > 1e-5) then
+ ne = ne + 1
+ write(*, 2005) 38, fl
+ end if
+
+! 125: fgd_add check
+ ent%shift = 33
+ ent%field(1) = 'new9'
+ ent%fragment_index = 0
+ ent%field_type = GD_PHASE_ENTRY
+ call fgd_add(d, 'new13', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 125, 1, e
+ end if
+
+ n = fgd_entry(d, 'new13', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 125, 2, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 125, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 125, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 33) then
+ ne = ne + 1
+ write(*, 2007) 125, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'new9') then
+ ne = ne + 1
+ write(*, 2008) 125, 4, ent%field(1)
+ end if
+
+! 39: fgd_fragmentname check
+ str = fgd_fragmentname(d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 39, e
+ end if
+
+ if (str .ne. 'test95_dirfile/format') then
+ ne = ne + 1
+ write(*, 2009), 39, str
+ end if
+
+! 40: fgd_nfragments check
+ n = fgd_nfragments(d)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 40, e
+ end if
+
+ if (n .ne. 1) then
+ ne = ne + 1
+ write(*, 2002), 40, n
+ end if
+
+! 41: fgd_include check
+ call fgd_include(d, 'form2', 0, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 41, 3, e
+ end if
+
+ call fgd_get_constant_i1(d, 'const2', ci1(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 41, 3, e
+ end if
+
+ if (ci1(1) .ne. -19) then
+ ne = ne + 1
+ write(*, 2004) 1, 41, ci1(1)
+ end if
+
+! 42: fgd_nfields_by_type check
+ n = fgd_nfields_by_type(d, GD_LINCOM_ENTRY)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 42, e
+ end if
+
+ if (n .ne. 3) then
+ ne = ne + 1
+ write(*, 2002), 42, n
+ end if
+
+! 43: 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 43, e
+ end if
+
+ if (l .ne. flen) then
+ ne = ne + 1
+ write(*, 2002) 43, l
+ end if
+
+ do i = 1, n
+ if (flist(i) .ne. fields(i)) then
+ ne = ne + 1
+ write(*, 2008) i, 43, flist(i)
+ end if
+ end do
+
+! 44: fgd_nvectors check
+ n = fgd_nvectors(d)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 44, e
+ end if
+
+ if (n .ne. 22) then
+ ne = ne + 1
+ write(*, 2002), 44, n
+ end if
+
+! 45: fgd_vector_list check
+ fields =(/ 'INDEX ', 'bit ', 'data ', 'div ', 'lincom ', 'linterp', &
+ 'mult ', 'new1 ', 'new10 ', 'new13 ', 'new2 ', 'new3 ', 'new4 ', &
+ 'new5 ', 'new6 ', 'new7 ', 'new8 ', 'new9 ', 'phase ', 'polynom', &
+ 'recip ', 'sbit ' /)
+ l = flen
+ call fgd_vector_list(flist, d, l)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 45, e
+ end if
+
+ if (l .ne. flen) then
+ ne = ne + 1
+ write(*, 2002) 45, l
+ end if
+
+ do i=1,n
+ if (flist(i) .ne. fields(i)) then
+ ne = ne + 1
+ write(*, 2008) i, 45, flist(i)
+ end if
+ end do
+
+! 46: fgd_madd_lincom check
+ call fgd_madd_lincom(d, 'data', 'mnew1', 2, 'in1', 9.9d0, 8.8d0, &
+ 'in2', 7.7d0, 6.6d0, '', 0d0, 0d0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 46, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew1', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 46, 2, e
+ end if
+
+ if (n .ne. GD_LINCOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 46, 3, n
+ end if
+
+ if (ent%n_fields .ne. 2) then
+ ne = ne + 1
+ write(*, 2007) 46, 4, ent%n_fields
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 46, 5, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 46, 6, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 46, 7, ent%field(2)
+ end if
+
+ if (ent%comp_scal .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 46, 8, ent%comp_scal
+ end if
+
+ q = (/ 9.9, 8.8, 7.7, 6.6, 5.5, 5.5 /)
+ DO i=1,2
+ if (abs(ent%m(i) - q(i * 2 - 1)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2 - 1, 46, ent%m(i)
+ end if
+ if (abs(ent%b(i) - q(i * 2)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2, 46, ent%m(i)
+ end if
+ end do
+
+! 47: 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))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 47, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew2', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 47, e
+ end if
+
+ if (n .ne. GD_LINCOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 47, 1, n
+ end if
+
+ if (ent%n_fields .ne. 2) then
+ ne = ne + 1
+ write(*, 2007) 47, 2, ent%n_fields
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 47, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 47, 4, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 47, 5, ent%field(2)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 47, 6, ent%comp_scal
+ end if
+
+ 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
+ if (abs(ent%cm(i) - cq(i * 2 - 1)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i * 2 - 1, 47, real(real(ent%cm(i))), real(aimag(ent%cm(i)))
+ end if
+ if (abs(ent%cb(i) - cq(i * 2)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i * 2, 47, real(real(ent%cb(i))), real(aimag(ent%cb(i)))
+ end if
+ end do
+
+! 48: fgd_madd_polynom check
+ call fgd_madd_polynom(d, 'data', 'mnew3', 3, 'in1', 3d3, 4d4, 5d5, &
+ 6d6, 0d0, 0d0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 48, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew3', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 48, 2, e
+ end if
+
+ if (n .ne. GD_POLYNOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 48, 1, n
+ end if
+
+ if (ent%poly_ord .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 48, 2, ent%poly_ord
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 48, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 48, 4, ent%field(1)
+ end if
+
+ q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /)
+ DO i=1,4
+ if (abs(ent%a(i) - q(i)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i, 48, ent%a(i)
+ end if
+ end do
+
+! 49: 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))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 49, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew5', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 49, 2, e
+ end if
+
+ if (n .ne. GD_POLYNOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 49, 1, n
+ end if
+
+ if (ent%poly_ord .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 49, 2, ent%poly_ord
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 49, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 49, 4, ent%field(1)
+ end if
+
+ 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
+ if (abs(ent%ca(i) - cq(i)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i, 49, real(real(ent%ca(i))), real(aimag(ent%ca(i)))
+ end if
+ end do
+
+! 50: fgd_madd_linterp check
+ call fgd_madd_linterp(d, "data", "mnew6", "in", "./more/table")
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 50, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew6', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 50, 2, e
+ end if
+
+ if (n .ne. GD_LINTERP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 50, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 50, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in') then
+ ne = ne + 1
+ write(*, 2008) 50, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. './more/table') then
+ ne = ne + 1
+ write(*, 2008) 50, 4, ent%field(2)
+ end if
+
+! 51: fgd_madd_bit check
+ call fgd_madd_bit(d, "data", "mnew7", "in", 13, 12)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 51, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew7', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 51, 2, e
+ end if
+
+ if (n .ne. GD_BIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 51, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 51, 2, ent%fragment_index
+ end if
+
+ if (ent%numbits .ne. 12) then
+ ne = ne + 1
+ write(*, 2007) 51, 3, ent%numbits
+ end if
+
+ if (ent%bitnum .ne. 13) then
+ ne = ne + 1
+ write(*, 2007) 51, 4, ent%bitnum
+ end if
+
+ if (ent%field(1) .ne. 'in') then
+ ne = ne + 1
+ write(*, 2008) 51, 5, ent%field(1)
+ end if
+
+! 52: fgd_madd_sbit check
+ call fgd_madd_sbit(d, "data", "mnew8", "in", 13, 12)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 52, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew8', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 52, 2, e
+ end if
+
+ if (n .ne. GD_SBIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 52, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 52, 2, ent%fragment_index
+ end if
+
+ if (ent%numbits .ne. 12) then
+ ne = ne + 1
+ write(*, 2007) 52, 3, ent%numbits
+ end if
+
+ if (ent%bitnum .ne. 13) then
+ ne = ne + 1
+ write(*, 2007) 52, 4, ent%bitnum
+ end if
+
+ if (ent%field(1) .ne. 'in') then
+ ne = ne + 1
+ write(*, 2008) 52, 5, ent%field(1)
+ end if
+
+! 53: fgd_madd_multiply check
+ call fgd_madd_multiply(d, 'data', 'mnew9', 'in1', 'in2')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 53, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew9', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 53, 2, e
+ end if
+
+ if (n .ne. GD_MULTIPLY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 53, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 53, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 53, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 53, 4, ent%field(2)
+ end if
+
+! 54: fgd_madd_phase check
+ call fgd_madd_phase(d, 'data', 'mnew10', 'in1', 22)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 54, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew10', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 54, 2, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 54, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 54, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 22) then
+ ne = ne + 1
+ write(*, 2007) 54, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 54, 4, ent%field(1)
+ end if
+
+! 55: fgd_madd_const check
+ call fgd_madd_const(d, 'data', 'mnew11', GD_FLOAT64)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 55, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew11', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 55, 2, e
+ end if
+
+ if (n .ne. GD_CONST_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 55, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 55, 2, ent%fragment_index
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT64) then
+ ne = ne + 1
+ write(*, 2007) 55, 3, ent%data_type
+ end if
+
+ call fgd_get_constant_r4(d, 'data/mnew11', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 55, 3, e
+ end if
+
+ if (abs(fl) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 55, fl
+ end if
+
+! 126: fgd_madd check
+ ent%shift = 33
+ ent%field(1) = 'data/mnew10'
+ ent%fragment_index = 0
+ ent%field_type = GD_PHASE_ENTRY
+ call fgd_madd(d, 'data', 'mnew4', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 126, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew4', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 126, 2, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 126, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 126, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 33) then
+ ne = ne + 1
+ write(*, 2007) 126, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'data/mnew10') then
+ ne = ne + 1
+ write(*, 2008) 126, 4, ent%field(1)
+ end if
+
+! 56: fgd_get_string check
+ n = fgd_get_string(d, 'string', GD_FIELD_LEN, str)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 56, e
+ end if
+
+ if (n .ne. 17) then
+ ne = ne + 1
+ write(*, 2002) 56, n
+ end if
+
+ if (str .ne. "Zaphod Beeblebrox") then
+ ne = ne + 1
+ write(*, 2009) 56, str
+ end if
+
+! 57: fgd_add_string check
+ call fgd_add_string(d, 'new12', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 57, 1, e
+ end if
+
+ n = fgd_get_string(d, 'new12', GD_FIELD_LEN, str)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 57, 2, e
+ end if
+
+ if (str .ne. "") then
+ ne = ne + 1
+ write(*, 2009) 57, str
+ end if
+
+! 58: fgd_madd_string check
+ call fgd_madd_string(d, "data", 'mnew12')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 58, 1, e
+ end if
+
+ n = fgd_get_string(d, 'data/mnew12', GD_FIELD_LEN, str)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 58, 2, e
+ end if
+
+ if (str .ne. "") then
+ ne = ne + 1
+ write(*, 2009) 58, str
+ end if
+
+! 59: fgd_add_spec check
+ call fgd_add_spec(d, 'lorem STRING "Lorem ipsum"', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 59, 1, e
+ end if
+
+ n = fgd_get_string(d, 'lorem', GD_FIELD_LEN, str)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 59, 2, e
+ end if
+
+ if (str .ne. "Lorem ipsum") then
+ ne = ne + 1
+ write(*, 2009) 59, str
+ end if
+
+! 60: fgd_madd_spec check
+ call fgd_madd_spec(d, 'ipsum STRING "dolor sit amet."', 'lorem')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 60, 1, e
+ end if
+
+ n = fgd_get_string(d, 'lorem/ipsum', GD_FIELD_LEN, str)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 60, 2, e
+ end if
+
+ if (str .ne. "dolor sit amet.") then
+ ne = ne + 1
+ write(*, 2009) 60, str
+ end if
+
+! 61: fgd_put_constant_i1 check
+ ci1(1) = 61
+ call fgd_put_constant_i1(d, 'const', ci1(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 61, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 61, 2, e
+ end if
+
+ if (abs(fl - 61) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 61, fl
+ end if
+
+! 127: fgd_put_constant_i2 check
+ ci2(1) = 127
+ call fgd_put_constant_i2(d, 'const', ci2(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 127, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 127, 2, e
+ end if
+
+ if (abs(fl - 127) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 127, fl
+ end if
+
+! 128: fgd_put_constant_i4 check
+ ci4(1) = 128
+ call fgd_put_constant_i4(d, 'const', ci4(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 128, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 128, 2, e
+ end if
+
+ if (abs(fl - 128) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 128, fl
+ end if
+
+! 129: fgd_put_constant_i8 check
+ ci8(1) = 129
+ call fgd_put_constant_i8(d, 'const', ci8(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 129, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 129, 2, e
+ end if
+
+ if (abs(fl - 129) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 129, fl
+ end if
+
+! 130: fgd_put_constant_r4 check
+ cr4(1) = 130
+ call fgd_put_constant_r4(d, 'const', cr4(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 130, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 130, 2, e
+ end if
+
+ if (abs(fl - 130) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 130, fl
+ end if
+
+! 131: fgd_put_constant_r8 check
+ cr8(1) = 131
+ call fgd_put_constant_r8(d, 'const', cr8(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 131, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 131, 2, e
+ end if
+
+ if (abs(fl - 131) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 131, fl
+ end if
+
+! 132: fgd_put_constant_c8 check
+ cc8(1) = 132
+ call fgd_put_constant_c8(d, 'const', cc8(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 132, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 132, 2, e
+ end if
+
+ if (abs(fl - 132) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 132, fl
+ end if
+
+! 133: fgd_put_constant_c16 check
+ cc16(1) = 133
+ call fgd_put_constant_c16(d, 'const', cc16(1))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 133, 1, e
+ end if
+
+ call fgd_get_constant_r4(d, 'const', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 133, 2, e
+ end if
+
+ if (abs(fl - 133) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 133, fl
+ end if
+
+! 62: fgd_put_string check
+ n = fgd_put_string(d, 'string', "Arthur Dent")
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 62, 1, e
+ end if
+
+ if (n .ne. 11) then
+ ne = ne + 1
+ write(*, 2002) 62, n
+ end if
+
+ n = fgd_get_string(d, 'string', GD_FIELD_LEN, str)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 62, 2, e
+ end if
+
+ if (str .ne. "Arthur Dent") then
+ ne = ne + 1
+ write(*, 2009) 62, str
+ end if
+
+! 63: fgd_nmfields_by_type check
+ n = fgd_nmfields_by_type(d, "data", GD_LINCOM_ENTRY)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 63, e
+ end if
+
+ if (n .ne. 2) then
+ ne = ne + 1
+ write(*, 2002), 63, n
+ end if
+
+! 64: 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 64, i, e
+ end if
+
+ if (l .ne. flen) then
+ ne = ne + 1
+ write(*, 2007) 64, i, l
+ end if
+
+ do i = 1, n
+ if (flist(i) .ne. fields(i)) then
+ ne = ne + 1
+ write(*, 2008) i, 64, flist(i)
+ end if
+ end do
+
+! 65: fgd_nmvectors check
+ n = fgd_nmvectors(d, "data")
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 65, e
+ end if
+
+ if (n .ne. 11) then
+ ne = ne + 1
+ write(*, 2002), 65, n
+ end if
+
+! 66: fgd_mvector_list check
+ fields =(/ 'mlut ', 'mnew1 ', 'mnew2 ', 'mnew3 ', 'mnew5 ', 'mnew6 ', &
+ 'mnew7 ', 'mnew8 ', 'mnew9 ', 'mnew10', 'mnew4 ', ' ', ' ', &
+ ' ', ' ', ' ', ' ', ' ', ' ', ' ', &
+ ' ', ' ' /)
+ l = flen
+ call fgd_mvector_list(flist, d, "data", l)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 66, i, e
+ end if
+
+ if (l .ne. flen) then
+ ne = ne + 1
+ write(*, 2007) 66, i, l
+ end if
+
+ do i=1,n
+ if (flist(i) .ne. fields(i)) then
+ ne = ne + 1
+ write(*, 2008) i, 66, flist(i)
+ end if
+ end do
+
+! 67: fgd_alter_raw check
+ call fgd_alter_raw(d, 'new1', GD_INT32, 4, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 67, 1, e
+ end if
+
+ n = fgd_entry(d, 'new1', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 67, 2, e
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 67, 3, ent%fragment_index
+ end if
+
+ if (ent%spf .ne. 4) then
+ ne = ne + 1
+ write(*, 2007) 67, 4, ent%spf
+ end if
+
+ if (ent%data_type .ne. GD_INT32) then
+ ne = ne + 1
+ write(*, 2007) 67, 5, ent%data_type
+ end if
+
+ if (n .ne. GD_RAW_ENTRY) then
+ ne = ne + 1
+ write(*, 2007), 67, 6, n
+ end if
+
+! 68: 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 68, 1, e
+ end if
+
+ n = fgd_entry(d, 'new2', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 68, 2, e
+ end if
+
+ if (n .ne. GD_LINCOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 68, 3, n
+ end if
+
+ if (ent%n_fields .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 68, 4, ent%n_fields
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 68, 5, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 68, 6, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in5') then
+ ne = ne + 1
+ write(*, 2008) 68, 7, ent%field(2)
+ end if
+
+ if (ent%field(3) .ne. 'in6') then
+ ne = ne + 1
+ write(*, 2008) 68, 8, ent%field(3)
+ end if
+
+ if (ent%comp_scal .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 68, 5, ent%comp_scal
+ end if
+
+ q = (/ 9.9d-1, 7.8d0, 1.1d1, 2.2d-2, 1.96d0, 0d0 /)
+ DO i=1,3
+ if (abs(ent%m(i) - q(i * 2 - 1)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2 - 1, 68, ent%m(i)
+ end if
+ if (abs(ent%b(i) - q(i * 2)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i * 2, 68, ent%b(i)
+ end if
+ end do
+
+! 69: 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))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 69, 1, e
+ end if
+
+ n = fgd_entry(d, 'new3', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 69, e
+ end if
+
+ if (n .ne. GD_LINCOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 69, 1, n
+ end if
+
+ if (ent%n_fields .ne. 2) then
+ ne = ne + 1
+ write(*, 2007) 69, 2, ent%n_fields
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 69, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 69, 4, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in3') then
+ ne = ne + 1
+ write(*, 2008) 69, 5, ent%field(2)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 69, 6, ent%comp_scal
+ end if
+
+ 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
+ if (abs(ent%cm(i) - cq(i * 2 - 1)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i * 2 - 1, 69, real(real(ent%cm(i))), real(aimag(ent%cm(i)))
+ end if
+ if (abs(ent%cb(i) - cq(i * 2)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i * 2, 69, real(real(ent%cb(i))), real(aimag(ent%cb(i)))
+ end if
+ end do
+
+! 70: fgd_alter_polynom check
+ call fgd_alter_polynom(d, 'new4', 4, 'in1', 3d0, 4d0, 5d0, 6d0, 7d0, 0d0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 70, 1, e
+ end if
+
+ n = fgd_entry(d, 'new4', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 70, 2, e
+ end if
+
+ if (n .ne. GD_POLYNOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 70, 1, n
+ end if
+
+ if (ent%poly_ord .ne. 4) then
+ ne = ne + 1
+ write(*, 2007) 70, 2, ent%poly_ord
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 70, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 70, 4, ent%field(1)
+ end if
+
+ q = (/ 3d0, 4d0, 5d0, 6d0, 7d0, 0d0 /)
+ DO i=1,5
+ if (abs(ent%a(i) - q(i)) > 0.001) then
+ ne = ne + 1
+ write(*, 2010) i, 70, ent%a(i)
+ end if
+ end do
+
+! 71: 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))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 71, 1, e
+ end if
+
+ n = fgd_entry(d, 'new5', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 71, 2, e
+ end if
+
+ if (n .ne. GD_POLYNOM_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 71, 1, n
+ end if
+
+ if (ent%poly_ord .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 71, 2, ent%poly_ord
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 71, 3, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 71, 4, ent%field(1)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 71, 5, ent%comp_scal
+ end if
+
+ 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 710 i=1,4
+ if (abs(ent%ca(i) - cq(i)) > 0.001) then
+ ne = ne + 1
+ write(*, 2011) i, 71, real(real(ent%ca(i))), real(aimag(ent%ca(i)))
+ end if
+ 710 CONTINUE
+
+! 72: fgd_alter_linterp check
+ call fgd_alter_linterp(d, "new6", "in3", "./other/table", 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 72, 1, e
+ end if
+
+ n = fgd_entry(d, 'new6', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 72, 2, e
+ end if
+
+ if (n .ne. GD_LINTERP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 72, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 72, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in3') then
+ ne = ne + 1
+ write(*, 2008) 72, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. './other/table') then
+ ne = ne + 1
+ write(*, 2008) 72, 4, ent%field(2)
+ end if
+
+! 73: fgd_alter_bit check
+ call fgd_alter_bit(d, "new7", "in3", 3, 2)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 73, 1, e
+ end if
+
+ n = fgd_entry(d, 'new7', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 73, 2, e
+ end if
+
+ if (n .ne. GD_BIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 73, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 73, 2, ent%fragment_index
+ end if
+
+ if (ent%numbits .ne. 2) then
+ ne = ne + 1
+ write(*, 2007) 73, 3, ent%numbits
+ end if
+
+ if (ent%bitnum .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 73, 4, ent%bitnum
+ end if
+
+ if (ent%field(1) .ne. 'in3') then
+ ne = ne + 1
+ write(*, 2008) 73, 5, ent%field(1)
+ end if
+
+! 74: fgd_alter_sbit check
+ call fgd_alter_sbit(d, "new8", "out", 1, 22)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 74, 1, e
+ end if
+
+ n = fgd_entry(d, 'new8', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 74, 2, e
+ end if
+
+ if (n .ne. GD_SBIT_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 74, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 74, 2, ent%fragment_index
+ end if
+
+ if (ent%numbits .ne. 22) then
+ ne = ne + 1
+ write(*, 2007) 74, 3, ent%numbits
+ end if
+
+ if (ent%bitnum .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 74, 4, ent%bitnum
+ end if
+
+ if (ent%field(1) .ne. 'out') then
+ ne = ne + 1
+ write(*, 2008) 74, 5, ent%field(1)
+ end if
+
+! 75: fgd_alter_multiply check
+ call fgd_alter_multiply(d, 'new9', 'in6', 'in4')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 75, 1, e
+ end if
+
+ n = fgd_entry(d, 'new9', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 75, 2, e
+ end if
+
+ if (n .ne. GD_MULTIPLY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 75, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 75, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in6') then
+ ne = ne + 1
+ write(*, 2008) 75, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 75, 4, ent%field(2)
+ end if
+
+! 76: fgd_alter_phase check
+ call fgd_alter_phase(d, 'new10', 'in2', 8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 76, 1, e
+ end if
+
+ n = fgd_entry(d, 'new10', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 76, 2, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 76, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 76, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 8) then
+ ne = ne + 1
+ write(*, 2007) 76, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 76, 4, ent%field(1)
+ end if
+
+! 77: fgd_alter_const check
+ call fgd_alter_const(d, 'new11', GD_FLOAT32)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 77, 1, e
+ end if
+
+ n = fgd_entry(d, 'new11', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 77, 2, e
+ end if
+
+ if (n .ne. GD_CONST_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 77, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 77, 2, ent%fragment_index
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT32) then
+ ne = ne + 1
+ write(*, 2007) 77, 3, ent%data_type
+ end if
+
+ call fgd_get_constant_r4(d, 'new11', fl)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 77, 3, e
+ end if
+
+ if (abs(fl) > 0.001) then
+ ne = ne + 1
+ write(*, 2005) 77, fl
+ end if
+
+! 78: fgd_encoding check
+ n = fgd_encoding(d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 78, e
+ end if
+
+ if (n .ne. GD_UNENCODED) then
+ ne = ne + 1
+ write(*, 2002) 78, n
+ end if
+
+! 79: fgd_endianness check
+ n = fgd_endianness(d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 79, e
+ end if
+
+ if (n .ne. (GD_LITTLE_ENDIAN + GD_NOT_ARM_ENDIAN)) then
+ ne = ne + 1
+ write(*, 2002) 79, n
+ end if
+
+! 80: fgd_dirfilename check
+ l = GD_FIELD_LEN
+ call fgd_dirfilename(str, l, d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 80, e
+ end if
+
+ if (l .ne. GD_FIELD_LEN) then
+ ne = ne + 1
+ write(*, 2002) 80, l
+ end if
+
+ if (str .ne. 'test95_dirfile') then
+ ne = ne + 1
+ write(*, 2009) 80, str
+ end if
+
+! 81: fgd_parent_fragment check
+ n = fgd_parent_fragment(d, 1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 81, e
+ end if
+
+ if (n .ne. 0) then
+ ne = ne + 1
+ write(*, 2002) 81, n
+ end if
+
+! 82: fgd_alter_protection check
+ call fgd_alter_protection(d, GD_PROTECT_DATA, 1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 82, e
+ end if
+
+! 83: fgd_protection check
+ n = fgd_protection(d, 1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 83, e
+ end if
+
+ if (n .ne. GD_PROTECT_DATA) then
+ ne = ne + 1
+ write(*, 2002) 83, n
+ end if
+
+! 84: fgd_raw_filename check
+ str = fgd_raw_filename(d, "data")
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 84, e
+ end if
+
+ if (str .ne. 'test95_dirfile/data') then
+ ne = ne + 1
+ write(*, 2009) 84, str
+ end if
+
+! 85: fgd_reference check
+ str = fgd_reference(d, "new1")
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 85, e
+ end if
+
+ if (str .ne. 'new1') then
+ ne = ne + 1
+ write(*, 2009) 85, str
+ end if
+
+! 87: fgd_alter_encoding check
+ call fgd_alter_encoding(d, GD_SLIM_ENCODED, 1, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 87, 1, e
+ end if
+
+ n = fgd_encoding(d, 1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 87, 2, e
+ end if
+
+ if (n .ne. GD_SLIM_ENCODED) then
+ ne = ne + 1
+ write(*, 2002) 87, n
+ end if
+
+! 88: fgd_alter_endianness check
+ call fgd_alter_endianness(d, GD_BIG_ENDIAN, 1, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 88, 1, e
+ end if
+
+ n = fgd_endianness(d, 1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 88, 2, e
+ end if
+
+ if (n .ne. GD_BIG_ENDIAN) then
+ ne = ne + 1
+ write(*, 2002) 88, n
+ end if
+
+! 89: fgd_alter_spec check
+ call fgd_alter_spec(d, 'new10 PHASE in1 3', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 89, 1, e
+ end if
+
+ n = fgd_entry(d, 'new10', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 89, 2, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 89, 1, l
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 89, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 89, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 89, 4, ent%field(1)
+ end if
+
+! 90: fgd_delete check
+ call fgd_delete(d, 'new10', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 90, 1, e
+ end if
+
+ n = fgd_entry(d, 'new10', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_BAD_CODE) then
+ ne = ne + 1
+ write(*, 2006) 90, 2, e
+ end if
+
+! 91: fgd_malter_spec check
+ call fgd_malter_spec(d, 'mnew10 PHASE in4 11', 'data', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 91, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/mnew10', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 91, 2, e
+ end if
+
+ if (n .ne. GD_PHASE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 91, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 91, 2, ent%fragment_index
+ end if
+
+ if (ent%shift .ne. 11) then
+ ne = ne + 1
+ write(*, 2007) 91, 3, ent%shift
+ end if
+
+ if (ent%field(1) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 91, 4, ent%field(1)
+ end if
+
+! 92: fgd_move check
+ call fgd_move(d, 'new9', 1, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 92, 1, e
+ end if
+
+ n = fgd_entry(d, 'new9', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 92, 2, e
+ end if
+
+ if (n .ne. GD_MULTIPLY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 92, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 92, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in6') then
+ ne = ne + 1
+ write(*, 2008) 92, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 92, 4, ent%field(2)
+ end if
+
+! 93: fgd_rename check
+ call fgd_rename(d, 'new9', 'newer', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 93, 1, e
+ end if
+
+ n = fgd_entry(d, 'new9', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_BAD_CODE) then
+ ne = ne + 1
+ write(*, 2006) 93, 2, e
+ end if
+
+ n = fgd_entry(d, 'newer', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 93, 3, e
+ end if
+
+ if (n .ne. GD_MULTIPLY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 93, 1, l
+ end if
+
+ if (ent%fragment_index .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 92, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in6') then
+ ne = ne + 1
+ write(*, 2008) 92, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 92, 4, ent%field(2)
+ end if
+
+! 94: fgd_uninclude check
+ call fgd_uninclude(d, 1, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 94, 1, e
+ end if
+
+ n = fgd_entry(d, 'newer', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_BAD_CODE) then
+ ne = ne + 1
+ write(*, 2006) 94, 2, e
+ end if
+
+! 95: fgd_frameoffset check
+ n = fgd_frameoffset(d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 95, e
+ end if
+
+ if (n .ne. 0) then
+ ne = ne + 1
+ write(*, 2002) 95, n
+ end if
+
+! 96: fgd_alter_frameoffset check
+ call fgd_alter_frameoffset(d, 33, 0, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 96, 1, e
+ end if
+
+ n = fgd_frameoffset(d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 96, 2, e
+ end if
+
+ if (n .ne. 33) then
+ ne = ne + 1
+ write(*, 2002) 96, n
+ end if
+
+! 97: fgd_native_type check
+ n = fgd_native_type(d, 'data')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 97, e
+ end if
+
+ if (n .ne. GD_INT8) then
+ ne = ne + 1
+ write(*, 2002) 97, n
+ end if
+
+! 99: fgd_validate check
+ n = fgd_validate(d, 'new7')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_BAD_CODE) then
+ ne = ne + 1
+ write(*, 2001) 99, e
+ end if
+
+ if (n .ne. -1) then
+ ne = ne + 1
+ write(*, 2002) 99, n
+ end if
+
+! 100: fgd_framenum check
+ str = fgd_reference(d, "data")
+ dp = fgd_framenum(d, 'INDEX', 33.3d0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 100, e
+ end if
+
+ if (abs(dp - 33.3) > 0.001) then
+ ne = ne + 1
+ write(*, 2012) 100, dp
+ end if
+
+! 101: fgd_framenum_subset check
+ dp = fgd_framenum_subset(d, 'data', 33.3d0, 6, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 101, e
+ end if
+
+ if (abs(dp - 37.0375) > 0.001) then
+ ne = ne + 1
+ write(*, 2012) 101, dp
+ end if
+
+! 86: fgd_eof check
+ n = fgd_eof(d, 'lincom')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 86, e
+ end if
+
+ if (n .ne. 344) then
+ ne = ne + 1
+ write(*, 2002), 86, n
+ end if
+
+! 142: fgd_bof check
+ n = fgd_bof(d, 'lincom')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 142, e
+ end if
+
+ if (n .ne. 264) then
+ ne = ne + 1
+ write(*, 2002), 142, n
+ end if
+
+! 143: fgd_entry (divide) check
+ n = fgd_entry(d, 'div', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 143, e
+ end if
+
+ if (n .ne. GD_DIVIDE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 143, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 143, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'mult') then
+ ne = ne + 1
+ write(*, 2008) 143, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'bit') then
+ ne = ne + 1
+ write(*, 2008) 143, 4, ent%field(2)
+ end if
+
+! 145: fgd_entry (recip) check
+ n = fgd_entry(d, 'recip', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 145, e
+ end if
+
+ if (n .ne. GD_RECIP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 145, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 145, 2, ent%fragment_index
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 145, 3, ent%comp_scal
+ end if
+
+ if (ent%field(1) .ne. 'div') then
+ ne = ne + 1
+ write(*, 2008) 145, 4, ent%field(1)
+ end if
+
+ if (abs(ent%cdividend - dcmplx(6.5, 4.3)) .gt. 1e-5) then
+ ne = ne + 1
+ write(*, 2013) 145, real(real(ent%cdividend)), real(aimag(ent%cdividend))
+ end if
+
+! 146: fgd_add_divide check
+ call fgd_add_divide(d, 'new14', 'in1', 'in2', 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 146, 1, e
+ end if
+
+ n = fgd_entry(d, 'new14', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 146, 2, e
+ end if
+
+ if (n .ne. GD_DIVIDE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 146, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 146, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 146, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 146, 4, ent%field(2)
+ end if
+
+! 147: fgd_add_recip check
+ call fgd_add_recip(d, 'new15', 'in1', 31.9d0, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 147, 1, e
+ end if
+
+ n = fgd_entry(d, 'new15', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 147, 2, e
+ end if
+
+ if (n .ne. GD_RECIP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 147, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 147, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 147, 3, ent%field(1)
+ end if
+
+ if (ent%comp_scal .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 147, 4, ent%comp_scal
+ end if
+
+ if (abs(ent%dividend - 31.9) > 1e-5) then
+ ne = ne + 1
+ write(*, 2012) 147, ent%dividend
+ end if
+
+! 148: fgd_add_recip check
+ call fgd_add_crecip(d, 'new16', 'in1', dcmplx(31.9d0, 38.2d0), 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 148, 1, e
+ end if
+
+ n = fgd_entry(d, 'new16', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 148, 2, e
+ end if
+
+ if (n .ne. GD_RECIP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 148, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 148, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in1') then
+ ne = ne + 1
+ write(*, 2008) 148, 3, ent%field(1)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 148, 4, ent%comp_scal
+ end if
+
+ if (abs(ent%cdividend - dcmplx(31.9, 38.2)) > 1e-5) then
+ ne = ne + 1
+ write(*, 2012) 148, ent%cdividend
+ end if
+
+! 149: fgd_madd_divide check
+ call fgd_madd_divide(d, 'data', 'new14', 'in3', 'in4')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 149, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/new14', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 149, 2, e
+ end if
+
+ if (n .ne. GD_DIVIDE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 149, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 149, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in3') then
+ ne = ne + 1
+ write(*, 2008) 149, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 149, 4, ent%field(2)
+ end if
+
+! 150: fgd_madd_recip check
+ call fgd_madd_recip(d, 'data', 'new15', 'in0', 95.5d0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 150, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/new15', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 150, 2, e
+ end if
+
+ if (n .ne. GD_RECIP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 150, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 150, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in0') then
+ ne = ne + 1
+ write(*, 2008) 150, 3, ent%field(1)
+ end if
+
+ if (ent%comp_scal .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 150, 4, ent%comp_scal
+ end if
+
+ if (abs(ent%dividend - 95.5) > 1e-5) then
+ ne = ne + 1
+ write(*, 2012) 150, ent%dividend
+ end if
+
+! 151: fgd_madd_recip check
+ call fgd_madd_crecip(d, 'data', 'new16', 'in3', dcmplx(8.47d0, 6.22d0))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 151, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/new16', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 151, 2, e
+ end if
+
+ if (n .ne. GD_RECIP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 151, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 151, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in3') then
+ ne = ne + 1
+ write(*, 2008) 151, 3, ent%field(1)
+ end if
+
+ if (ent%comp_scal .ne. 1) then
+ ne = ne + 1
+ write(*, 2007) 151, 4, ent%comp_scal
+ end if
+
+ if (abs(ent%cdividend - dcmplx(8.47, 6.22)) > 1e-5) then
+ ne = ne + 1
+ write(*, 2012) 151, ent%cdividend
+ end if
+
+! 152: fgd_alter_divide check
+ call fgd_alter_divide(d, 'new14', 'in6', 'in4')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 152, 1, e
+ end if
+
+ n = fgd_entry(d, 'new14', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 152, 2, e
+ end if
+
+ if (n .ne. GD_DIVIDE_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 152, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 152, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in6') then
+ ne = ne + 1
+ write(*, 2008) 152, 3, ent%field(1)
+ end if
+
+ if (ent%field(2) .ne. 'in4') then
+ ne = ne + 1
+ write(*, 2008) 152, 4, ent%field(2)
+ end if
+
+! 153: fgd_alter_recip check
+ call fgd_alter_recip(d, 'new15', 'in5', 0.187d0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 153, 1, e
+ end if
+
+ n = fgd_entry(d, 'new15', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 153, 2, e
+ end if
+
+ if (n .ne. GD_RECIP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 153, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 153, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in5') then
+ ne = ne + 1
+ write(*, 2008) 153, 3, ent%field(1)
+ end if
+
+ if (abs(ent%dividend - 0.187) > 1e-5) then
+ ne = ne + 1
+ write(*, 2012) 153, ent%dividend
+ end if
+
+! 154: fgd_alter_crecip check
+ call fgd_alter_crecip(d, 'new16', 'in2', dcmplx(4.3d0, 81.81d0))
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 154, 1, e
+ end if
+
+ n = fgd_entry(d, 'new16', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 154, 2, e
+ end if
+
+ if (n .ne. GD_RECIP_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 154, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 154, 2, ent%fragment_index
+ end if
+
+ if (ent%field(1) .ne. 'in2') then
+ ne = ne + 1
+ write(*, 2008) 154, 3, ent%field(1)
+ end if
+
+ if (abs(ent%cdividend - dcmplx(4.3d0, 81.81d0)) > 1e-5) then
+ ne = ne + 1
+ write(*, 2013) 154, ent%cdividend
+ end if
+
+! 155: fgd_rewrite_fragment check
+ call fgd_rewrite_fragment(d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 155, e
+ end if
+
+! 156: fgd_invalid_dirfile check
+ m = fgd_invalid_dirfile()
+ e = fgd_error(m)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 156, 1, e
+ end if
+
+ n = fgd_nfragments(m)
+ e = fgd_error(m)
+
+ if (e .ne. GD_E_BAD_DIRFILE) then
+ ne = ne + 1
+ write(*, 2006), 156, 2, e
+ end if
+
+ call fgd_close(m)
+
+! 157: fgd_dirfile_standards
+ n = fgd_dirfile_standards(d, GD_VERSION_CURRENT)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 157, 1, e
+ end if
+
+ if (n .ne. 8) then
+ ne = ne + 1
+ write(*, 2002), 157, n
+ end if
+
+ n = fgd_dirfile_standards(d, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_BAD_VERSION) then
+ ne = ne + 1
+ write(*, 2006), 156, 2, e
+ end if
+
+! 158: gd_get_carray_slice (INT8)
+ call fgd_get_carray_i1(d, "carray", 0, 0, ci1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 158, e
+ end if
+
+ do i=1,6
+ if (ci1(i) .ne. i) then
+ ne = ne + 1
+ write(*, 2004), 158, i, ci1(i)
+ end if
+ end do
+
+! 159: gd_get_carray_slice (INT8)
+ call fgd_get_carray_i1(d, "carray", 3, 2, ci1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 159, e
+ end if
+
+ do i=1,2
+ if (ci1(i) .ne. i + 2) then
+ ne = ne + 1
+ write(*, 2004), 159, i, ci1(i)
+ end if
+ end do
+
+! 160: gd_get_carray_slice (INT16)
+ call fgd_get_carray_i2(d, "carray", 3, 2, ci2)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 160, e
+ end if
+
+ do i=1,2
+ if (ci2(i) .ne. i + 2) then
+ ne = ne + 1
+ write(*, 2004), 160, i, ci2(i)
+ end if
+ end do
+
+! 161: gd_get_carray_slice (INT32)
+ call fgd_get_carray_i4(d, "carray", 3, 2, ci4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 161, e
+ end if
+
+ do i=1,2
+ if (ci4(i) .ne. i + 2) then
+ ne = ne + 1
+ write(*, 2004), 161, i, ci4(i)
+ end if
+ end do
+
+! 162: gd_get_carray_slice (INT64)
+ call fgd_get_carray_i8(d, "carray", 3, 2, ci8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 162, e
+ end if
+
+ do i=1,2
+ if (ci8(i) .ne. i + 2) then
+ ne = ne + 1
+ write(*, 2004), 162, i, ci8(i)
+ end if
+ end do
+
+! 163: gd_get_carray_slice (FLOAT32)
+ call fgd_get_carray_r4(d, "carray", 3, 2, cr4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 163, e
+ end if
+
+ do i=1,2
+ if (abs(cr4(i) - (2 + i) * 1.1) > 0.001) then
+ ne = ne + 1
+ write(*, 2010), 163, i, cr4(i)
+ end if
+ end do
+
+! 164: gd_get_carray_slice (FLOAT64)
+ call fgd_get_carray_r8(d, "carray", 3, 2, cr8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 164, e
+ end if
+
+ do i=1,2
+ if (abs(cr8(i) - (2 + i) * 1.1) > 0.001) then
+ ne = ne + 1
+ write(*, 2010), 164, i, cr8(i)
+ end if
+ end do
+
+! 165: gd_get_carray_slice (COMPLEX64)
+ call fgd_get_carray_c8(d, "carray", 3, 2, cc8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 165, e
+ end if
+
+ do i=1,2
+ if (abs(cc8(i) - (2 + i) * 1.1) > 0.001) then
+ ne = ne + 1
+ write(*, 2011), 165, i, real(real(cc8(i))), real(aimag(cc8(i)))
+ end if
+ end do
+
+! 166: gd_get_carray_slice (COMPLEX128)
+ call fgd_get_carray_c16(d, "carray", 3, 2, cc16)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 166, e
+ end if
+
+ do i=1,2
+ if (abs(cc16(i) - (2 + i) * 1.1) > 0.001) then
+ ne = ne + 1
+ write(*, 2011), 166, i, real(real(cc16(i))), real(aimag(cc16(i)))
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 168, 1, e
+ end if
+
+ call fgd_get_carray_i1(d, "carray", 0, 0, ci1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 168, 2, e
+ end if
+
+ do i=1,6
+ if (ci1(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2004), 168, i, ci1(i)
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 169, 1, e
+ end if
+
+ call fgd_get_carray_i1(d, "carray", 0, 0, ci1)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 169, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (ci1(i) .ne. 69 + i) then
+ ne = ne + 1
+ write(*, 2004), 169, i, ci1(i)
+ end if
+ else
+ if (ci1(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2004), 169, i, ci1(i)
+ end if
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 170, 1, e
+ end if
+
+ call fgd_get_carray_i2(d, "carray", 0, 0, ci2)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 170, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (ci2(i) .ne. 170 + i) then
+ ne = ne + 1
+ write(*, 2004), 170, i, ci2(i)
+ end if
+ else
+ if (ci2(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2004), 170, i, ci2(i)
+ end if
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 171, 1, e
+ end if
+
+ call fgd_get_carray_i4(d, "carray", 0, 0, ci4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 171, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (ci4(i) .ne. 171 + i) then
+ ne = ne + 1
+ write(*, 2004), 171, i, ci4(i)
+ end if
+ else
+ if (ci4(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2004), 171, i, ci4(i)
+ end if
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 172, 1, e
+ end if
+
+ call fgd_get_carray_i8(d, "carray", 0, 0, ci8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 172, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (ci8(i) .ne. 172 + i) then
+ ne = ne + 1
+ write(*, 2004), 172, i, ci8(i)
+ end if
+ else
+ if (ci8(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2004), 172, i, ci8(i)
+ end if
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 173, 1, e
+ end if
+
+ call fgd_get_carray_r4(d, "carray", 0, 0, cr4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 173, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (abs(cr4(i) - 173. - i) > 0.001) then
+ ne = ne + 1
+ write(*, 2010), 173, i, cr4(i)
+ end if
+ else
+ if (cr4(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2010), 173, i, cr4(i)
+ end if
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 174, 1, e
+ end if
+
+ call fgd_get_carray_r8(d, "carray", 0, 0, cr8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 174, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (abs(cr8(i) - 174. - i) > 0.001) then
+ ne = ne + 1
+ write(*, 2010), 174, i, cr8(i)
+ end if
+ else
+ if (cr8(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2010), 174, i, cr8(i)
+ end if
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 175, 1, e
+ end if
+
+ call fgd_get_carray_c8(d, "carray", 0, 0, cc8)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 175, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (abs(cc8(i) - 175. - i) > 0.001) then
+ ne = ne + 1
+ write(*, 2011), 175, i, real(real(cc8(i))), real(aimag(cc8(i)))
+ end if
+ else
+ if (cc8(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2011), 175, i, real(real(cc8(i))), real(aimag(cc8(i)))
+ end if
+ end if
+ 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)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 176, 1, e
+ end if
+
+ call fgd_get_carray_c16(d, "carray", 0, 0, cc16)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006), 176, 2, e
+ end if
+
+ do i=1,6
+ if (i .eq. 3 .or. i .eq. 4) then
+ if (abs(cc16(i) - 176. - i) > 0.001) then
+ ne = ne + 1
+ write(*, 2011), 176, i, real(real(cc16(i))), real(aimag(cc16(i)))
+ end if
+ else
+ if (cc16(i) .ne. i + 10) then
+ ne = ne + 1
+ write(*, 2011), 176, i, real(real(cc16(i))), real(aimag(cc16(i)))
+ end if
+ end if
+ end do
+
+! 177: gd_carray_len
+ n = fgd_carray_len(d, 'carray')
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001), 177, e
+ end if
+
+ if (n .ne. 6) then
+ ne = ne + 1
+ write(*, 2002), 177, n
+ end if
+
+! 178: gd_entry (CARRAY)
+ n = fgd_entry(d, 'carray', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2001) 178, e
+ end if
+
+ if (n .ne. GD_CARRAY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 178, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 178, 2, ent%fragment_index
+ end if
+
+ if (ent%array_len .ne. 6) then
+ ne = ne + 1
+ write(*, 2007) 178, 2, ent%array_len
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT64) then
+ ne = ne + 1
+ write(*, 2007) 178, 3, ent%data_type
+ end if
+
+! 179: gd_add_carray
+ call fgd_add_carray(d, 'new17', GD_FLOAT64, 4, 0)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 179, 1, e
+ end if
+
+ n = fgd_entry(d, 'new17', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 179, 2, e
+ end if
+
+ if (n .ne. GD_CARRAY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 179, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 179, 2, ent%fragment_index
+ end if
+
+ if (ent%array_len .ne. 4) then
+ ne = ne + 1
+ write(*, 2007) 179, 3, ent%array_len
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT64) then
+ ne = ne + 1
+ write(*, 2007) 179, 4, ent%data_type
+ end if
+
+ call fgd_get_carray_r4(d, 'new17', 0, 0, cr4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 179, 3, e
+ end if
+
+ do i=1,4
+ if (abs(cr4(i)) > 1e-5) then
+ ne = ne + 1
+ write(*, 2010) 179, i, cr4(i)
+ end if
+ end do
+
+! 180: gd_madd_carray
+ call fgd_madd_carray(d, 'data', 'new17', GD_FLOAT64, 4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 180, 1, e
+ end if
+
+ n = fgd_entry(d, 'data/new17', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 180, 2, e
+ end if
+
+ if (n .ne. GD_CARRAY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 180, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 180, 2, ent%fragment_index
+ end if
+
+ if (ent%array_len .ne. 4) then
+ ne = ne + 1
+ write(*, 2007) 180, 3, ent%array_len
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT64) then
+ ne = ne + 1
+ write(*, 2007) 180, 4, ent%data_type
+ end if
+
+ call fgd_get_carray_r4(d, 'data/new17', 0, 0, cr4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 180, 3, e
+ end if
+
+ do i=1,4
+ if (abs(cr4(i)) > 1e-5) then
+ ne = ne + 1
+ write(*, 2010) 180, i, cr4(i)
+ end if
+ end do
+
+! 181: gd_alter_carray
+ call fgd_alter_carray(d, 'new17', GD_FLOAT32, 3)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 181, 1, e
+ end if
+
+ n = fgd_entry(d, 'new17', ent)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 181, 2, e
+ end if
+
+ if (n .ne. GD_CARRAY_ENTRY) then
+ ne = ne + 1
+ write(*, 2007) 181, 1, n
+ end if
+
+ if (ent%fragment_index .ne. 0) then
+ ne = ne + 1
+ write(*, 2007) 181, 2, ent%fragment_index
+ end if
+
+ if (ent%data_type .ne. GD_FLOAT32) then
+ ne = ne + 1
+ write(*, 2007) 181, 3, ent%data_type
+ end if
+
+ if (ent%array_len .ne. 3) then
+ ne = ne + 1
+ write(*, 2007) 181, 4, ent%data_type
+ end if
+
+ call fgd_get_carray_r4(d, 'new17', 0, 0, cr4)
+ e = fgd_error(d)
+
+ if (e .ne. GD_E_OK) then
+ ne = ne + 1
+ write(*, 2006) 181, 3, e
+ end if
+
+ do i=1,4
+ if (abs(cr4(i)) > 1e-5) then
+ ne = ne + 1
+ write(*, 2010) 181, i, cr4(i)
+ end if
+ end do
+
+
+
+
+
+
+
+!================================================================
+ call fgd_discard(d)
+
+ call system ( 'rm -rf ' // fildir )
+
+ if (ne .GT. 0) then
+ write(*, 2003) ne
+ call exit(1)
+ end if
+
+2001 format('e[', i0, '] = ', i0)
+2002 format('n[', i0, '] = ', i0)
+2003 format('ne = ', i0)
+2004 format('c(', i0, ')[', i0, '] = ', i0)
+2005 format('fl[', i0, '] = ', f0.16)
+2006 format('e[', i0, ', ', i0, '] = ', i0)
+2007 format('n[', i0, ', ', i0, '] = ', i0)
+2008 format('fn(', i0, ')[', i0, '] = "', a, '"')
+2009 format('s[' i0, '] = "', a, '"')
+2010 format('p(', i0, ')[', i0, '] = ', d16.10)
+2011 format('p(', i0, ')[', i0, '] = ', d16.10, ';', d16.10)
+2012 format('d[', i0, '] = ', d16.10)
+2013 format('c[', i0, '] = ', d16.10, ';', d16.10)
+end program
diff --git a/bindings/f77/test/gdcopn.f b/bindings/f77/test/gdcopn.f
new file mode 100644
index 0000000..89a9cf5
--- /dev/null
+++ b/bindings/f77/test/gdcopn.f
@@ -0,0 +1,59 @@
+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
+
+ PROGRAM GETTST
+ EXTERNAL CALBCK
+ INCLUDE "getdata.f"
+
+ CHARACTER*12 fildir
+ PARAMETER (fildir = 'test_dirfile')
+ CHARACTER*19 frmat
+ PARAMETER (frmat = 'test_dirfile/format')
+ CHARACTER*17 dat
+ PARAMETER (dat = 'test_dirfile/data')
+ CHARACTER*15 frmdat1
+ PARAMETER (frmdat1 = 'data RAW INT8 8')
+ CHARACTER*9 frmdat2
+ PARAMETER (frmdat2 = 'bad line')
+ INTEGER*1 datdat(80)
+ INTEGER*1 i;
+ INTEGER d;
+ INTEGER e;
+
+ 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, *) frmdat1
+ WRITE(1, *) frmdat2
+ 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_RO, CALBCK)
+ CALL GDEROR(e, d)
+ CALL GDCLOS(d)
+
+ CALL SYSTEM ( 'rm -rf ' // fildir )
+
+ IF (e .NE. GD_EOK) CALL EXIT(1)
+
+ STOP
+ END
diff --git a/bindings/idl/Makefile.am b/bindings/idl/Makefile.am
new file mode 100644
index 0000000..3ac4638
--- /dev/null
+++ b/bindings/idl/Makefile.am
@@ -0,0 +1,98 @@
+# 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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CC_WALL
+WALL=-Wall
+endif
+
+if GETDATA_DEBUG
+DEBUG_C = ../../src/debug.c
+endif
+
+SUBDIRS=test
+
+if GDIDL_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 = ${WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS)
+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 ${DEBUG_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
+
diff --git a/bindings/idl/Makefile.in b/bindings/idl/Makefile.in
new file mode 100644
index 0000000..335b2f9
--- /dev/null
+++ b/bindings/idl/Makefile.in
@@ -0,0 +1,861 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/idl
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/makedlm.sh.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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__installdirs = "$(DESTDIR)$(idldir)" "$(DESTDIR)$(idldir)"
+LTLIBRARIES = $(idl_LTLIBRARIES)
+ at GDIDL_EXTERNAL_FALSE@am__DEPENDENCIES_1 = ../../src/libgetdata.la
+idl_getdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_idl_getdata_la_OBJECTS = getdata.lo
+ at GETDATA_DEBUG_TRUE@am__objects_1 = debug.lo
+nodist_idl_getdata_la_OBJECTS = constants.lo sublist.lo \
+ $(am__objects_1)
+idl_getdata_la_OBJECTS = $(am_idl_getdata_la_OBJECTS) \
+ $(nodist_idl_getdata_la_OBJECTS)
+idl_getdata_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(idl_getdata_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(idl_getdata_la_SOURCES) $(nodist_idl_getdata_la_SOURCES)
+DIST_SOURCES = $(idl_getdata_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+HEADERS = $(nodist_idl_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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, 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
+#
+AUTOMAKE_OPTIONS = foreign
+ at CC_WALL_TRUE@WALL = -Wall
+ at GETDATA_DEBUG_TRUE@DEBUG_C = ../../src/debug.c
+SUBDIRS = test
+ at GDIDL_EXTERNAL_FALSE@GDIDL_GETDATA_LIBS = ../../src/libgetdata.la
+ at GDIDL_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 = ${WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS)
+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 ${DEBUG_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)
+ test -z "$(idldir)" || $(MKDIR_P) "$(DESTDIR)$(idldir)"
+ @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 " $(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)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+idl_getdata.la: $(idl_getdata_la_OBJECTS) $(idl_getdata_la_DEPENDENCIES)
+ $(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
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/constants.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getdata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sublist.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+debug.lo: ../../src/debug.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug.lo -MD -MP -MF $(DEPDIR)/debug.Tpo -c -o debug.lo `test -f '../../src/debug.c' || echo '$(srcdir)/'`../../src/debug.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/debug.Tpo $(DEPDIR)/debug.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../../src/debug.c' object='debug.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f '../../src/debug.c' || echo '$(srcdir)/'`../../src/debug.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-nodist_idlHEADERS: $(nodist_idl_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(idldir)" || $(MKDIR_P) "$(DESTDIR)$(idldir)"
+ @list='$(nodist_idl_HEADERS)'; test -n "$(idldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(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|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(idldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(idldir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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 \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -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: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+ ctags-recursive install install-am install-strip \
+ tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am all-local check check-am clean clean-generic \
+ clean-idlLTLIBRARIES clean-libtool clean-local ctags \
+ ctags-recursive distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am \
+ install-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-recursive 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
+
+ at HAVE_DIFF_TRUE@sublist.stamp: sublist.c.in
+ at HAVE_DIFF_TRUE@ @if $(DIFF) sublist.c sublist.c.in >/dev/null 2>&1; then \
+ at HAVE_DIFF_TRUE@ echo "sublist.c is unchanged"; \
+ at HAVE_DIFF_TRUE@ else \
+ at HAVE_DIFF_TRUE@ rm -f sublist.c; \
+ at HAVE_DIFF_TRUE@ cp sublist.c.in sublist.c; \
+ at HAVE_DIFF_TRUE@ fi; \
+ at HAVE_DIFF_TRUE@ touch sublist.stamp
+
+ at HAVE_DIFF_FALSE@sublist.stamp: sublist.c.in
+ at HAVE_DIFF_FALSE@ @rm -f sublist.c; \
+ at HAVE_DIFF_FALSE@ cp sublist.c.in sublist.c; \
+ at 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:
diff --git a/bindings/idl/getdata.c b/bindings/idl/getdata.c
new file mode 100644
index 0000000..7bd2582
--- /dev/null
+++ b/bindings/idl/getdata.c
@@ -0,0 +1,4739 @@
+/* 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <idl_export.h>
+#include <stdlib.h>
+#define NO_GETDATA_LEGACY_API
+#undef _BSD_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#undef _SVID_SOURCE
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef GDIDL_EXTERNAL
+# include <complex.h>
+# include <getdata.h>
+# define dtracevoid()
+# define dtrace(...)
+# define dprintf(...)
+# define dreturnvoid()
+# define dreturn(...)
+# define dwatch(...)
+#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;
+
+/* Remember: there's a longjmp here -- in general this will play merry havoc
+ * with our debugging messagecruft */
+#define idl_abort(s) do { dreturnvoid(); \
+ IDL_Message(IDL_M_GENERIC, IDL_MSG_LONGJMP, s); } while(0)
+#define idl_kw_abort(s) do { IDL_KW_FREE; idl_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 */
+ idl_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 */
+static inline UCHAR gdidl_idl_type(gd_type_t t) {
+ switch (t) {
+ case GD_UINT8:
+ return IDL_TYP_BYTE;
+ case GD_UINT16:
+ return IDL_TYP_UINT;
+ case GD_INT8: /* there is no signed 8-bit type in IDL
+ - we type promote to INT */
+ case GD_INT16:
+ return IDL_TYP_INT;
+ case GD_UINT32:
+ return IDL_TYP_ULONG;
+ case GD_INT32:
+ return IDL_TYP_LONG;
+ case GD_UINT64:
+ return IDL_TYP_ULONG64;
+ case GD_INT64:
+ return IDL_TYP_LONG64;
+ case GD_FLOAT32:
+ return IDL_TYP_FLOAT;
+ case GD_FLOAT64:
+ return IDL_TYP_DOUBLE;
+ case GD_COMPLEX64:
+ return IDL_TYP_COMPLEX;
+ case GD_COMPLEX128:
+ return IDL_TYP_DCOMPLEX;
+ case GD_NULL:
+ case GD_UNKNOWN:
+ ;
+ }
+
+ return IDL_TYP_UNDEF;
+}
+
+/* convert an IDL type code to a GetData type code */
+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 */
+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 */
+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 */
+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 */
+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 */
+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;
+
+ /* 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)
+ idl_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
+ idl_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
+ idl_abort("complex value expected");
+ }
+
+ 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)
+ {
+ IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+ "IN_FIELDS", IDL_MSG_LONGJMP, NULL)), E->in_fields[0]);
+ }
+
+ 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;
+ *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+ "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
+ 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];
+ }
+ if (E->comp_scal) {
+ 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);
+ } else {
+ 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_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+ "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
+ 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];
+
+ if (E->comp_scal)
+ gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
+ IDL_StructTagInfoByName(gdidl_entry_def, "CDIVIDEND",
+ IDL_MSG_LONGJMP, NULL)), &E->cdividend, 1);
+ else
+ *(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,
+ "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
+ *(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];
+ }
+
+ if (E->comp_scal)
+ gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
+ IDL_StructTagInfoByName(gdidl_entry_def, "CA", IDL_MSG_LONGJMP,
+ NULL)), E->ca, E->poly_ord + 1);
+ else
+ memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "A",
+ IDL_MSG_LONGJMP, NULL), E->a,
+ (E->poly_ord + 1) * sizeof(double));
+ break;
+ case GD_CARRAY_ENTRY:
+ *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "ARRAY_LEN",
+ IDL_MSG_LONGJMP, NULL)) = E->array_len;
+ /* fallthrough */
+ 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_INDEX_ENTRY:
+ case GD_STRING_ENTRY:
+ break;
+ }
+
+ dreturn("%p", r);
+ return r;
+}
+
+/* convert an IDL structure into an gd_entry_t */
+void gdidl_read_idl_entry(gd_entry_t *E, IDL_VPTR v, int alter)
+{
+ /* 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", E, v, alter);
+
+ IDL_VPTR d;
+ IDL_MEMINT o;
+ int i, n = 0;
+ int copy_scalar[GD_MAX_POLYORD + 1];
+ int action = (alter) ? IDL_MSG_RET | IDL_MSG_ATTR_NOPRINT : IDL_MSG_LONGJMP;
+
+ memset(copy_scalar, 0, sizeof(int) * (GD_MAX_POLYORD + 1));
+ memset(E, 0, sizeof(gd_entry_t));
+
+ unsigned char* data = v->value.s.arr->data;
+
+ if (!alter) {
+ /* field */
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "FIELD", IDL_MSG_LONGJMP, &d);
+ IDL_ENSURE_STRING(d);
+ E->field = IDL_STRING_STR((IDL_STRING*)(data + o));
+
+ /* fragment_index */
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "FRAGMENT", IDL_MSG_LONGJMP,
+ &d);
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element FRAGMENT must be of type INT");
+ E->fragment_index = *(int16_t*)(data + o);
+ }
+
+ /* field_type */
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "FIELD_TYPE", IDL_MSG_LONGJMP,
+ &d);
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element FIELD_TYPE must be of type INT");
+ E->field_type = *(int16_t*)(data + o);
+
+ /* the common case in_fields */
+ 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)
+ {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "IN_FIELDS", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_STRING(d);
+ E->in_fields[0] = IDL_STRING_STR((IDL_STRING*)(data + o));
+ }
+ }
+
+ switch (E->field_type)
+ {
+ case GD_RAW_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "SPF", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_UINT)
+ idl_abort("GD_ENTRY element INDEX must be of type UINT");
+ E->spf = *(uint16_t*)(data + o);
+ }
+
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "DATA_TYPE", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element DATA_TYPE must be of type INT");
+ E->data_type = *(int16_t*)(data + o);
+ } else
+ E->data_type = GD_NULL;
+
+ copy_scalar[0] = 1;
+
+ break;
+ case GD_LINCOM_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "N_FIELDS", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element N_FIELDS must be of type INT");
+ n = E->n_fields = *(int16_t*)(data + o);
+ }
+
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "COMP_SCAL", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element COMP_SCAL must be of type INT");
+ E->comp_scal = *(int16_t*)(data + o);
+ }
+
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "IN_FIELDS", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_STRING(d);
+ IDL_ENSURE_ARRAY(d);
+ if (n == 0) {
+ n = d->value.arr->dim[0];
+ if (n > GD_MAX_LINCOM)
+ n = GD_MAX_LINCOM;
+ }
+ for (i = 0; i < n; ++i)
+ E->in_fields[i] = IDL_STRING_STR((IDL_STRING*)(data + o) + i);
+ }
+
+ for (i = 0 ; i < n; ++i) {
+ copy_scalar[i] = 1;
+ copy_scalar[i + GD_MAX_LINCOM] = 1;
+ }
+
+ if (E->comp_scal) {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "CM", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_ARRAY(d);
+ if (n == 0) {
+ n = d->value.arr->dim[0];
+ if (n > GD_MAX_LINCOM)
+ n = GD_MAX_LINCOM;
+ }
+ if (d->type == IDL_TYP_DCOMPLEX)
+ gdidl_dcmp_to_c99(E->cm, (IDL_DCOMPLEX*)data + o, n);
+ else
+ idl_abort("GD_ENTRY element CM must be of type DCOMPLEX");
+ }
+ } else {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "M", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_ARRAY(d);
+ if (n == 0) {
+ n = d->value.arr->dim[0];
+ if (n > GD_MAX_LINCOM)
+ n = GD_MAX_LINCOM;
+ }
+ if (d->type == IDL_TYP_DOUBLE) {
+ memcpy(E->m, data + o, n * sizeof(double));
+ for (i = 0; i < n; ++i)
+ E->cm[i] = E->m[i];
+ } else
+ idl_abort("GD_ENTRY element M must be of type DOUBLE");
+ }
+ }
+
+ if (E->comp_scal) {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "CB", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_ARRAY(d);
+ if (n == 0) {
+ n = d->value.arr->dim[0];
+ if (n > GD_MAX_LINCOM)
+ n = GD_MAX_LINCOM;
+ }
+ if (d->type == IDL_TYP_DCOMPLEX)
+ gdidl_dcmp_to_c99(E->cb, (IDL_DCOMPLEX*)data + o,
+ E->n_fields);
+ else
+ idl_abort("GD_ENTRY element CB must be of type DCOMPLEX");
+ }
+ } else {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "B", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_ARRAY(d);
+ if (n == 0) {
+ n = d->value.arr->dim[0];
+ if (n > GD_MAX_LINCOM)
+ n = GD_MAX_LINCOM;
+ }
+ if (d->type == IDL_TYP_DOUBLE) {
+ memcpy(E->b, data + o, E->n_fields *
+ sizeof(double));
+ for (i = 0; i < E->n_fields; ++i)
+ E->cb[i] = E->b[i];
+ } else
+ idl_abort("GD_ENTRY element B must be of type DOUBLE");
+ }
+ }
+ break;
+ case GD_LINTERP_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "TABLE", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_STRING(d);
+ E->field = IDL_STRING_STR((IDL_STRING*)(data + o));
+ }
+ break;
+ case GD_BIT_ENTRY:
+ case GD_SBIT_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "BITNUM", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element BITNUM must be of type INT");
+ E->bitnum = *(int16_t*)(data + o);
+ } else
+ E->bitnum = -1;
+
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "NUMBITS", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element NUMBITS must be of type INT");
+ E->numbits = *(int16_t*)(data + o);
+ }
+
+ copy_scalar[0] = copy_scalar[1] = 1;
+ break;
+ case GD_MULTIPLY_ENTRY:
+ case GD_DIVIDE_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "IN_FIELDS", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_STRING(d);
+ E->in_fields[1] = IDL_STRING_STR((IDL_STRING*)(data + o) + 1);
+ }
+ break;
+ case GD_RECIP_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "COMP_SCAL", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element COMP_SCAL must be of type INT");
+ E->comp_scal = *(int16_t*)(data + o);
+ }
+
+ if (E->comp_scal) {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "CDIVIDEND", action, &d);
+ if (o != -1) {
+ if (d->type == IDL_TYP_DCOMPLEX)
+ gdidl_dcmp_to_c99(&E->cdividend, (IDL_DCOMPLEX*)data + o,
+ 1);
+ else
+ idl_abort("GD_ENTRY element CDIVIDEND must be of type DCOMPLEX");
+ }
+ } else {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "DIVIDEND", action, &d);
+ if (o != -1) {
+ if (d->type == IDL_TYP_DOUBLE)
+ E->dividend = *(double*)(data + o);
+ else
+ idl_abort("GD_ENTRY element DIVIDEND must be of type DOUBLE");
+ }
+ }
+ copy_scalar[0] = 1;
+ break;
+ case GD_PHASE_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "SHIFT", IDL_MSG_LONGJMP,
+ &d);
+ if (d->type != IDL_TYP_LONG)
+ idl_abort("GD_ENTRY element SHIFT must be of type LONG");
+ E->shift = *(int16_t*)(data + o);
+ copy_scalar[0] = 1;
+ break;
+ case GD_POLYNOM_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "POLY_ORD", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element POLY_ORD must be of type INT");
+ E->poly_ord = *(int16_t*)(data + o);
+ n = E->poly_ord + 1;
+ }
+
+ for (i = 0 ; i < n; ++i)
+ copy_scalar[i] = 1;
+
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "COMP_SCAL", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element COMP_SCAL must be of type INT");
+ E->comp_scal = *(int16_t*)(data + o);
+ }
+
+ if (E->comp_scal) {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "CA", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_ARRAY(d);
+ if (n == 0) {
+ n = d->value.arr->dim[0];
+ if (n > GD_MAX_POLYORD + 1)
+ n = GD_MAX_POLYORD;
+ }
+ if (d->type == IDL_TYP_DCOMPLEX)
+ gdidl_dcmp_to_c99(E->ca, (IDL_DCOMPLEX*)data + o, n);
+ else
+ idl_abort("GD_ENTRY element CA must be of type DCOMPLEX");
+ }
+ } else {
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "A", action, &d);
+ if (o != -1) {
+ IDL_ENSURE_ARRAY(d);
+ if (n == 0) {
+ n = d->value.arr->dim[0];
+ if (n > GD_MAX_POLYORD + 1)
+ n = GD_MAX_POLYORD;
+ }
+ if (d->type == IDL_TYP_DOUBLE)
+ memcpy(E->a, data + o, n * sizeof(double));
+ else
+ idl_abort("GD_ENTRY element A must be of type DOUBLE");
+ }
+ }
+ break;
+ case GD_CARRAY_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "ARRAY_LEN", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element ARRAY_LEN must be of type INT");
+ E->array_len = *(int16_t*)(data + o);
+ } else
+ E->array_len = 0;
+ /* fallthrough */
+ case GD_CONST_ENTRY:
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "DATA_TYPE", action, &d);
+ if (o != -1) {
+ if (d->type != IDL_TYP_INT)
+ idl_abort("GD_ENTRY element DATA_TYPE must be of type INT");
+ E->const_type = *(int16_t*)(data + o);
+ } else
+ E->const_type = GD_NULL;
+ break;
+ case GD_NO_ENTRY:
+ case GD_INDEX_ENTRY:
+ case GD_STRING_ENTRY:
+ break;
+ }
+
+ /* scalars */
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "SCALAR", action, &d);
+ if (o != -1) {
+ for (i = 0; i < GD_MAX_POLYORD + 1; ++i)
+ if (copy_scalar[i]) {
+ E->scalar[i] = IDL_STRING_STR((IDL_STRING*)(data + o) + i);
+ if (E->scalar[i][0] == '\0')
+ E->scalar[i] = NULL;
+ }
+ } else
+ for (i = 0; i < GD_MAX_POLYORD + 1; ++i)
+ E->scalar[i] = NULL;
+
+ /* scalar indices */
+ o = IDL_StructTagInfoByName(v->value.s.sdef, "SCALAR_IND", action, &d);
+ if (o != -1)
+ for (i = 0; i < GD_MAX_POLYORD + 1; ++i)
+ if (copy_scalar[i])
+ E->scalar_ind[i] = *((int16_t*)(data + o) + i);
+
+ 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, "LZMA"))
+ encoding = GD_LZMA_ENCODED;
+ else if (strcasecmp(enc, "SLIM"))
+ encoding = GD_SLIM_ENCODED;
+ else if (strcasecmp(enc, "TEXT"))
+ encoding = GD_TEXT_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
+ idl_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 */
+/* @@DLM: P gdidl_add GD_MADD 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], 0);
+
+ 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 */
+/* @@DLM: P gdidl_add_bit GD_MADD_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 */
+/* @@DLM: P gdidl_add_const GD_MADD_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 */
+/* @@DLM: P gdidl_add_carray GD_MADD_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)
+ idl_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
+ idl_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 */
+/* @@DLM: P gdidl_add_lincom GD_ADD_CLINCOM 5 11 KEYWORDS */
+/* @@DLM: P gdidl_add_lincom GD_MADD_CLINCOM 5 11 KEYWORDS */
+/* @@DLM: P gdidl_add_lincom GD_MADD_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 */
+/* @@DLM: P gdidl_add_linterp GD_MADD_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();
+}
+
+/* @@DLM: P gdidl_add_multiply GD_ADD_MULTIPLY 4 4 KEYWORDS */
+/* @@DLM: P gdidl_add_multiply GD_MADD_MULTIPLY 4 4 KEYWORDS */
+void gdidl_add_multiply(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_field1 = IDL_VarGetString(argv[2]);
+ const char* in_field2 = IDL_VarGetString(argv[3]);
+
+ if (kw.parent_x) {
+ const char* parent = IDL_STRING_STR(&kw.parent);
+ gd_madd_multiply(D, parent, field_code, in_field1, in_field2);
+ } else
+ gd_add_multiply(D, field_code, in_field1, in_field2, kw.fragment_index);
+
+ GDIDL_SET_ERROR(D);
+
+ IDL_KW_FREE;
+
+ dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_divide GD_ADD_DIVIDE 4 4 KEYWORDS */
+/* @@DLM: P gdidl_add_divide GD_MADD_DIVIDE 4 4 KEYWORDS */
+void gdidl_add_divide(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_field1 = IDL_VarGetString(argv[2]);
+ const char* in_field2 = IDL_VarGetString(argv[3]);
+
+ if (kw.parent_x) {
+ const char* parent = IDL_STRING_STR(&kw.parent);
+ gd_madd_divide(D, parent, field_code, in_field1, in_field2);
+ } else
+ gd_add_divide(D, field_code, in_field1, in_field2, kw.fragment_index);
+
+ GDIDL_SET_ERROR(D);
+
+ IDL_KW_FREE;
+
+ dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_recip GD_ADD_RECIP 3 3 KEYWORDS */
+/* @@DLM: P gdidl_add_recip GD_ADD_CRECIP 3 3 KEYWORDS */
+/* @@DLM: P gdidl_add_recip GD_MADD_RECIP 3 3 KEYWORDS */
+/* @@DLM: P gdidl_add_recip GD_MADD_CRECIP 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 */
+/* @@DLM: P gdidl_add_phase GD_MADD_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 */
+/* @@DLM: P gdidl_add_polynom GD_ADD_CPOLYNOM 4 8 KEYWORDS */
+/* @@DLM: P gdidl_add_polynom GD_MADD_CPOLYNOM 4 9 KEYWORDS */
+/* @@DLM: P gdidl_add_polynom GD_MADD_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)
+ idl_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)
+ idl_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:
+ idl_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 */
+/* @@DLM: P gdidl_add_sbit GD_MADD_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 */
+/* @@DLM: P gdidl_add_spec GD_MADD_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 */
+/* @@DLM: P gdidl_add_string GD_MADD_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;
+
+ 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]);
+ gdidl_read_idl_entry(&E, argv[2], 1);
+
+ 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 */
+/* @@DLM: P gdidl_alter_lincom GD_ALTER_CLINCOM 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)
+ idl_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)
+ idl_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)
+ idl_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)
+ idl_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();
+}
+
+/* @@DLM: P gdidl_alter_multiply GD_ALTER_MULTIPLY 2 2 KEYWORDS */
+void gdidl_alter_multiply(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;
+ 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]));
+ const char* field_code = IDL_VarGetString(argv[1]);
+
+ 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_multiply(D, field_code, in_field1, in_field2);
+
+ GDIDL_SET_ERROR(D);
+
+ IDL_KW_FREE;
+
+ dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_divide GD_ALTER_DIVIDE 2 2 KEYWORDS */
+void gdidl_alter_divide(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;
+ 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]));
+ const char* field_code = IDL_VarGetString(argv[1]);
+
+ 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_divide(D, field_code, in_field1, in_field2);
+
+ GDIDL_SET_ERROR(D);
+
+ IDL_KW_FREE;
+
+ dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_recip GD_ALTER_RECIP 2 2 KEYWORDS */
+/* @@DLM: P gdidl_alter_recip GD_ALTER_CRECIP 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 */
+/* @@DLM: P gdidl_alter_polynom GD_ALTER_CPOLYNOM 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)
+ idl_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 */
+/* @@DLM: P gdidl_alter_spec GD_MALTER_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;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ kw.data = kw.deref = kw.force = 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) },
+ { 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);
+
+ 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;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ const char* field_code = NULL;
+
+ GDIDL_KW_INIT_ERROR;
+ kw.field_code_x = 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) },
+ { 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);
+
+ 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();
+
+ 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;
+ } 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 = 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) },
+ { "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);
+
+ int index = (int16_t)gd_include(D, file, kw.fragment_index, 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 move_data;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ kw.move_data = 0;
+ GDIDL_KW_INIT_ERROR;
+
+ static IDL_KW_PAR kw_pars[] = {
+ GDIDL_KW_PAR_ERROR,
+ GDIDL_KW_PAR_ESTRING,
+ { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
+ { 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.move_data);
+
+ 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 little_end;
+ int not_arm_end;
+ int pedantic;
+ int permissive;
+ int trunc;
+ 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 = 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) },
+ { "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) },
+ { "RDWR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(rdwr) },
+ { "TRUNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(trunc) },
+ { "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.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) | (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: P gdidl_reference GD_REFERENCE 2 2 KEYWORDS */
+void gdidl_reference(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_reference(D, field_code);
+
+ GDIDL_SET_ERROR(D);
+
+ IDL_KW_FREE;
+
+ dreturnvoid();
+}
+
+/* @@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 move_data;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ kw.move_data = 0;
+ GDIDL_KW_INIT_ERROR;
+
+ static IDL_KW_PAR kw_pars[] = {
+ GDIDL_KW_PAR_ERROR,
+ GDIDL_KW_PAR_ESTRING,
+ { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
+ { 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.move_data);
+
+ 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;
+ gd_type_t return_type;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ IDL_VPTR r;
+
+ kw.first_frame = kw.first_sample = kw.n_frames = kw.n_samples = 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, 0, IDL_KW_OFFSETOF(first_frame) },
+ { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, 0, 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);
+
+ /* no signed 8-bit type in IDL */
+ if (kw.return_type == GD_INT8)
+ idl_kw_abort("Cannot return data as a signed 8-bit integer.");
+
+ 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);
+
+ if (gd_error(D))
+ r = IDL_GettmpInt(0);
+ else {
+ void* data = malloc((kw.n_frames * spf + kw.n_samples) *
+ GD_SIZE(kw.return_type));
+
+ gd_getdata64(D, field_code, kw.first_frame, kw.first_sample, kw.n_frames,
+ kw.n_samples, kw.return_type, data);
+
+ if (gd_error(D)) {
+ free(data);
+ r = IDL_GettmpInt(0);
+ } else {
+ IDL_MEMINT dim[] = { kw.n_frames * spf + kw.n_samples };
+ 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]);
+
+ off64_t bof = gd_bof(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_carray_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 */
+/* @@DLM: F gdidl_get_constants GD_MCONSTANTS 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)
+ idl_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);
+ IDL_ALLTYPES v = gdidl_to_alltypes(kw.const_type, data);
+ IDL_StoreScalar(r, gdidl_idl_type(kw.const_type), &v);
+ } 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_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]);
+
+ off64_t eof = gd_eof(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_FIELD_LIST 1 1 KEYWORDS */
+/* @@DLM: F gdidl_get_field_list GD_FIELD_LIST_BY_TYPE 1 1 KEYWORDS */
+/* @@DLM: F gdidl_get_field_list GD_MFIELD_LIST 1 1 KEYWORDS */
+/* @@DLM: F gdidl_get_field_list GD_MFIELD_LIST_BY_TYPE 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_field_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;
+ int type_x;
+ IDL_STRING parent;
+ int parent_x;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ GDIDL_KW_INIT_ERROR;
+ kw.type = kw.type_x = 0;
+ 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) },
+ { "TYPE", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(type_x),
+ IDL_KW_OFFSETOF(type) },
+ { 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);
+ if (kw.type_x) {
+ nfields = gd_nmfields_by_type(D, parent, kw.type);
+ list = gd_mfield_list_by_type(D, parent, kw.type);
+ } else {
+ nfields = gd_nmfields(D, parent);
+ list = gd_mfield_list(D, parent);
+ }
+ } else {
+ if (kw.type_x) {
+ nfields = gd_nfields_by_type(D, kw.type);
+ list = gd_field_list_by_type(D, kw.type);
+ } else {
+ nfields = gd_nfields(D);
+ list = gd_field_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: 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 */
+/* @@DLM: F gdidl_get_framenum GD_FRAMENUM_SUBSET 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]));
+
+ 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_NFIELDS 1 1 KEYWORDS */
+/* @@DLM: F gdidl_get_nfields GD_NFIELDS_BY_TYPE 1 1 KEYWORDS */
+/* @@DLM: F gdidl_get_nfields GD_NMFIELDS 1 1 KEYWORDS */
+/* @@DLM: F gdidl_get_nfields GD_NMFIELDS_BY_TYPE 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_nfields(int argc, IDL_VPTR argv[], char *argk)
+{
+ dtraceidl();
+
+ unsigned int nfields;
+
+ typedef struct {
+ IDL_KW_RESULT_FIRST_FIELD;
+ GDIDL_KW_RESULT_ERROR;
+ gd_type_t type;
+ int type_x;
+ IDL_STRING parent;
+ int parent_x;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ GDIDL_KW_INIT_ERROR;
+ kw.type = kw.type_x = 0;
+ 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) },
+ { "TYPE", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(type_x),
+ IDL_KW_OFFSETOF(type) },
+ { 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);
+ if (kw.type_x)
+ nfields = gd_nmfields_by_type(D, parent, kw.type);
+ else
+ nfields = gd_nmfields(D, parent);
+ } else {
+ if (kw.type_x)
+ nfields = gd_nfields_by_type(D, kw.type);
+ else
+ nfields = gd_nfields(D);
+ }
+
+ GDIDL_SET_ERROR(D);
+
+ IDL_KW_FREE;
+
+ IDL_VPTR r = IDL_GettmpLong(nfields);
+ 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]));
+
+ 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_NMVECTORS 1 1 KEYWORDS */
+/* @@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;
+}
+
+/* @@DLM: F gdidl_carray_len GD_CARRAY_LEN 2 2 KEYWORDS */
+IDL_VPTR gdidl_carray_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_carray_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 */
+/* @@DLM: F gdidl_get_strings GD_MSTRINGS 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 */
+/* @@DLM: F gdidl_get_vector_list GD_MVECTOR_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;
+ } KW_RESULT;
+ KW_RESULT kw;
+
+ kw.first_frame = kw.first_sample = 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, 0, IDL_KW_OFFSETOF(first_frame) },
+ { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, 0, 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]);
+
+ IDL_ENSURE_ARRAY(argv[2]);
+ if (argv[2]->value.arr->n_dim != 1)
+ idl_kw_abort("data must be a vector, not a multidimensional array");
+
+ 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)
+ idl_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;
+}
+
+
+
+/**** 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 gnerated 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 },
+ { "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 */
+ { "COMP_SCAL", 0, (void*)IDL_TYP_INT }, /* LINCOM / POLYNOM */
+ { "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 */
+ { "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 */
+ { 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;
+}
diff --git a/bindings/idl/makedlm.sh.in b/bindings/idl/makedlm.sh.in
new file mode 100644
index 0000000..02062fb
--- /dev/null
+++ b/bindings/idl/makedlm.sh.in
@@ -0,0 +1,73 @@
+#!/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@
+
+sed=@SED@
+grep=@GREP@
+opt=$1
+in=$2
+
+if test "$opt" = "-c"; then
+cat <<EOF
+/* This code is automatically generated. Changes made here will be lost. */
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <idl_export.h>
+EOF
+else
+cat <<EOF
+MODULE GETDATA
+DESCRIPTION IDL GetData bindings
+VERSION @VERSION@
+BUILD_DATE @BUILD_DATE@
+SOURCE The GetData Project <@PACKAGE_BUGREPORT@>
+
+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; }
diff --git a/bindings/idl/test/Makefile.am b/bindings/idl/test/Makefile.am
new file mode 100644
index 0000000..bc11bbc
--- /dev/null
+++ b/bindings/idl/test/Makefile.am
@@ -0,0 +1,40 @@
+# 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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if TEST_IDL
+TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../../src/.libs 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 *~
diff --git a/bindings/idl/test/Makefile.in b/bindings/idl/test/Makefile.in
new file mode 100644
index 0000000..67906fe
--- /dev/null
+++ b/bindings/idl/test/Makefile.in
@@ -0,0 +1,549 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/idl/test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/config.h \
+ $(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at TEST_IDL_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../../src/.libs IDL_PATH="${srcdir}" IDL_DLM_PATH=../.libs ${IDL}
+ at TEST_IDL_TRUE@idlTESTS = big_test.pro
+ at 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
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+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; 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 \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-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 distclean \
+ distclean-generic distclean-libtool distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+# 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:
diff --git a/bindings/idl/test/big_test.pro b/bindings/idl/test/big_test.pro
new file mode 100644
index 0000000..de4484d
--- /dev/null
+++ b/bindings/idl/test/big_test.pro
@@ -0,0 +1,1123 @@
+; 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
+
+; 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 = 7
+nfields = 14
+nume = 0
+
+spawn, "rm -rf " + filedir
+file_mkdir, filedir
+
+datadata = bindgen(80) + 1
+
+fields = [ 'INDEX', 'bit', 'carray', 'const', 'data', 'div', 'lincom', $
+ 'linterp', 'mult', 'phase', 'polynom', 'recip', 'sbit', 'string' ]
+
+; 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 /look/up/file'
+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,'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,'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
+
+; 140: getdata_constants check
+defsysv, "!GD", getdata_constants()
+nume += check_simple(140, !GD.E_OPEN, 1)
+
+; 0: gd_error check
+d = gd_open("x",error=error)
+nume += check_error(0, d, !GD.E_OPEN)
+nume += check_simple(0, error, !GD.E_OPEN)
+gd_close, d, /DISCARD
+
+; 1: gd_open check
+d = gd_open(filedir, /RDWR)
+nume += check_ok(1, d)
+nume += check_simple(1, d, 1)
+
+; 2: gd_getdata check
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok(2, d)
+nume += check_simple(2, n, INDGEN(8) + 41)
+
+; 3: gd_get_constant check
+n = gd_get_constant(d, "const", type=!GD.FLOAT64)
+nume += check_ok(3, d)
+nume += check_simple(3, n, 5.5)
+
+; 6: gd_nfields check
+n = gd_nfields(d)
+nume += check_ok(6, d)
+nume += check_simple(6, n, nfields)
+
+; 8: gd_field_list check
+n = gd_field_list(d)
+nume += check_ok(8, d)
+nume += check_simple(8, n, fields)
+
+; 9: gd_nmfields_check
+n = gd_nfields(d, parent="data")
+nume += check_ok(9, d)
+nume += check_simple(9, n, 3)
+
+; 10: gd_mfield_list check
+n = gd_field_list(d, parent="data")
+nume += check_ok(10, d)
+nume += check_simple(10, n, [ "mstr", "mconst", "mlut" ])
+
+; 11: gd_nframes check
+n = gd_nframes(d)
+nume += check_ok(11, d)
+nume += check_simple(11, n, 10)
+
+; 12: gd_spf check
+n = gd_spf(d, "data")
+nume += check_ok(12, d)
+nume += check_simple(12, n, 8)
+
+; 13: gd_putdata check
+gd_putdata, d, "data", [13, 14, 15, 16], first_frame=5, first_sample=1
+nume += check_ok2(13, 1, d)
+
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok2(13, 2, d)
+nume += check_simple(13, n, [ 41, 13, 14, 15, 16, 46, 47, 48])
+
+; 122: gd_putdata (float) check
+gd_putdata, d, "data", [23., 24., 25., 26.], first_frame=5, first_sample=1
+nume += check_ok2(122, 1, d)
+
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok2(122, 2, d)
+nume += check_simple(122, n, [ 41, 23, 24, 25, 26, 46, 47, 48])
+
+; 124: 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(124, 1, d)
+
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok2(124, 2, d)
+nume += check_simple(124, n, [ 41, 33, 34, 35, 36, 46, 47, 48])
+
+; 14: gd_error_string check
+n = gd_getdata(d, "x", num_frames=1, estring=estring)
+nume += check_error(14, d, !GD.E_BAD_CODE)
+nume += check_simple2(14, 1, gd_error_string(d), "Field not found: x")
+nume += check_simple2(14, 2, estring, "Field not found: x")
+
+; 15: gd_entry_type check
+n = gd_entry_type(d, "data")
+nume += check_ok(15, d)
+nume += check_simple(15, n, !GD.RAW_ENTRY)
+
+; 16: gd_entry (raw)
+n = gd_entry(d, "data")
+nume += check_ok(16, d)
+nume += check_simple2(16, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(16, 2, n.field, "data")
+nume += check_simple2(16, 3, n.fragment, 0)
+nume += check_simple2(16, 4, n.data_type, !GD.INT8)
+nume += check_simple2(16, 5, n.spf, 8)
+
+; 18: gd_entry (lincom)
+n = gd_entry(d, "lincom")
+nume += check_ok(18, d)
+nume += check_simple2(18, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(18, 2, n.field, "lincom")
+nume += check_simple2(18, 3, n.fragment, 0)
+nume += check_simple2(18, 4, n.n_fields, 3)
+nume += check_simple2(18, 5, n.in_fields, [ "data", "INDEX", "linterp" ])
+nume += check_simple2(18, 6, n.comp_scal, 1)
+nume += check_simple2(18, 7, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $
+ DCOMPLEX(5.5D,0) ])
+nume += check_simple2(18, 8, n.cb, [ DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), $
+ DCOMPLEX(5.5D,0) ])
+nume += check_simple2(18, 9, n.scalar, [ "", "", "const", "", "", "const" ])
+
+; 20: gd_entry (polynom)
+n = gd_entry(d, "polynom")
+nume += check_ok(20, d)
+nume += check_simple2(20, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(20, 2, n.field, "polynom")
+nume += check_simple2(20, 3, n.fragment, 0)
+nume += check_simple2(20, 4, n.poly_ord, 5)
+nume += check_simple2(20, 5, n.in_fields, [ "data" ])
+nume += check_simple2(20, 6, n.comp_scal, 1)
+nume += check_simple2(20, 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(20, 8, n.scalar, [ "", "", "", "", "const", "const" ])
+
+; 21: gd_entry (linterp)
+n = gd_entry(d, "linterp")
+nume += check_ok(21, d)
+nume += check_simple2(21, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(21, 2, n.field, "linterp")
+nume += check_simple2(21, 3, n.fragment, 0)
+nume += check_simple2(21, 4, n.in_fields, [ "data" ])
+nume += check_simple2(21, 5, n.table, "/look/up/file")
+
+; 22: gd_entry (bit)
+n = gd_entry(d, "bit")
+nume += check_ok(22, d)
+nume += check_simple2(22, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(22, 2, n.field, "bit")
+nume += check_simple2(22, 3, n.fragment, 0)
+nume += check_simple2(22, 4, n.in_fields, [ "data" ])
+nume += check_simple2(22, 5, n.numbits, 4)
+nume += check_simple2(22, 6, n.bitnum, 3)
+
+; 23: gd_entry (sbit)
+n = gd_entry(d, "sbit")
+nume += check_ok(23, d)
+nume += check_simple2(23, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(23, 2, n.field, "sbit")
+nume += check_simple2(23, 3, n.fragment, 0)
+nume += check_simple2(23, 4, n.in_fields, [ "data" ])
+nume += check_simple2(23, 5, n.numbits, 6)
+nume += check_simple2(23, 6, n.bitnum, 5)
+
+; 24: gd_entry (multiply)
+n = gd_entry(d, "mult")
+nume += check_ok(24, d)
+nume += check_simple2(24, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(24, 2, n.field, "mult")
+nume += check_simple2(24, 3, n.fragment, 0)
+nume += check_simple2(24, 4, n.in_fields, [ "data", "sbit" ])
+
+; 25: gd_entry (phase)
+n = gd_entry(d, "phase")
+nume += check_ok(25, d)
+nume += check_simple2(25, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(25, 2, n.field, "phase")
+nume += check_simple2(25, 3, n.fragment, 0)
+nume += check_simple2(25, 4, n.in_fields, [ "data" ])
+nume += check_simple2(25, 5, n.shift, 11)
+
+; 26: gd_entry (const)
+n = gd_entry(d, "const")
+nume += check_ok(26, d)
+nume += check_simple2(26, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(26, 2, n.field, "const")
+nume += check_simple2(26, 3, n.fragment, 0)
+nume += check_simple2(26, 4, n.data_type, !GD.FLOAT64)
+
+; 134: gd_entry (string)
+n = gd_entry(d, "string")
+nume += check_ok(134, d)
+nume += check_simple2(134, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(134, 2, n.field, "string")
+nume += check_simple2(134, 3, n.fragment, 0)
+
+; 27: gd_fragment_index check
+n = gd_fragment_index(d, "data")
+nume += check_ok(27, d)
+nume += check_simple(27, n, 0)
+
+; 28: gd_add_raw check
+gd_add_raw, d, "new1", !GD.FLOAT64, spf=3
+nume += check_ok2(28, 1, d)
+
+n = gd_entry(d, "new1")
+nume += check_ok2(28, 2, d)
+nume += check_simple2(28, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(28, 2, n.field, "new1")
+nume += check_simple2(28, 3, n.fragment, 0)
+nume += check_simple2(28, 4, n.data_type, !GD.FLOAT64)
+nume += check_simple2(28, 5, n.spf, 3)
+
+; 30: 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(30, 1, d)
+
+n = gd_entry(d, "new2")
+nume += check_ok2(30, 2, d)
+nume += check_simple2(30, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(30, 2, n.field, "new2")
+nume += check_simple2(30, 3, n.fragment, 0)
+nume += check_simple2(30, 4, n.n_fields, 2)
+nume += check_simple2(30, 5, n.in_fields, [ "in1", "in2" ])
+nume += check_simple2(30, 6, n.comp_scal, 1)
+nume += check_simple2(30, 7, n.cm, [ DCOMPLEX(1.1,1.2), DCOMPLEX(1.4,1.5) ])
+nume += check_simple2(30, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ])
+
+; 32: 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(32, 1, d)
+
+n = gd_entry(d, "new4")
+nume += check_ok2(32, 2, d)
+nume += check_simple2(32, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(32, 2, n.field, "new4")
+nume += check_simple2(32, 3, n.fragment, 0)
+nume += check_simple2(32, 4, n.poly_ord, 3)
+nume += check_simple2(32, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(32, 6, n.comp_scal, 1)
+nume += check_simple2(32, 7, n.ca, [ DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $
+ DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4) ])
+
+; 33: gd_add_linterp
+gd_add_linterp, d, "new6", "in", "./some/table"
+nume += check_ok2(33, 1, d)
+
+n = gd_entry(d, "new6")
+nume += check_ok2(33, 2, d)
+nume += check_simple2(33, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(33, 2, n.field, "new6")
+nume += check_simple2(33, 3, n.fragment, 0)
+nume += check_simple2(33, 4, n.in_fields, [ "in" ])
+nume += check_simple2(33, 5, n.table, "./some/table")
+
+; 34: gd_add_bit
+gd_add_bit, d, "new7", "in1", bitnum=11, numbits=22
+nume += check_ok2(34, 1, d)
+
+n = gd_entry(d, "new7")
+nume += check_ok2(34, 2, d)
+nume += check_simple2(34, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(34, 2, n.field, "new7")
+nume += check_simple2(34, 3, n.fragment, 0)
+nume += check_simple2(34, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(34, 5, n.numbits, 22)
+nume += check_simple2(34, 6, n.bitnum, 11)
+
+; 35: gd_add_sbit
+gd_add_sbit, d, "new8", "in2", bitnum=5, numbits=10
+nume += check_ok2(35, 1, d)
+
+n = gd_entry(d, "new8")
+nume += check_ok2(35, 2, d)
+nume += check_simple2(35, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(35, 2, n.field, "new8")
+nume += check_simple2(35, 3, n.fragment, 0)
+nume += check_simple2(35, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(35, 5, n.numbits, 10)
+nume += check_simple2(35, 6, n.bitnum, 5)
+
+; 36: gd_add_multiply
+gd_add_multiply, d, "new9", "in2", "in3"
+nume += check_ok2(36, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_ok(36, d)
+nume += check_simple2(36, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(36, 2, n.field, "new9")
+nume += check_simple2(36, 3, n.fragment, 0)
+nume += check_simple2(36, 4, n.in_fields, [ "in2", "in3" ])
+
+; 37: gd_add_phase
+gd_add_phase, d, "new10", "in6", 42
+nume += check_ok2(37, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_ok2(37, 2, d)
+nume += check_simple2(37, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(37, 2, n.field, "new10")
+nume += check_simple2(37, 3, n.fragment, 0)
+nume += check_simple2(37, 4, n.in_fields, [ "in6" ])
+nume += check_simple2(37, 5, n.shift, 42)
+
+; 38: gd_add_const
+gd_add_const, d, "new11", type=!GD.FLOAT64, value=4.3D
+nume += check_ok2(38, 1, d)
+
+n = gd_entry(d, "new11")
+nume += check_ok2(38, 2, d)
+nume += check_simple2(38, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(38, 2, n.field, "new11")
+nume += check_simple2(38, 3, n.fragment, 0)
+nume += check_simple2(38, 4, n.data_type, !GD.FLOAT64)
+
+n = gd_get_constant(d, "new11")
+nume += check_ok2(38, 3, d)
+nume += check_simple2(38, 5, n, 4.3D)
+
+; 125: gd_add
+n = {field: "new13", field_type: !GD.PHASE_ENTRY, fragment: 0, $
+ shift: -88L, in_fields: [ "new9" ], scalar: [ "" ], scalar_ind: [ 0 ]}
+gd_add, d, n
+nume += check_ok2(125, 1, d)
+
+n = gd_entry(d, "new13")
+nume += check_ok2(125, 2, d)
+nume += check_simple2(125, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(125, 2, n.field, "new13")
+nume += check_simple2(125, 3, n.fragment, 0)
+nume += check_simple2(125, 4, n.in_fields, [ "new9" ])
+nume += check_simple2(125, 5, n.shift, -88)
+
+; 39: gd_fragmentname
+n = gd_fragmentname(d, 0)
+nume += check_ok(39, d)
+nume += check_simple(39, n, "test_dirfile/format")
+
+; 40: gd_nfragments
+n = gd_nfragments(d)
+nume += check_ok(40, d)
+nume += check_simple(40, n, 1)
+
+; 41: gd_include
+gd_include, d, "form2"
+nume += check_ok2(41, 1, d)
+
+n = gd_get_constant(d, "const2", type=!GD.INT16)
+nume += check_ok2(41, 2, d)
+nume += check_simple(41, n, -19)
+
+; 42: gd_nfields_by_type check
+n = gd_nfields(d,type=!GD.LINCOM_ENTRY)
+nume += check_ok(42, d)
+nume += check_simple(42, n, 2)
+
+; 43: gd_field_list_by_type check
+n = gd_field_list(d, type=!GD.LINCOM_ENTRY)
+nume += check_ok(43, d)
+nume += check_simple(43, n, [ "lincom", "new2" ])
+
+; 44: gd_nvectors check
+n = gd_nvectors(d)
+nume += check_ok(44, d)
+nume += check_simple(44, n, 20)
+
+; 45: gd_vector_list check
+n = gd_vector_list(d)
+nume += check_ok(45, d)
+nume += check_simple(45, n, [ 'INDEX', 'bit', 'data', 'div', 'lincom', $
+ 'linterp', 'mult', 'new1', 'new10', 'new13', 'new2', 'new4', 'new6', 'new7', $
+ 'new8', 'new9', 'phase', 'polynom', 'recip', 'sbit' ])
+
+; 46: gd_madd_lincom
+gd_add_lincom, d, "mnew2", "in1", 9.9D, 8.8D, "in2", 7.7D, 6.6D, $
+ parent="data"
+nume += check_ok2(46, 1, d)
+
+n = gd_entry(d, "data/mnew2")
+nume += check_ok2(46, 2, d)
+nume += check_simple2(46, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(46, 2, n.field, "data/mnew2")
+nume += check_simple2(46, 3, n.fragment, 0)
+nume += check_simple2(46, 4, n.n_fields, 2)
+nume += check_simple2(46, 5, n.in_fields, [ "in1", "in2" ])
+nume += check_simple2(46, 6, n.comp_scal, 0)
+nume += check_simple2(46, 7, n.m, [ 9.9D, 7.7D ])
+nume += check_simple2(46, 8, n.b, [ 8.8D, 6.6D ])
+
+; 48: gd_madd_polynom
+gd_add_polynom, d, "mnew4", "in1", [ 3.3D, 4.4D, 5.5D, 6.6D ], $
+ parent="data"
+nume += check_ok2(48, 1, d)
+
+n = gd_entry(d, "data/mnew4")
+nume += check_ok2(48, 2, d)
+nume += check_simple2(48, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(48, 2, n.field, "data/mnew4")
+nume += check_simple2(48, 3, n.fragment, 0)
+nume += check_simple2(48, 4, n.poly_ord, 3)
+nume += check_simple2(48, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(48, 6, n.comp_scal, 0)
+nume += check_simple2(48, 7, n.a, [ 3.3D, 4.4D, 5.5D, 6.6D ])
+
+; 50: gd_madd_linterp
+gd_add_linterp, d, "mnew6", "in", "./more/table", parent="data"
+nume += check_ok2(50, 1, d)
+
+n = gd_entry(d, "data/mnew6")
+nume += check_ok2(50, 2, d)
+nume += check_simple2(50, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(50, 2, n.field, "data/mnew6")
+nume += check_simple2(50, 3, n.fragment, 0)
+nume += check_simple2(50, 4, n.in_fields, [ "in" ])
+nume += check_simple2(50, 5, n.table, "./more/table")
+
+; 51: gd_madd_bit
+gd_add_bit, d, "mnew7", "in1", bitnum=21, numbits=12, parent="data"
+nume += check_ok2(51, 1, d)
+
+n = gd_entry(d, "data/mnew7")
+nume += check_ok2(51, 2, d)
+nume += check_simple2(51, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(51, 2, n.field, "data/mnew7")
+nume += check_simple2(51, 3, n.fragment, 0)
+nume += check_simple2(51, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(51, 5, n.numbits, 12)
+nume += check_simple2(51, 6, n.bitnum, 21)
+
+; 52: gd_madd_sbit
+gd_add_sbit, d, "mnew8", "in3", bitnum=2, numbits=14, parent="data"
+nume += check_ok2(52, 1, d)
+
+n = gd_entry(d, "data/mnew8")
+nume += check_ok2(52, 2, d)
+nume += check_simple2(52, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(52, 2, n.field, "data/mnew8")
+nume += check_simple2(52, 3, n.fragment, 0)
+nume += check_simple2(52, 4, n.in_fields, [ "in3" ])
+nume += check_simple2(52, 5, n.numbits, 14)
+nume += check_simple2(52, 6, n.bitnum, 2)
+
+; 53: gd_madd_multiply
+gd_add_multiply, d, "mnew9", "in4", "in1", parent="data"
+nume += check_ok2(53, 1, d)
+
+n = gd_entry(d, "data/mnew9")
+nume += check_ok2(53, 2, d)
+nume += check_simple2(53, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(53, 2, n.field, "data/mnew9")
+nume += check_simple2(53, 3, n.fragment, 0)
+nume += check_simple2(53, 4, n.in_fields, [ "in4", "in1" ])
+
+; 54: gd_madd_phase
+gd_add_phase, d, "mnew10", "in1", -4, parent="data"
+nume += check_ok2(54, 1, d)
+
+n = gd_entry(d, "data/mnew10")
+nume += check_ok2(54, 2, d)
+nume += check_simple2(54, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(54, 2, n.field, "data/mnew10")
+nume += check_simple2(54, 3, n.fragment, 0)
+nume += check_simple2(54, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(54, 5, n.shift, -4)
+
+; 55: gd_madd_const
+gd_add_const, d, "mnew11", type=!GD.UINT64, parent="data"
+nume += check_ok2(55, 1, d)
+
+n = gd_entry(d, "data/mnew11")
+nume += check_ok2(55, 2, d)
+nume += check_simple2(55, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(55, 2, n.field, "data/mnew11")
+nume += check_simple2(55, 3, n.fragment, 0)
+nume += check_simple2(55, 4, n.data_type, !GD.UINT64)
+
+; 126: gd_madd
+n = {field: "mnew13", field_type: !GD.PHASE_ENTRY, fragment: 0, $
+ shift: 2L, in_fields: [ "in1" ], scalar: [ "" ], scalar_ind: [ 0 ]}
+gd_add, d, n, parent="data"
+nume += check_ok2(126, 1, d)
+
+n = gd_entry(d, "data/mnew13")
+nume += check_ok2(126, 2, d)
+nume += check_simple2(126, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(126, 2, n.field, "data/mnew13")
+nume += check_simple2(126, 3, n.fragment, 0)
+nume += check_simple2(126, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(126, 5, n.shift, 2)
+
+; 56: gd_get_string
+n = gd_get_string(d, "string")
+nume += check_ok(56, d)
+nume += check_simple(56, n, "Zaphod Beeblebrox")
+
+; 57: gd_add_string
+gd_add_string, d, "new12", value="a string"
+nume += check_ok2(57, 1, d)
+
+n = gd_entry(d, "new12")
+nume += check_ok2(57, 2, d)
+nume += check_simple2(57, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(57, 2, n.field, "new12")
+nume += check_simple2(57, 3, n.fragment, 0)
+
+n = gd_get_string(d, "new12")
+nume += check_ok2(57, 3, d)
+nume += check_simple2(57, 4, n, "a string")
+
+; 58: gd_madd_string
+gd_add_string, d, "mnew12", value="another string", parent="data"
+nume += check_ok2(58, 1, d)
+
+n = gd_entry(d, "data/mnew12")
+nume += check_ok2(58, 2, d)
+nume += check_simple2(58, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(58, 2, n.field, "data/mnew12")
+nume += check_simple2(58, 3, n.fragment, 0)
+
+n = gd_get_string(d, "data/mnew12")
+nume += check_ok2(58, 3, d)
+nume += check_simple2(58, 4, n, "another string")
+
+; 59: gd_add_spec
+gd_add_spec, d, 'lorem STRING "Lorem ipsum"'
+nume += check_ok2(59, 1, d)
+
+n = gd_entry(d, "lorem")
+nume += check_ok2(59, 2, d)
+nume += check_simple2(59, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(59, 2, n.field, "lorem")
+nume += check_simple2(59, 3, n.fragment, 0)
+
+n = gd_get_string(d, "lorem")
+nume += check_ok2(59, 3, d)
+nume += check_simple2(59, 4, n, "Lorem ipsum")
+
+; 60: gd_madd_string
+gd_add_spec, d, 'ipsum STRING "dolor sit amet."', parent="lorem"
+nume += check_ok2(60, 1, d)
+
+n = gd_entry(d, "lorem/ipsum")
+nume += check_ok2(60, 2, d)
+nume += check_simple2(60, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(60, 2, n.field, "lorem/ipsum")
+nume += check_simple2(60, 3, n.fragment, 0)
+
+n = gd_get_string(d, "lorem/ipsum")
+nume += check_ok2(60, 3, d)
+nume += check_simple2(60, 4, n, "dolor sit amet.")
+
+; 61: gd_put_constant
+gd_put_constant, d, "const", 61
+nume += check_ok2(61, 1, d)
+
+n = gd_get_constant(d, "const", type=!GD.INT32)
+nume += check_ok2(61, 2, d)
+nume += check_simple(61, n, 61)
+
+; 62: gd_put_string
+gd_put_string, d, "string", "Arthur Dent"
+nume += check_ok2(62, 1, d)
+
+n = gd_get_string(d, "string")
+nume += check_ok2(62, 2, d)
+nume += check_simple(62, n, "Arthur Dent")
+
+; 63: gd_nmfields_by_type
+n = gd_nfields(d, parent="data", type=!GD.LINCOM_ENTRY)
+nume += check_ok(63, d)
+nume += check_simple(63, n, 1)
+
+; 64: gd_mfield_list_by_type
+n = gd_field_list(d, parent="data", type=!GD.LINCOM_ENTRY)
+nume += check_ok(64, d)
+nume += check_simple(64, n, [ "mnew2" ])
+
+; 65: gd_nmvectors
+n = gd_nvectors(d, parent="data")
+nume += check_ok(65, d)
+nume += check_simple(65, n, 9)
+
+; 66: gd_mvector_list check
+n = gd_vector_list(d, parent="data")
+nume += check_ok(66, d)
+nume += check_simple(66, n, [ 'mlut', 'mnew2', 'mnew4', 'mnew6', $
+ 'mnew7', 'mnew8', 'mnew9', 'mnew10', 'mnew13' ])
+
+; 67: gd_alter_raw check
+gd_alter_raw, d, "new1", type=!GD.INT32
+nume += check_ok2(67, 1, d)
+
+n = gd_entry(d, "new1")
+nume += check_ok2(67, 2, d)
+nume += check_simple2(67, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(67, 2, n.field, "new1")
+nume += check_simple2(67, 3, n.fragment, 0)
+nume += check_simple2(67, 4, n.data_type, !GD.INT32)
+nume += check_simple2(67, 5, n.spf, 3)
+
+; 69: 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(69, 1, d)
+
+n = gd_entry(d, "new2")
+nume += check_ok2(69, 2, d)
+nume += check_simple2(69, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(69, 2, n.field, "new2")
+nume += check_simple2(69, 3, n.fragment, 0)
+nume += check_simple2(69, 4, n.n_fields, 2)
+nume += check_simple2(69, 5, n.in_fields, [ "in3", "in4" ])
+nume += check_simple2(69, 6, n.comp_scal, 1)
+nume += check_simple2(69, 7, n.cm, [ DCOMPLEX(2.3,4.5), DCOMPLEX(6.7,8.9) ])
+nume += check_simple2(69, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ])
+
+; 71: 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(71, 1, d)
+
+n = gd_entry(d, "new4")
+nume += check_ok2(71, 2, d)
+nume += check_simple2(71, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(71, 2, n.field, "new4")
+nume += check_simple2(71, 3, n.fragment, 0)
+nume += check_simple2(71, 4, n.poly_ord, 4)
+nume += check_simple2(71, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(71, 6, n.comp_scal, 1)
+nume += check_simple2(71, 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) ])
+
+; 72: gd_alter_linterp
+gd_alter_linterp, d, "new6", table="./other/table"
+nume += check_ok2(72, 1, d)
+
+n = gd_entry(d, "new6")
+nume += check_ok2(72, 2, d)
+nume += check_simple2(72, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(72, 2, n.field, "new6")
+nume += check_simple2(72, 3, n.fragment, 0)
+nume += check_simple2(72, 4, n.in_fields, [ "in" ])
+nume += check_simple2(72, 5, n.table, "./other/table")
+
+; 73: gd_alter_bit
+gd_alter_bit, d, "new7", in_field="in3", numbits=8
+nume += check_ok2(73, 1, d)
+
+n = gd_entry(d, "new7")
+nume += check_ok2(73, 2, d)
+nume += check_simple2(73, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(73, 2, n.field, "new7")
+nume += check_simple2(73, 3, n.fragment, 0)
+nume += check_simple2(73, 4, n.in_fields, [ "in3" ])
+nume += check_simple2(73, 5, n.numbits, 8)
+nume += check_simple2(73, 6, n.bitnum, 11)
+
+; 74: gd_alter_sbit
+gd_alter_sbit, d, "new8", bitnum=15, numbits=1
+nume += check_ok2(74, 1, d)
+
+n = gd_entry(d, "new8")
+nume += check_ok2(74, 2, d)
+nume += check_simple2(74, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(74, 2, n.field, "new8")
+nume += check_simple2(74, 3, n.fragment, 0)
+nume += check_simple2(74, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(74, 5, n.numbits, 1)
+nume += check_simple2(74, 6, n.bitnum, 15)
+
+; 75: gd_alter_multiply
+gd_alter_multiply, d, "new9", in_field1="in6"
+nume += check_ok2(75, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_ok(75, d)
+nume += check_simple2(75, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(75, 2, n.field, "new9")
+nume += check_simple2(75, 3, n.fragment, 0)
+nume += check_simple2(75, 4, n.in_fields, [ "in6", "in3" ])
+
+; 76: gd_alter_phase
+gd_alter_phase, d, "new10", shift=76
+nume += check_ok2(76, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_ok2(76, 2, d)
+nume += check_simple2(76, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(76, 2, n.field, "new10")
+nume += check_simple2(76, 3, n.fragment, 0)
+nume += check_simple2(76, 4, n.in_fields, [ "in6" ])
+nume += check_simple2(76, 5, n.shift, 76)
+
+; 77: gd_alter_const
+gd_alter_const, d, "new11", type=!GD.FLOAT32
+nume += check_ok2(77, 1, d)
+
+n = gd_entry(d, "new11")
+nume += check_ok2(77, 2, d)
+nume += check_simple2(77, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(77, 2, n.field, "new11")
+nume += check_simple2(77, 3, n.fragment, 0)
+nume += check_simple2(77, 4, n.data_type, !GD.FLOAT32)
+
+; 141: gd_alter
+n = {field_type: !GD.PHASE_ENTRY, shift: -8L}
+gd_alter_entry, d, "new13", n
+nume += check_ok2(141, 1, d)
+
+n = gd_entry(d, "new13")
+nume += check_ok2(141, 2, d)
+nume += check_simple2(141, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(141, 2, n.field, "new13")
+nume += check_simple2(141, 3, n.fragment, 0)
+nume += check_simple2(141, 4, n.in_fields, [ "new9" ])
+nume += check_simple2(141, 5, n.shift, -8)
+
+; 78: gd_encoding
+n = gd_encoding(d, fragment=0)
+nume += check_ok(78, d)
+nume += check_simple(78, n, !GD.UNENCODED)
+
+; 79: gd_endianness
+n = gd_endianness(d, fragment=0)
+nume += check_ok(79, d)
+nume += check_simple(79, n, (!GD.LITTLE_ENDIAN + !GD.NOT_ARM_ENDIAN))
+
+; 80: dirfilename
+n = gd_dirfilename(d)
+nume += check_ok(80, d)
+nume += check_simple(80, n, "test_dirfile")
+
+; 81: gd_parent_fragment
+n = gd_parent_fragment(d, fragment=1)
+nume += check_ok(81, d)
+nume += check_simple(80, n, 0)
+
+; 82: gd_alter_protection
+gd_alter_protection, d, !GD.PROTECT_DATA, fragment=1
+nume += check_ok(82, d)
+
+; 83: gd_protection
+n = gd_protection(d, fragment=1)
+nume += check_ok(83, d)
+nume += check_simple(83, n, !GD.PROTECT_DATA)
+
+; 84: gd_raw_filename
+n = gd_raw_filename(d, 'data')
+nume += check_ok(84, d)
+nume += check_simple(84, n, "test_dirfile/data")
+
+; 85: gd_reference
+gd_reference, d, "new1"
+nume += check_ok(85, d)
+
+; 87: gd_alter_encoding
+gd_alter_encoding, d, !GD.SLIM_ENCODED, fragment=1
+nume += check_ok2(87, 1, d)
+
+n = gd_encoding(d, fragment=1)
+nume += check_ok2(87, 2, d)
+nume += check_simple(87, n, !GD.SLIM_ENCODED)
+
+; 88: gd_alter_endianness
+gd_alter_endianness, d, /big_endian, fragment=1
+nume += check_ok2(88, 1, d)
+
+n = gd_endianness(d, fragment=1)
+nume += check_ok2(88, 2, d)
+nume += check_simple(88, n, !GD.BIG_ENDIAN)
+
+; 89: gd_alter_spec
+gd_alter_spec, d, "new10 PHASE in 3"
+nume += check_ok2(89, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_ok2(89, 2, d)
+nume += check_simple2(89, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(89, 2, n.field, "new10")
+nume += check_simple2(89, 3, n.fragment, 0)
+nume += check_simple2(89, 4, n.in_fields, [ "in" ])
+nume += check_simple2(89, 5, n.shift, 3)
+
+; 90: gd_delete
+gd_delete, d, "new10"
+nume += check_ok2(90, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_error2(90, 2, d, !GD.E_BAD_CODE)
+
+; 91: gd_malter_spec
+gd_alter_spec, d, "mnew10 PHASE in4 11", parent="data"
+nume += check_ok2(91, 1, d)
+
+n = gd_entry(d, "data/mnew10")
+nume += check_ok2(91, 2, d)
+nume += check_simple2(91, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(91, 2, n.field, "data/mnew10")
+nume += check_simple2(91, 3, n.fragment, 0)
+nume += check_simple2(91, 4, n.in_fields, [ "in4" ])
+nume += check_simple2(91, 5, n.shift, 11)
+
+; 92: gd_move
+gd_move, d, "new9", 1
+nume += check_ok2(92, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_ok2(92, 2, d)
+nume += check_simple2(92, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(92, 2, n.field, "new9")
+nume += check_simple2(92, 3, n.fragment, 1)
+
+; 93: gd_rename
+gd_rename, d, "new9", "newer"
+nume += check_ok2(93, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_error2(93, 2, d, !GD.E_BAD_CODE)
+
+n = gd_entry(d, "newer")
+nume += check_ok2(93, 3, d)
+nume += check_simple2(93, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(93, 2, n.field, "newer")
+nume += check_simple2(93, 3, n.fragment, 1)
+
+; 94: gd_uninclude
+gd_uninclude, d, 1
+nume += check_ok2(94, 1, d)
+
+n = gd_entry(d, "newer")
+nume += check_error2(94, 2, d, !GD.E_BAD_CODE)
+
+; 95: gd_frameoffset
+n = gd_frameoffset(d,fragment=0)
+nume += check_ok(95,d)
+nume += check_simple(95,n,0)
+
+; 96: gd_alter_frameoffset
+gd_alter_frameoffset, d, 33, fragment=0
+nume += check_ok2(96,1,d)
+
+n = gd_frameoffset(d,fragment=0)
+nume += check_ok(96,d)
+nume += check_simple(96,n,33)
+
+; 97: gd_native_type
+n = gd_native_type(d, "data")
+nume += check_ok(97, d)
+nume += check_simple(97,n,!GD.INT8)
+
+; 99: gd_validate
+n = gd_validate(d, "new7")
+nume += check_error(99,d,!GD.E_BAD_CODE)
+nume += check_simple(99,n,-1)
+
+; 101: gd_framenum
+n = gd_framenum(d, "data", 33.3, field_start=6)
+nume += check_ok(101,d)
+nume += check_float(101, n, 37.037500D)
+
+; 86: gd_eof
+n = gd_eof(d, "lincom")
+nume += check_ok(86,d)
+nume += check_simple(86,n,344)
+
+; 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.comp_scal, 1)
+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.comp_scal, 1)
+nume += check_simple2(148, 6, n.cdividend, DCOMPLEX(33.3, 44.4))
+
+; 152: gd_alter_multiply
+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_multiply
+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.comp_scal, 0)
+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, 8)
+n = gd_dirfile_standards(d, 0)
+nume += check_error2(157, 2, d, !GD.E_BAD_VERSION)
+
+; 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 ])
+
+; 167: gd_carrays
+; 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_carray_len
+n = gd_carray_len(d, "carray")
+nume += check_ok(170, d)
+nume += check_simple(170, 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)
+
+
+
+
+; ===============================================================
+; 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
diff --git a/bindings/idl/test/getdata_idl_test_routines.pro b/bindings/idl/test/getdata_idl_test_routines.pro
new file mode 100644
index 0000000..34928d7
--- /dev/null
+++ b/bindings/idl/test/getdata_idl_test_routines.pro
@@ -0,0 +1,64 @@
+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
+ 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
+ return,1
+ endif
+
+ return,0
+end
+
+function check_simple, t, v, g
+ if (total(v ne g)) then begin
+ print,"n[", t, "]=", v
+ 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
+ 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
+ return,1
+ endif
+
+ return,0
+end
+
+function check_ok2, t, m, d
+ return, check_error2(t,m,d,!GD.E_OK)
+end
diff --git a/bindings/make_parameters.c b/bindings/make_parameters.c
new file mode 100644
index 0000000..d0fa3f8
--- /dev/null
+++ b/bindings/make_parameters.c
@@ -0,0 +1,359 @@
+/* Copyright (C) 2008-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
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#define NO_GETDATA_LEGACY_API
+#include "getdata.h"
+
+#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;
+ int type;
+} constant_list[] = {
+ CONSTANT(E_OK, "GD_EOK", 0),
+ CONSTANT(E_OPEN, "GD_EOP", 0),
+ CONSTANT(E_FORMAT, "GD_EFO", 0),
+ CONSTANT(E_TRUNC, "GD_ETR", 0),
+ CONSTANT(E_CREAT, "GD_ECR", 0),
+ CONSTANT(E_BAD_CODE, "GD_EBC", 0),
+ CONSTANT(E_BAD_TYPE, "GD_EBT", 0),
+ CONSTANT(E_RAW_IO, "GD_ERW", 0),
+ CONSTANT(E_OPEN_FRAGMENT, "GD_EOF", 0),
+ CONSTANT(E_OPEN_INCLUDE, "GD_EOI", 0),
+ CONSTANT(E_INTERNAL_ERROR, "GD_EIE", 0),
+ CONSTANT(E_ALLOC, "GD_EAL", 0),
+ CONSTANT(E_RANGE, "GD_ERA", 0),
+ CONSTANT(E_OPEN_LINFILE, "GD_EOL", 0),
+ CONSTANT(E_RECURSE_LEVEL, "GD_ERL", 0),
+ CONSTANT(E_BAD_DIRFILE, "GD_EBD", 0),
+ CONSTANT(E_BAD_FIELD_TYPE, "GD_EBF", 0),
+ CONSTANT(E_ACCMODE, "GD_EAC", 0),
+ CONSTANT(E_UNSUPPORTED, "GD_UNS", 0),
+ CONSTANT(E_BAD_ENTRY, "GD_EBE", 0),
+ CONSTANT(E_DUPLICATE, "GD_EDU", 0),
+ CONSTANT(E_DIMENSION, "GD_EDM", 0),
+ CONSTANT(E_BAD_INDEX, "GD_EBI", 0),
+ CONSTANT(E_BAD_SCALAR, "GD_EBS", 0),
+ CONSTANT(E_BAD_REFERENCE, "GD_EBR", 0),
+ CONSTANT(E_PROTECTED, "GD_EPT", 0),
+ CONSTANT(E_DELETE, "GD_EDL", 0),
+ CONSTANT(E_BAD_ENDIANNESS, "GD_EEN", 0),
+ CONSTANT(E_CALLBACK, "GD_ECB", 0),
+ CONSTANT(E_BAD_PROTECTION, "GD_EBP", 0),
+ CONSTANT(E_UNCLEAN_DB, "GD_UCL", 0),
+ CONSTANT(E_DOMAIN, "GD_EDO", 0),
+ CONSTANT(E_BAD_REPR, "GD_ERP", 0),
+ CONSTANT(E_BAD_VERSION, "GD_EVR", 0),
+ CONSTANT(E_FLUSH, "GD_EFL", 0),
+ CONSTANT(E_BOUNDS, "GD_EBO", 0),
+ CONSTANT(E_LINE_TOO_LONG, "GD_ETL", 0),
+
+ CONSTANT(RDONLY, "GD_RO", 1),
+ CONSTANT(RDWR, "GD_RW", 1),
+ CONSTANT(FORCE_ENDIAN, "GD_FE", 1),
+ CONSTANT(BIG_ENDIAN, "GD_BE", 2),
+ CONSTANT(LITTLE_ENDIAN, "GD_LE", 2),
+ CONSTANT(CREAT, "GD_CR", 1),
+ CONSTANT(EXCL, "GD_EX", 1),
+ CONSTANT(TRUNC, "GD_TR", 1),
+ CONSTANT(PEDANTIC, "GD_PE", 1),
+ CONSTANT(FORCE_ENCODING, "GD_FC", 1),
+ CONSTANT(VERBOSE, "GD_VB", 1),
+ CONSTANT(IGNORE_DUPS, "GD_ID", 1),
+ CONSTANT(IGNORE_REFS, "GD_IR", 1),
+ CONSTANT(PRETTY_PRINT, "GD_PP", 1),
+ CONSTANT(ARM_ENDIAN, "GD_AE", 2),
+ CONSTANT(NOT_ARM_ENDIAN, "GD_NA", 2),
+ CONSTANT(PERMISSIVE, "GD_PM", 1),
+
+ CONSTANT(AUTO_ENCODED, "GD_EA", 1),
+ CONSTANT(UNENCODED, "GD_EN", 2),
+ CONSTANT(TEXT_ENCODED, "GD_ET", 2),
+ CONSTANT(SLIM_ENCODED, "GD_ES", 2),
+ CONSTANT(GZIP_ENCODED, "GD_EG", 2),
+ CONSTANT(BZIP2_ENCODED, "GD_EB", 2),
+ CONSTANT(LZMA_ENCODED, "GD_EL", 2),
+
+ CONSTANT(NO_ENTRY, "GD_NOE", 3),
+ CONSTANT(RAW_ENTRY, "GD_RWE", 3),
+ CONSTANT(LINCOM_ENTRY, "GD_LCE", 3),
+ CONSTANT(LINTERP_ENTRY, "GD_LTE", 3),
+ CONSTANT(BIT_ENTRY, "GD_BTE", 3),
+ CONSTANT(MULTIPLY_ENTRY, "GD_MTE", 3),
+ CONSTANT(PHASE_ENTRY, "GD_PHE", 3),
+ CONSTANT(INDEX_ENTRY, "GD_IXE", 3),
+ CONSTANT(POLYNOM_ENTRY, "GD_PNE", 3),
+ CONSTANT(SBIT_ENTRY, "GD_SBE", 3),
+ CONSTANT(DIVIDE_ENTRY, "GD_DVE", 3),
+ CONSTANT(RECIP_ENTRY, "GD_RCE", 3),
+ CONSTANT(CONST_ENTRY, "GD_COE", 3),
+ CONSTANT(CARRAY_ENTRY, "GD_CAE", 3),
+ CONSTANT(STRING_ENTRY, "GD_STE", 3),
+
+ CONSTANT(NULL, "GD_NUL", 4),
+ CONSTANT(UINT8, "GD_U8", 4),
+ CONSTANT(INT8, "GD_I8", 4),
+ CONSTANT(UINT16, "GD_U16", 4),
+ CONSTANT(INT16, "GD_I16", 4),
+ CONSTANT(UINT32, "GD_U32", 4),
+ CONSTANT(INT32, "GD_I32", 4),
+ CONSTANT(UINT64, "GD_U64", 4),
+ CONSTANT(INT64, "GD_I64", 4),
+ CONSTANT(FLOAT32, "GD_F32", 4),
+ CONSTANT(FLOAT64, "GD_F64", 4),
+ CONSTANT(COMPLEX64, "GD_C64", 4),
+ CONSTANT(COMPLEX128, "GDC128", 4),
+
+ CONSTANT(DEL_META, "GDD_MT", 5),
+ CONSTANT(DEL_DATA, "GDD_DT", 5),
+ CONSTANT(DEL_DEREF, "GDD_DR", 5),
+ CONSTANT(DEL_FORCE, "GDD_FO", 5),
+
+ CONSTANT(PROTECT_NONE, "GDPR_N", 6),
+ CONSTANT(PROTECT_FORMAT, "GDPR_F", 6),
+ CONSTANT(PROTECT_DATA, "GDPR_D", 6),
+ CONSTANT(PROTECT_ALL, "GDPR_A", 6),
+
+ CONSTANT(SYNTAX_ABORT, "GDSX_A", 7),
+ CONSTANT(SYNTAX_RESCAN, "GDSX_S", 7),
+ CONSTANT(SYNTAX_IGNORE, "GDSX_I", 7),
+ CONSTANT(SYNTAX_CONTINUE, "GDSX_C", 7),
+
+ CONSTANT(E_FORMAT_BAD_SPF, "GDF_SF", 8),
+ CONSTANT(E_FORMAT_N_FIELDS,"GDF_NF", 8),
+ CONSTANT(E_FORMAT_N_TOK, "GDF_NT", 8),
+ CONSTANT(E_FORMAT_NUMBITS, "GDF_NB", 8),
+ CONSTANT(E_FORMAT_BITNUM, "GDF_BN", 8),
+ CONSTANT(E_FORMAT_BITSIZE, "GDF_SZ", 8),
+ CONSTANT(E_FORMAT_CHARACTER,"GDF_CH", 8),
+ CONSTANT(E_FORMAT_BAD_LINE,"GDF_LI", 8),
+ CONSTANT(E_FORMAT_RES_NAME,"GDF_RN", 8),
+ CONSTANT(E_FORMAT_ENDIAN, "GDF_EN", 8),
+ CONSTANT(E_FORMAT_BAD_TYPE,"GDF_TY", 8),
+ CONSTANT(E_FORMAT_BAD_NAME,"GDF_NA", 8),
+ CONSTANT(E_FORMAT_UNTERM, "GDF_UM", 8),
+ CONSTANT(E_FORMAT_METARAW, "GDF_MR", 8),
+ CONSTANT(E_FORMAT_NO_PARENT,"GDF_PA", 8),
+ CONSTANT(E_FORMAT_DUPLICATE,"GDF_DU", 8),
+ CONSTANT(E_FORMAT_LOCATION,"GDF_LO", 8),
+ CONSTANT(E_FORMAT_PROTECT, "GDF_PR", 8),
+ CONSTANT(E_FORMAT_LITERAL, "GDF_LT", 8),
+
+ CONSTANT(VERSION_CURRENT, "GDSV_C", 9),
+ CONSTANT(VERSION_LATEST, "GDSV_L", 10),
+ CONSTANT(VERSION_EARLIEST, "GDSV_E", 10),
+
+ CONSTANT(MAX_LINE_LENGTH, "GD_MLL", 11),
+ CONSTANT(ALL_FRAGMENTS, "GD_ALL", 11),
+ CONSTANT(DIRFILE_STANDARDS_VERSION, "GD_DSV", 11),
+ { 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 == 0)
+ 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 == 1 || constant_list[j].type == 2)
+ parameter(constant_list[j].lname, constant_list[j].fname,
+ constant_list[j].value, i);
+
+ printf("\\\n%c Field types\\\n", c);
+
+ for (j = 0; constant_list[j].lname != NULL; ++j)
+ if (constant_list[j].type == 3)
+ 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, but we keep them anyways, since\\\n"
+ "%c they might appear as a result of calling %s\\\n",
+ c, c, c, (i == 0) ? "GDGERW" : "fget_entry");
+
+ for (j = 0; constant_list[j].lname != NULL; ++j)
+ if (constant_list[j].type == 4)
+ parameter(constant_list[j].lname, constant_list[j].fname,
+ constant_list[j].value, i);
+
+ printf("\\\n%c Delete flags\\\n", c);
+
+ for (j = 0; constant_list[j].lname != NULL; ++j)
+ if (constant_list[j].type == 5)
+ 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 == 6)
+ 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 == 7)
+ 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 == 8)
+ 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 == 9 || constant_list[j].type == 10)
+ 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 == 11)
+ 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)
+ if (constant_list[i].type != 9)
+ 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 <stdio.h>\n#include <idl_export.h>\n"
+ "IDL_STRUCT_TAG_DEF gdidl_constants[] = {\n"
+ );
+
+ for (i = 0; constant_list[i].lname != NULL; ++i)
+ if ((constant_list[i].type != 1) && (constant_list[i].type != 5) &&
+ (constant_list[i].type != 7) && (constant_list[i].type != 8))
+ {
+ printf("{ \"%s\", 0, (void*)IDL_TYP_%s }, ", constant_list[i].sname,
+ (constant_list[i].type == 2) ? "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 != 1) && (constant_list[i].type != 5) &&
+ (constant_list[i].type != 7) && (constant_list[i].type != 8))
+ {
+ printf("*(IDL_%s*)(data + IDL_StructTagInfoByIndex(gdidl_const_def, %i, "
+ "IDL_MSG_LONGJMP, NULL)) = %li;\n", (constant_list[i].type == 2) ?
+ "LONG" : "INT", n++, constant_list[i].value);
+ }
+
+ printf("return r; }\n");
+}
+
+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();
+
+ return 0;
+}
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
new file mode 100644
index 0000000..df987f7
--- /dev/null
+++ b/bindings/python/Makefile.am
@@ -0,0 +1,53 @@
+# Copyright (C) 2009 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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 CC_WALL
+WALL=-Wall
+endif
+
+if GETDATA_DEBUG
+DEBUG_C = ../../src/debug.c
+endif
+
+SUBDIRS=test
+
+python_LTLIBRARIES = pygetdata.la
+
+BUILT_SOURCES = pyconstants.c
+AM_CFLAGS = ${WALL} -fno-strict-aliasing
+AM_CPPFLAGS = $(CPPFLAGS) $(PYTHON_CPPFLAGS) $(NUMPY_CPPFLAGS)
+pygetdata_la_LDFLAGS = -module -avoid-version \
+ -export-symbols-regex initpygetdata
+pygetdata_la_LIBADD = $(PYTHON_LIBS) ../../src/libgetdata.la
+pygetdata_la_SOURCES = pygetdata.c pydirfile.c pyentry.c pyfragment.c \
+ ${DEBUG_C} pygetdata.h
+nodist_pygetdata_la_SOURCES = pyconstants.c
+
+pyconstants.c: ../make_parameters
+ ../make_parameters p > $@
+
+../make_parameters: ../make_parameters.c
+ cd .. && ${MAKE} make_parameters
+
+clean-local:
+ rm -rf ${BUILT_SOURCES} *~
+
diff --git a/bindings/python/Makefile.in b/bindings/python/Makefile.in
new file mode 100644
index 0000000..ee6ec6b
--- /dev/null
+++ b/bindings/python/Makefile.in
@@ -0,0 +1,805 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/python
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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__installdirs = "$(DESTDIR)$(pythondir)"
+LTLIBRARIES = $(python_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+pygetdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ ../../src/libgetdata.la
+am__pygetdata_la_SOURCES_DIST = pygetdata.c pydirfile.c pyentry.c \
+ pyfragment.c ../../src/debug.c pygetdata.h
+ at GETDATA_DEBUG_TRUE@am__objects_1 = debug.lo
+am_pygetdata_la_OBJECTS = pygetdata.lo pydirfile.lo pyentry.lo \
+ pyfragment.lo $(am__objects_1)
+nodist_pygetdata_la_OBJECTS = pyconstants.lo
+pygetdata_la_OBJECTS = $(am_pygetdata_la_OBJECTS) \
+ $(nodist_pygetdata_la_OBJECTS)
+pygetdata_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(pygetdata_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(pygetdata_la_SOURCES) $(nodist_pygetdata_la_SOURCES)
+DIST_SOURCES = $(am__pygetdata_la_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at CC_WALL_TRUE@WALL = -Wall
+ at GETDATA_DEBUG_TRUE@DEBUG_C = ../../src/debug.c
+SUBDIRS = test
+python_LTLIBRARIES = pygetdata.la
+BUILT_SOURCES = pyconstants.c
+AM_CFLAGS = ${WALL} -fno-strict-aliasing
+AM_CPPFLAGS = $(CPPFLAGS) $(PYTHON_CPPFLAGS) $(NUMPY_CPPFLAGS)
+pygetdata_la_LDFLAGS = -module -avoid-version \
+ -export-symbols-regex initpygetdata
+
+pygetdata_la_LIBADD = $(PYTHON_LIBS) ../../src/libgetdata.la
+pygetdata_la_SOURCES = pygetdata.c pydirfile.c pyentry.c pyfragment.c \
+ ${DEBUG_C} pygetdata.h
+
+nodist_pygetdata_la_SOURCES = pyconstants.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/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):
+install-pythonLTLIBRARIES: $(python_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(pythondir)" || $(MKDIR_P) "$(DESTDIR)$(pythondir)"
+ @list='$(python_LTLIBRARIES)'; test -n "$(pythondir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pythondir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pythondir)"; \
+ }
+
+uninstall-pythonLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(python_LTLIBRARIES)'; test -n "$(pythondir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pythondir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pythondir)/$$f"; \
+ done
+
+clean-pythonLTLIBRARIES:
+ -test -z "$(python_LTLIBRARIES)" || rm -f $(python_LTLIBRARIES)
+ @list='$(python_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+pygetdata.la: $(pygetdata_la_OBJECTS) $(pygetdata_la_DEPENDENCIES)
+ $(pygetdata_la_LINK) -rpath $(pythondir) $(pygetdata_la_OBJECTS) $(pygetdata_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pyconstants.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pydirfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pyentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pyfragment.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pygetdata.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+debug.lo: ../../src/debug.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug.lo -MD -MP -MF $(DEPDIR)/debug.Tpo -c -o debug.lo `test -f '../../src/debug.c' || echo '$(srcdir)/'`../../src/debug.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/debug.Tpo $(DEPDIR)/debug.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../../src/debug.c' object='debug.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f '../../src/debug.c' || echo '$(srcdir)/'`../../src/debug.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.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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 \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+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)$(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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local \
+ clean-pythonLTLIBRARIES 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-pythonLTLIBRARIES
+
+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-pythonLTLIBRARIES
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+ ctags-recursive install install-am install-strip \
+ tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-local clean-pythonLTLIBRARIES ctags ctags-recursive \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-pythonLTLIBRARIES \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-pythonLTLIBRARIES
+
+
+pyconstants.c: ../make_parameters
+ ../make_parameters p > $@
+
+../make_parameters: ../make_parameters.c
+ 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:
diff --git a/bindings/python/pydirfile.c b/bindings/python/pydirfile.c
new file mode 100644
index 0000000..0f8a952
--- /dev/null
+++ b/bindings/python/pydirfile.c
@@ -0,0 +1,2622 @@
+/* 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
+ */
+#define NO_IMPORT_ARRAY
+#include "pygetdata.h"
+
+/* Dirfile */
+static int gdpy_callback_func(gd_parser_data_t* pdata, void* extra)
+{
+ dtrace("%p, %p", pdata, extra);
+
+ int r = GD_SYNTAX_ABORT;
+ struct gdpy_dirfile_t* self = extra;
+
+ if (self->callback != NULL) {
+ char buffer[GD_MAX_LINE_LENGTH];
+ gd_error_string(pdata->dirfile, buffer, GD_MAX_LINE_LENGTH);
+
+ PyObject* arglist = Py_BuildValue("({sssisssiss}O)", "error_string", buffer,
+ "suberror", pdata->suberror, "line", pdata->line, "linenum",
+ pdata->linenum, "filename", pdata->filename, self->callback_data);
+
+ /* an exception results in an abort */
+ if (arglist == NULL) {
+ self->callback_exception = 1;
+ dreturn("%i", GD_SYNTAX_ABORT);
+ return GD_SYNTAX_ABORT;
+ }
+
+ PyObject* 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;
+ }
+
+ char* new_string = PyString_AsString(PyTuple_GetItem(result, 1));
+
+ if (new_string == NULL) {
+ self->callback_exception = 1;
+ r = GD_SYNTAX_ABORT;
+ }
+
+ strncpy(pdata->line, new_string, GD_MAX_LINE_LENGTH - 1);
+ pdata->line[GD_MAX_LINE_LENGTH - 1] = '\0';
+ }
+
+ if (PyTuple_Size(result) == 1) {
+ }
+ } else if (PyString_Check(result)) {
+ char* new_string = PyString_AsString(result);
+
+ if (new_string == NULL) {
+ self->callback_exception = 1;
+ r = GD_SYNTAX_ABORT;
+ }
+
+ r = GD_SYNTAX_RESCAN;
+ strncpy(pdata->line, new_string, GD_MAX_LINE_LENGTH - 1);
+ pdata->line[GD_MAX_LINE_LENGTH - 1] = '\0';
+ } 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);
+
+ dreturnvoid();
+}
+
+static PyObject* gdpy_dirfile_create(PyTypeObject *type, PyObject *args,
+ PyObject *keys)
+{
+ dtrace("%p, %p, %p", type, args, keys);
+
+ struct gdpy_dirfile_t *self = (struct gdpy_dirfile_t*)type->tp_alloc(type, 0);
+
+ if (self) {
+ self->D = 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ PyObject* pycallback = NULL;
+ PyObject* pycallback_data = Py_None;
+ char *keywords[] = {"name", "flags", "callback", "extra", NULL};
+ PyObject* name = NULL;
+ unsigned long flags = GD_RDONLY;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "entry", NULL };
+ struct gdpy_entry_t* entry = NULL;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "spec", "fragment_index", NULL };
+ const char* spec;
+ int fragment = 0;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", "entry", "recode", NULL };
+ struct gdpy_entry_t* entry = NULL;
+ int recode = 0;
+ char *field_code;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "spec", "recode", NULL };
+ const char* spec;
+ int recode = 0;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = {"field_code", "flags", NULL};
+ const char* field_code;
+ int flags = 0;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, 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* pylist = NULL;
+#ifdef USE_NUMPY
+ npy_intp dims[] = { 0 };
+#endif
+
+ 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_carray_len(self->D, field_code);
+ if (len > start)
+ len -= start;
+ else
+ len = 0;
+ }
+
+ if (len == 0) {
+#ifdef USE_NUMPY
+ if (!as_list)
+ pylist = PyArray_ZEROS(1, dims, NPY_INT, 0);
+ else
+#endif
+ pylist = Py_BuildValue("[]");
+ } else {
+ void* data;
+#ifdef USE_NUMPY
+ if (!as_list) {
+ dims[0] = (npy_intp)len;
+ pylist = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type));
+ data = PyArray_DATA(pylist);
+ } else
+#endif
+ data = malloc(len * GD_SIZE(return_type));
+
+ gd_get_carray_slice(self->D, field_code, start, (size_t)len, return_type,
+ data);
+
+#ifdef USE_NUMPY
+ if (!as_list)
+ PYGD_CHECK_ERROR(self->D, NULL);
+ else
+#endif
+ {
+ PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+ pylist = gdpy_convert_to_pylist(data, return_type, len);
+
+ free(data);
+ }
+ }
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_getconstant(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = {"field_code", "return_type", NULL};
+ const char* field_code;
+ gd_type_t return_type;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "si:pygetdata.dirfile.get_constant", keywords, &field_code,
+ &return_type))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ char data[16];
+
+ gd_get_constant(self->D, field_code, return_type, data);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = gdpy_convert_to_pyobj(data, return_type);
+
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_carraylen(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.carray_len",
+ keywords, &field_code)) {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ size_t len = gd_carray_len(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyInt_FromLong((long)len);
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_carrays(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = {"return_type", "as_list", NULL};
+ const char **fields;
+ int as_list = 0, i;
+ gd_type_t return_type;
+#ifdef USE_NUMPY
+ npy_intp dims[] = { 0 };
+#endif
+
+ 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);
+
+ const gd_carray_t *carrays = gd_carrays(self->D, return_type);
+
+ PyObject *pylist = PyList_New(0);
+
+ for (i = 0; carrays[i].n != 0; ++i) {
+ PyObject *pydata;
+#ifdef USE_NUMPY
+ 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
+#endif
+ pydata = gdpy_convert_to_pylist(carrays[i].d, return_type, carrays[i].n);
+
+ PyList_Append(pylist, Py_BuildValue("sN", fields[i], pydata));
+ }
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_getconstants(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ int i;
+ char* keywords[] = {"return_type", NULL};
+ const char** fields;
+ const char* values;
+ gd_type_t return_type;
+
+ 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);
+
+ PyObject* list = PyList_New(0);
+
+ for (i = 0; fields[i] != NULL; ++i)
+ PyList_Append(list, Py_BuildValue("sN", fields[i],
+ gdpy_convert_to_pyobj(values + i * GD_SIZE(return_type),
+ return_type)));
+
+ dreturn("%p", list);
+ return list;
+}
+
+static PyObject* gdpy_dirfile_getdata(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, 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;
+ long int num_frames = 0, num_samples = 0;
+ int as_list = 0;
+ gd_type_t return_type;
+ gd_spf_t spf = 1;
+ PyObject* pylist = NULL;
+#ifdef USE_NUMPY
+ npy_intp dims[] = { 0 };
+#endif
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "si|LLOOi:pygetdata.dirfile.getdata", keywords, &field_code,
+ &return_type, &first_frame, &first_sample, &num_frames_obj,
+ &num_samples_obj, &as_list))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* sanity check */
+ if (num_frames_obj == NULL && num_samples_obj == NULL) {
+ PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.gd_getdata(): at "
+ "least one of num_frames and num_samples must be specified");
+ dreturn("%p", NULL);
+ return 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;
+ }
+ }
+
+ /* we need the SPF to know how many samples we have to allocate */
+ if (num_frames) {
+ spf = gd_spf(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+ }
+
+ size_t ns = num_samples + num_frames * spf;
+
+ if (ns == 0) {
+#ifdef USE_NUMPY
+ if (!as_list)
+ pylist = PyArray_ZEROS(1, dims, NPY_INT, 0);
+ else
+#endif
+ pylist = Py_BuildValue("[]");
+ } else {
+ void* data;
+#ifdef USE_NUMPY
+ if (!as_list) {
+ dims[0] = (npy_intp)ns;
+ pylist = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type));
+ data = PyArray_DATA(pylist);
+ } else
+#endif
+ data = malloc(ns * GD_SIZE(return_type));
+
+ ns = gd_getdata(self->D, field_code, first_frame, first_sample,
+ (size_t)num_frames, (size_t)num_samples, return_type, data);
+
+
+#ifdef USE_NUMPY
+ if (!as_list)
+ PYGD_CHECK_ERROR(self->D, NULL);
+ else
+#endif
+ {
+ PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+ pylist = gdpy_convert_to_pylist(data, return_type, ns);
+
+ free(data);
+ }
+ }
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_getentry(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = {"field_code", NULL};
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.entry",
+ keywords, &field_code))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ gd_entry_t* E = malloc(sizeof(gd_entry_t));
+
+ if (E == NULL) {
+ PyErr_NoMemory();
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ gd_entry(self->D, field_code, E);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ struct gdpy_entry_t *obj =
+ (struct gdpy_entry_t*)gdpy_entry.tp_alloc(&gdpy_entry, 0);
+
+ if (obj == NULL) {
+ PyErr_NoMemory();
+ 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ PyObject* error = PyInt_FromLong(gd_error(self->D));
+
+ dreturn("%p", error);
+ return error;
+}
+
+static PyObject* gdpy_dirfile_getfragment(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = {"fragment_index", NULL};
+ int fragment_index;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "i:pygetdata.dirfile.fragment",
+ keywords, &fragment_index))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ struct gdpy_fragment_t *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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = {"field_code", NULL};
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.fragment_index", keywords, &field_code))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ int index = gd_fragment_index(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyInt_FromLong(index);
+
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_geterrorstring(struct gdpy_dirfile_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ char buffer[GD_MAX_LINE_LENGTH];
+
+ PyObject* error = PyString_FromString(gd_error_string(self->D, buffer,
+ GD_MAX_LINE_LENGTH));
+
+ dreturn("%p", error);
+ return error;
+}
+
+static PyObject* gdpy_dirfile_getvectorlist(struct gdpy_dirfile_t* self)
+{
+ dtrace("%p", self);
+
+ int i;
+
+ const char **vectors = gd_vector_list(self->D);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pylist = PyList_New(0);
+
+ for (i = 0; vectors[i] != NULL; ++i)
+ PyList_Append(pylist, PyString_FromString(vectors[i]));
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_getfieldlist(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ const char **fields;
+ char* keywords[] = { "type", NULL };
+ int i, type = (int)GD_NO_ENTRY;
+
+ 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_type_t)type);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pylist = PyList_New(0);
+
+ for (i = 0; fields[i] != NULL; ++i)
+ PyList_Append(pylist, PyString_FromString(fields[i]));
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_flush(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code = NULL;
+
+ 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_include(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "file", "fragment_index", "flags", NULL };
+ const char* file = NULL;
+ int fragment_index = 0;
+ unsigned int flags = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "s|ii:pygetdata.dirfile.include",
+ keywords, &file, &fragment_index, &flags))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ self->callback_exception = 0;
+
+ long index = gd_include(self->D, file, fragment_index, flags);
+
+ if (self->callback_exception) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* obj = PyInt_FromLong(index);
+
+ dreturn("%p", obj);
+ return obj;
+}
+
+static PyObject* gdpy_dirfile_madd(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "entry", "parent", NULL };
+ struct gdpy_entry_t* entry = NULL;
+ const char* parent;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "spec", "parent", NULL };
+ const char* spec;
+ const char* parent;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "spec", "parent", "recode", NULL };
+ const char *spec, *parent;
+ int recode = 0;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, 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;
+#ifdef USE_NUMPY
+ npy_intp dims[] = { 0 };
+#endif
+
+ 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);
+
+ const gd_carray_t *carrays = gd_mcarrays(self->D, parent, return_type);
+
+ PyObject *pylist = PyList_New(0);
+
+ for (i = 0; carrays[i].n != 0; ++i) {
+ PyObject *pydata;
+#ifdef USE_NUMPY
+ 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
+#endif
+ pydata = gdpy_convert_to_pylist(carrays[i].d, return_type, carrays[i].n);
+
+ PyList_Append(pylist, Py_BuildValue("sN", fields[i], pydata));
+ }
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_getmconstants(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ int i;
+ char* keywords[] = {"parent", "return_type", NULL};
+ const char** fields;
+ const char* values;
+ const char* parent = NULL;
+ gd_type_t return_type;
+
+ 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);
+
+ PyObject* list = PyList_New(0);
+
+ for (i = 0; fields[i] != NULL; ++i)
+ PyList_Append(list, Py_BuildValue("sN", fields[i],
+ gdpy_convert_to_pyobj(values + i * GD_SIZE(return_type),
+ return_type)));
+
+ dreturn("%p", list);
+ return list;
+}
+
+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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ const char** fields;
+ char* keywords[] = { "parent", "type", NULL };
+ const char* parent = NULL;
+ gd_entype_t type = GD_NO_ENTRY;
+ int i;
+
+ 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_type_t)type);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pylist = PyList_New(0);
+
+ for (i = 0; fields[i] != NULL; ++i)
+ PyList_Append(pylist, PyString_FromString(fields[i]));
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_getname(struct gdpy_dirfile_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ const char* name = gd_dirfilename(self->D);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyname = PyString_FromString(name);
+
+ dreturn("%p", pyname);
+ return pyname;
+}
+
+static PyObject* gdpy_dirfile_getmstrings(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ int i;
+ char* keywords[] = {"parent", NULL};
+ const char** fields;
+ const char** values;
+ const char* parent = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.mconstants", 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);
+
+ PyObject* list = PyList_New(0);
+
+ for (i = 0; fields[i] != NULL; ++i)
+ PyList_Append(list, Py_BuildValue("ss", fields[i], values[i]));
+
+ dreturn("%p", list);
+ return list;
+}
+
+static PyObject* gdpy_dirfile_getmvectorlist(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ int i;
+
+ char* keywords[] = {"parent", NULL};
+ const char* parent = NULL;
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.mvector_list", keywords, &parent))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ const char **fields = gd_mvector_list(self->D, parent);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pylist = PyList_New(0);
+
+ for (i = 0; fields[i] != NULL; ++i)
+ PyList_Append(pylist, PyString_FromString(fields[i]));
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+static PyObject* gdpy_dirfile_getrawfilename(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+ const char* filename;
+
+ 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);
+
+ PyObject* pyobj = PyString_FromString(filename);
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_getnativetype(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.native_type", keywords, &field_code))
+ {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ gd_type_t ntype = gd_native_type(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyInt_FromLong((long)ntype);
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_getnativetypename(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+ char tbuffer[11];
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.native_type_name", keywords, &field_code))
+ {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ gd_type_t 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)));
+
+ PyObject* pyobj = PyString_FromString(tbuffer);
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_getnfields(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ unsigned int nfields;
+ char* keywords[] = { "type", NULL };
+ int type = GD_NO_ENTRY;
+
+ 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);
+
+ PyObject* pynfields = PyInt_FromLong((long)nfields);
+
+ dreturn("%p", pynfields);
+ return pynfields;
+}
+
+static PyObject* gdpy_dirfile_getnfragments(struct gdpy_dirfile_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ long nfragments = gd_nfragments(self->D);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pynfragments = PyInt_FromLong(nfragments);
+
+ dreturn("%p", pynfragments);
+ return pynfragments;
+}
+
+static PyObject* gdpy_dirfile_getnframes(struct gdpy_dirfile_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ off_t nframes = gd_nframes(self->D);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pynframes = PyLong_FromLongLong(nframes);
+
+ dreturn("%p", pynframes);
+ return pynframes;
+}
+
+static PyObject* gdpy_dirfile_getnmfields(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "parent", "type", NULL };
+ const char* parent = NULL;
+ int type = GD_NO_ENTRY;
+ unsigned int nmfields;
+
+ 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_type_t)type);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyInt_FromLong((long)nmfields);
+
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_getnmvectors(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "parent", NULL };
+ const char* parent = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.nmvectors", keywords, &parent))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ unsigned int nmvectors = gd_nmvectors(self->D, parent);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyInt_FromLong((long)nmvectors);
+
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_getbof(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.bof", keywords, &field_code))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ off_t bof = gd_bof(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pybof = PyLong_FromLongLong(bof);
+
+ dreturn("%p", pybof);
+ return pybof;
+}
+
+static PyObject* gdpy_dirfile_geteof(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "s:pygetdata.dirfile.eof", keywords, &field_code))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ off_t eof = gd_eof(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyeof = PyLong_FromLongLong(eof);
+
+ dreturn("%p", pyeof);
+ return pyeof;
+}
+
+static PyObject* gdpy_dirfile_getnvectors(struct gdpy_dirfile_t* self)
+{
+ dtrace("%p", self);
+
+ unsigned int nvectors = gd_nvectors(self->D);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pynvectors = PyInt_FromLong((long)nvectors);
+
+ dreturn("%p", pynvectors);
+ return pynvectors;
+}
+
+static PyObject* gdpy_dirfile_getreference(struct gdpy_dirfile_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ const char *ref = gd_reference(self->D, NULL);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyref = PyString_FromString(ref);
+
+ dreturn("%p", pyref);
+ return pyref;
+}
+
+static int gdpy_dirfile_setreference(struct gdpy_dirfile_t* self,
+ PyObject *value, void *closure)
+{
+ dtrace("%p, %p, %p", self, value, closure);
+
+ const char* 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.get_string",
+ keywords, &field_code))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ char data[GD_MAX_LINE_LENGTH];
+
+ gd_get_string(self->D, field_code, GD_MAX_LINE_LENGTH, data);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ /* using the \u escape, it is possible to create a string longer than
+ * GD_MAX_LINE_LENGTH -- this ensures we remain NULL terminated */
+ data[GD_MAX_LINE_LENGTH - 1] = 0;
+
+ PyObject* pyobj = PyString_FromString(data);
+
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_getstrings(struct gdpy_dirfile_t* self)
+{
+ dtrace("%p", self);
+
+ int i;
+ const char** fields;
+ const char** values;
+
+ 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);
+
+ PyObject* list = PyList_New(0);
+
+ for (i = 0; fields[i] != NULL; ++i)
+ PyList_Append(list, Py_BuildValue("ss", fields[i], values[i]));
+
+ dreturn("%p", list);
+ return list;
+}
+
+static PyObject* gdpy_dirfile_putconstant(struct gdpy_dirfile_t* self,
+ void* args, void* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = {"field_code", "value", "type", NULL};
+ const char* field_code;
+ PyObject* value;
+ gd_type_t type = GD_UNKNOWN;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "sO|i:pygetdata.dirfile.put_constant", keywords, &field_code, &value,
+ &type))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ union gdpy_quadruple_value data;
+ int 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)
+{
+ dtrace("%p, %p, %p", self, args, 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;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "sO|iI:pygetdata.dirfile.putdata", keywords, &field_code, &pyobj,
+ &type, &start)) {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ /* we only handle list or ndarray data */
+#ifdef USE_NUMPY
+ int have_ndarray = 0;
+ 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
+#endif
+ {
+ if (!PyList_Check(pyobj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "pygetdata.dirfile.put_carray() argument 2 must be list"
+#ifdef USE_NUMPY
+ " or NumPy array"
+#endif
+ ".");
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ len = PyList_Size(pyobj);
+ }
+
+ if (len > 0) {
+ void* data;
+
+#ifdef USE_NUMPY
+ 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
+#endif
+ {
+ 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.");
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+ }
+
+ gd_put_carray_slice(self->D, field_code, start, len, type, data);
+
+#ifdef USE_NUMPY
+ if (have_ndarray)
+ PYGD_CHECK_ERROR(self->D, NULL);
+ else
+#endif
+ {
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", "data", "type", "first_frame",
+ "first_sample", NULL };
+ const char* field_code;
+ off_t first_frame = 0, first_sample = 0;
+ gd_type_t type = GD_UNKNOWN;
+ PyObject* pyobj;
+ size_t ns;
+
+ 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 */
+#ifdef USE_NUMPY
+ int have_ndarray = 0;
+ 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
+#endif
+ {
+ if (!PyList_Check(pyobj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "pygetdata.dirfile.putdata() argument 2 must be list"
+#ifdef USE_NUMPY
+ " or NumPy array"
+#endif
+ ".");
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ ns = PyList_Size(pyobj);
+ }
+
+ if (ns > 0) {
+ void* data;
+
+#ifdef USE_NUMPY
+ 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
+#endif
+ {
+ 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.");
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+ }
+
+ ns = gd_putdata(self->D, field_code, first_frame, first_sample, 0, ns, type,
+ data);
+
+#ifdef USE_NUMPY
+ if (have_ndarray)
+ PYGD_CHECK_ERROR(self->D, NULL);
+ else
+#endif
+ {
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", "data", NULL };
+ const char* field_code;
+ const char* data;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.spf",
+ keywords, &field_code)) {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ unsigned int spf = gd_spf(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyInt_FromLong((long)spf);
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_validate(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", "value", "start", "end", NULL };
+ const char* field_code;
+ double value;
+ off_t frame_start = 0;
+ off_t frame_end = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "sd|KK:pygetdata.dirfile.framenum", keywords, &field_code, &value,
+ &frame_start, &frame_end))
+ {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ double frame = gd_framenum_subset(self->D, field_code, value, frame_start,
+ frame_end);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyFloat_FromDouble(frame);
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static PyObject* gdpy_dirfile_callback(struct gdpy_dirfile_t* self,
+ PyObject *args, PyObject *keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ PyObject* pycallback = NULL;
+ PyObject* pycallback_data = Py_None;
+ char *keywords[] = {"callback", "extra", NULL};
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char *keywords[] = {"fragment_index", "del", NULL};
+ int fragment_index;
+ int del = 0;
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", "new_fragment", "move_data", NULL };
+ const char* field_code;
+ int new_fragment;
+ int move_data = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "si|i:pygetdata.dirfile.move",
+ keywords, &field_code, &new_fragment, &move_data)) {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ gd_move(self->D, field_code, new_fragment, move_data);
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "old_code", "new_name", "move_data", NULL };
+ const char* old_code;
+ const char* new_name;
+ int move_data = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "ss|i:pygetdata.dirfile.move",
+ keywords, &old_code, &new_name, &move_data)) {
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+
+ gd_rename(self->D, old_code, new_name, move_data);
+
+ 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ int vers = gd_dirfile_standards(self->D, GD_VERSION_CURRENT);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ PyObject* pyobj = PyInt_FromLong(vers);
+
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+static int gdpy_dirfile_setstandards(struct gdpy_dirfile_t* self,
+ PyObject *value, void *closure)
+{
+ dtrace("%p, %p, %p", self, value, closure);
+
+ int 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 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_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 },
+ { "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 modified. See\n"
+ "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 },
+ { 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"
+ "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_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."
+ },
+ {"carray_len", (PyCFunction)gdpy_dirfile_carraylen, METH_VARARGS |
+ METH_KEYWORDS,
+ "carray_len(field_code)\n\n"
+ "Returns the length of the CARRAY specified by 'field_code'. See\n"
+ "gd_carray_len(3)."
+ },
+ {"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,
+ "gd_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"
+ "The 'first_frame' and 'first_samples' 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 of these results in an error.\n"
+ "Fewer samples than requested may be returned without causing an\n"
+ "error. 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)."
+ },
+ {"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, MULTIPLY, PHASE, POLYNOM, RECIP, and SBIT\n"
+ "metafields) for the parent field 'parent'. See 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)."
+ },
+ {"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, MULTIPLY, PHASE, POLYNOM, RECIP, and SBIT\n"
+ "metafields) for the parent field 'parent'. See 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, MULTIPLY, PHASE, POLYNOM, RAW, RECIP, and\n"
+ "SBIT fields) defined in the database. See 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, MULTIPLY, PHASE, POLYNOM, RAW, RECIP, and\n"
+ "SBIT metafields) defined in the database. See gd_vector_list(3)."
+ },
+ {"include", (PyCFunction)gdpy_dirfile_include, METH_VARARGS | METH_KEYWORDS,
+ "include(filename [, fragment_index, flags])\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. See gd_include(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 [, move_data])\n\n"
+ "Move the specification of the field given by 'field_code' to the\n"
+ "format file fragment indexed by 'new_fragment'. If 'move_data' is\n"
+ "given and is non-zero, and 'field_code' specifies a RAW field, the\n"
+ "associated file on disk will also be moved, if necessary. See\n"
+ "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)."
+ },
+ {"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 [, move_data])\n\n"
+ "Change the name of the field specified by 'old_code' to 'new_name'.\n"
+ "If 'move_data' is given and is non-zero, and if 'old_code' specifies\n"
+ "a RAW field, the file on disk will also be renamed accordingly.\n"
+ "See gd_rename(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)."
+ },
+ {"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)."
+ },
+ { 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 */
+};
diff --git a/bindings/python/pyentry.c b/bindings/python/pyentry.c
new file mode 100644
index 0000000..6883516
--- /dev/null
+++ b/bindings/python/pyentry.c
@@ -0,0 +1,2046 @@
+/* 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
+ */
+#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 */
+ NULL, /* 0x0C - unused */
+ NULL, /* 0x0D - unused */
+ NULL, /* 0x0E - unused */
+ NULL, /* 0x0F - unused */
+ "CONST_ENTRY", /* 0x10 */
+ "STRING_ENTRY", /* 0x11 */
+ "CARRAY_ENTRY", /* 0x12 */
+};
+
+/* Entry */
+static char* gdpy_dup_pystring(PyObject* obj)
+{
+ dtrace("%p", obj);
+ char* 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);
+
+ dreturnvoid();
+}
+
+static PyObject* gdpy_entry_create(PyTypeObject *type, PyObject *args,
+ PyObject *keys)
+{
+ dtrace("%p, %p, %p", type, args, keys);
+
+ struct gdpy_entry_t *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);
+
+ if (PyString_Check(pyobj))
+ *scalar = gdpy_dup_pystring(pyobj);
+ else {
+ *scalar = NULL;
+ if (type == GD_INT64)
+ *(int64_t*)data = (int64_t)PyLong_AsLongLong(pyobj);
+ else if (type & GD_COMPLEX128)
+ *(double complex*)data = gdpy_as_complex(pyobj);
+ else if (type & GD_FLOAT64)
+ *(double*)data = PyFloat_AsDouble(pyobj);
+ else if (type & GD_INT16)
+ *(int16_t*)data = PyLong_AsUnsignedLong(pyobj);
+ else if (type & GD_UINT16)
+ *(uint16_t*)data = PyLong_AsUnsignedLong(pyobj);
+ }
+
+ 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;
+
+ dtrace("%p, %p, \"%s\"", E, tuple, name);
+
+ int min;
+ 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;
+ default:
+ PyErr_Format(PyExc_TypeError, "%s: unrecognised field type", name);
+ dreturnvoid();
+ return;
+ }
+
+ if (min == 0) { /* nothing to do */
+ dreturnvoid();
+ return;
+ }
+
+ int 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->data_type = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
+ if (GDPY_INVALID_TYPE(E->data_type))
+ PyErr_SetString(PyExc_ValueError,
+ "'pygetdata.entry' invalid data type");
+
+ gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_UINT16,
+ &E->scalar[0], &E->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->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->comp_scal = 1;
+ E->cm[i] = gdpy_as_complex(obj);
+ } else if (E->comp_scal)
+ gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
+ &E->cm[i]);
+ else {
+ gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i],
+ &E->m[i]);
+ E->cm[i] = E->m[i];
+ }
+
+ if (PyErr_Occurred()) {
+ dreturnvoid();
+ return;
+ }
+
+ obj = PyTuple_GetItem(parm3, i);
+ if (PyComplex_Check(obj)) {
+ E->comp_scal = 1;
+ E->cb[i] = gdpy_as_complex(obj);
+ } else if (E->comp_scal)
+ gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128,
+ &E->scalar[i + GD_MAX_LINCOM], &E->cb[i]);
+ else {
+ gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64,
+ &E->scalar[i + GD_MAX_LINCOM], &E->b[i]);
+ E->cb[i] = E->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->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_INT16,
+ &E->scalar[0], &E->bitnum);
+ if (size > 2)
+ gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 2), GD_INT16,
+ &E->scalar[1], &E->numbits);
+ else {
+ E->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->comp_scal = 1;
+ E->cdividend = gdpy_as_complex(obj);
+ } else if (E->comp_scal)
+ gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[0],
+ &E->cdividend);
+ else {
+ gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[0],
+ &E->dividend);
+ E->cdividend = E->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->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->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->comp_scal = 1;
+ E->ca[i] = gdpy_as_complex(obj);
+ E->scalar[i] = NULL;
+ } else if (E->comp_scal)
+ gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
+ &E->ca[i]);
+ else {
+ gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i],
+ &E->a[i]);
+ E->ca[i] = E->a[i];
+ }
+
+ if (PyErr_Occurred()) {
+ dreturnvoid();
+ return;
+ }
+ }
+ break;
+ case GD_CARRAY_ENTRY:
+ E->array_len = (size_t)PyLong_AsUnsignedLong(PyTuple_GetItem(tuple, 1));
+ /* fallthrough */
+ case GD_CONST_ENTRY:
+ E->const_type = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
+ if (GDPY_INVALID_TYPE(E->const_type))
+ PyErr_SetString(PyExc_ValueError,
+ "'pygetdata.entry' invalid data type");
+ case GD_NO_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)
+{
+ dtrace("%p, %p, \"%s\"", E, parms, name);
+
+ PyObject* tuple = Py_None;
+ const char* key[3];
+ int i, size = 0;
+
+ /* 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
+ * 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_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_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;
+ }
+
+ 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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ gd_entry_t E;
+ char *keywords[] = {"type", "name", "fragment_index", "parameters", NULL};
+ PyObject* parms = NULL;
+ const char* field_name;
+
+ 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 > 0x12 || 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ PyObject* pyname = PyString_FromString(self->E->field);
+
+ dreturn("%p", pyname);
+ return pyname;
+}
+
+static int gdpy_entry_setname(struct gdpy_entry_t* self, PyObject *value,
+ void *closure)
+{
+ dtrace("%p, %p, %p", self, value, closure);
+
+ char *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)
+{
+ dtrace("%p, %p", self, closure);
+
+ PyObject* 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)
+{
+ dtrace("%p, %p, %p", self, value, closure);
+
+ int 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ PyObject* 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ PyObject* 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;
+
+ dtrace("%p, %p", self, closure);
+
+ PyObject* tuple = NULL;
+
+ switch (self->E->field_type)
+ {
+ case GD_LINCOM_ENTRY:
+ tuple = PyTuple_New(self->E->n_fields);
+ for (i = 0; i < self->E->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:
+ tuple = Py_BuildValue("(ss)", self->E->in_fields[0],
+ self->E->in_fields[1]);
+ 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:
+ 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->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->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->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:
+ 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_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->data_type;
+ else if (self->E->field_type == GD_CONST_ENTRY ||
+ self->E->field_type == GD_CARRAY_ENTRY)
+ t = self->E->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->data_type);
+ else if (self->E->field_type == GD_CONST_ENTRY ||
+ self->E->field_type == GD_CARRAY_ENTRY)
+ obj = PyInt_FromLong(self->E->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)
+{
+ 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;
+ }
+
+ int 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->data_type = (gd_type_t)t;
+ else
+ self->E->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->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)
+{
+ gd_spf_t spf;
+ 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_UINT16, &scalar, &spf);
+
+ if (PyErr_Occurred()) {
+ free(scalar);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ free(self->E->scalar[0]);
+ self->E->scalar[0] = scalar;
+ self->E->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->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->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->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;
+ 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;
+ }
+
+ int 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->n_fields; ++i)
+ free(self->E->in_fields[i]);
+
+ /* initialise new terms */
+ for (i = self->E->n_fields; i < n; ++i) {
+ self->E->in_fields[i] = strdup("");
+ self->E->m[i] = self->E->b[i] = 0;
+ }
+
+ self->E->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->n_fields);
+ for (i = 0; i < self->E->n_fields; ++i)
+ PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
+ (self->E->comp_scal) ? gdpy_from_complex(self->E->cm[i]) :
+ PyFloat_FromDouble(self->E->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];
+ double complex 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->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->n_fields; ++i) {
+ PyObject *obj = PyTuple_GetItem(value, i);
+ if (PyComplex_Check(obj)) {
+ comp_scal = 1;
+ m[i] = (double)(cm[i] = gdpy_as_complex(obj));
+ 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);
+ 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->n_fields; ++i) {
+ if (cimag(self->E->cb[i]))
+ comp_scal = 1;
+ self->E->cm[i] = cm[i];
+ self->E->m[i] = m[i];
+ free(self->E->scalar[i]);
+ self->E->scalar[i] = scalar[i];
+ }
+ self->E->comp_scal = 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->n_fields);
+ for (i = 0; i < self->E->n_fields; ++i)
+ PyTuple_SetItem(obj, i, (self->E->scalar[i + GD_MAX_LINCOM] == NULL) ?
+ (self->E->comp_scal) ? gdpy_from_complex(self->E->cb[i]) :
+ PyFloat_FromDouble(self->E->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];
+ double complex 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->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->n_fields; ++i) {
+ PyObject *obj = PyTuple_GetItem(value, i);
+ if (PyComplex_Check(obj)) {
+ comp_scal = 1;
+ b[i] = (double)(cb[i] = gdpy_as_complex(obj));
+ 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);
+ 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->n_fields; ++i) {
+ if (cimag(self->E->cm[i]))
+ comp_scal = 1;
+ self->E->cb[i] = cb[i];
+ self->E->b[i] = b[i];
+ free(self->E->scalar[i + GD_MAX_LINCOM]);
+ self->E->scalar[i + GD_MAX_LINCOM] = scalar[i];
+ }
+ self->E->comp_scal = comp_scal;
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+static PyObject* gdpy_entry_gettable(struct gdpy_entry_t* self, void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ PyObject* obj = NULL;
+ if (self->E->field_type == GD_LINTERP_ENTRY)
+ obj = PyString_FromString(self->E->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->field);
+ self->E->field = 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->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;
+ 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_INT16, &scalar, &bitnum);
+ if (PyErr_Occurred()) {
+ free(scalar);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ self->E->bitnum = (gd_bit_t)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->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;
+ 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_INT16, &scalar, &numbits);
+
+ if (PyErr_Occurred()) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ self->E->numbits = (gd_bit_t)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->comp_scal)
+ obj = gdpy_from_complex(self->E->cdividend);
+ else
+ obj = PyFloat_FromDouble(self->E->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;
+ double complex cdividend = 0;
+ double dividend = 0;
+
+ dtrace("%p, %p, %p", self, value, closure);
+
+ 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 = 1;
+
+ 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);
+ cdividend = dividend;
+ }
+
+ if (PyErr_Occurred()) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ self->E->comp_scal = comp_scal;
+ self->E->cdividend = cdividend;
+ self->E->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->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;
+ 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->shift = shift;
+ free(self->E->scalar[0]);
+ self->E->scalar[0] = 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->poly_ord + 1);
+ for (i = 0; i <= self->E->poly_ord; ++i)
+ PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
+ (self->E->comp_scal) ? gdpy_from_complex(self->E->ca[i]) :
+ PyFloat_FromDouble(self->E->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];
+ double complex 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->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->poly_ord; ++i) {
+ PyObject *obj = PyTuple_GetItem(value, i);
+ if (PyComplex_Check(obj)) {
+ comp_scal = 1;
+ scalar[i] = NULL;
+ } else if (comp_scal) {
+ gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, scalar + i, ca + i);
+ a[i] = (double)ca[i];
+ } else {
+ gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, scalar + i, a + i);
+ ca[i] = a[i];
+ }
+ }
+
+ if (PyErr_Occurred()) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ for (i = 0; i <= self->E->poly_ord; ++i) {
+ self->E->a[i] = a[i];
+ self->E->ca[i] = ca[i];
+ free(self->E->scalar[i]);
+ self->E->scalar[i] = scalar[i];
+ }
+ self->E->comp_scal = 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->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)
+{
+ 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;
+ }
+
+ int 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->poly_ord = n;
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+static PyObject* gdpy_entry_getparms(struct gdpy_entry_t* self, void* closure)
+{
+ int i;
+
+ dtrace("%p, %p", self, closure);
+
+ PyObject *a, *tuple = NULL;
+
+ switch (self->E->field_type)
+ {
+ case GD_NO_ENTRY:
+ case GD_INDEX_ENTRY:
+ case GD_STRING_ENTRY:
+ tuple = Py_BuildValue("()");
+ break;
+ case GD_CONST_ENTRY:
+ tuple = Py_BuildValue("(i)", self->E->const_type);
+ break;
+ case GD_CARRAY_ENTRY:
+ tuple = Py_BuildValue("(iI)", self->E->const_type, self->E->array_len);
+ break;
+ case GD_RAW_ENTRY:
+ tuple = Py_BuildValue("(iI)", self->E->data_type, self->E->spf);
+ break;
+ case GD_LINTERP_ENTRY:
+ tuple = Py_BuildValue("(ss)", self->E->in_fields[0],
+ self->E->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->comp_scal)
+ tuple = Py_BuildValue("(sO)", self->E->in_fields[0],
+ gdpy_from_complex(self->E->cdividend));
+ else
+ tuple = Py_BuildValue("(sd)", self->E->in_fields[0],
+ self->E->dividend);
+ break;
+ case GD_PHASE_ENTRY:
+ tuple = Py_BuildValue("(si)", self->E->in_fields[0],
+ self->E->shift);
+ break;
+ case GD_POLYNOM_ENTRY:
+ a = PyTuple_New(self->E->poly_ord + 1);
+ if (self->E->comp_scal)
+ for (i = 0; i <= self->E->poly_ord; ++i)
+ PyTuple_SetItem(a, i, gdpy_from_complex(self->E->ca[i]));
+ else
+ for (i = 0; i <= self->E->poly_ord; ++i)
+ PyTuple_SetItem(a, i, PyFloat_FromDouble(self->E->a[i]));
+ tuple = Py_BuildValue("(sO)", self->E->in_fields[0], a);
+ break;
+ case GD_LINCOM_ENTRY:
+ switch (self->E->n_fields) {
+ case 1:
+ if (self->E->comp_scal)
+ tuple = Py_BuildValue("((s)(O)(O))", self->E->in_fields[0],
+ gdpy_from_complex(self->E->cm[0]),
+ gdpy_from_complex(self->E->cb[0]));
+ else
+ tuple = Py_BuildValue("((s)(d)(d))", self->E->in_fields[0],
+ self->E->m[0], self->E->b[0]);
+ break;
+ case 2:
+ if (self->E->comp_scal)
+ tuple = Py_BuildValue("((ss)(OO)(OO))", self->E->in_fields[0],
+ self->E->in_fields[1],
+ gdpy_from_complex(self->E->cm[0]),
+ gdpy_from_complex(self->E->cm[1]),
+ gdpy_from_complex(self->E->cb[0]),
+ gdpy_from_complex(self->E->cb[1]));
+ else
+ tuple = Py_BuildValue("((ss)(dd)(dd))", self->E->in_fields[0],
+ self->E->in_fields[1], self->E->m[0],
+ self->E->m[1], self->E->b[0],
+ self->E->b[1]);
+ break;
+ case 3:
+ if (self->E->comp_scal)
+ 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->cm[0]),
+ gdpy_from_complex(self->E->cm[1]),
+ gdpy_from_complex(self->E->cm[2]),
+ gdpy_from_complex(self->E->cb[0]),
+ gdpy_from_complex(self->E->cb[1]),
+ gdpy_from_complex(self->E->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->m[0], self->E->m[1],
+ self->E->m[2], self->E->b[0],
+ self->E->b[1], self->E->b[2]);
+ break;
+ }
+ break;
+ case GD_BIT_ENTRY:
+ case GD_SBIT_ENTRY:
+ tuple = Py_BuildValue("(sii)", self->E->in_fields[0],
+ self->E->bitnum, self->E->numbits);
+ break;
+ }
+
+ dreturn("%p", tuple);
+ return tuple;
+}
+
+static int gdpy_entry_setparms(struct gdpy_entry_t* self, PyObject *value,
+ void *closure)
+{
+ dtrace("%p, %p, %p", self, value, closure);
+
+ gd_entry_t E;
+ 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 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 },
+ { "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 },
+ { "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 },
+ { 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\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 */
+};
diff --git a/bindings/python/pyfragment.c b/bindings/python/pyfragment.c
new file mode 100644
index 0000000..9ecd7d2
--- /dev/null
+++ b/bindings/python/pyfragment.c
@@ -0,0 +1,415 @@
+/* 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
+ */
+#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);
+
+ dreturnvoid();
+}
+
+static PyObject* gdpy_fragment_create(PyTypeObject *type, PyObject *args,
+ PyObject *keys)
+{
+ dtrace("%p, %p, %p", type, args, keys);
+
+ struct gdpy_fragment_t *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)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char *keywords[] = {"dirifle", "index", NULL};
+
+ 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ PyObject* obj = PyInt_FromLong(self->n);
+
+ dreturn("%p", obj);
+ return obj;
+}
+
+static PyObject* gdpy_fragment_getname(struct gdpy_fragment_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ const char* name = gd_fragmentname(self->dirfile->D, self->n);
+
+ PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+ PyObject* pyname = PyString_FromString(name);
+
+ dreturn("%p", pyname);
+ return pyname;
+}
+
+static PyObject* gdpy_fragment_getencoding(struct gdpy_fragment_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ unsigned long enc = gd_encoding(self->dirfile->D, self->n);
+
+ PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+ PyObject* obj = PyLong_FromUnsignedLong(enc);
+
+ dreturn("%p", obj);
+ return obj;
+}
+
+static PyObject* gdpy_fragment_setencoding(struct gdpy_fragment_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "encoding", "recode", NULL };
+ unsigned long enc;
+ int recode = 0;
+
+ 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ unsigned long end = gd_endianness(self->dirfile->D, self->n);
+
+ PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+ PyObject* obj = PyLong_FromUnsignedLong(end);
+
+ dreturn("%p", obj);
+ return obj;
+}
+
+static PyObject* gdpy_fragment_setendianness(struct gdpy_fragment_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "endianness", "recode", NULL };
+ unsigned long end;
+ int recode = 0;
+
+ 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)
+{
+ dtrace("%p, %p", self, closure);
+
+ off_t offset = gd_frameoffset(self->dirfile->D, self->n);
+
+ PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+ PyObject* obj = PyLong_FromLongLong((long long)offset);
+
+ dreturn("%p", obj);
+ return obj;
+}
+
+static PyObject* gdpy_fragment_setoffset(struct gdpy_fragment_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "frameoffset", "recode", NULL };
+ long long offset;
+ int recode = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys,
+ "L|i:pygetdata.fragment.alter_frameoffset", keywords, &offset, &recode))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ gd_alter_frameoffset(self->dirfile->D, (off_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)
+{
+ dtrace("%p, %p", self, closure);
+
+ int parent = gd_parent_fragment(self->dirfile->D, self->n);
+
+ PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+ PyObject* obj = PyInt_FromLong(parent);
+
+ dreturn("%p", obj);
+ return obj;
+}
+
+static PyObject* gdpy_fragment_getprotection(struct gdpy_fragment_t* self,
+ void* closure)
+{
+ dtrace("%p, %p", self, closure);
+
+ int prot = gd_protection(self->dirfile->D, self->n);
+
+ PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+ PyObject* obj = PyInt_FromLong(prot);
+
+ dreturn("%p", obj);
+ return obj;
+}
+
+static int gdpy_fragment_setprotection(struct gdpy_fragment_t* self,
+ PyObject *value, void *closure)
+{
+ dtrace("%p, %p, %p", self, value, closure);
+
+ int 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 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 },
+ { "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 },
+ { 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 */
+};
diff --git a/bindings/python/pygetdata.c b/bindings/python/pygetdata.c
new file mode 100644
index 0000000..1edf0ba
--- /dev/null
+++ b/bindings/python/pygetdata.c
@@ -0,0 +1,617 @@
+/* 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
+ */
+#include "pygetdata.h"
+
+static PyObject *GdPy_DirfileError;
+static const char *gdpy_exception_list[GD_N_ERROR_CODES] = {
+ NULL,
+ "Open",
+ "Format",
+ "Truncate",
+ "Creation",
+ "BadCode",
+ "BadType",
+ "RawIO",
+ "OpenFragment",
+ "InternalError",
+ "Alloc",
+ "Range",
+ "OpenLinfile",
+ "RecurseLevel",
+ "BadDirfile",
+ "BadFieldType",
+ "AccessMode",
+ "Unsupported",
+ "UnknownEncoding",
+ "BadEntry",
+ "Duplicate",
+ "Dimension",
+ "BadIndex",
+ "BadScalar",
+ "BadReference",
+ "Protected",
+ "Deletion",
+ "BadEndianess",
+ "Callback",
+ "BadProtection",
+ "UncleanDatabase",
+ "Domain",
+ "BadRepr",
+ "BadVersion",
+ "Flush"
+};
+PyObject *gdpy_exceptions[GD_N_ERROR_CODES];
+
+int gdpy_convert_from_pyobj(PyObject* value, union gdpy_quadruple_value *data,
+ gd_type_t type)
+{
+ dtrace("%p, %p, %02x", value, data, type);
+ int 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)) {
+ data->c = gdpy_as_complex(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;
+ union gdpy_quadruple_value tmp;
+
+ dtrace("%p, %p, %02x, %zi", value, data, type, ns);
+
+ /* use the first element to determine the data type */
+ int 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;
+ *(complex double*)data = tmp.c;
+ for (i = 1; i < ns; ++i)
+ ((double complex*)data)[i] = gdpy_as_complex(PyList_GetItem(value, i));
+ break;
+ }
+
+ dreturn("%02x", type);
+ return type;
+}
+
+/* generic utitily functions */
+#ifdef USE_NUMPY
+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;
+}
+#endif
+
+PyObject* gdpy_convert_to_pylist(const void* data, gd_type_t type, size_t ns)
+{
+ size_t i;
+
+ dtrace("%p, %02x, %zi", data, type, ns);
+
+ PyObject* pylist;
+
+ if (type != GD_NULL)
+ pylist = PyList_New(0);
+
+ switch(type) {
+ case GD_NULL:
+ Py_INCREF(Py_None);
+ dreturn("%p", Py_None);
+ return Py_None;
+ case GD_UINT8:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist, PyInt_FromLong((long)((uint8_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_INT8:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist, PyInt_FromLong((long)((int8_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_UINT16:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist, PyInt_FromLong((long)((uint16_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_INT16:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist, PyInt_FromLong((long)((int16_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_UINT32:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist,
+ PyLong_FromUnsignedLong((unsigned long)((uint32_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_INT32:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist, PyInt_FromLong((long)((int32_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_UINT64:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist, PyLong_FromUnsignedLongLong(
+ (unsigned long long)((uint64_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_INT64:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist,
+ PyLong_FromLongLong((long long)((int64_t*)data)[i])))
+ return NULL;
+ break;
+ case GD_FLOAT32:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist,
+ PyFloat_FromDouble((double)((float*)data)[i])))
+ return NULL;
+ break;
+ case GD_FLOAT64:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist, PyFloat_FromDouble(((double*)data)[i])))
+ return NULL;
+ break;
+ case GD_COMPLEX64:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist,
+ gdpy_from_complex((double complex)((float complex*)data)[i])))
+ return NULL;
+ break;
+ case GD_COMPLEX128:
+ for (i = 0; i < ns; ++i)
+ if (PyList_Append(pylist,
+ gdpy_from_complex(((double complex*)data)[i])))
+ return NULL;
+ break;
+ case GD_UNKNOWN: /* prevent compiler warning */
+ break;
+ }
+
+ dreturn("%p", pylist);
+ return pylist;
+}
+
+PyObject* gdpy_convert_to_pyobj(const void* data, gd_type_t type)
+{
+ dtrace("%p, %02x", data, type);
+ PyObject* pyobj = NULL;
+
+ 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_complex((double complex)*(float complex*)data);
+ break;
+ case GD_COMPLEX128:
+ pyobj = gdpy_from_complex(*(double complex*)data);
+ break;
+ case GD_UNKNOWN: /* prevent compiler warning */
+ break;
+ }
+
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
+/* GetData */
+static PyMethodDef GetDataMethods[] = {
+ { NULL, NULL, 0, NULL }
+};
+
+PyMODINIT_FUNC initpygetdata(void)
+{
+ int i;
+ PyObject* mod;
+
+ if (PyType_Ready(&gdpy_dirfile) < 0)
+ return;
+
+ if (PyType_Ready(&gdpy_entry) < 0)
+ return;
+
+ if (PyType_Ready(&gdpy_fragment) < 0)
+ return;
+
+#ifdef USE_NUMPY
+ /* The following macro will cause this function to return if importing numpy
+ * fails */
+ import_array()
+#endif
+
+ 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__",
+ "D. V. Wiebe <getdata at ketiltrout.net>");
+
+ /* 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__",
+#ifdef USE_NUMPY
+ 1
+#else
+ 0
+#endif
+ );
+
+ /* 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) {
+ 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]);
+ }
+}
diff --git a/bindings/python/pygetdata.h b/bindings/python/pygetdata.h
new file mode 100644
index 0000000..48089dc
--- /dev/null
+++ b/bindings/python/pygetdata.h
@@ -0,0 +1,128 @@
+/* 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
+ */
+#include <Python.h>
+#define NO_GETDATA_LEGACY_API
+
+#define _FILE_OFFSET_BITS 64
+#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 <numpy/arrayobject.h>
+#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_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 the_error; \
+ if ((the_error = gd_error(D))) { \
+ char buffer[GD_MAX_LINE_LENGTH]; \
+ PyErr_SetString(gdpy_exceptions[the_error], gd_error_string((D), \
+ buffer, GD_MAX_LINE_LENGTH)); \
+ E; \
+ dreturnvoid(); \
+ return (R); \
+ } \
+ } 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;
+ 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;
+ double complex c;
+};
+
+static inline double complex gdpy_as_complex(PyObject* o)
+{
+ Py_complex c = PyComplex_AsCComplex(o);
+ return c.real + _Complex_I * c.imag;
+}
+
+#define gdpy_from_complex(c) PyComplex_FromDoubles(creal(c), cimag(c))
+
+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 int gdpy_npytype_from_type(gd_type_t type);
+extern gd_type_t gdpy_type_from_npytype(int npytype);
+PyMODINIT_FUNC initpygetdata(void);
diff --git a/bindings/python/test/Makefile.am b/bindings/python/test/Makefile.am
new file mode 100644
index 0000000..55083ff
--- /dev/null
+++ b/bindings/python/test/Makefile.am
@@ -0,0 +1,40 @@
+# 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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if TEST_PYTHON
+TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../../src/.libs PYTHONPATH=../.libs/ ${PYTHON}
+pyTESTS=big_test.py callback.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 *~
diff --git a/bindings/python/test/Makefile.in b/bindings/python/test/Makefile.in
new file mode 100644
index 0000000..48dabc5
--- /dev/null
+++ b/bindings/python/test/Makefile.in
@@ -0,0 +1,549 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/python/test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/config.h \
+ $(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at TEST_PYTHON_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../../src/.libs PYTHONPATH=../.libs/ ${PYTHON}
+ at TEST_PYTHON_TRUE@pyTESTS = big_test.py callback.py
+ at 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
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+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; 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 \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-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 distclean \
+ distclean-generic distclean-libtool distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+# 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:
diff --git a/bindings/python/test/big_test.py b/bindings/python/test/big_test.py
new file mode 100644
index 0000000..eca0f2c
--- /dev/null
+++ b/bindings/python/test/big_test.py
@@ -0,0 +1,1530 @@
+# 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
+
+import sys
+import os
+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
+
+def CheckException2(t,m,g):
+ global ne
+ if (sys.exc_type != g):
+ ne+=1
+ print "e[", t, ",", m, "] =", sys.exc_type
+
+def CheckNumpy(t,v,g):
+ global ne
+ if (numpy.any(v - g)):
+ ne+=1
+ print "a[", t, "] =", v
+
+def CheckNumpy2(t,m,v,g):
+ global ne
+ if (numpy.any(v - g)):
+ ne+=1
+ print "a[", t, ",", m, "] =", v
+
+def CheckSimple(t,v,g):
+ global ne
+ if (v != g):
+ ne+=1
+ print "n[", t, "] =", v
+
+def CheckSimple2(t,m,v,g):
+ global ne
+ if (v != g):
+ ne+=1
+ print "n[", t, ",", m, "] =", v
+
+# 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", "bit", "carray", "const", "data", "div", "lincom",
+"linterp", "mult", "phase", "polynom", "recip", "sbit", "string"]
+
+nfields = 14
+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 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 /look/up/file\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"
+ "mult MULTIPLY data sbit\n"
+ "div DIVIDE mult bit\n"
+ "recip RECIP div 6.5;4.3\n"
+ "phase PHASE data 11\n"
+ "string STRING \"Zaphod Beeblebrox\"\n"
+ )
+file.close()
+
+file=open("dirfile/form2", 'w')
+file.write("const2 CONST INT8 -19\n")
+file.close()
+
+# 0: error check
+try:
+ d = pygetdata.dirfile("x", pygetdata.RDONLY)
+except:
+ CheckException(0, pygetdata.OpenError)
+
+# 1: dirfile check
+try:
+ d = pygetdata.dirfile("dirfile", pygetdata.RDWR)
+except:
+ CheckOK(1)
+
+# 2: getdata (int) check
+try:
+ n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1)
+except:
+ CheckOK(2)
+CheckSimple(2,len(n),8)
+if (pygetdata.__numpy_supported__):
+ CheckNumpy(2,n,numpy.arange(41,49))
+else:
+ CheckSimple(2,n,range(41,49))
+
+# 104: getdata (long) check
+try:
+ n = d.getdata("data", pygetdata.LONG, first_frame=5, num_frames=1)
+except:
+ CheckOK(104)
+CheckSimple(104,len(n),8)
+if (pygetdata.__numpy_supported__):
+ CheckNumpy(104,n,numpy.arange(41L,49L))
+else:
+ CheckSimple(104,n,range(41L,49L))
+
+# 106: getdata (float) check
+try:
+ n = d.getdata("data", pygetdata.FLOAT, first_frame=5, num_frames=1)
+except:
+ CheckOK(106)
+CheckSimple(106,len(n),8)
+if (pygetdata.__numpy_supported__):
+ CheckNumpy(106,n,numpy.arange(41.,49.))
+else:
+ CheckSimple(106,n,[41.,42.,43.,44.,45.,46.,47.,48.])
+
+# 108: getdata (complex) check
+try:
+ n = d.getdata("data", pygetdata.COMPLEX, first_frame=5, num_frames=1)
+except:
+ CheckOK(108)
+CheckSimple(108,len(n),8)
+if (pygetdata.__numpy_supported__):
+ CheckNumpy(108,n,numpy.arange(41,49,dtype=numpy.complex128))
+else:
+ CheckSimple(108,n,[41.+0j,42.+0j,43.+0j,44.+0j,45.+0j,46.+0j,47.+0j,48.+0j])
+
+# 3: constant (int) check
+try:
+ n = d.get_constant("const", pygetdata.INT)
+except:
+ CheckOK(3)
+CheckSimple(3,n,5)
+
+# 112: constant (long) check
+try:
+ n = d.get_constant("const", pygetdata.LONG)
+except:
+ CheckOK(112)
+CheckSimple(112,n,5L)
+
+# 114: constant (float) check
+try:
+ n = d.get_constant("const", pygetdata.FLOAT)
+except:
+ CheckOK(114)
+CheckSimple(114,n,5.5)
+
+# 116: constant (float) check
+try:
+ n = d.get_constant("const", pygetdata.COMPLEX)
+except:
+ CheckOK(116)
+CheckSimple(116,n,5.5+0j)
+
+# 6: nfields check
+try:
+ n = d.nfields()
+except:
+ CheckOK(6)
+CheckSimple(6,n,nfields)
+
+# 8: field_list check
+try:
+ n = d.field_list()
+except:
+ CheckOK(8)
+CheckSimple(8,n,fields)
+
+# 9: nmfields check
+try:
+ n = d.nmfields("data")
+except:
+ CheckOK(9)
+CheckSimple(9,n,3)
+
+# 10: mfield_list check
+try:
+ n = d.mfield_list("data")
+except:
+ CheckOK(10)
+CheckSimple(10,n,["mstr", "mconst", "mlut"])
+
+# 11: nframes check
+try:
+ n = d.nframes
+except:
+ CheckOK(11)
+CheckSimple(11,n,10)
+
+# 12: spf check
+try:
+ n = d.spf("data")
+except:
+ CheckOK(12)
+CheckSimple(12,n,8)
+
+# 13: putdata (int) check
+p = [ 13, 14, 15, 16 ]
+try:
+ n = d.putdata("data", p, pygetdata.INT, first_frame=5, first_sample=1)
+except:
+ CheckOK2(13,1)
+CheckSimple2(13,1,n,4)
+
+try:
+ n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+ CheckOK(13,2)
+CheckSimple2(13,2,n,[41, 13, 14, 15, 16, 46, 47, 48])
+
+# 119: 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(13,1)
+ CheckSimple2(13,1,n,4)
+
+ try:
+ n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1)
+ except:
+ CheckOK(13,2)
+ CheckNumpy2(13,2,n,numpy.array([41, 73, 74, 75, 76, 46, 47, 48]))
+
+# 120: putdata (long) check
+p = [ 23L, 24L, 25L, 26L ]
+try:
+ n = d.putdata("data", p, pygetdata.LONG, first_frame=5, first_sample=1)
+except:
+ CheckOK2(120,1)
+CheckSimple2(120,1,n,4)
+
+try:
+ n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+ CheckOK(120,2)
+CheckSimple2(120,2,n,[41, 23, 24, 25, 26, 46, 47, 48])
+
+# 122: putdata (float) check
+p = [ 33., 34., 35., 36. ]
+try:
+ n = d.putdata("data", p, pygetdata.FLOAT, first_frame=5, first_sample=1)
+except:
+ CheckOK2(122,1)
+CheckSimple2(122,1,n,4)
+
+try:
+ n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+ CheckOK(122,2)
+CheckSimple2(122,2,n,[41, 33, 34, 35, 36, 46, 47, 48])
+
+# 124: putdata (complex) check
+p = [ 43.+0j, 44.+0j, 45.+0j, 46.+0j ]
+try:
+ n = d.putdata("data", p, pygetdata.COMPLEX, first_frame=5, first_sample=1)
+except:
+ CheckOK2(124,1)
+CheckSimple2(124,1,n,4)
+
+try:
+ n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+ CheckOK2(124,2)
+CheckSimple2(124,2,n,[41, 43, 44, 45, 46, 46, 47, 48])
+
+# 136: putdata (auto) check
+p = [ 53.+0j, 54.+0j, 55.+0j, 56.+0j ]
+try:
+ n = d.putdata("data", p, first_frame=5, first_sample=1)
+except:
+ CheckOK2(136,1)
+CheckSimple2(136,1,n,4)
+
+try:
+ n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+ CheckOK2(136,2)
+CheckSimple2(136,2,n,[41, 53, 54, 55, 56, 46, 47, 48])
+
+# 14: error_string check
+try:
+ n = d.getdata("x", pygetdata.INT, first_frame=5, num_frames=1)
+except:
+ CheckException(14,pygetdata.BadCodeError)
+ CheckSimple(14,d.error_string,"Field not found: x")
+
+# 16: entry (raw) check
+try:
+ ent = d.entry("data")
+except:
+ CheckOK(16)
+CheckSimple2(16,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(16,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(16,3,ent.fragment,0)
+CheckSimple2(16,4,ent.data_type,pygetdata.INT8)
+CheckSimple2(16,5,ent.data_type_name,"INT8")
+CheckSimple2(16,6,ent.spf,8)
+
+# 18: entry (lincom) check
+try:
+ ent = d.entry("lincom")
+except:
+ CheckOK(18)
+CheckSimple2(18,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(18,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(18,3,ent.fragment,0)
+CheckSimple2(18,4,ent.n_fields,3)
+CheckSimple2(18,5,ent.in_fields,( "data", "INDEX", "linterp" ))
+CheckSimple2(18,6,ent.m,(1.1, 2.2, "const"))
+CheckSimple2(18,7,ent.b,(2.2, 3.3 + 4.4j, "const"))
+
+# 20: entry (polynom) check
+try:
+ ent = d.entry("polynom")
+except:
+ CheckOK(20)
+CheckSimple2(20,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(20,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(20,3,ent.fragment,0)
+CheckSimple2(20,4,ent.poly_ord,5)
+CheckSimple2(20,5,ent.in_fields,( "data", ))
+CheckSimple2(20,6,ent.a,(1.1, 2.2, 2.2, 3.3 + 4.4j, "const", "const"))
+
+# 21: entry (linterp) check
+try:
+ ent = d.entry("linterp")
+except:
+ CheckOK(21)
+CheckSimple2(21,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(21,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(21,3,ent.fragment,0)
+CheckSimple2(21,4,ent.in_fields,( "data", ))
+CheckSimple2(21,5,ent.table,"/look/up/file")
+
+# 22: entry (bit) check
+try:
+ ent = d.entry("bit")
+except:
+ CheckOK(22)
+CheckSimple2(22,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(22,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(22,3,ent.fragment,0)
+CheckSimple2(22,4,ent.in_fields,( "data", ))
+CheckSimple2(22,5,ent.numbits,4)
+CheckSimple2(22,6,ent.bitnum,3)
+
+# 23: entry (sbit) check
+try:
+ ent = d.entry("sbit")
+except:
+ CheckOK(23)
+CheckSimple2(23,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(23,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(23,3,ent.fragment,0)
+CheckSimple2(23,4,ent.in_fields,( "data", ))
+CheckSimple2(23,5,ent.numbits,6)
+CheckSimple2(23,6,ent.bitnum,5)
+
+# 24: entry (mult) check
+try:
+ ent = d.entry("mult")
+except:
+ CheckOK(24)
+CheckSimple2(24,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(24,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(24,3,ent.fragment,0)
+CheckSimple2(24,4,ent.in_fields,( "data", "sbit"))
+
+# 25: entry (phase) check
+try:
+ ent = d.entry("phase")
+except:
+ CheckOK(25)
+CheckSimple2(25,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(25,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(25,3,ent.fragment,0)
+CheckSimple2(25,4,ent.in_fields,( "data", ))
+CheckSimple2(25,5,ent.shift,11)
+
+# 26: entry (const) check
+try:
+ ent = d.entry("const")
+except:
+ CheckOK(26)
+CheckSimple2(26,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(26,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(26,3,ent.fragment,0)
+CheckSimple2(26,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(26,5,ent.data_type_name,"FLOAT64")
+
+# 134: entry (string) check
+try:
+ ent = d.entry("string")
+except:
+ CheckOK(134)
+CheckSimple2(134,1,ent.field_type,pygetdata.STRING_ENTRY)
+CheckSimple2(134,2,ent.field_type_name,"STRING_ENTRY")
+CheckSimple2(134,3,ent.fragment,0)
+
+# 27: fragment_index check
+try:
+ n = d.fragment_index("data")
+except:
+ CheckOK(27)
+CheckSimple(27,n,0)
+
+# 28: add / entry (raw) check
+ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0, (pygetdata.FLOAT64, 3))
+try:
+ d.add(ent)
+except:
+ CheckOK2(28,1)
+
+try:
+ ent = d.entry("new1")
+except:
+ CheckOK(28,2)
+CheckSimple2(28,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(28,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(28,3,ent.fragment,0)
+CheckSimple2(28,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(28,5,ent.data_type_name,"FLOAT64")
+CheckSimple2(28,6,ent.spf,3)
+
+# 29: 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(29,1)
+
+try:
+ ent = d.entry("new2")
+except:
+ CheckOK(29,2)
+CheckSimple2(29,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(29,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(29,3,ent.fragment,0)
+CheckSimple2(29,4,ent.n_fields,2)
+CheckSimple2(29,5,ent.in_fields,( "in1", "in2" ))
+CheckSimple2(29,6,ent.m,(9.9, 7.7))
+CheckSimple2(29,7,ent.b,(8.8, 6.6))
+
+# 31: 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(31,1)
+
+try:
+ ent = d.entry("new4")
+except:
+ CheckOK2(31,2)
+CheckSimple2(31,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(31,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(31,3,ent.fragment,0)
+CheckSimple2(31,4,ent.poly_ord,3)
+CheckSimple2(31,5,ent.in_fields,( "in1", ))
+CheckSimple2(31,6,ent.a,(3.9, 4.8, 5.7, 6.6))
+
+# 33: add / entry (linterp) check
+ent = pygetdata.entry(pygetdata.LINTERP_ENTRY, "new6", 0,
+ ("in", "./some/table"))
+try:
+ d.add(ent)
+except:
+ CheckOK2(33,1)
+
+try:
+ ent = d.entry("new6")
+except:
+ CheckOK2(33,2)
+CheckSimple2(33,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(33,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(33,3,ent.fragment,0)
+CheckSimple2(33,4,ent.in_fields,( "in", ))
+CheckSimple2(33,5,ent.table,"./some/table")
+
+# 34: add / entry (bit) check
+ent = pygetdata.entry(pygetdata.BIT_ENTRY, "new7", 0, ("in", 13, 12))
+try:
+ d.add(ent)
+except:
+ CheckOK2(34,1)
+
+try:
+ ent = d.entry("new7")
+except:
+ CheckOK2(34,1)
+CheckSimple2(34,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(34,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(34,3,ent.fragment,0)
+CheckSimple2(34,4,ent.in_fields,( "in", ))
+CheckSimple2(34,5,ent.numbits,12)
+CheckSimple2(34,6,ent.bitnum,13)
+
+# 35: add / entry (sbit) check
+ent = pygetdata.entry(pygetdata.SBIT_ENTRY, "new8", 0, ("in2", 14, 15))
+try:
+ d.add(ent)
+except:
+ CheckOK2(35,1)
+
+try:
+ ent = d.entry("sbit")
+except:
+ CheckOK2(35,2)
+CheckSimple2(35,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(35,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(35,3,ent.fragment,0)
+CheckSimple2(35,4,ent.in_fields,( "data", ))
+CheckSimple2(35,5,ent.numbits,6)
+CheckSimple2(35,6,ent.bitnum,5)
+
+# 36: add / entry (mult) check
+ent = pygetdata.entry(pygetdata.MULTIPLY_ENTRY, "new9", 0, ("in1", "in2"))
+try:
+ d.add(ent)
+except:
+ CheckOK2(36,1)
+
+try:
+ ent = d.entry("new9")
+except:
+ CheckOK2(36,2)
+CheckSimple2(36,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(36,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(36,3,ent.fragment,0)
+CheckSimple2(36,4,ent.in_fields,( "in1", "in2"))
+
+# 37: add / entry (phase) check
+ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "new10", 0, ("in1", 22))
+try:
+ d.add(ent)
+except:
+ CheckOK2(37,1)
+
+try:
+ ent = d.entry("new10")
+except:
+ CheckOK2(37,2)
+CheckSimple2(37,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(37,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(37,3,ent.fragment,0)
+CheckSimple2(37,4,ent.in_fields,( "in1", ))
+CheckSimple2(37,5,ent.shift,22)
+
+# 38: add / entry (const) check
+ent = pygetdata.entry(pygetdata.CONST_ENTRY, "new11", 0, (pygetdata.FLOAT64,))
+try:
+ d.add(ent)
+except:
+ CheckOK2(38,1)
+
+try:
+ ent = d.entry("new11")
+except:
+ CheckOK2(38,2)
+CheckSimple2(38,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(38,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(38,3,ent.fragment,0)
+CheckSimple2(38,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(38,5,ent.data_type_name,"FLOAT64")
+
+# 39: fragment check
+try:
+ f = d.fragment(0)
+except:
+ CheckOK(39)
+CheckSimple(39,f.name,"dirfile/format")
+
+# 40: nfragments check
+try:
+ n = d.nfragments
+except:
+ CheckOK(40)
+CheckSimple(40,n,1)
+
+# 41: include check
+try:
+ n = d.include("form2")
+except:
+ CheckOK2(41,1)
+CheckSimple2(41,1,n,1)
+
+try:
+ n = d.get_constant("const2", pygetdata.INT)
+except:
+ CheckOK2(41,2)
+CheckSimple2(41,2,n,-19)
+
+# 42: nfields_by_type check
+try:
+ n = d.nfields(pygetdata.LINCOM_ENTRY)
+except:
+ CheckOK(42)
+CheckSimple(42,n,2)
+
+# 43: field_list_by_type check
+try:
+ n = d.field_list(pygetdata.LINCOM_ENTRY)
+except:
+ CheckOK(43)
+CheckSimple(43,n,["lincom", "new2"])
+
+# 44: nvectors check
+try:
+ n = d.nvectors()
+except:
+ CheckOK(44)
+CheckSimple(44,n,19)
+
+# 45: field_list check
+try:
+ n = d.vector_list()
+except:
+ CheckOK(45)
+CheckSimple(45,n,['INDEX', 'bit', 'data', 'div', 'lincom', 'linterp', 'mult',
+ 'new1', 'new10', 'new2', 'new4', 'new6', 'new7', 'new8', 'new9', 'phase',
+ 'polynom', 'recip', 'sbit'])
+
+# 46: 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(46,1)
+
+try:
+ ent = d.entry("data/mnew1")
+except:
+ CheckOK(46,2)
+CheckSimple2(46,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(46,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(46,3,ent.fragment,0)
+CheckSimple2(46,4,ent.n_fields,2)
+CheckSimple2(46,5,ent.in_fields,( "in1", "in2" ))
+CheckSimple2(46,6,ent.m,(9.9, 7.7))
+CheckSimple2(46,7,ent.b,(8.8, 6.6))
+
+# 48: 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(48,1)
+
+try:
+ ent = d.entry("data/mnew3")
+except:
+ CheckOK2(48,2)
+CheckSimple2(48,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(48,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(48,3,ent.fragment,0)
+CheckSimple2(48,4,ent.poly_ord,3)
+CheckSimple2(48,5,ent.in_fields,( "in1", ))
+CheckSimple2(48,6,ent.a,(3.9, 4.8, 5.7, 6.6))
+
+# 50: 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(50,1)
+
+try:
+ ent = d.entry("data/mnew6")
+except:
+ CheckOK2(50,2)
+CheckSimple2(50,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(50,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(50,3,ent.fragment,0)
+CheckSimple2(50,4,ent.in_fields,( "in", ))
+CheckSimple2(50,5,ent.table,"./more/table")
+
+# 51: 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(51,1)
+
+try:
+ ent = d.entry("data/mnew7")
+except:
+ CheckOK2(51,1)
+CheckSimple2(51,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(51,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(51,3,ent.fragment,0)
+CheckSimple2(51,4,ent.in_fields,( "in1", ))
+CheckSimple2(51,5,ent.numbits,2)
+CheckSimple2(51,6,ent.bitnum,3)
+
+# 52: 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(52,1)
+
+try:
+ ent = d.entry("data/mnew8")
+except:
+ CheckOK2(52,2)
+CheckSimple2(52,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(52,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(52,3,ent.fragment,0)
+CheckSimple2(52,4,ent.in_fields,( "in2", ))
+CheckSimple2(52,5,ent.numbits,5)
+CheckSimple2(52,6,ent.bitnum,4)
+
+# 53: 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(53,1)
+
+try:
+ ent = d.entry("data/mnew9")
+except:
+ CheckOK2(53,2)
+CheckSimple2(53,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(53,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(53,3,ent.fragment,0)
+CheckSimple2(53,4,ent.in_fields,( "in3", "in2"))
+
+# 54: add / entry (phase) check
+ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "mnew10", 0,
+ {"in_field": "in3", "shift": 44})
+try:
+ d.madd(ent,"data")
+except:
+ CheckOK2(54,1)
+
+try:
+ ent = d.entry("data/mnew10")
+except:
+ CheckOK2(54,2)
+CheckSimple2(54,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(54,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(54,3,ent.fragment,0)
+CheckSimple2(54,4,ent.in_fields,( "in3", ))
+CheckSimple2(54,5,ent.shift,44)
+
+# 55: add / entry (const) check
+ent = pygetdata.entry(pygetdata.CONST_ENTRY, "mnew11", 0,
+ {"type": pygetdata.FLOAT64})
+try:
+ d.madd(ent,"data")
+except:
+ CheckOK2(55,1)
+
+try:
+ ent = d.entry("data/mnew11")
+except:
+ CheckOK2(55,2)
+CheckSimple2(55,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(55,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(55,3,ent.fragment,0)
+CheckSimple2(55,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(55,5,ent.data_type_name,"FLOAT64")
+
+#56: string check
+try:
+ n = d.get_string("string")
+except:
+ CheckOK(56)
+CheckSimple(56,n,"Zaphod Beeblebrox")
+
+# 57: entry (string) check
+ent = pygetdata.entry(pygetdata.STRING_ENTRY, "new12", 0)
+try:
+ d.add(ent)
+except:
+ CheckOK2(57,1)
+
+try:
+ ent = d.entry("new12")
+except:
+ CheckOK(57)
+CheckSimple2(57,1,ent.field_type,pygetdata.STRING_ENTRY)
+CheckSimple2(57,2,ent.field_type_name,"STRING_ENTRY")
+CheckSimple2(57,3,ent.fragment,0)
+
+# 59: add_spec check
+try:
+ d.add_spec("lorem STRING \"Lorem ipsum\"", 0)
+except:
+ CheckOK2(58,1)
+
+try:
+ n = d.get_string("lorem")
+except:
+ CheckOK2(59,2)
+CheckSimple(59,n,"Lorem ipsum")
+
+# 60: madd_spec check
+try:
+ d.madd_spec("ipsum STRING \"dolor sit amet.\"", "lorem")
+except:
+ CheckOK2(60,1)
+
+try:
+ n = d.get_string("lorem/ipsum")
+except:
+ CheckOK2(60,2)
+CheckSimple(60,n,"dolor sit amet.")
+
+# 61: put_constant / int check
+try:
+ d.put_constant("const", 61)
+except:
+ CheckOK2(61,1)
+
+try:
+ n = d.get_constant("const",pygetdata.INT)
+except:
+ CheckOK2(61,2)
+CheckSimple(61,n,61)
+
+# 128: put_constant / int check
+try:
+ d.put_constant("const", 128L)
+except:
+ CheckOK2(128,1)
+
+try:
+ n = d.get_constant("const",pygetdata.ULONG)
+except:
+ CheckOK2(128,2)
+CheckSimple(128,n,128L)
+
+# 129: put_constant / int check
+try:
+ d.put_constant("const", 129L)
+except:
+ CheckOK2(129,1)
+
+try:
+ n = d.get_constant("const",pygetdata.LONG)
+except:
+ CheckOK2(129,2)
+CheckSimple(129,n,129L)
+
+# 131: put_constant / float check
+try:
+ d.put_constant("const", 131.)
+except:
+ CheckOK2(131,1)
+
+try:
+ n = d.get_constant("const",pygetdata.FLOAT)
+except:
+ CheckOK2(131,2)
+CheckSimple(131,n,131.)
+
+# 133: put_constant / complex check
+try:
+ d.put_constant("const", 133.+0j)
+except:
+ CheckOK2(133,1)
+
+try:
+ n = d.get_constant("const",pygetdata.COMPLEX)
+except:
+ CheckOK2(133,2)
+CheckSimple(133,n,133.+0j)
+
+# 62: put_string
+try:
+ d.put_string("string", "Arthur Dent")
+except:
+ CheckOK2(62,1)
+
+try:
+ n = d.get_string("string")
+except:
+ CheckOK2(62,2)
+CheckSimple(62,n,"Arthur Dent")
+
+# 63: nmfields_by_type check
+try:
+ n = d.nmfields("data",pygetdata.LINCOM_ENTRY)
+except:
+ CheckOK(63)
+CheckSimple(63,n,1)
+
+# 64: mfield_list_by_type check
+try:
+ n = d.mfield_list("data",pygetdata.LINCOM_ENTRY)
+except:
+ CheckOK(64)
+CheckSimple(64,n,["mnew1"])
+
+# 65: nmfields_by_type check
+try:
+ n = d.nmvectors("data")
+except:
+ CheckOK(65)
+CheckSimple(65,n,8)
+
+# 66: mfield_list_by_type check
+try:
+ n = d.mvector_list("data")
+except:
+ CheckOK(66)
+CheckSimple(66,n,['mlut', 'mnew1', 'mnew3', 'mnew6', 'mnew7', 'mnew8', 'mnew9',
+ 'mnew10'])
+
+# 67: alter / raw check
+ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0,
+ {"type": pygetdata.FLOAT32, "spf": 4})
+try:
+ n = d.alter("new1", ent)
+except:
+ CheckOK2(67,1)
+
+try:
+ ent = d.entry("new1")
+except:
+ CheckOK(67,2)
+CheckSimple2(67,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(67,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(67,3,ent.fragment,0)
+CheckSimple2(67,4,ent.data_type,pygetdata.FLOAT32)
+CheckSimple2(67,5,ent.data_type_name,"FLOAT32")
+CheckSimple2(67,6,ent.spf,4)
+
+# 78: encoding check
+try:
+ f = d.fragment(0)
+ CheckSimple(78,f.encoding,pygetdata.UNENCODED)
+except:
+ CheckOK(78)
+
+# 79: endianness check
+try:
+ CheckSimple(79,f.endianness,pygetdata.LITTLE_ENDIAN |
+ pygetdata.NOT_ARM_ENDIAN)
+except:
+ CheckOK(79)
+
+# 80: dirfilename check
+try:
+ CheckSimple(80,d.name,"dirfile")
+except:
+ CheckOK(80)
+
+# 81: parent_fragment check
+try:
+ f = d.fragment(1)
+ CheckSimple(81,f.parent,0)
+except:
+ CheckOK(81)
+
+# 82: dirfile_protect check
+try:
+ f.protection = pygetdata.PROTECT_DATA
+except:
+ CheckOK(82)
+
+# 83: protection check
+try:
+ f = d.fragment(1)
+ CheckSimple(83,f.protection,pygetdata.PROTECT_DATA)
+except:
+ CheckOK(83)
+
+# 84: raw_filename check
+try:
+ n = d.raw_filename("data")
+except:
+ CheckOK(84)
+CheckSimple(84,n,"dirfile/data")
+
+# 85: reference check
+try:
+ d.reference = "new1"
+except:
+ CheckOK2(85,1)
+
+try:
+ CheckSimple(85,d.reference,"new1")
+except:
+ CheckOK2(85,2)
+
+# 87: alter_encoding check
+try:
+ f = d.fragment(1)
+ f.alter_encoding(pygetdata.SLIM_ENCODED,0)
+except:
+ CheckOK(87)
+
+# 88: alter_endianness check
+try:
+ f.alter_endianness(pygetdata.BIG_ENDIAN,0)
+except:
+ CheckOK(88)
+
+# 89: alter_spec check
+try:
+ d.alter_spec("new10 PHASE in5 3", 0)
+except:
+ CheckOK2(89,1)
+
+try:
+ ent = d.entry("new10")
+except:
+ CheckOK2(89,2)
+CheckSimple2(89,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(89,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(89,3,ent.fragment,0)
+CheckSimple2(89,4,ent.in_fields,( "in5", ))
+CheckSimple2(89,5,ent.shift,3)
+
+# 90: delete check
+try:
+ d.delete("new10",0)
+except:
+ CheckOK2(90,1)
+
+try:
+ ent = d.entry("new10")
+except:
+ CheckException2(90,2,pygetdata.BadCodeError)
+
+# 91: malter_spec check
+try:
+ d.malter_spec("mnew10 PHASE in4 11", "data", 0)
+except:
+ CheckOK2(91,1)
+
+try:
+ ent = d.entry("data/mnew10")
+except:
+ CheckOK2(91,2)
+CheckSimple2(91,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(91,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(91,3,ent.fragment,0)
+CheckSimple2(91,4,ent.in_fields,( "in4", ))
+CheckSimple2(91,5,ent.shift,11)
+
+# 92: move check
+try:
+ d.move("new9", 1, 0)
+except:
+ CheckOK2(92,1)
+
+try:
+ ent = d.entry("new9")
+except:
+ CheckOK2(92,2)
+CheckSimple2(92,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(92,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(92,3,ent.fragment,1)
+CheckSimple2(92,4,ent.in_fields,( "in1", "in2"))
+
+# 93: move check
+try:
+ d.rename("new9", "newer", 0)
+except:
+ CheckOK2(93,1)
+
+try:
+ ent = d.entry("new9")
+except:
+ CheckException2(93,2,pygetdata.BadCodeError)
+
+try:
+ ent = d.entry("newer")
+except:
+ CheckOK2(93,3)
+CheckSimple2(93,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(93,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(93,3,ent.fragment,1)
+CheckSimple2(93,4,ent.in_fields,( "in1", "in2"))
+
+# 94: uninclude check
+try:
+ d.uninclude(1,0)
+except:
+ CheckOK2(94,1)
+
+try:
+ ent = d.entry("newer")
+except:
+ CheckException2(93,2,pygetdata.BadCodeError)
+
+# 95: frameoffset check
+try:
+ f = d.fragment(0)
+ CheckSimple(95,f.frameoffset,0)
+except:
+ CheckOK(95)
+
+# 96: alter_frameoffset check
+try:
+ f.alter_frameoffset(33, 0)
+ CheckSimple(96,f.frameoffset,33)
+except:
+ CheckOK(96)
+
+# 97: native_type check
+try:
+ n = d.native_type("data")
+except:
+ CheckOK(97)
+CheckSimple(97,n,pygetdata.INT8)
+
+# 137: native_type_name check
+try:
+ n = d.native_type_name("data")
+except:
+ CheckOK(137)
+CheckSimple(137,n,"INT8")
+
+# 99: validate check
+try:
+ d.validate("new7")
+except:
+ CheckException(99,pygetdata.BadCodeError)
+
+# 101: framenum check
+try:
+ n = d.framenum("data", 33.3, start=6)
+except:
+ CheckOK(101)
+CheckSimple(101,n,37.0375)
+
+# 86: eof check
+try:
+ n = d.eof("lincom")
+except:
+ CheckOK(86)
+CheckSimple(86,n,344)
+
+# 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 (divide) 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: add / entry (mult) 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: add / entry (mult) 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,8)
+
+try:
+ d.standards = 0;
+except:
+ CheckException2(157,2,pygetdata.BadVersionError)
+
+# 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,2,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)
+
+del d
+os.system("rm -rf dirfile")
+
+if (ne > 0):
+ print "ne =", ne
+ print "__numpy_supported__ =", pygetdata.__numpy_supported__
+ sys.exit(1)
diff --git a/bindings/python/test/callback.py b/bindings/python/test/callback.py
new file mode 100644
index 0000000..64d35b8
--- /dev/null
+++ b/bindings/python/test/callback.py
@@ -0,0 +1,50 @@
+import sys
+import os
+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 (pdata["filename"] != "dirfile/format"):
+ 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)
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..dc84c68
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1501 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel at ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes at openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf at swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+ 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 <sys/param.h>
+# 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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..2a55a50
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1705 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>. Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..33b68f9
--- /dev/null
+++ b/configure
@@ -0,0 +1,33458 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for GetData 0.7.3.
+#
+# Report bugs to <getdata-devel at lists.sourceforge.net>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 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 :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf at gnu.org and
+$0: getdata-devel at lists.sourceforge.net about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&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.7.3'
+PACKAGE_STRING='GetData 0.7.3'
+PACKAGE_BUGREPORT='getdata-devel at lists.sourceforge.net'
+PACKAGE_URL=''
+
+ac_unique_file="src/getdata.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+GDIDL_EXTERNAL_FALSE
+GDIDL_EXTERNAL_TRUE
+HAVE_DIFF_FALSE
+HAVE_DIFF_TRUE
+TEST_IDL_FALSE
+TEST_IDL_TRUE
+TEST_PYTHON_FALSE
+TEST_PYTHON_TRUE
+USE_MODULES_FALSE
+USE_MODULES_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
+LFS_TRANSITIONAL_API_FALSE
+LFS_TRANSITIONAL_API_TRUE
+INTEL_FC_COMPILER_FALSE
+INTEL_FC_COMPILER_TRUE
+INTEL_F77_COMPILER_FALSE
+INTEL_F77_COMPILER_TRUE
+FC_WEXTRA_FALSE
+FC_WEXTRA_TRUE
+F77_WEXTRA_FALSE
+F77_WEXTRA_TRUE
+CXX_WEXTRA_FALSE
+CXX_WEXTRA_TRUE
+CC_WEXTRA_FALSE
+CC_WEXTRA_TRUE
+FC_WALL_FALSE
+FC_WALL_TRUE
+F77_WALL_FALSE
+F77_WALL_TRUE
+CXX_WALL_FALSE
+CXX_WALL_TRUE
+CC_WALL_FALSE
+CC_WALL_TRUE
+GETDATA_DEBUG_FALSE
+GETDATA_DEBUG_TRUE
+absolute_docdir
+PRIVATE_LIBS
+USE_LZMA_FALSE
+USE_LZMA_TRUE
+path_xz
+LZMA_LDFLAGS
+LZMA_CPPFLAGS
+USE_GZIP_FALSE
+USE_GZIP_TRUE
+path_gunzip
+path_gzip
+GZIP_LDFLAGS
+GZIP_CPPFLAGS
+USE_SLIM_FALSE
+USE_SLIM_TRUE
+path_unslim
+path_slim
+SLIM_LDFLAGS
+SLIM_CPPFLAGS
+USE_BZIP2_FALSE
+USE_BZIP2_TRUE
+path_bunzip2
+path_bzip2
+BZIP2_LDFLAGS
+BZIP2_CPPFLAGS
+BUILD_DATE
+DATE
+IDL_LIBS
+IDL_CFLAGS
+idldir
+IDL
+NUMPY_CPPFLAGS
+pythondir
+PYTHON_LIBS
+PYTHON_CPPFLAGS
+PYTHON
+JOT
+SEQ
+DEFINE_gd_int64_t
+DEFINE_gd_uint16_t
+DEFINE_gd_int16_t
+FLIBS
+LTDLINCL
+LIBLTDL
+LIBTOOL_DEPS
+CXXCPP
+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
+EGREP
+CPP
+DEFINE_GD_NO_C99_API
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+DIFF
+SED
+GREP
+LN_S
+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
+DL_LIBRARY_PATH
+DEFINE_GD_LEGACY_API
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+F95GETDATA_VERSION
+FGETDATA_VERSION
+GETDATAXX_VERSION
+GETDATA_IFACE_AGE
+GETDATA_IMPL_REVISION
+GETDATA_IFACE_VERSION
+BUILDCC
+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_python
+enable_idl
+enable_modules
+with_module_dir
+with_ltdl
+with_external_libraries
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+with_python
+with_python_module_dir
+with_idl
+with_idl_dlm_dir
+with_libbz2
+with_libslim
+with_libz
+with_liblzma
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+BUILDCC
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+F77
+FFLAGS
+FC
+FCFLAGS
+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
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures GetData 0.7.3 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/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.7.3:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-legacy-api don't 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-python don't build the Python bindings (pygetdata)
+ --disable-idl don't build the Interactive Data Language (IDL)
+ bindings (IDL_GetData)
+ --enable-modules build external encodings in dynamically loaded
+ modules instead of directly into the core GetData
+ library
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+
+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 [autodetect]
+ --without-external-libraries
+ disable all features relying on external libraries
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+ --with-python=PATH use the Python interpreter located in PATH
+ [autodetect]
+ --with-python-module-dir=PATH
+ install the Python bindings into PATH [autodetect]
+ --with-idl=PATH use the IDL interpreter located in PATH [autodetect]
+ --with-idl-dlm-dir=PATH install the IDL bindings into PATH [autodetect]
+ --with-libbz2=PREFIX use the libbz2 installed in PREFIX [autodetect]
+ --without-libbz2 disable encodings supported by libbz2, even if the
+ library is present
+ --with-libslim=PREFIX use the libslim installed in PREFIX [autodetect]
+ --without-libslim disable encodings supported by libslim, even if the
+ library is present
+ --with-libz=PREFIX use the libz installed in PREFIX [autodetect]
+ --without-libz disable encodings supported by libz, even if the
+ library is present
+ --with-liblzma=PREFIX use the liblzma installed in PREFIX [autodetect]
+ --without-liblzma disable encodings supported by liblzma, even if the
+ library is present
+
+Some influential environment variables:
+ BUILDCC C compiler command on the build system (only needed if
+ cross-compiling)
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ 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
+ 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-devel at lists.sourceforge.net>.
+_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.7.3
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_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 ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_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 <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $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 ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_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 ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_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 ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_fc_try_link
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## -------------------------------------------------- ##
+## Report this to getdata-devel at lists.sourceforge.net ##
+## -------------------------------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#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
+
+# 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_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 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 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 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 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 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 <stdio.h>
+#include <stdlib.h>
+#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 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# 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 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_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 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 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
+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.7.3, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+$as_echo "#define GETDATA_MAJOR 0" >>confdefs.h
+
+
+$as_echo "#define GETDATA_MINOR 7" >>confdefs.h
+
+
+$as_echo "#define GETDATA_REVISION 3" >>confdefs.h
+
+
+$as_echo "#define GETDATA_VERSION_SUFFIX \"\"" >>confdefs.h
+
+
+
+
+
+
+
+
+
+GETDATA_IFACE_VERSION=4
+
+GETDATA_IMPL_REVISION=3
+
+GETDATA_IFACE_AGE=0
+
+GETDATAXX_VERSION=2:0:0
+
+FGETDATA_VERSION=2:1:0
+
+F95GETDATA_VERSION=2:0:0
+
+
+
+ac_config_headers="$ac_config_headers src/config.h"
+
+
+BUINDINGS_BUILT=
+BINDINGS_LEFT=
+ENCODINGS_BUILT=" raw ascii"
+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="yes"
+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"
+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"
+# 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"
+ 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; }
+
+case "${host}" in
+ *-apple-darwin*) DL_LIBRARY_PATH="DYLD_LIBRARY_PATH" ;;
+ *) DL_LIBRARY_PATH="LD_LIBRARY_PATH" ;;
+esac
+
+
+# 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; }
+if test "x$disable_c99" = "xyes"; then
+ make_pybindings="no";
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (requires C99 compiler)" >&5
+$as_echo "no (requires C99 compiler)" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_pybindings" >&5
+$as_echo "$make_pybindings" >&6; }
+fi
+
+# 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; }
+if test "x$disable_c99" = "xyes"; then
+ make_idlbindings="no";
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (requires C99 compiler)" >&5
+$as_echo "no (requires C99 compiler)" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_idlbindings" >&5
+$as_echo "$make_idlbindings" >&6; }
+fi
+
+# 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.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='getdata'
+ VERSION='0.7.3'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether 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
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+
+
+{ $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
+
+echo
+echo "*** Checking C compiler characteristics"
+echo
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+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 <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// 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 -xc99=all -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"
+ make_pybindings="no"
+ make_idlbindings="no"
+ 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_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 <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#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 <ac_nonexistent.h>
+_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 <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#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 <ac_nonexistent.h>
+_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"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+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 <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ 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
+
+if test "x$make_cxxbindings" != "xno"; then
+ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_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'.
+ 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 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_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
+
+fi
+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
+ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_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
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+else
+ BUILDCC=$CC
+
+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'
+macro_revision='1.3293'
+
+
+
+
+
+
+
+
+
+
+
+
+
+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"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&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 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="$ac_tool_prefix$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+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; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at 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 at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ lt_prog_compiler_pic='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$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
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#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 <ac_nonexistent.h>
+_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 <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#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 <ac_nonexistent.h>
+_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_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+ # save warnings/boilerplate of simple test code
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ compiler_CXX=$CC
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+ else
+ lt_prog_compiler_no_builtin_flag_CXX=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&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 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ ld_shlibs_CXX=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ file_list_spec_CXX='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec_CXX='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ fi
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX=' '
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=yes
+ file_list_spec_CXX='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+ enable_shared_with_static_runtimes_CXX=yes
+ # Don't use ranlib
+ old_postinstall_cmds_CXX='chmod 644 $oldlib'
+ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec_CXX=''
+ fi
+ link_all_deplibs_CXX=yes
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+
+ else
+ ld_shlibs_CXX=no
+ fi
+
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs_CXX=yes
+ ;;
+
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ inherit_rpath_CXX=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+ prelink_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ old_archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_CXX=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ ld_shlibs_CXX=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ hardcode_direct_absolute_CXX=yes
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ ;;
+ esac
+
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+ '"$old_archive_cmds_CXX"
+ reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+ '"$reload_cmds_CXX"
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+ test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+ GCC_CXX="$GXX"
+ LD_CXX="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ ;;
+ esac
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc_CXX=no
+ else
+ lt_cv_archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+ archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$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
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+ test -n "$runpath_var_CXX" ||
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+ test "$inherit_rpath_CXX" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ 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 "X$F77" = "Xno"; 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_flag_spec_ld_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 "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# 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
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+ 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 "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+ 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 "$GCC" = yes; then
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_static_F77='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ 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'
+ ;;
+
+ 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 '
+ lt_prog_compiler_pic_F77='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ else
+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ 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'
+ ;;
+
+ 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)
+ 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'
+ ;;
+ 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\ F* | *Sun*Fortran*)
+ # 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\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ 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 which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_F77=
+ ;;
+ *)
+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+ ;;
+esac
+
+{ $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"
+ # 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 x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+ esac
+else
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+
+
+
+
+
+#
+# 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 x"$lt_cv_prog_compiler_static_works_F77" = xyes; 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 "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag_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_flag_spec_ld_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 "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_F77=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_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 <jrb3 at best.com> 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 (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs_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 "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_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' ;;
+ 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 "x$supports_anon_versioning" = xyes; 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
+ 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=
+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+ archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; 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 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_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 "$ld_shlibs_F77" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=yes
+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_F77=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_F77=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_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,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_F77=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_F77=yes
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_libdir_separator_F77=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ 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_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_F77='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = 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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_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 "${lt_cv_aix_libpath+set}" = 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 "$with_gnu_ld" = yes; 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
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ 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~linknames='
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, F77)='true'
+ enable_shared_with_static_runtimes_F77=yes
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # 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 "$lt_cv_ld_force_load" = "yes"; 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\"`'
+ 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*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_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
+ ;;
+
+ freebsd1*)
+ ld_shlibs_F77=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | 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 "$GCC" = yes; 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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_F77='+b $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 "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_F77='$CC -shared $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 "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_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 "$GCC" = yes; 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 "$lt_cv_irix_exported_symbol" = yes; 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
+ ;;
+
+ 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*)
+ 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ allow_undefined_flag_F77=unsupported
+ archive_cmds_F77='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_F77='$CC -r -o $output$reload_objs'
+ hardcode_direct_F77=no
+ ;;
+ motorola)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_F77=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | 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 "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_F77='${wl}-z,text'
+ allow_undefined_flag_F77='${wl}-z,nodefs'
+ archive_cmds_need_lc_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='${wl}-R,$libdir'
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,$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 x$host_vendor = xsni; 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 "$ld_shlibs_F77" = no && 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 "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_F77 in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $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
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$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
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_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
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" ||
+ test -n "$runpath_var_F77" ||
+ test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_F77" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+ test "$hardcode_minus_L_F77" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_F77=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_F77=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_F77=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5
+$as_echo "$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink ||
+ test "$inherit_rpath_F77" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ 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 "X$FC" = "Xno"; 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_flag_spec_ld_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 "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# 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
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+ if test -n "$compiler"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+ 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" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_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 "$pre_test_object_deps_done" = no; 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 "$GCC" = yes; 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 "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_FC='-Bstatic'
+ fi
+ ;;
+
+ 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'
+ ;;
+
+ 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 '
+ lt_prog_compiler_pic_FC='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ if test "$host_cpu" = ia64; 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
+ ;;
+
+ 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'
+ ;;
+
+ 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)
+ 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'
+ ;;
+ 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\ F* | *Sun*Fortran*)
+ # 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\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ lt_prog_compiler_wl_FC='-Wl,'
+ ;;
+ 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 which 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"
+ # 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 x"$lt_cv_prog_compiler_pic_works_FC" = xyes; 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 x"$lt_cv_prog_compiler_static_works_FC" = xyes; 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 "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag_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_flag_spec_ld_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 "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_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 "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_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 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_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 <jrb3 at best.com> 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 (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs_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 "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_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' ;;
+ 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 "x$supports_anon_versioning" = xyes; 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
+ 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=
+ hardcode_libdir_flag_spec_ld_FC='-rpath $libdir'
+ archive_cmds_FC='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; 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 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_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 "$ld_shlibs_FC" = no; 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 "$GCC" = yes && 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 "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_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,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_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 "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec_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_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_FC='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_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 "${lt_cv_aix_libpath+set}" = 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 "$with_gnu_ld" = yes; 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
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds_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~linknames='
+ archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, FC)='true'
+ enable_shared_with_static_runtimes_FC=yes
+ 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 "$lt_cv_ld_force_load" = "yes"; 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\"`'
+ 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*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_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
+ ;;
+
+ freebsd1*)
+ ld_shlibs_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 "$GCC" = yes; 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 $output_objdir/$soname = $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 $output_objdir/$soname = $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 "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_FC='+b $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 "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes; 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 "$lt_cv_irix_exported_symbol" = yes; 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
+ ;;
+
+ 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*)
+ 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_FC='-R$libdir'
+ ;;
+ *)
+ archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+ ;;
+ esac
+ 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
+ archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_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 "$GCC" = yes; 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 can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_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 "$GCC" = yes; 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 x$host_vendor = xsni; 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 "$ld_shlibs_FC" = no && 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 "$enable_shared" = yes && test "$GCC" = yes; 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
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$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
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_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
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_FC=
+if test -n "$hardcode_libdir_flag_spec_FC" ||
+ test -n "$runpath_var_FC" ||
+ test "X$hardcode_automatic_FC" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_FC" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no &&
+ test "$hardcode_minus_L_FC" != no; 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 "$hardcode_action_FC" = relink ||
+ test "$inherit_rpath_FC" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+case "${host}" in
+ *-pc-mingw*|*-pc-cygwin*)
+ NO_UNDEFINED=" -no-undefined --enable-auto-import";
+ NO_DLOPEN_TESTS=1 ;;
+ *) NO_DLOPEN_TESTS=0 ;;
+esac
+
+: ${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 -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## --------------------------------- ##
+## Main body of "$CONFIG_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 <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+GetData config.lt 0.7.3
+configured by $0, generated by GNU Autoconf 2.68.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $# != 0
+do
+ case $1 in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) 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"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+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_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+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_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_F77='`$ECHO "$hardcode_libdir_flag_spec_ld_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_FC='`$ECHO "$hardcode_libdir_flag_spec_ld_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 \
+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_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+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_flag_spec_ld_CXX \
+hardcode_libdir_flag_spec_ld_F77 \
+hardcode_libdir_flag_spec_ld_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\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+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\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+
+
+
+
+
+_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 which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX F77 FC "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# 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 in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using 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
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to "yes" if using 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
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_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 "$silent" = yes &&
+ 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=PREFIX or else disable the building of modules by using --disable-modules." "$LINENO" 5
+ fi
+
+ if test "x$ltdl_prefix" != "x"; then
+ 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="-L${ltdl_prefix}/lib -lltdl"
+ LTDLINC="-I${ltdl_prefix}/include"
+ 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
+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
+
+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
+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$make_c++bindings" != "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
+ 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
+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
+ 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
+ { $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_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
+ 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
+ { $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
+
+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
+ # If we are using xlf then replace all the commas with spaces.
+ *xlfentry*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+ # 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 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
+ # If we are using xlf then replace all the commas with spaces.
+ *xlfentry*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+ # 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 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)
+ test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+ ;;
+ -[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
+
+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
+
+
+$as_echo "#define _BSD_SOURCE /**/" >>confdefs.h
+
+
+$as_echo "#define _SVID_SOURCE /**/" >>confdefs.h
+
+
+$as_echo "#define _POSIX_SOURCE /**/" >>confdefs.h
+
+
+$as_echo "#define _POSIX_C_SOURCE 200809L" >>confdefs.h
+
+
+echo
+echo "*** Looking for library functions"
+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
+
+
+if test "x${use_modules}" != "xno"; then
+ { $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 ();
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+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
+
+for ac_func in _commit fchmod _fdopen fseeko fseeko64 fsync ftello ftello64 \
+ getcwd _getcwd getdelim gmtime_r _lseeki64 _mkdir mkstemp nan \
+ _open _read _rmdir _snprintf stat64 _stat64 _strtoi64 strtoll \
+ _strtoui64 strtoull _unlink _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
+
+
+echo
+echo "*** Looking for additional header files"
+echo
+for ac_header in direct.h fcntl.h libgen.h stdint.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 <sys/types.h>
+#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
+
+
+for ac_header in io.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "io.h" "ac_cv_header_io_h" "$ac_includes_default"
+if test "x$ac_cv_header_io_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_IO_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $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 <sys/stat.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_IO_H
+#include <io.h>
+#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
+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 ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* 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. */
+ char *t;
+ 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 saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ 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 <sys/types.h>
+ #include <sys/param.h>
+
+#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 <sys/types.h>
+ #include <sys/param.h>
+
+#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 <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+#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 <limits.h>
+
+#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 <endian.h>
+#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 <endian.h>
+#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_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
+
+# 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
+
+
+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 :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SSIZE_T 1
+_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
+
+# 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
+
+
+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_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_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_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_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_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_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
+
+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
+
+
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
+$as_echo_n "checking for struct stat64... " >&6; }
+if ${gd_cv_type_struct_stat64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+if test "x$gd_cv_c_need_lfs_defined" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(struct stat64))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gd_cv_type_struct_stat64="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test "x$gd_cv_type_struct_stat64" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(struct stat64))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if test "x$gd_cv_c_need_lfs_defined" = "xyes"; then
+gd_cv_type_struct_stat64="yes"
+else
+gd_cv_type_struct_stat64="yes, with _LARGEFILE64_SOURCE defined"
+fi
+gd_cv_c_need_lfs_defined="yes"
+else
+ gd_cv_type_struct_stat64="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_type_struct_stat64" >&5
+$as_echo "$gd_cv_type_struct_stat64" >&6; }
+
+if test "x$gd_cv_type_struct_stat64" != "xno"; then
+
+$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct _stat64" >&5
+$as_echo_n "checking for struct _stat64... " >&6; }
+if ${gd_cv_type_struct__stat64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+if test "x$gd_cv_c_need_lfs_defined" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(struct _stat64))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gd_cv_type_struct__stat64="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test "x$gd_cv_type_struct__stat64" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(struct _stat64))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if test "x$gd_cv_c_need_lfs_defined" = "xyes"; then
+gd_cv_type_struct__stat64="yes"
+else
+gd_cv_type_struct__stat64="yes, with _LARGEFILE64_SOURCE defined"
+fi
+gd_cv_c_need_lfs_defined="yes"
+else
+ gd_cv_type_struct__stat64="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_type_struct__stat64" >&5
+$as_echo "$gd_cv_type_struct__stat64" >&6; }
+
+if test "x$gd_cv_type_struct__stat64" != "xno"; then
+
+$as_echo "#define HAVE_STRUCT__STAT64 1" >>confdefs.h
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct __stat64" >&5
+$as_echo_n "checking for struct __stat64... " >&6; }
+if ${gd_cv_type_struct___stat64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+if test "x$gd_cv_c_need_lfs_defined" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(struct __stat64))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gd_cv_type_struct___stat64="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test "x$gd_cv_type_struct___stat64" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(struct __stat64))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if test "x$gd_cv_c_need_lfs_defined" = "xyes"; then
+gd_cv_type_struct___stat64="yes"
+else
+gd_cv_type_struct___stat64="yes, with _LARGEFILE64_SOURCE defined"
+fi
+gd_cv_c_need_lfs_defined="yes"
+else
+ gd_cv_type_struct___stat64="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_type_struct___stat64" >&5
+$as_echo "$gd_cv_type_struct___stat64" >&6; }
+
+if test "x$gd_cv_type_struct___stat64" != "xno"; then
+
+$as_echo "#define HAVE_STRUCT___STAT64 1" >>confdefs.h
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
+$as_echo_n "checking for off64_t... " >&6; }
+if ${gd_cv_type_off64_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+if test "x$gd_cv_c_need_lfs_defined" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(off64_t))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gd_cv_type_off64_t="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test "x$gd_cv_type_off64_t" != "xyes"; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _LARGEFILE64_SOURCE 1
+
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+if (sizeof(off64_t))
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if test "x$gd_cv_c_need_lfs_defined" = "xyes"; then
+gd_cv_type_off64_t="yes"
+else
+gd_cv_type_off64_t="yes, with _LARGEFILE64_SOURCE defined"
+fi
+gd_cv_c_need_lfs_defined="yes"
+else
+ gd_cv_type_off64_t="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_type_off64_t" >&5
+$as_echo "$gd_cv_type_off64_t" >&6; }
+
+if test "x$gd_cv_type_off64_t" != "xno"; then
+
+$as_echo "#define HAVE_OFF64_T 1" >>confdefs.h
+
+fi
+
+
+if test "x$gd_cv_c_need_lfs_defined" = "xyes"; then
+
+$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
+
+fi
+
+if test "x$gd_cv_type_off64_t" = "xyes"; then
+
+$as_echo "#define HAVE_OFF64_T 1" >>confdefs.h
+ 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 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
+
+
+
+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
+
+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";
+
+
+
+
+if test "x$make_pybindings" = "xyes"; then
+ echo
+ echo "*** Configuring python bindings"
+ echo
+
+last_python=2.7
+first_python=2.3
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+
+if test "x$SEQ" == "xnot found"; then
+ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+
+ 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 { test -f "$as_dir/$py$exec_ext" && $as_test_x "$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; }
+
+if test -x $PYTHON-config; then
+ if test -n "$user_python"; then
+ python_exec_prefix=`$PYTHON-config --exec-prefix`
+ PYTHON_LIBS="-L${python_exec_prefix}/lib "
+ else
+ PYTHON_LIBS=""
+ fi
+ PYTHON_CPPFLAGS=`$PYTHON-config --includes 2>/dev/null`
+ PYTHON_LIBS="${PYTHON_LIBS}`$PYTHON-config --ldflags 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_libdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBDIR')"`
+ python_syslibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('SYSLIBS')"`
+ python_shlibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('SHLIBS')"`
+ python_modlibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('MODLIBS')"`
+
+ PYTHON_CPPFLAGS="-I${python_prefix}/include/python${PYTHON_VERSION} -I${python_exec_prefix}/include/python${PYTHON_VERSION}"
+ if test -n "$user_python"; then
+ PYTHON_LIBS="-L${python_libdir} "
+ else
+ PYTHON_LIBS=""
+ fi
+ PYTHON_LIBS="${PYTHON_LIBS}$python_syslibs $python_shlibs $python_modlibs -lpython${PYTHON_VERSION}"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python includes" >&5
+$as_echo_n "checking Python includes... " >&6; }
+{ $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 libraries" >&5
+$as_echo_n "checking Python libraries... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LIBS" >&5
+$as_echo "$PYTHON_LIBS" >&6; }
+
+
+saved_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}"
+for ac_header in Python.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
+if test "x$ac_cv_header_Python_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PYTHON_H 1
+_ACEOF
+
+else
+ have_python="no"
+fi
+
+done
+
+CPPFLAGS=${saved_CPPFLAGS}
+
+fi
+
+if test "x${have_python}" != "xno"; then
+
+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; }
+
+saved_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}"
+saved_LIBS=$LIBS
+LIBS="$LIBS ${PYTHON_LIBS}"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile a simple Python extension module" >&5
+$as_echo_n "checking if we can compile a simple Python extension module... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char Py_Initialize ();
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return Py_Initialize ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; have_python="no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+CPPFLAGS=$saved_CPPFLAGS
+LIBS=$saved_LIBS
+
+fi
+
+ have_numpy="no"
+ 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<Python.h>
+
+"
+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
+ fi
+
+ if test "x$have_numpy" = "xyes"; then
+
+$as_echo "#define USE_NUMPY /**/" >>confdefs.h
+
+ fi
+fi
+
+if test "x$make_idlbindings" = "xyes"; then
+ echo
+ echo "*** Configuring interactive data language (IDL) bindings"
+ echo
+
+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 { test -f "$as_dir/$prog$exec_ext" && $as_test_x "$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 /-m/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"
+ else
+ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+
+ if test "x$DATE" == "xnot found"; then
+ BUILD_DATE="Build date unspecified"
+ else
+ BUILD_DATE=`$DATE`
+ fi
+
+ 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
+
+$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=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+ if test "x$bzip2_prefix" = "x"; then
+ BZIP2_LDFLAGS="-lbz2"
+ BZIP2_SEARCHPATH="$PATH"
+ else
+ BZIP2_CPPFLAGS="-I$bzip2_prefix/include"
+ BZIP2_LDFLAGS="-L$bzip2_prefix/lib -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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+ else
+ PRIVATE_LIBS="$PRIVATE_LIBS $BZIP2_LDFLAGS"
+ fi
+ fi
+else
+ ENCODINGS_LEFT="${ENCODINGS_LEFT} bzip2";
+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
+
+$as_echo "#define HAVE_LIBSLIM 1" >>confdefs.h
+
+fi
+
+ 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=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+ if test "x$slim_prefix" = "x"; then
+ SLIM_LDFLAGS="-lslim"
+ SLIM_SEARCHPATH="$PATH"
+ else
+ SLIM_CPPFLAGS="-I$slim_prefix/include"
+ SLIM_LDFLAGS="-L$slim_prefix/lib -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 slim slimdata
+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_slim+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $path_slim in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_path_slim="$path_slim" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_path_slim="$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_slim=$ac_cv_path_path_slim
+if test -n "$path_slim"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_slim" >&5
+$as_echo "$path_slim" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$path_slim" && break
+done
+test -n "$path_slim" || path_slim="not found"
+
+
+if test "x$path_slim" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SLIM "$path_slim"
+_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_slim" != "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"
+ else
+ PRIVATE_LIBS="$PRIVATE_LIBS $SLIM_LDFLAGS"
+ fi
+ fi
+else
+ ENCODINGS_LEFT="${ENCODINGS_LEFT} slim";
+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
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+ 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=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+ if test "x$gzip_prefix" = "x"; then
+ GZIP_LDFLAGS="-lz"
+ GZIP_SEARCHPATH="$PATH"
+ else
+ GZIP_CPPFLAGS="-I$gzip_prefix/include"
+ GZIP_LDFLAGS="-L$gzip_prefix/lib -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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+ else
+ PRIVATE_LIBS="$PRIVATE_LIBS $GZIP_LDFLAGS"
+ 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
+
+$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=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+ if test "x$lzma_prefix" = "x"; then
+ LZMA_LDFLAGS="-llzma"
+ LZMA_SEARCHPATH="$PATH"
+ else
+ LZMA_CPPFLAGS="-I$lzma_prefix/include"
+ LZMA_LDFLAGS="-L$lzma_prefix/lib -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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+ else
+ PRIVATE_LIBS="$PRIVATE_LIBS $LZMA_LDFLAGS"
+ fi
+ fi
+else
+ ENCODINGS_LEFT="${ENCODINGS_LEFT} lzma";
+fi
+
+
+if test ! -z "${LIBS}"; then
+ PRIVATE_LIBS="${LIBS} ${PRIVATE_LIBS}"
+fi
+
+
+cat <<EOF > 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/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/python/Makefile"
+
+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.ah:src/getdata.h.in"
+
+ac_config_headers="$ac_config_headers src/getdata.h:src/getdata.ah"
+
+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$gd_cv_prog_cc_wall" == "xyes"; then
+ CC_WALL_TRUE=
+ CC_WALL_FALSE='#'
+else
+ CC_WALL_TRUE='#'
+ CC_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_cxx_wall" == "xyes"; then
+ CXX_WALL_TRUE=
+ CXX_WALL_FALSE='#'
+else
+ CXX_WALL_TRUE='#'
+ CXX_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_f77_wall" == "xyes"; then
+ F77_WALL_TRUE=
+ F77_WALL_FALSE='#'
+else
+ F77_WALL_TRUE='#'
+ F77_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_fc_wall" == "xyes"; then
+ FC_WALL_TRUE=
+ FC_WALL_FALSE='#'
+else
+ FC_WALL_TRUE='#'
+ FC_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_cc_wextra" == "xyes"; then
+ CC_WEXTRA_TRUE=
+ CC_WEXTRA_FALSE='#'
+else
+ CC_WEXTRA_TRUE='#'
+ CC_WEXTRA_FALSE=
+fi
+
+ if test "x$gd_cv_prog_cxx_wextra" == "xyes"; then
+ CXX_WEXTRA_TRUE=
+ CXX_WEXTRA_FALSE='#'
+else
+ CXX_WEXTRA_TRUE='#'
+ CXX_WEXTRA_FALSE=
+fi
+
+ if test "x$gd_cv_prog_f77_wextra" == "xyes"; then
+ F77_WEXTRA_TRUE=
+ F77_WEXTRA_FALSE='#'
+else
+ F77_WEXTRA_TRUE='#'
+ F77_WEXTRA_FALSE=
+fi
+
+ if test "x$gd_cv_prog_fc_wextra" == "xyes"; then
+ FC_WEXTRA_TRUE=
+ FC_WEXTRA_FALSE='#'
+else
+ FC_WEXTRA_TRUE='#'
+ FC_WEXTRA_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$gd_cv_type_off64_t" = "xyes"; then
+ LFS_TRANSITIONAL_API_TRUE=
+ LFS_TRANSITIONAL_API_FALSE='#'
+else
+ LFS_TRANSITIONAL_API_TRUE='#'
+ LFS_TRANSITIONAL_API_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$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$DIFF" != "x"; then
+ HAVE_DIFF_TRUE=
+ HAVE_DIFF_FALSE='#'
+else
+ HAVE_DIFF_TRUE='#'
+ HAVE_DIFF_FALSE=
+fi
+
+ if false; then
+ GDIDL_EXTERNAL_TRUE=
+ GDIDL_EXTERNAL_FALSE='#'
+else
+ GDIDL_EXTERNAL_TRUE='#'
+ GDIDL_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
+
+
+ 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__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_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_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 "${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 "${CC_WALL_TRUE}" && test -z "${CC_WALL_FALSE}"; then
+ as_fn_error $? "conditional \"CC_WALL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CXX_WALL_TRUE}" && test -z "${CXX_WALL_FALSE}"; then
+ as_fn_error $? "conditional \"CXX_WALL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${F77_WALL_TRUE}" && test -z "${F77_WALL_FALSE}"; then
+ as_fn_error $? "conditional \"F77_WALL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${FC_WALL_TRUE}" && test -z "${FC_WALL_FALSE}"; then
+ as_fn_error $? "conditional \"FC_WALL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CC_WEXTRA_TRUE}" && test -z "${CC_WEXTRA_FALSE}"; then
+ as_fn_error $? "conditional \"CC_WEXTRA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CXX_WEXTRA_TRUE}" && test -z "${CXX_WEXTRA_FALSE}"; then
+ as_fn_error $? "conditional \"CXX_WEXTRA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${F77_WEXTRA_TRUE}" && test -z "${F77_WEXTRA_FALSE}"; then
+ as_fn_error $? "conditional \"F77_WEXTRA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${FC_WEXTRA_TRUE}" && test -z "${FC_WEXTRA_FALSE}"; then
+ as_fn_error $? "conditional \"FC_WEXTRA\" 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 "${LFS_TRANSITIONAL_API_TRUE}" && test -z "${LFS_TRANSITIONAL_API_FALSE}"; then
+ as_fn_error $? "conditional \"LFS_TRANSITIONAL_API\" 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 "${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 "${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 "${GDIDL_EXTERNAL_TRUE}" && test -z "${GDIDL_EXTERNAL_FALSE}"; then
+ as_fn_error $? "conditional \"GDIDL_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 -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by GetData $as_me 0.7.3, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <getdata-devel at lists.sourceforge.net>."
+
+_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.7.3
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+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_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+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_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_F77='`$ECHO "$hardcode_libdir_flag_spec_ld_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_FC='`$ECHO "$hardcode_libdir_flag_spec_ld_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 \
+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_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+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_flag_spec_ld_CXX \
+hardcode_libdir_flag_spec_ld_F77 \
+hardcode_libdir_flag_spec_ld_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\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+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\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+
+
+
+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/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/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/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/python/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/Makefile" ;;
+ "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.ah") CONFIG_FILES="$CONFIG_FILES src/getdata.ah:src/getdata.h.in" ;;
+ "src/getdata.h") CONFIG_HEADERS="$CONFIG_HEADERS src/getdata.h:src/getdata.ah" ;;
+ "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 2>/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
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$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
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX F77 FC "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# 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 in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using 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
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to "yes" if using 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
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_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_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
+
+if test "x$gd_cv_type_off64_t" = "xyes"; then
+ lfs_transitional_api="yes"
+else
+ lfs_transitional_api="no"
+fi
+
+echo
+echo "Configuration summary: "
+echo " ANSI C compatibility mode: ${disable_c99}"
+echo " LFS transitional API: ${lfs_transitional_api}"
+echo " Legacy API: ${include_legacy_api}"
+echo " Verbose debugging: ${enable_debug}"
+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}"
+if test "x$make_pybindings" != "xno"; then
+ echo " NumPy support in Python: ${have_numpy}"
+fi
+echo
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..721b9a2
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,888 @@
+dnl Copyright (C) 2008-2011 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 at lists.sourceforge.net])
+
+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_PREREQ([2.63])
+AC_CONFIG_MACRO_DIR([m4])
+
+LT_PREREQ([2.2.6b])
+
+AC_ARG_VAR([BUILDCC],
+ [C compiler command on 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_CONFIG_SRCDIR([src/getdata.c])
+AC_CONFIG_HEADER([src/config.h])
+
+dnl Features
+BUINDINGS_BUILT=
+BINDINGS_LEFT=
+ENCODINGS_BUILT=" raw ascii"
+ENCODINGS_LEFT=
+PRIVATE_LIBS=
+
+echo "*** Checking GetData configuration"
+echo
+
+dnl Build/Host triplets
+AC_CANONICAL_HOST
+
+dnl Legacy API
+AC_ARG_ENABLE(legacy-api, AS_HELP_STRING([--disable-legacy-api],
+ [don't 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="yes" ])
+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"
+fi
+
+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"
+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"
+ 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 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)]),
+ [
+ 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 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])
+
+dnl Python bindings
+AC_ARG_ENABLE(python, AS_HELP_STRING([--disable-python],
+ [don't build the Python bindings (pygetdata)]),
+ [
+ case "${enableval}" in
+ no) make_pybindings="no" ;;
+ *) make_pybindings="yes" ;;
+ esac
+ ])
+
+AC_MSG_CHECKING([whether to include the Python bindings])
+if test "x$disable_c99" = "xyes"; then
+ make_pybindings="no";
+ AC_MSG_RESULT([no (requires C99 compiler)])
+else
+ AC_MSG_RESULT([$make_pybindings])
+fi
+
+dnl IDL bindings
+AC_ARG_ENABLE(idl, AS_HELP_STRING([--disable-idl],
+ [don't build the Interactive Data Language (IDL) bindings (IDL_GetData)]),
+ [
+ case "${enableval}" in
+ no) make_idlbindings="no" ;;
+ *) make_idlbindings="yes" ;;
+ esac
+ ])
+
+AC_MSG_CHECKING([whether to include the IDL bindings])
+if test "x$disable_c99" = "xyes"; then
+ make_idlbindings="no";
+ AC_MSG_RESULT([no (requires C99 compiler)])
+else
+ AC_MSG_RESULT([$make_idlbindings])
+fi
+
+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 [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_GREP
+AC_PROG_AWK
+AC_PROG_SED
+AC_CHECK_PROGS([DIFF], [diff], [])
+GD_MSYS_SHELL
+echo
+echo "*** Checking C compiler characteristics"
+echo
+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"
+ make_pybindings="no"
+ make_idlbindings="no"
+ 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
+if test "x$make_cxxbindings" != "xno"; then
+ echo
+ echo "*** Checking C++ compiler characteristics"
+ echo
+ AC_PROG_CXX
+ AC_PROG_CXX_C_O
+fi
+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
+else
+ BUILDCC=$CC
+ AC_SUBST([BUILDCC])
+fi
+
+echo
+echo "*** Building libtool"
+echo
+LT_INIT([dlopen])
+AC_SUBST([LIBTOOL_DEPS])
+
+case "${host}" in
+ *-pc-mingw*|*-pc-cygwin*)
+ NO_UNDEFINED=" -no-undefined --enable-auto-import";
+ NO_DLOPEN_TESTS=1 ;;
+ *) NO_DLOPEN_TESTS=0 ;;
+esac
+
+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=PREFIX or else disable the building of modules by using --disable-modules.])
+ fi
+
+ if test "x$ltdl_prefix" != "x"; then
+ AC_CHECK_HEADERS(ltdl.h)
+ LIBLTDL="-L${ltdl_prefix}/lib -lltdl"
+ LTDLINC="-I${ltdl_prefix}/include"
+ else
+ AC_CHECK_HEADERS(ltdl.h)
+ LIBLTDL="-lltdl"
+ fi
+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
+GD_PROG_CC_WALL
+GD_PROG_CC_WEXTRA
+
+if test "x$make_c++bindings" != "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
+
+if test "x$make_f95bindings" != "xno"; then
+ GD_PROG_FC_WALL
+ GD_PROG_FC_WEXTRA
+ GD_LANG_FC_COMPILER_INTEL
+fi
+
+dnl F77 stuff
+if test "x$make_f77bindings" != "xno"; then
+ AC_F77_WRAPPERS
+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 Declare a few feature test macros
+AC_DEFINE([_BSD_SOURCE], [], [ Expose BSD-derived definitions ])
+AC_DEFINE([_SVID_SOURCE], [], [ Expose System V-derived definitions ])
+AC_DEFINE([_POSIX_SOURCE], [], [ Expose POSIX.1-1990 conforming definitions ])
+AC_DEFINE([_POSIX_C_SOURCE], [200809L],
+ [ Expose POSIX:2008 conforming definitions ])
+
+dnl libraries
+echo
+echo "*** Looking for library functions"
+echo
+AC_SEARCH_LIBS([ceil],[m])
+
+dnl pthread
+if test "x${use_modules}" != "xno"; then
+ 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
+
+dnl functions
+AC_CHECK_FUNCS([_commit fchmod _fdopen fseeko fseeko64 fsync ftello ftello64 \
+ getcwd _getcwd getdelim gmtime_r _lseeki64 _mkdir mkstemp nan \
+ _open _read _rmdir _snprintf stat64 _stat64 _strtoi64 strtoll \
+ _strtoui64 strtoull _unlink _write])
+if test "x$disable_c99" = "xno"; then
+ AC_CHECK_FUNCS([cabs])
+fi
+AC_FUNC_STRERROR_R
+
+dnl headers
+echo
+echo "*** Looking for additional header files"
+echo
+AC_CHECK_HEADERS([direct.h fcntl.h libgen.h stdint.h unistd.h])
+if test "x$disable_c99" = "xno"; then
+AC_CHECK_HEADERS([complex.h])
+fi
+AC_HEADER_DIRENT
+
+AC_CHECK_HEADERS([io.h])
+
+AC_MSG_CHECKING([whether mkdir accepts two arguments])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_IO_H
+#include <io.h>
+#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`
+
+dnl types
+echo
+echo "*** Checking data types"
+echo
+AC_C_CONST
+AC_C_BIGENDIAN
+GD_C_FLOATORDERING
+AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF([size_t])
+AC_CHECK_TYPES([ssize_t])
+AC_TYPE_OFF_T
+AC_CHECK_SIZEOF([off_t])
+AC_TYPE_UINT8_T
+AC_TYPE_INT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_INT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_INT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_INT64_T
+
+if test "x$disable_c99" = "xno"; then
+AC_CHECK_TYPES([_Complex float, _Complex double])
+fi
+
+GD_CHECK_LFS_TYPE([struct stat64],[
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+])
+
+GD_CHECK_LFS_TYPE([struct _stat64],[
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+])
+
+GD_CHECK_LFS_TYPE([struct __stat64],[
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+])
+
+GD_CHECK_LFS_TYPE([off64_t],[
+#ifdef STDC_HEADERS
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+])
+
+if test "x$gd_cv_c_need_lfs_defined" = "xyes"; then
+ AC_DEFINE([_LARGEFILE64_SOURCE], [1],
+ [ Additional functionality from LFS for large files. ])
+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
+
+dnl integer sizes
+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])
+
+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
+
+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";
+AC_SUBST([DEFINE_gd_int16_t])
+AC_SUBST([DEFINE_gd_uint16_t])
+AC_SUBST([DEFINE_gd_int64_t])
+
+dnl python
+if test "x$make_pybindings" = "xyes"; then
+ echo
+ echo "*** Configuring python bindings"
+ echo
+ GD_PYTHON([2.3])
+ have_numpy="no"
+ 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])
+ AC_SUBST([NUMPY_CPPFLAGS])
+
+ saved_cppflags=$CPPFLAGS
+ CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS} ${NUMPY_CPPFLAGS}"
+ AC_CHECK_HEADERS([numpy/arrayobject.h],,[have_numpy="no"],[
+#include<Python.h>
+])
+ CPPFLAGS=$saved_cppflags
+ fi
+
+ if test "x$have_numpy" = "xyes"; then
+ AC_DEFINE([USE_NUMPY], [],
+ [ Define to to enable NumPy support in the Python bindings ])
+ fi
+fi
+
+dnl idl
+if test "x$make_idlbindings" = "xyes"; then
+ echo
+ echo "*** Configuring interactive data language (IDL) bindings"
+ echo
+ GD_IDL([5.5])
+ if test "x$have_idl" = "xno"; then
+ make_idlbindings="no"
+ else
+ dnl build date
+ AC_CHECK_PROGS([DATE], [date], [not found])
+ if test "x$DATE" == "xnot found"; then
+ BUILD_DATE="Build date unspecified"
+ else
+ BUILD_DATE=`$DATE`
+ fi
+ AC_SUBST([BUILD_DATE])
+ fi
+fi
+
+dnl external encodings
+GD_CHECK_ENCODING([bzip2],[bz2],[BZ2_bzReadOpen],[bzlib.h],[bzip2],[bunzip2])
+GD_CHECK_ENCODING([slim],[slim],[slimopen],[slimlib.h],[slim slimdata],[unslim],[])
+GD_CHECK_ENCODING([gzip],[z],[gzopen],[zlib.h],[gzip],[gunzip],[])
+GD_CHECK_ENCODING([lzma],[lzma],[lzma_auto_decoder],[lzma.h],[xz],[],[])
+
+if test ! -z "${LIBS}"; then
+ PRIVATE_LIBS="${LIBS} ${PRIVATE_LIBS}"
+fi
+AC_SUBST([PRIVATE_LIBS])
+
+dnl Calculate absolute docdir
+cat <<EOF > 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/idl/Makefile])
+AC_CONFIG_FILES([bindings/idl/makedlm.sh])
+AC_CONFIG_FILES([bindings/idl/test/Makefile])
+AC_CONFIG_FILES([bindings/python/Makefile])
+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 use
+dnl AC_CONFIG_HEADERS to check whether it has changed.
+AC_CONFIG_FILES([src/getdata.ah:src/getdata.h.in])
+AC_CONFIG_HEADERS([src/getdata.h:src/getdata.ah], [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(CC_WALL, [test "x$gd_cv_prog_cc_wall" == "xyes"])
+AM_CONDITIONAL(CXX_WALL, [test "x$gd_cv_prog_cxx_wall" == "xyes"])
+AM_CONDITIONAL(F77_WALL, [test "x$gd_cv_prog_f77_wall" == "xyes"])
+AM_CONDITIONAL(FC_WALL, [test "x$gd_cv_prog_fc_wall" == "xyes"])
+AM_CONDITIONAL(CC_WEXTRA, [test "x$gd_cv_prog_cc_wextra" == "xyes"])
+AM_CONDITIONAL(CXX_WEXTRA, [test "x$gd_cv_prog_cxx_wextra" == "xyes"])
+AM_CONDITIONAL(F77_WEXTRA, [test "x$gd_cv_prog_f77_wextra" == "xyes"])
+AM_CONDITIONAL(FC_WEXTRA, [test "x$gd_cv_prog_fc_wextra" == "xyes"])
+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(LFS_TRANSITIONAL_API, [test "x$gd_cv_type_off64_t" = "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(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(HAVE_DIFF, [test "x$DIFF" != "x"])
+AM_CONDITIONAL(GDIDL_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_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
+
+if test "x$gd_cv_type_off64_t" = "xyes"; then
+ lfs_transitional_api="yes"
+else
+ lfs_transitional_api="no"
+fi
+
+echo
+echo "Configuration summary: "
+echo " ANSI C compatibility mode: ${disable_c99}"
+echo " LFS transitional API: ${lfs_transitional_api}"
+echo " Legacy API: ${include_legacy_api}"
+echo " Verbose debugging: ${enable_debug}"
+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}"
+if test "x$make_pybindings" != "xno"; then
+ echo " NumPy support in Python: ${have_numpy}"
+fi
+echo
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..df8eea7
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
+# Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u="sed s,\\\\\\\\,/,g"
+ depmode=msvisualcpp
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> "$depfile"
+ echo >> "$depfile"
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..459f79e
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,47 @@
+# Copyright (C) 2008 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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_PYBINDINGS
+READMEPYTHON=README.python
+endif
+
+dist_doc_DATA = ${READMECXX} ${READMEF77} ${READMEF95} ${READMEIDL} \
+ ${READMEPYTHON} unclean_database_recovery.txt
+
+clean-local:
+ rm -rf *~
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..13ddb23
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,500 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = doc
+DIST_COMMON = $(am__dist_doc_DATA_DIST) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/config.h \
+ $(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__dist_doc_DATA_DIST = README.cxx README.f77 README.f95 README.idl \
+ 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__installdirs = "$(DESTDIR)$(docdir)"
+DATA = $(dist_doc_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at MAKE_CXXBINDINGS_TRUE@READMECXX = README.cxx
+ at MAKE_F77BINDINGS_TRUE@READMEF77 = README.f77
+ at MAKE_F95BINDINGS_TRUE@READMEF95 = README.f95
+ at MAKE_IDLBINDINGS_TRUE@READMEIDL = README.idl
+ at MAKE_PYBINDINGS_TRUE@READMEPYTHON = README.python
+dist_doc_DATA = ${READMECXX} ${READMEF77} ${READMEF95} ${READMEIDL} \
+ ${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)
+ test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
+ @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(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|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(docdir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-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 distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dist_docDATA \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-dist_docDATA
+
+
+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:
diff --git a/doc/README.cxx b/doc/README.cxx
new file mode 100644
index 0000000..7d38717
--- /dev/null
+++ b/doc/README.cxx
@@ -0,0 +1,696 @@
+C++ 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. Header files
+defining these classes are installed into the ${includedir}/getdata directory.
+The following classes are available:
+
+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 provides access to the error member of the underlying
+ DIRFILE* object.
+
+* 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::AddSpec(const char *spec, int format_file = 0)
+* int Dirfile::AlterSpec(const char *line, int recode = 0)
+* const gd_carray_t *Dirfile::Carrays(GetData::DataType type = Float64)
+* const size_t Dirfile::CarrayLen(const char *field_code)
+* const void *Dirfile::Constants(GetData::DataType type = Float64)
+* int Delete(const char *field_code, int flags = 0)
+* const char **Dirfile::FieldList()
+* const char **Dirfile::FieldListByType(GetData::EntryType type)
+* 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 Include(const char *file, int format_file, unsigned int flags)
+* int Dirfile::MAdd(const Entry &entry, const char *parent)
+* 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)
+* const char **Dirfile::MFieldList(const char *parent)
+* const char **Dirfile::MFieldListByType(const char *parent,
+ * GetData::EntryType type)
+* int Dirfile::MetaFlush()
+* const char **Dirfile::MStrings(const char *parent)
+* const char **Dirfile::MVectorList(const char *parent)
+* DataType Dirfile::NativeType(const char *field_code)
+* 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)
+* unsigned int Dirfile::SamplesPerFrame(const char *field_code)
+* const char **Dirfile::Strings()
+* int Dirfile::Validate(const char *field_code)
+* const char **Dirfile::VectorList()
+
+ These methods call the corresponding function from the C API on the C DIRFILE
+ object associated with the C++ object. Arguments of type GetData::DataType
+ should be one of:
+
+ Null, Unknown, UInt8, Int8, UInt16, Int16, UInt32, Int32, UInt64, Int64,
+ Float32, Float64, Complex64, Complex128
+
+ which are aliases for the gd_type_t values GD_NULL, GD_UNKNOWN, GD_UINT8, &c.
+ Arguments of type GetData::EntryType should be one of
+
+ NoEntryType, BitEntryType, CarrayEntry, ConstEntryType, DivideEntryType,
+ IndexEntryType, LincomEntryType, LinterpEntryType, MultiplyEntryType,
+ PhaseEntryType, PolynomEntryType, RawEntryType, RecipEntryType,
+ SBitEntryType, StringEntryType
+
+ which are aliases for the gd_entype_t values GD_NO_ENTRY, GD_RAW_ENTRY, &c.
+ Note that the arguments to AddSpec are opposite of the corresponding function
+ in add_spec.
+
+
+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.
+ Variables of type EncodingScheme will be one of
+
+ AutoEncoding, RawEncoding, TextEncoding, SlimEncoding, GzipEncoding,
+ Bzip2Encoding, UnsupportedEncoding
+
+ which are aliases for GD_AUTO_ENCODED, GD_UNENCODED, GD_TEXT_ENCODED, &c.
+
+* 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 SetProtection(int protection_level)
+
+ These methods set the specified information on the associated fragment by
+ calling gd_alter_encoding(3), gd_alter_endianness(3), gd_alter_frameoffset(3),
+ or gd_protect(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:
+
+ NoEntryType, BitEntryType, ConstEntryType, DivideEntryType, IndexEntryType,
+ LincomEntryType, LinterpEntryType, MultiplyEntryType, PhaseEntryType,
+ PolynomEntryType, RawEntryType, RecipEntryType, SBitEntryType,
+ StringEntryType
+
+* int Entry::SetFragmentIndex(int fragment_index)
+* int Entry::Move(int new_fragment, int move_data = 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 the move_data flag. Entry::SetFragmentIndex always calls gd_move
+ with move_data = 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, int move_data = 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 move_data flag
+ explicitly. Entry::SetName always calls gd_rename with move_data = 0.
+
+* 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()
+
+ 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 = 0)
+* virtual double Entry::Scale(int index = 0)
+* virtual std::complex<double> Entry::CScale(int index = 0)
+* virtual double Entry::Offset(int index = 0)
+* virtual std::complex<double> Entry::COffset(int index = 0)
+* virtual double Entry::Coefficient(int index = 0)
+* virtual std::complex<double> Entry::CCoefficient(int index = 0)
+* virtual const char *Entry::Scalar(int index = 0)
+* virtual int Entry::ScalaIndexr(int index = 0)
+
+ 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 not return
+ meaningful results.
+
+
+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 format_file = 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()
+
+ 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 format_file = 0)
+* LincomEntry::LincomEntry(const char *field_code, int n_fields,
+ const char **in_fields, std::complex<double> *m, std::complex<double> *b,
+ int format_file = 0)
+
+* virtual const char *LincomEntry::Input(int index = 0)
+* virtual int LincomEntry::ComplexScalars()
+* virtual int LincomEntry::NFields()
+* virtual double LincomEntry::Scale(int index = 0)
+* virtual std::complex<double> LincomEntry::CScale(int index = 0)
+* virtual double LincomEntry::Offset(int index = 0)
+* virtual std::complex<double> LincomEntry::COffset(int index = 0)
+* virtual const char *LincomEntry::Scalar(int index = 0)
+* virtual int LincomEntry::ScalarIndex(int index = 0)
+
+ These methods, re-implemented from the Entry class, return the corresponding
+ field parameter.
+
+* int LincomEntry::SetInput(const char *field, int index = 0)
+* int LincomEntry::SetScale(double scale, int index = 0)
+* int LincomEntry::SetScale(const char* scale, int index = 0)
+* int LincomEntry::SetScale(std::complex<double> scale, int index = 0)
+* int LincomEntry::SetOffset(double offset, int index = 0)
+* int LincomEntry::SetOffset(const char* scale, int index = 0)
+* int LincomEntry::SetOffset(std::complex<double> offset, int index = 0)
+
+ 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 format_file = 0)
+
+* virtual const char *Entry::Input()
+* 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 format_file = 0)
+* SBitEntry::SBitEntry(const char *field_code, const char *in_field, int bitnum,
+ int numbits = 1, int format_file = 0)
+
+* virtual const char *Input(int __gd_unused index = 0)
+* virtual int FirstBit()
+* virtual int NumBits()
+* virtual const char *Scalar(int index = 0)
+
+ 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 format_file = 0)
+
+* virtual const char *MultiplyEntry::Input(int index = 0)
+
+ This method, re-implemented from the Entry class, returns one of the input
+ fields.
+
+* int MultiplyEntry::SetInput(const char *field, int index = 0)
+
+ 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 format_file = 0)
+
+* virtual const char *PhaseEntry::Input()
+* virtual long int PhaseEntry::Shift()
+
+ 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 format_file = 0)
+* PolynomEntry::PolynomEntry(const char *field_code, int poly_ord,
+ const char *in_field, std::complex<double> *a int format_file = 0)
+
+* virtual const char *PolynomEntry::Input(int index = 0)
+* virtual int PolynomEntry::ComplexScalars()
+* virtual int PolynomEntry::PolyOrd()
+* virtual double PolynomEntry::Coefficient(int index = 0)
+* virtual std::complex<double> PolynomEntry::CCoefficient(int index = 0)
+* virtual const char *PolynomEntry::Scalar(int index = 0)
+* virtual int PolynomEntry::ScalarIndex(int index = 0)
+
+ 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 = 0)
+* int PolynomEntry::SetCoefficient(const char* scale, int index = 0)
+* int PolynomEntry::SetCoefficient(std::complex<double> scale, int index = 0)
+
+ 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 format_file = 0)
+
+* virtual const char *DivideEntry::Input(int index = 0)
+
+ This method, re-implemented from the Entry class, returns one of the input
+ fields.
+
+* int DivideEntry::SetInput(const char *field, int index = 0)
+
+ 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 format_file = 0)
+
+* virtual const char *RecipEntry::Input()
+* virtual int RecipEntry::ComplexScalars()
+* virtual double RecipEntry::Dividend()
+* virtual std::complex<double> RecipEntry::CDividend()
+* virtual const char *RecipEntry::Scalar()
+* virtual int RecipEntry::ScalarIndex()
+
+ These methods, re-implemented from the Entry class, return the corresponding
+ field parameter.
+
+* int RecipEntry::SetInput(const char *field)
+* virtual std::complex<double> CDividend()
+* int SetInput(const char* field)
+* int SetDividend(double coeff)
+* int SetDividend(const char* coeff)
+* int SetDividend(std::complex<double> coeff)
+
+ This function will change the specified input field with the given index,
+ which should be zero or one.
+
+
+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 format_file = 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 format_file = 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 format_file = 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.
diff --git a/doc/README.f77 b/doc/README.f77
new file mode 100644
index 0000000..5a868e9
--- /dev/null
+++ b/doc/README.f77
@@ -0,0 +1,1786 @@
+FORTRAN 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 raise SIGABRT. 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
+will not be available in the Fortran 77 bindings on a 32-bit system.
+
+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
+=====================
+
+Subroutines interacting with the database
+-----------------------------------------
+
+* GDOPEN(dirfile_unit, dirfilename, dirfilename_len, flags)
+
+ Output:
+ INTEGER dirfile_unit
+ Input:
+ INTEGER dirfilename_len, flags
+ CHARACTER*<dirfilename_len> 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). 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_len> 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 subroutine which
+ potentially could cause the callback subroutine to be called is GDINCL. Use
+ GDCLBK to change the callback function before calling GDINCL, if required.
+
+* GDINVD(dirfile_unit)
+
+ Output:
+ INTEGER dirfile_unit
+
+ This wraps gd_invalid_dirfile(3), and returns the unit number of a
+ newly-created, invalid dirfile.
+
+* 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_len> 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.
+
+* GDMFLS(dirfile_unit)
+
+ Input:
+ INTEGER dirfile_unit
+
+ This subroutine wraps gd_metaflush(3), and will cause metadata changes to be
+ written to disk.
+
+
+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
+ <datatype> data_out(n)
+ Input:
+ INTEGER dirfile_unit, field_code_len, first_frame, first_sample
+ INTEGER num_frames, num_samples, return_type
+ CHARACTER*<field_code_len> 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:
+ <datatype> data_out(array_len)
+ Input:
+ INTEGER dirfile_unit, field_code_len, return_type
+ CHARACTER*<field_code_len> 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:
+ <datatype> data_out(array_len)
+ Input:
+ INTEGER dirfile_unit, field_code_len, return_type, start, n
+ CHARACTER*<field_code_len> 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:
+ <datatype> data_out
+ Input:
+ INTEGER dirfile_unit, field_code_len, return_type
+ CHARACTER*<field_code_len> 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*<len> data_out
+ Input:
+ INTEGER dirfile_unit, field_code_len, len
+ CHARACTER*<field_code_len> 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_len> field_code
+ <datatype> 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_len> field_code
+ <datatype> 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_len> field_code
+ <datatype> 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_len> field_code
+ <datatype> 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_len> field_code
+ CHARACTER*<len> 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_len> 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_len> 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_len> field_code
+
+ This subroutine wraps gd_framenum_subset(3), and performs a reverse
+ look-up on a field.
+
+
+Subroutines interacting with global metadata
+--------------------------------------------
+
+* GDNFLD(nfields, dirfile_unit)
+
+ Output:
+ INTEGER nframes
+ Input:
+ INTEGER dirfile_unit
+
+ This wraps gd_nfields(3). It takes the dirfile unit number as input and
+ returns the number of fields in the dirfile in nfields.
+
+* GDNFDT(nfields, dirfile_unit, type)
+
+ Output:
+ INTEGER nframes
+ Input:
+ INTEGER dirfile_unit, type
+
+ This wraps gd_nfields_by_type(3). It takes the dirfile unit number, and
+ type specifier as input and returns the number of fields of the specified type
+ in the dirfile in nfields.
+
+* GDNVEC(nvectors, dirfile_unit)
+
+ Output:
+ INTEGER nvectors
+ Input:
+ INTEGER dirfile_unit
+
+ This wraps gd_nvectors(3). It takes the dirfile unit number as input and
+ returns the number of vector fields in the dirfile in nfields.
+
+* GDNMFD(nfields, dirfile, parent, parent_l)
+* GDNMFT(nfields, dirfile, parent, parent_l, type)
+* GDNMVE(nvectors, dirfile, parent, parent_l)
+
+ These subroutine wrap gd_nmfields(3), gd_nmfields_by_type(3), and
+ gd_nmvectors(3). They behave analogously to GDNFLD, GDNFDT, and GDNVEC.
+
+* GDFDNX(field_max, dirfile_unit)
+
+ Output:
+ INTEGER field_max
+ Input:
+ INTEGER dirfile_unit
+
+ This subroutine, which has no direct analogue in the C API, returns the
+ length of the longest field name defined in the dirfile. It takes the
+ dirfile unit number as input and returns the length (in characters) of
+ the longest field name in the dirfile in field_max.
+
+* GDMFNX(field_max, dirfile_unit, parent, parent_len)
+
+ Output:
+ INTEGER field_max
+ Input:
+ INTEGER dirfile_unit, parent_len
+ CHARACTER*<parent_len> parent
+
+ This subroutine, which has no direct analogue in the C API, returns the
+ length of the longest field name defined in the dirfile for META fields of the
+ supplied parent field. It returns the length (in characters) of the longest
+ META field name for the supplied parent in field_max.
+
+* GDFLDN(name, name_len, dirfile_unit, field_num)
+
+ Output:
+ CHARACTER*<name_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_num
+
+ This subroutine is the replacement for gd_field_list(3). It returns in
+ name a Fortran 77 string containing the field name of the field indexed by
+ field_num (which is should be a number between 1 and the output of GDNFLD).
+ 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
+ field_num is out of range, name_len will be set to zero, and name will not be
+ modified.
+
+* GDFDNT(name, name_len, dirfile_unit, type, field_num)
+
+ Output:
+ CHARACTER*<name_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_num, type
+
+ This subroutine is the replacement for gd_field_list_by_type(3) and
+ behaves in the same manner as GDFLDN. Type should be one of the parameters
+ defined in getdata.f (see below).
+
+* GDVECN(name, name_len, dirfile_unit, field_num)
+
+ Output:
+ CHARACTER*<name_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_num
+
+ This subroutine is the replacement for gd_vector_list(3) and behaves in
+ the same manner as GDFLDN.
+
+* GDMFDN(name, name_len, dirfile_unit, parent, parent_len, field_num)
+
+ Output:
+ CHARACTER*<name_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_num, parent_len
+ CHARACTER*<parent_len> parent
+
+ This subroutine is the replacement for gd_mfield_list(3) and behaves in
+ the same manner as GDFLDN.
+
+* GDMFDT(name, name_len, dirfile_unit, parent, parent_len, type, field_num)
+
+ Output:
+ CHARACTER*<name_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_num, parent_len, type
+ CHARACTER*<parent_len> parent
+
+ This subroutine is the replacement for gd_mfield_list_by_type(3) and
+ behaves in the same manner as GDFDNT.
+
+* GDMVEN(name, name_len, dirfile_unit, parent, parent_len, field_num)
+
+ Output:
+ CHARACTER*<name_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_num, parent_len
+ CHARACTER*<parent_len> parent
+
+ This subroutine is the replacement for gd_mvector_list(3) and behaves in
+ the same manner as GDVECN.
+
+* 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.
+
+* GDEROR(error, dirfile_unit)
+
+ Output:
+ INTEGER error
+ Input:
+ INTEGER dirfile_unit
+
+ This subroutine takes a dirfile unit as input and returns the DIRFILE.error
+ value associated with it 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_len> 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_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit
+
+ This wraps diriflename(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_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> 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_len> 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.
+
+* 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.
+
+
+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_len> 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_len> infield1
+ CHARACTER*<infield2_len> infield2
+ CHARACTER*<infield3_len> 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_len> 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_len> infield1
+ CHARACTER*<infield2_len> infield2
+ CHARACTER*<infield3_len> 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_len> 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_len> infield
+ CHARACTER*<table_len> table
+ INTEGER fragment_index
+ Input/Output:
+ INTEGER infield_len, table_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> infield
+ INTEGER bitnum, numbits, fragment_index
+ Input/Output:
+ INTEGER infield_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> infield
+ INTEGER bitnum, numbits, fragment_index
+ Input/Output:
+ INTEGER infield_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> infield
+ COMPLEX*16 dividend
+ INTEGER fragment_index
+ Input/Output:
+ INTEGER infield_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> infield
+ REAL*8 dividend
+ INTEGER fragment_index
+ Input/Output:
+ INTEGER infield_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> infield1
+ CHARACTER*<infield2_len> infield2
+ INTEGER fragment_index
+ Input/Output:
+ INTEGER infield1_len, infield2_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> infield1
+ CHARACTER*<infield2_len> infield2
+ INTEGER fragment_index
+ Input/Output:
+ INTEGER infield1_len, infield2_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> infield
+ INTEGER shift, fragment_index
+ Input/Output:
+ INTEGER infield_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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, shift will
+ be set to zero. In this case the value of the remaining data is unspecified.
+
+* 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_len> 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_len> field_code
+
+ This subroutine returns metadata describing a POLYNOM field. Although six
+ coefficients, 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.
+
+* 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_len> 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_len> 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_len> 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_len> field_code
+
+ This subroutine returns metadata describing a POLYNOM field. Although six
+ coefficients, 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.
+
+* 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_len> 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_len> field_code
+
+ This is equivalent to GDGECP above, but returns only the real part of the
+ coefficients.
+
+* GDGECO(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_len> 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_len> 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.
+
+* GDCALN(array_len, dirfile_unit, field_code, field_code_len)
+
+ Output:
+ INTEGER array_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> field_code
+
+ This wraps gd_carray_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_len> 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_len> 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_len> 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.
+
+* GDGBOF(bof, dirfile, field_code, field_code_len)
+
+ Output:
+ INTEGER bof
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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_len> field_code
+
+ This subroutine wraps gd_eof(3), and returns the location of the end-of-field
+ marker for the specified field.
+
+* 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_len> 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.
+
+* 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> in_field2
+ CHARACTER*<in_field3_len> in_field3
+
+ This subroutine wraps gd_alter_lincom(3), and modifies the specified field
+ metadata.
+
+* 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> in_field2
+ CHARACTER*<in_field3_len> 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+ CHARACTER*<table_len> 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.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> in_field2
+
+ This subroutine wraps gd_alter_multiply(3), and modifies the specified field
+ metadata.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine wraps gd_alter_phase(3), and modifies the specified field
+ metadata.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine wraps gd_alter_polynom(3), and modifies the specified field
+ metadata.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine is equivalent to GDALCP above, but takes purely real
+ parameters.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine wraps gd_alter_sbit(3), and modifies the specified field
+ metadata.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+ COMPLEX*16 dividend
+
+ This subroutine wraps gd_alter_crecip(3), and modifies the specified field
+ metadata.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+ REAL*8 dividend
+
+ This subroutine wraps gd_alter_recip(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_len> 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_len> 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_len> 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_len> spec
+ CHARACTER*<parent_len> 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_len> name
+ Input/Output:
+ INTEGER name_len
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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, move_data)
+
+ Input:
+ INTEGER dirfile_unit, field_code_len, new_fragment, move_data
+ CHARACTER*<field_code_len> field_code
+
+ This subroutine wraps gd_move(3), and moves the specified field to the new
+ fragment given. If move_data is non-zero, the binary file, for RAW fields, is
+ also moved, if necessary.
+
+* GDRENM(dirfile_unit, field_code, field_code_len, new_name, new_name_len,
+ move_data)
+
+ Input:
+ INTEGER dirfile_unit, field_code_len, new_name_len, move_data
+ CHARACTER*<field_code_len> field_code
+ CHARACTER*<new_name_len> new_name
+
+ This subroutine wraps gd_rename(3), and changes the name of a field. If
+ move_data is non-zero, and the field is a RAW field, the binary file
+ associated with the field will also be renamed.
+
+* GDNTYP(ntype, dirfile_unit, field_code, field_code_len)
+
+ Output:
+ INTEGER ntype
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> 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.
+
+* GDCSCL(comp_scal, dirfile_unit, field_code, field_code_len)
+
+ Output:
+ INTEGER comp_scal
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> field_code
+
+ This subroutine returns the comp_scal member of the specified field. If the
+ specified field is not a LINCOM or POLYNOM, the return value will not be
+ meaningful.
+
+* GDGSCA(scalar, scalar_len, scalar_index, dirfile_unit, field_code,
+ field_code_len, index)
+
+ Output:
+ CHARACTER*<scalar_len> scalar
+ INTEGER scalar_index
+ Input/Output:
+ INTEGER scalar_len
+ Input:
+ INTEGER dirfile_unit, field_code_len, index
+ CHARACTER*<field_code_len> 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_len> field_code
+ CHARACTER*<scalar_len> 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, sclaar_index
+ is ignored.
+
+
+Subroutines which add or delete fields
+--------------------------------------
+
+* GDDELE(dirfile_unit, field_code, field_code_len, flags)
+
+ Input:
+ INTEGER dirfile_unit, field_code_len, flags
+ CHARACTER*<field_code_len> field_code
+
+ This subroutine wraps gd_delete(3). It deletes the indicated field. The
+ flags parameter should be either zero, or one or more of the delete flags
+ listed below combined with a bitwise or.
+
+* 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_len> field_code
+
+ This subroutine adds a RAW field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> in_field2
+ CHARACTER*<in_field3_len> in_field3
+
+ 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
+ nfield sets will be examined.
+
+* 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> in_field2
+ CHARACTER*<in_field3_len> 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+ CHARACTER*<table_len> table
+
+ This subroutine adds a LINTERP field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine adds a BIT field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine adds a SBIT field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+ COMPLEX*16 dividend
+
+ This subroutine adds a RECIP field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+ REAL*8 dividend
+
+ This subroutine adds a RECIP field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> 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_len> field_code
+ CHARACTER*<in_field1_len> in_field1
+ CHARACTER*<in_field2_len> in_field2
+
+ This subroutine adds a DIVIDE field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> 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.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine is equivalent the GDADCP, but takes purely real parameters.
+
+* 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_len> field_code
+ CHARACTER*<in_field_len> in_field
+
+ This subroutine adds a PHASE field with the supplied parameters to the
+ specified format file fragment of the dirfile.
+
+* 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_len> field_code
+ <data_type> 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_len> field_code
+ <data_type> 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_len> field_code
+ CHARACTER*<value_len> 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_len> 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_len> spec
+ CHARACTER*<parent_len> parent
+
+ This subroutine wraps gd_madd_spec(3), and allows adding a metafield to a
+ dirfile given a field specification line.
+
+* 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)
+* 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_EOP GD_E_OPEN
+ GD_EFO GD_E_FORMAT
+ GD_ETR GD_E_TRUNC
+ GD_ECR GD_E_CREAT
+ GD_EBC GD_E_BAD_CODE
+ GD_EBT GD_E_BAD_TYPE
+ GD_ERW GD_E_RAW_IO
+ GD_EOF GD_E_OPEN_FRAGMENT
+ GD_EOI GD_E_OPEN_INCLUDE An alias for GD_E_OPEN_FRAGMENT.
+ GD_EIE GD_E_INTERNAL_ERROR
+ GD_EAL GD_E_ALLOC
+ GD_ERA GD_E_RANGE
+ GD_EOL GD_E_OPEN_LINFILE
+ GD_ERL GD_E_RECURSE_LEVEL
+ GD_EBD GD_E_BAD_DIRFILE
+ GD_EBF GD_E_BAD_FIELD_TYPE
+ GD_EAC GD_E_ACCMODE
+ GD_EBE GD_E_BAD_ENTRY
+ GD_EDU GD_E_DUPLICATE
+ GD_EDM GD_E_DIMENSION
+ GD_EBI GD_E_BAD_INDEX
+ GD_EBS GD_E_BAD_SCALAR
+ GD_EBR GD_E_BAD_REFERENCE
+ GD_EPT GD_E_PROTECTED
+ GD_EDL GD_E_DELETE
+ GD_EEN GD_E_BAD_ENDIANNESS
+ GD_ECB GD_E_CALLBACK
+ GD_EBP GD_E_BAD_PROTECTION
+ GD_UCL GD_E_UNCLEAN_DB
+ GD_EDO GD_E_DOMAIN
+ GD_ERP GD_E_BAD_REPR
+ GD_EVR GD_E_BAD_VERSION
+ GD_EFL GD_E_FLUSH
+ GD_EBO GD_E_BOUNDS
+ GD_ETL GD_E_LINE_TOO_LONG
+
+Dirfile flags (required by GDOPEN, GDCOPN, and GDINCL):
+
+ 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_CR GD_CREAT
+ GD_EX GD_EXCL
+ GD_TR GD_TRUNC
+ GD_AE GD_ARM_ENDIAN
+ GD_BE GD_BIG_ENDIAN
+ GD_LE GD_LITTLE_ENDIAN
+ GD_NA GD_NOT_ARM_ENDIAN
+ GD_FC GD_FORCE_ENCODING
+ GD_FE GD_FORCE_ENDIAN
+ GD_PE GD_PEDANTIC
+ GD_PM GD_PERMISSIVE
+ GD_VB GD_VERBOSE
+ GD_ID GD_IGNORE_DUPS
+ GD_IR GD_IGNORE_REFS
+ GD_PP GD_PRETTY_PRINT
+ GD_EA GD_AUTO_ENCODED
+ GD_EN GD_UNENCODED
+ GD_ET GD_TEXT_ENCODED
+ GD_ES GD_SLIM_ENCODED
+ GD_EG GD_GZIP_ENCODED
+ GD_EB GD_BZIP2_ENCODED
+ GD_EL GD_LZMA_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_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
+
+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_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_MR GD_E_FORMAT_METARAW
+ 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_LT GD_E_FORMAT_LITERAL
+
+Special version symbols:
+
+ F77 symbol C symbol
+ ---------- ---------------------
+ GDSV_C GD_VERSION_CURRENT
+ GDSV_L GD_VERSION_LATEST
+ GDSV_E GD_VERSION_EARLIEST
+
+Miscellaneous parameters:
+
+ F77 symbol C symbol
+ ---------- -------------------------
+ GD_ALL GD_ALL_FRAGMENTS
+ GD_DSV DIRFILE_STANDARDS_VERSION
+ GD_MLL GD_MAX_LINE_LENGTH
diff --git a/doc/README.f95 b/doc/README.f95
new file mode 100644
index 0000000..877c70d
--- /dev/null
+++ b/doc/README.f95
@@ -0,0 +1,728 @@
+FORTRAN 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 raise
+SIGABRT. 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_carray_len (dirfile_unit, field_code)
+ integer, intent(in) :: dirfile
+ character (len=*), intent(in) :: field_code
+
+* 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_discard (dirfile_unit)
+ integer, intent(in) :: dirfile
+
+* subroutine fgd_flush (dirfile_unit, field_code)
+ integer, intent(in) :: dirfile
+ character (len=*), intent(in) :: field_code
+
+ (If field_code is the empty string, the entire dirfile will be flushed.)
+
+* 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
+
+* 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_string (dirfile, buffer, len)
+ integer, intent(in) :: dirfile, len
+ character (len=<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_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_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_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_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).
+
+* 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_protect (dirfile, protection_level, fragment)
+ integer, intent(in) :: dirfile, protection_level, fragment
+
+* 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, move_data)
+ integer, intent(in) :: dirfile, new_fragment, move_data
+ 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_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_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, move_data)
+ integer, intent(in) :: dirfile, move_data
+ 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 ()
+
+
+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
+ <datatype>, 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 <datatype> 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
+ <datatype>, dimension(:), intent(in) :: data_in
+
+ No corresponding fgd_putdata_n function exists, since GD_NULL is not an
+ acceptable input data_type for putdata(3).
+
+ Analogously for gd_get_carray_slice, gd_get_constant, gd_put_carray_slice, and
+ gd_put_constant, for which only the _i1 versions are shown here:
+
+* 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
+ <datatype>, 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
+ <datatype>, intent(out) :: data_out
+* 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
+ <datatype>, 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
+ <datatype>, 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:
+
+* 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.
+
+* subroutine fgd_field_list (field_list, dirfile, field_len)
+ character (len=<field_len>) dimension(:), intent(out) :: field_list
+ integer, intent(in) :: dirfile_unit
+ integer, intent(inout) :: field_len
+
+ This subroutine behaves analogously to gd_get_field_list(3), except that it
+ requires a third argument, field_len, which is the longest field name which
+ will fit in the supplied field_list array. If the longest field name in the
+ dirfile is longer than field_len, field_len will be set to this value (which
+ is equivalent to the return value of fgd_field_name_max) and field_list
+ will remain untouched. The character strings returned are Fortran strings.
+
+ Analogously:
+
+* subroutine fgd_field_list_by_type (field_list, dirfile, entype, field_len)
+ character (len=<field_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=<field_len>) dimension(:), intent(out) :: field_list
+ integer, intent(in) :: dirfile_unit
+ integer, intent(inout) :: field_len
+
+ Also analogously, except that field_len will be equivalent to the return
+ value of fgd_mfield_name_max, if too small:
+
+* subroutine fgd_mfield_list (field_list, dirfile, field_len)
+ character (len=<field_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,
+ field_len)
+ character (len=<field_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, field_len)
+ character (len=<field_len>) dimension(:), intent(out) :: field_list
+ integer, intent(in) :: dirfile_unit
+ integer, intent(inout) :: field_len
+ character (len=*), intent(in) :: parent
+
+* integer function fgd_error (dirfile_unit)
+ integer, intent(in) :: dirfile_unit
+
+ This returns the DIRFILE error associated with the supplied dirfile unit.
+
+* 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_get_entry(3). It returns the field type, or GD_NO_ENTRY if an error
+ occurred in the gd_get_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, comp_scal, poly_ord, array_len
+ 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
+ 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] --
+
+ Furthermore, data_type does double duty as the data_type parameter for RAW
+ fields, and the const_type parameter for CONST and CARRAY fields.
+
+* 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.
diff --git a/doc/README.idl b/doc/README.idl
new file mode 100644
index 0000000..f643289
--- /dev/null
+++ b/doc/README.idl
@@ -0,0 +1,813 @@
+IDL 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.7.0, Build Date: Sat Oct 23 00:00:00 UTC 2010, Source: The GetData Project <getdata-devel at lists.sourceforge.net>
+ 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, 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_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 in which the dirfile error number resulting from this
+ call will be stored. It will be the !GD.E_* error codes
+ 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().
+
+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:
+
+ FIELD STRING
+ FIELD_TYPE INTEGER
+ FRAGMENT INTEGER
+ IN_FIELDS STRING Array[3]
+ A DOUBLE Array[6]
+ CA DCOMPLEX Array[6]
+ ARRAY_LEN INTEGER
+ B DOUBLE Array[3]
+ CB DCOMPLEX Array[3]
+ BITNUM INTEGER
+ COMP_SCAL INTEGER
+ DATA_TYPE INTEGER
+ DIVIDEND DOUBLE
+ CDIVIDEND DCOMPLEX
+ M DOUBLE Array[3]
+ CM DCOMPLEX Array[3]
+ N_FIELDS INTEGER
+ NUMBITS INTEGER
+ POLY_ORD INTEGER
+ SCALAR STRING Array[6]
+ SCALAR_IND INTEGER Array[6]
+ SHIFT LONG
+ SPF UINT
+ TABLE STRING
+
+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. This procedure may also be called as GD_MADD with
+ no change in functionality. See gd_add(3) and gd_madd(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. This procedure may also be called as
+ GD_MADD_BIT with no change in functionality. 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. This
+ procedure may also be called as GD_MADD_CARRAY with no change in
+ functionality. 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. This procedure may also be called as GD_MADD_CONST with no
+ change in functionality. 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. This procedure may also
+ be called as GD_MADD_DIVIDE without change in functionality. 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. This
+ procedure may also be called as GD_ADD_CLINCOM, GD_MADD_LINCOM, or
+ GD_MADD_CLINCOM without change in functionality. 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. This procedure may also be called as GD_MADD_LINTERP without
+ change in functionality. See gd_add_linterp(3) and
+ gd_madd_linterp(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. This procedure may
+ also be called as GD_MADD_MULTIPLY without change in functionality. 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. This procedure may
+ also be called as GD_MADD_PHASE without change in functionality. 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<i> 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. This procedure may
+ also be called as GD_MADD_CPOLYNOM, GD_MADD_POLYNOM, or GD_MADD_CPOLYNOM
+ without change in functionality. 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. This procedure may also be called as GD_ADD_CRECIP, GD_MADD_RECIP, or
+ GD_MADD_CRECIP with no change in functionality. 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. This procedure may also be called as
+ GD_MADD_SBIT with no change in functionality. 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. This
+ procedure may also be called as GD_MADD_SPEC with no change in
+ functionality. 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. This procedure may also be called as GD_MADD_STRING with no
+ change in functionality. See gd_add_string(3) and
+ gd_madd_string(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. This procedure may also be called
+ GD_ALTER_CLINCOM without change of functionality. 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_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. This procedure may also be called GD_ALTER_CRECIP without change
+ in functionality. 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. This procedure may also be called as
+ GD_MALTER_SPEC without change in functionality. See
+ gd_alter_spec(3) and gd_malter_spec(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. This function may be called as GD_MCONSTANTS
+ without change in functionality. See gd_constants(3) and gd_mconstants(3).
+
+PROCEDURE GD_DELETE, dirfile_unit, field_code, /DEL_DATA, /DEREF, /FORCE
+
+ This procedure delete the field specified by 'field_code' from the database.
+ The meanings of the three keyword flags are discussed in the gd_delete
+ manual page. See gd_delete(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_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_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_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, PARENT=parent, TYPE=type)
+
+ This function returns a list of field names defined by the dirfile. If PARENT
+ is given, a list of metafields for the given parent will be returned. If TYPE
+ is given, which should be one of the !GD.*_ENTRY constants, only fields of the
+ given type will be returned. If neither PARENT, nor TYPE, are given, all
+ fields are returned. This function may also be called as
+ GD_FIELD_LIST_BY_TYPE, GD_MFIELD_LIST, or GD_MFIELD_LIST_BY_TYPE, without
+ change in functionality. See gd_field_list(3), gd_field_list_by_type(3),
+ gd_mfield_list(3), and gd_mfield_list_by_type(3).
+
+PROCEDURE GD_FLUSH, dirfile_unit, FIELD_CODE=field_code
+
+ 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. see gd_flush(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. This
+ function may also be called as GD_FRAMENUM_SUBSET without change in
+ functionality. 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. 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).
+
+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, /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).
+
+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, /MOVE_DATA
+
+ This procedure moves the field specified by 'field_code' to the new format
+ file fragment indexed by 'new_fragment'. If MOVE_DATA is specified, and
+ 'field_code' specifies a RAW file, the data file on disk will also be moved,
+ if necessary. See gd_move(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_NFIELDS(dirfile_unit, PARENT=parent, TYPE=type)
+
+ This function returns the number of fields defined by the dirfile. If PARENT
+ is given, the number metafields for the given parent will be returned. If
+ TYPE is given, which should be one of the !GD.*_ENTRY constants, only fields
+ of the given type will be counted. If neither PARENT, nor TYPE, are given,
+ the total number of fields in the database will be returned. This function
+ may also be called as GD_NFIELDS_BY_TYPE, GD_NMFIELDS, or
+ GD_NMFIELDS_BY_TYPE, without change in functionality. See gd_nfields(3),
+ gd_nfields_by_type(3), gd_nmfields(3), and gd_nmfields_by_type(3).
+
+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. This function may also be called as GD_NMVECTORS,
+ without change in functionality. 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,
+ /LITTLE_ENDIAN, /NOT_ARM_ENDIAN, /PEDANTIC, /PERMISSIVE, /RDWR, /TRUNC,
+ /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', 'SLIM', 'TEXT', 'NONE', or else a numeric
+ encoding type: !GD.BZIP2_ENCODED, &c. The meaning of the other keyword flags
+ is explained in the gd_open 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 from the beginning of the frame. 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)
+
+ This function returns the name of the RAW field used as the reference field
+ for the dirfile. See gd_reference(3).
+
+PROCEDURE GD_RENAME, dirfile_unit, field_code, new_name, /MOVE_DATA
+
+ This function renames the field specified by 'field_code' to 'new_name'. If
+ MOVE_DATA is specified, and the field is a RAW field, the data file on disk
+ is renamed as well. See gd_rename(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.
+ This function may be called as GD_MSTRINGS without change in functionality.
+ See gd_strings(3) and gd_mstrings(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).
+
+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. This
+ function may also be called as GD_MVECTOR_LIST, without change in
+ functionality. See gd_vector_list(3) and gd_mvector_list(3).
+
diff --git a/doc/README.python b/doc/README.python
new file mode 100644
index 0000000..027592c
--- /dev/null
+++ b/doc/README.python
@@ -0,0 +1,23 @@
+PYTHON 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.
+
+If found at configure time, the bindings will be built with NumPy support, which
+will result in requests for vector data returning NumPy arrays instead of Python
+lists. If built with NumPy support, importing the module will fail if the numpy
+module cannot be found. NumPy support should be preferred: it is more
+efficient both in memory usage and speed of data retrieval.
+
+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 interpereter after the bindings have been installed.
diff --git a/doc/unclean_database_recovery.txt b/doc/unclean_database_recovery.txt
new file mode 100644
index 0000000..3da5da3
--- /dev/null
+++ b/doc/unclean_database_recovery.txt
@@ -0,0 +1,184 @@
+UNCLEAN 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
+<field_name>_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.
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..6781b98
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100755
index 0000000..db863e6
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,9636 @@
+
+# libtool (GNU libtool) 2.4
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4
+TIMESTAMP=""
+package_revision=1.3293
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${EGREP="grep -E"}
+: ${FGREP="grep -F"}
+: ${GREP="grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=:
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name 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.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $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 >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
+
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ #func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ #test "$absdir" != "$libdir" && \
+ # func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ 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 I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ 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 a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_apped perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4
new file mode 100644
index 0000000..3f33ad1
--- /dev/null
+++ b/m4/ax_compare_version.m4
@@ -0,0 +1,174 @@
+# ===========================================================================
+# 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 <toolan at ele.uri.edu>
+#
+# 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
diff --git a/m4/compiler.m4 b/m4/compiler.m4
new file mode 100644
index 0000000..5f11869
--- /dev/null
+++ b/m4/compiler.m4
@@ -0,0 +1,253 @@
+dnl Copyright (C) 2008, 2009, 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_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])
+
+
+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])
+
+
+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])
+
+
+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])
+
+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])
+
+
+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])
+
+
+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])
+
+
+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])
+
+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 <endian.h>]],
+[[#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 <endian.h>]],
+[[#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])
+
+dnl GD_CHECK_LFS_TYPE
+dnl -----------------------------------------------------------
+dnl Check whether the specified type exists, and whether _LARGEFILE64_SOURCE
+dnl must be defined.
+AC_DEFUN([GD_CHECK_LFS_TYPE],[
+AC_CACHE_CHECK([for $1], [AS_TR_SH([gd_cv_type_$1])],[
+if test "x$gd_cv_c_need_lfs_defined" != "xyes"; then
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$2],[
+if (sizeof($1))
+return 0;])],
+[gd_cv_type_[]AS_TR_SH($1)="yes"])
+fi
+
+if test "x$AS_TR_SH([gd_cv_type_$1])" != "xyes"; then
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#define _LARGEFILE64_SOURCE 1
+$2],[
+if (sizeof($1))
+return 0;])],
+[if test "x$gd_cv_c_need_lfs_defined" = "xyes"; then
+AS_TR_SH([gd_cv_type_$1])="yes"
+else
+AS_TR_SH([gd_cv_type_$1])="yes, with _LARGEFILE64_SOURCE defined"
+fi
+gd_cv_c_need_lfs_defined="yes"],
+[AS_TR_SH([gd_cv_type_$1])="no"])
+fi
+])
+
+if test "x$AS_TR_SH([gd_cv_type_$1])" != "xno"; then
+AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+[ Define to 1 if you have the type `$1' ])
+fi
+])
diff --git a/m4/encoding.m4 b/m4/encoding.m4
new file mode 100644
index 0000000..c1292c2
--- /dev/null
+++ b/m4/encoding.m4
@@ -0,0 +1,133 @@
+dnl Copyright (C) 2008-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_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 [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]
+ AC_DEFINE(AS_TR_CPP([HAVE_LIB$2]), 1,
+ [Define to 1 if you have the `$2' library (-l$2).]))
+ 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])=
+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[_LDFLAGS])="-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 -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]))
+
+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
+$7
+])
+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])"
+ else
+ PRIVATE_LIBS="$PRIVATE_LIBS [$]AS_TR_CPP(gd_encoding[_LDFLAGS])"
+ fi
+ fi
+else
+ ENCODINGS_LEFT="${ENCODINGS_LEFT} gd_encoding";
+fi
+])
diff --git a/m4/idl.m4 b/m4/idl.m4
new file mode 100644
index 0000000..aad5d42
--- /dev/null
+++ b/m4/idl.m4
@@ -0,0 +1,134 @@
+dnl Copyright (C) 2009-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_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 [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 [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 /-m/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
+])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..d812584
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,7831 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$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
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _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
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t at _DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t at _DLSYM_CONST
+#else
+# define LT@&t at _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 at _DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at 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 at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ _LT_TAGVAR(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_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(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
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 0000000..17cfd51
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,369 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 0000000..9c7b5d4
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3293 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4])
+m4_define([LT_PACKAGE_REVISION], [1.3293])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4'
+macro_revision='1.3293'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/m4/python.m4 b/m4/python.m4
new file mode 100644
index 0000000..fba7e1d
--- /dev/null
+++ b/m4/python.m4
@@ -0,0 +1,172 @@
+dnl Copyright (C) 2009-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_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
+
+AC_CHECK_PROGS([SEQ], [seq], [not found])
+if test "x$SEQ" == "xnot found"; then
+ AC_CHECK_PROGS([JOT], [jot], [not found])
+ 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 [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 [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])
+
+dnl calculate python CPPFLAGS and LIBS
+if test -x $PYTHON-config; then
+ if test -n "$user_python"; then
+ python_exec_prefix=`$PYTHON-config --exec-prefix`
+ PYTHON_LIBS="-L${python_exec_prefix}/lib "
+ else
+ PYTHON_LIBS=""
+ fi
+ PYTHON_CPPFLAGS=`$PYTHON-config --includes 2>/dev/null`
+ PYTHON_LIBS="${PYTHON_LIBS}`$PYTHON-config --ldflags 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_libdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBDIR')"`
+ python_syslibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('SYSLIBS')"`
+ python_shlibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('SHLIBS')"`
+ python_modlibs=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('MODLIBS')"`
+
+ PYTHON_CPPFLAGS="-I${python_prefix}/include/python${PYTHON_VERSION} -I${python_exec_prefix}/include/python${PYTHON_VERSION}"
+ if test -n "$user_python"; then
+ PYTHON_LIBS="-L${python_libdir} "
+ else
+ PYTHON_LIBS=""
+ fi
+ PYTHON_LIBS="${PYTHON_LIBS}$python_syslibs $python_shlibs $python_modlibs -lpython${PYTHON_VERSION}"
+fi
+AC_MSG_CHECKING([Python includes])
+AC_MSG_RESULT([$PYTHON_CPPFLAGS])
+AC_SUBST([PYTHON_CPPFLAGS])
+AC_MSG_CHECKING([Python libraries])
+AC_MSG_RESULT([$PYTHON_LIBS])
+AC_SUBST([PYTHON_LIBS])
+
+dnl header check
+saved_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}"
+AC_CHECK_HEADERS(Python.h,,[have_python="no"])
+CPPFLAGS=${saved_CPPFLAGS}
+
+fi
+
+if test "x${have_python}" != "xno"; then
+
+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])
+
+saved_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}"
+saved_LIBS=$LIBS
+LIBS="$LIBS ${PYTHON_LIBS}"
+dnl try to compile a module
+AC_MSG_CHECKING([if we can compile a simple Python extension module])
+AC_TRY_LINK_FUNC([Py_Initialize], [ AC_MSG_RESULT([yes]) ],
+[ AC_MSG_RESULT([no]); have_python="no" ])
+CPPFLAGS=$saved_CPPFLAGS
+LIBS=$saved_LIBS
+
+fi
+])
diff --git a/m4/version.m4 b/m4/version.m4
new file mode 100644
index 0000000..f81efbc
--- /dev/null
+++ b/m4/version.m4
@@ -0,0 +1,42 @@
+dnl Copyright (C) 2008-2010 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, 7)
+m4_define(getdata_revision, 3)
+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, 4)
+dnl libgetdata current interface implementation revision
+m4_define(getdata_impl_revision, 3)
+dnl libgetdata interface age (current interface - oldest supported interface)
+m4_define(getdata_iface_age, 0)
+
+dnl libgetdata++ interface version info
+m4_define(getdataxx_version, 2:0:0)
+
+dnl libfgetdata interface version info
+m4_define(fgetdata_version, 2:1:0)
+
+dnl libf95getdata interface version info
+m4_define(f95getdata_version, 2:0:0)
diff --git a/m4/win32.m4 b/m4/win32.m4
new file mode 100644
index 0000000..61defa5
--- /dev/null
+++ b/m4/win32.m4
@@ -0,0 +1,43 @@
+dnl 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_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
+])
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..5505910
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,110 @@
+# Copyright (C) 2008-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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if LFS_TRANSITIONAL_API
+LFS_transitional_mans = gd_getdata64.3 gd_framenum_subset64.3 \
+ gd_frameoffset64.3 gd_nframes64.3 gd_putdata64.3
+MAN3ALIASES64=gd_frameoffset64.3:gd_alter_frameoffset64.3
+endif
+
+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_bit.3 \
+ gd_add_spec.3 gd_alter_bit.3 gd_alter_entry.3 \
+ gd_alter_protection.3 gd_alter_spec.3 gd_bof.3 gd_carray_len.3 \
+ gd_carrays.3 gd_cbopen.3 gd_close.3 gd_get_carray_slice.3 \
+ gd_put_carray_slice.3 gd_get_constant.3 gd_put_constant.3 \
+ gd_constants.3 gd_dirfile_standards.3 gd_getdata.3 \
+ gd_putdata.3 gd_delete.3 gd_encoding.3 gd_endianness.3 \
+ gd_entry.3 gd_entry_type.3 gd_eof.3 gd_error.3 \
+ gd_error_string.3 gd_field_list.3 gd_field_list_by_type.3 \
+ gd_flush.3 gd_fragment_index.3 gd_fragmentname.3 \
+ gd_framenum_subset.3 gd_frameoffset.3 gd_free_entry_strings.3 \
+ gd_include.3 gd_invalid_dirfile.3 gd_madd_bit.3 gd_mcarrays.3 \
+ gd_mconstants.3 gd_metaflush.3 gd_mfield_list.3 \
+ gd_mfield_list_by_type.3 gd_move.3 gd_mstrings.3 \
+ gd_mvector_list.3 gd_dirfilename.3 gd_native_type.3 \
+ gd_nfields.3 gd_nfields_by_type.3 gd_nfragments.3 gd_nframes.3 \
+ gd_nmfields.3 gd_nmfields_by_type.3 gd_nmvectors.3 \
+ gd_nvectors.3 gd_parent_fragment.3 gd_parser_callback.3 \
+ gd_protection.3 gd_raw_filename.3 gd_reference.3 gd_rename.3 \
+ gd_rewrite_fragment.3 gd_spf.3 gd_get_string.3 gd_put_string.3 \
+ gd_strings.3 gd_uninclude.3 gd_validate.3 gd_vector_list.3 \
+ dirfile.5 dirfile-encoding.5 dirfile-format.5 \
+ $(LFS_transitional_mans)
+
+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_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_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_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_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_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_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_spec.3:gd_malter_spec.3 \
+ gd_framenum_subset.3:gd_framenum.3 gd_get_carray_slice.3:gd_get_carray.3 \
+ gd_put_carray_slice.3:gd_put_carray.3 $(MAN3ALIASES64)
+
+#man conversion
+HTMLMANS=$(addsuffix .html,$(nodist_man_MANS)) \
+ $(addsuffix .html,$(dist_man_MANS))
+
+%.html: %
+ man2html -r $< | tail -n +2 | $(SED) -e 's/~/\ /g' > $@
+
+htmlman: $(HTMLMANS)
+ for m in $(MAN3ALIASES); do \
+ rm -f `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \
+ $(LN_S) `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)
diff --git a/man/Makefile.in b/man/Makefile.in
new file mode 100644
index 0000000..7f60b30
--- /dev/null
+++ b/man/Makefile.in
@@ -0,0 +1,702 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = man
+DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/gd_alter_encoding.3.in \
+ $(srcdir)/gd_alter_endianness.3.in \
+ $(srcdir)/gd_alter_frameoffset.3.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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 =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = 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'
+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)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at LFS_TRANSITIONAL_API_TRUE@LFS_transitional_mans = gd_getdata64.3 gd_framenum_subset64.3 \
+ at LFS_TRANSITIONAL_API_TRUE@ gd_frameoffset64.3 gd_nframes64.3 gd_putdata64.3
+
+ at LFS_TRANSITIONAL_API_TRUE@MAN3ALIASES64 = gd_frameoffset64.3:gd_alter_frameoffset64.3
+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_bit.3 \
+ gd_add_spec.3 gd_alter_bit.3 gd_alter_entry.3 \
+ gd_alter_protection.3 gd_alter_spec.3 gd_bof.3 gd_carray_len.3 \
+ gd_carrays.3 gd_cbopen.3 gd_close.3 gd_get_carray_slice.3 \
+ gd_put_carray_slice.3 gd_get_constant.3 gd_put_constant.3 \
+ gd_constants.3 gd_dirfile_standards.3 gd_getdata.3 \
+ gd_putdata.3 gd_delete.3 gd_encoding.3 gd_endianness.3 \
+ gd_entry.3 gd_entry_type.3 gd_eof.3 gd_error.3 \
+ gd_error_string.3 gd_field_list.3 gd_field_list_by_type.3 \
+ gd_flush.3 gd_fragment_index.3 gd_fragmentname.3 \
+ gd_framenum_subset.3 gd_frameoffset.3 gd_free_entry_strings.3 \
+ gd_include.3 gd_invalid_dirfile.3 gd_madd_bit.3 gd_mcarrays.3 \
+ gd_mconstants.3 gd_metaflush.3 gd_mfield_list.3 \
+ gd_mfield_list_by_type.3 gd_move.3 gd_mstrings.3 \
+ gd_mvector_list.3 gd_dirfilename.3 gd_native_type.3 \
+ gd_nfields.3 gd_nfields_by_type.3 gd_nfragments.3 gd_nframes.3 \
+ gd_nmfields.3 gd_nmfields_by_type.3 gd_nmvectors.3 \
+ gd_nvectors.3 gd_parent_fragment.3 gd_parser_callback.3 \
+ gd_protection.3 gd_raw_filename.3 gd_reference.3 gd_rename.3 \
+ gd_rewrite_fragment.3 gd_spf.3 gd_get_string.3 gd_put_string.3 \
+ gd_strings.3 gd_uninclude.3 gd_validate.3 gd_vector_list.3 \
+ dirfile.5 dirfile-encoding.5 dirfile-format.5 \
+ $(LFS_transitional_mans)
+
+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_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_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_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_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_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_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_spec.3:gd_malter_spec.3 \
+ gd_framenum_subset.3:gd_framenum.3 gd_get_carray_slice.3:gd_get_carray.3 \
+ gd_put_carray_slice.3:gd_put_carray.3 $(MAN3ALIASES64)
+
+
+#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)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list=''; test -n "$(man1dir)" || exit 0; \
+ { 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'; \
+ } | 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,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man3: $(dist_man_MANS) $(nodist_man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)"
+ @list=''; test -n "$(man3dir)" || exit 0; \
+ { 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'; \
+ } | 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,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man3dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man3dir)" && rm -f $$files; }
+install-man5: $(dist_man_MANS) $(nodist_man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)"
+ @list=''; test -n "$(man5dir)" || exit 0; \
+ { 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'; \
+ } | 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,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man5dir)" && rm -f $$files; }
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+ for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-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 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 uninstall uninstall-am \
+ uninstall-hook uninstall-man uninstall-man1 uninstall-man3 \
+ uninstall-man5
+
+
+%.html: %
+ man2html -r $< | tail -n +2 | $(SED) -e 's/~/\ /g' > $@
+
+htmlman: $(HTMLMANS)
+ for m in $(MAN3ALIASES); do \
+ rm -f `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \
+ $(LN_S) `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:
diff --git a/man/checkdirfile.1 b/man/checkdirfile.1
new file mode 100644
index 0000000..63c0967
--- /dev/null
+++ b/man/checkdirfile.1
@@ -0,0 +1,48 @@
+.\" checkdirfile.1. The checkdirfile 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 checkdirfile 1 "22 November 2010" "Version 0.7.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 SEE ALSO
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/dirfile-encoding.5 b/man/dirfile-encoding.5
new file mode 100644
index 0000000..cee8da5
--- /dev/null
+++ b/man/dirfile-encoding.5
@@ -0,0 +1,193 @@
+.\" dirfile-encoding.5. The dirfile-encoding 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 dirfile-encoding 5 "4 August 2010" "Standards Version 8" "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 unaffected.
+
+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_getdata (3),
+.BR gd_move (3),\~ gd_nframes (3),\~ gd_putdata (3),
+and
+.BR gd_rename (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 five other encoding
+schemes:
+.I text
+encoding,
+.I bzip2
+encoding,
+.I gzip
+encoding,
+.I lzma
+encoding, and
+.I slim
+encoding, all discussed below.
+
+.SS Text Encoding
+
+The Text Encoding is unique among GetData encoding schemes in that it requires
+no external library. As a result, all builds of the library contain full
+support for this encoding. It is meant to serve as a reference encoding and
+example of the encoding framework for work on other encoding schemes.
+
+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 BZip2 Encoding
+
+The BZip2 Encoding compresses 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 the
+.I bzip2 compression library
+written by Julian Seward. GetData's BZip2 Encoding framework currently lacks
+write capabilities; as a result the BZip2 Encoding does not support functions
+which modify binary data.
+
+GetData caches an uncompressed megabyte of data at a time to speed access times.
+A call to
+.BR get_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 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 the
+.I zlib compression library
+written by Jean-loup Gailly and Mark Adler. GetData's GZip Encoding framework
+currently lacks write capabilities; as a result the GZip Encoding does not
+support functions which modify binary data.
+
+To speed the operation of
+.BR get_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 compresses 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. GetData's LZMA
+Encoding framework currently lacks write capabilities; as a result the LZMA
+Encoding does not support functions which modify binary data.
+
+As with the BZip2 Encoding, GetData caches an uncompressed megabyte of data at a
+time to speed access times. A call to
+.BR get_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 Slim Encoding
+
+The Slim Encoding compresses 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 .
+
+.SH AUTHOR
+
+This manual page was by D. V. Wiebe
+.nh
+<dvw at ketiltrout.net>.
+.hy 1
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile\-format (5),
+.BR bzip2 (1),
+.BR gzip (1),
+.BR zlib (3).
diff --git a/man/dirfile-format.5 b/man/dirfile-format.5
new file mode 100644
index 0000000..b8676e5
--- /dev/null
+++ b/man/dirfile-format.5
@@ -0,0 +1,1108 @@
+.\" dirfile-format.5. The dirfile format specification man page.
+.\"
+.\" Copyright (C) 2005, 2006, 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 dirfile\-format 5 "23 October 2010" "Standards Version 8" "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 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.
+
+.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 will be 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 will be 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
+.IR ooo .
+.TP
+.BI \ex hh
+the single byte given by the hexadecimal number
+.IR hh .
+.TP
+.BI \eu hhhhhhh
+the UTF-8 byte sequence encoding the Unicode code point given by the hexadecimal
+number
+.IR hhhhhhh .
+.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).
+
+.SH DIRECTIVES
+
+There are eight
+.IR "reserved words" ,
+which cannot be used as field names in the dirfile. Instead, these specify
+directives. All reserved words start with an initial forward slash
+.RB ( / ),
+to distinguish them from field names. Previous versions of the Standards
+permitted the omission of the 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 will be honoured, with the exception that the effect of
+a directive will not be 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 /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
+.I none
+The dirfile is unencoded.
+.TP
+.I bzip2
+The dirfile is compressed using the bzip2 compression scheme.
+.TP
+.I gzip
+The dirfile is compressed using the gzip compression scheme.
+.TP
+.I lzma
+The dirfile is compressed using the LZMA compression scheme.
+.TP
+.I slim
+The dirfile is compressed using the slim compression scheme.
+.TP
+.I text
+The dirfile is text encoded.
+.PP
+Implementations should fail gracefully when encountering an unknown encoding
+scheme. If no encoding scheme is specified, behaviour is implementation
+dependent. Syntax is:
+.IP
+.BI /ENCODING\~ <scheme>
+.PP
+The /ENCODING directive has
+.IR "fragment scope" .
+.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
+.IR "( " 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" .
+.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\~ <integer>
+.PP
+The /FRAMEOFFSET directive has
+.IR "fragment scope" .
+.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
+treated as if the lines of the fragment were pasted verbatim in place of the
+INCLUDE directive line. The exception to this is that RAW fields specified in
+the fragment are located in the directory containing the fragment 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 relative path from the current file. Syntax is:
+.RS
+.IP
+.BI /INCLUDE\~ <file>
+.PP
+The /INCLUDE directive has no scope: it is processed immediately and has no
+long-term effect.
+.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 <parent-field> / <meta-field>
+.PP
+META fields may not be specified before their parent field has been. Syntax is:
+.IP
+.B /META
+.I <parent-field>
+{field specification line}
+.PP
+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, a metafield may be specified by a
+standard field specification line, using
+.IP
+.IB <parent-field> / <meta-field>
+.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 and has no
+long-term effect.
+.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\~ <level>
+.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" .
+.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\~ <field-code>
+.PP
+The /REFERENCE directive has
+.IR "global scope" :
+if multiple /REFERENCE directives appear in the dirfile metadata, only the last
+such will be honoured.
+.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\~ <integer>
+.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. Its effect
+will also propagate upwards back to the parent fragment, and affect subsequent
+metadata.
+.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 field name may not be
+.IR INDEX ,
+which is a special, implicit field which contains the integer frame index.
+Field names are case sensitive.
+
+If the field name beginning a field specification line does contain a
+.B /
+character, the line is assumed to specify a metafield. See the
+.B /META
+directive above for further details.
+
+.SS Field Types
+There are thirteen field types. Of these, ten are of vector type
+.RB ( BIT ", " DIVIDE ", " LINCOM ", " LINTERP ", " MULTIPLY ", " PHASE ,
+.BR POLYNOM ", " RAW ", " RECIP ", and " SBIT )
+and three are of scalar type
+.RB ( CONST ", " CARRAY ", and " STRING ).
+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 <field-name>
+.B BIT
+.I <input> <first-bit> [<bits>]
+.PP
+which specifies
+.I field-name
+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 an (endianness corrected) unsigned 64-bit
+integer. If
+.I bits
+is omitted, it is assumed to be 1. Both
+.IR first-bit " and " bits
+may be either literal numbers, or else the field code of a
+.B CONST
+or
+.B CARRAY
+field type containing their values. The
+.B SBIT
+field type is a signed version of this field type.
+.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 <field-name>
+.B CARRAY
+.I <type> <value0> <value1> <value2> ...
+.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.)
+.RE
+.TP
+.B CONST
+The CONST scalar field type is a constant fully specified in the format
+specification metadata. Syntax is:
+.RS
+.IP
+.I <field-name>
+.B CONST
+.I <type> <value>
+.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 .
+.RE
+.TP
+.B DIVIDE
+The DIVIDE vector field type is the quotient of two vector fields. Syntax is:
+.RS
+.IP
+.I <field-name>
+.B DIVIDE
+.I <field1> <field1>
+.PP
+The derived field will be computed as:
+.IP
+field-name[n] = field1[n] / field2[n2]
+.PP
+with the index
+.I n2
+computed appropriately for the (potentially differing) sample rates of the
+input fields. The resultant field will have the same sample rate as
+.IR field1 .
+.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 <field-name>
+.B LINCOM
+.RI [ <n> "] " "<field1> <a1> <b1>"\~ [ "<field2> <a2> <b2>"\~ [ "<field3> <a3>"
+.IR <b3> ]]
+.PP
+where
+.IR n ,
+if present, indicates the number of input vector fields (1, 2, or 3). The
+derived field will be computed as:
+.IP
+field-name[n] = (a1 * field1[n] + b1) + (a2 * field2[n2] + b2) + (a3 * field3[n3] + b3)
+.PP
+with the
+.I field2
+and
+.I field3
+terms included only if specified and the indices
+.I n2
+and
+.I n3
+computed appropriately for the (potentially differing) sample rates of the
+input fields. The resultant field will have the same sample rate as
+.IR field1 .
+Each supplied co-efficient
+.RI ( a1 ,\~ b1 ,\~ a2 ,
+&c.) may be either a literal number, or else the field code of a
+.B CONST
+or
+.B CARRAY
+field type containing its value.
+
+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.
+.RE
+.TP
+.B LINTERP
+The LINTERP vector field type specifies a table look up based on another vector
+field. Syntax is:
+.RS
+.IP
+.I <field-name>
+.B LINTERP
+.I <input> <table>
+.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 MULTIPLY
+The MULTIPLY vector field type is the product of two vector fields. Syntax is:
+.RS
+.IP
+.I <field-name>
+.B MULTIPLY
+.I <field1> <field2>
+.PP
+The derived field will be computed as:
+.IP
+field-name[n] = field1[n] * field2[n2]
+.PP
+with the index
+.I n2
+computed appropriately for the (potentially differing) sample rates of the
+input fields. The resultant field will have the same sample rate as
+.IR field1 .
+.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 <field-name>
+.B PHASE
+.I <input> <shift>
+.PP
+which specifies
+.I field-name
+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. The
+.I shift
+parameter may be either a literal number, or else the field code of a
+.B CONST
+or
+.B CARRAY
+field type containing its values.
+.RE
+.TP
+.B POLYNOM
+The POLYNOM vector field type specifies a polynomial function of a single input
+vector field. Syntax is:
+.RS
+.IP
+.I <field_name>
+.B POLYNOM
+.I <input> <a0> <a1>
+.RI [ <a2> \~[ <a3> \~[ <a4> \~[ <a5> ]]]]
+.PP
+where
+.I <input>
+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
+field-name[n] = a0 + a1 * input[n] + a2 * input[n]**2 + a3 * input[n]**3 +
+a4 * input[n]**4 + a5 * input[n]**5
+.PP
+where
+.I **
+is the exponentiation operator, and the higher order terms are computed only
+if the corresponding co-efficients
+.RI a i
+are specified. The coefficients, if specified, may be either literal numbers,
+or else the field code of a
+.B CONST
+or
+.B CARRAY
+field type containing the value.
+.RE
+.TP
+.B RECIP
+The RECIP vector field type computes the reciprocal of a single input vector
+field. Syntax is:
+.RS
+.IP
+.I <field_name>
+.B RECIP
+.I <input> <dividend>
+.PP
+where
+.I <input>
+is the input field code and
+.I <dividend>
+is a scalar quantity. The derived field is computed as:
+.IP
+field-name[n] = dividend / input[n].
+.PP
+The dividend, if specified, may be either literal numbers, or else the field
+code of a
+.B CONST
+or
+.B CARRAY
+field type containing the value.
+.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 <field-name>
+.B RAW
+.I <type> <sample-rate>
+.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
+.IR FLOAT32 \~or\~ FLOAT
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.IR FLOAT64 \~or\~ DOUBLE
+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.
+.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.
+.RE
+
+For more information on the storage of complex valued data, see dirfile(5).
+
+For backwards compatibility, implementations should also recognise the following
+single character type aliases in use prior to Standards Version 5:
+.RS
+.TP
+.I c
+UINT8
+.TP
+.I u
+UINT16
+.TP
+.I s
+INT16
+.TP
+.I U
+UINT32
+.TP
+.IR i ,\~ S
+INT32
+.TP
+.IR f
+FLOAT32
+.TP
+.IR 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. Standards Version 8 removed support for these
+single character type codes.
+
+The
+.I sample-rate
+parameter may be either a literal number, or else the name of a
+.B CONST
+or
+.B CARRAY
+field type containing its values.
+.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 <field-name>
+.B SBIT
+.I <input> <first-bit> [<bits>]
+.PP
+which specifies
+.I field-name
+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. Both
+.IR first-bit " and " bits
+may be either literal numbers, or else the field code of a
+.B CONST
+or
+.B CARRAY
+field type containing their values. The
+.B BIT
+field type is an unsigned version of this field type.
+.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 <field-name>
+.B STRING
+.I <value>
+.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 ).
+.RE
+
+.SS Field Parameters
+All input vector field parameters should be
+.I field codes
+(see below). Additionally, some of the numerical field parameters 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 field_code < n >
+.PP
+Parameters which allow non-literal values are indicated above. 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.
+
+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.
+
+A 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 0;1 4;0 0;5 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
+
+.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, 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 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 STANDARDS VERSIONS
+
+This document describes Version 8 of the Dirfile Standards.
+
+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 .
+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
+<netterfield at astro.utoronto.ca>.
+.hy 1
+
+Since Standards Version 3, the dirfile specification has been maintained by
+D. V. Wiebe
+.nh
+<getdata at ketiltrout.net>.
+.hy 1
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile\-encoding (5)
diff --git a/man/dirfile.5 b/man/dirfile.5
new file mode 100644
index 0000000..a291e22
--- /dev/null
+++ b/man/dirfile.5
@@ -0,0 +1,141 @@
+.\" dirfile.5. The dirfile man page.
+.\"
+.\" Copyright (C) 2005, 2006, 2008, 2009 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 "21 July 2010" "Standards Version 8" "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 standard. The latest
+C++ standard (C++98) does not specify a standard storage format for native
+complex numbers, but the upcoming standard, (C++0x) is intended to specify the
+above format for compatibility with C99
+.RI ( see :
+ISO/IEC JTC1/SC22/WG21/N1388).
+
+To aid in using complex valued data, dirfile field codes may contain a
+.I representation suffix
+which specifies a norm to apply to the complex valued data to convert it into
+purely real data. See
+.BR dirfile\-format (5).
+
+.SH AUTHORS
+
+The dirfile specification was developed by C. B. Netterfield
+.nh
+<netterfield at astro.utoronto.ca>.
+.hy 1
+
+The dirfile specification is now maintained by D. V. Wiebe
+.nh
+<getdata at ketiltrout.net>.
+.hy 1
+
+.SH SEE ALSO
+.BR dirfile\-encoding (5),
+.BR dirfile\-format (5)
diff --git a/man/dirfile2ascii.1 b/man/dirfile2ascii.1
new file mode 100644
index 0000000..bc6a82f
--- /dev/null
+++ b/man/dirfile2ascii.1
@@ -0,0 +1,144 @@
+.\" dirfile2ascii.1. The dirfile2ascii 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 dirfile2ascii 1 "30 November 2010" "Version 0.7.1" "GETDATA"
+.SH NAME
+dirfile2ascii \(em output dirfile database vectors as ASCII text
+.SH SYNOPSIS
+.nh
+.ad l
+.TP
+\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 SEE ALSO
+.BR dirfile (5),
+.BR printf (3)
diff --git a/man/gd_add.3 b/man/gd_add.3
new file mode 100644
index 0000000..cc528cb
--- /dev/null
+++ b/man/gd_add.3
@@ -0,0 +1,223 @@
+.\" gd_add.3. The gd_add 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_add 3 "30 November 2010" "Version 0.7.1" "GETDATA"
+.SH NAME
+gd_add, gd_madd \(em add a field to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+
+When adding a metafield, the
+.IR entry -> field
+member should contain just the metafield's name, not the fully formed
+.IB <parent-field> / <meta-field>
+field code. Also,
+.BR gd_madd ()
+ignores the value of
+.IR entry -> fragment_index ,
+and instead adds the new meta field to the same format specification fragment in
+which the parent field is defined.
+
+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. 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_BOUNDS
+The
+.IR entry -> array_len
+parameter provided with a
+.B CARRAY
+entry was greater than GD_MAX_CARRAY_LENGTH.
+.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_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_RAW_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_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 NOTES
+GetData artifically limits the number of elements in a
+.B CARRAY
+to the value of the symbol GD_MAX_CARRAY_LENGTH defined in getdata.h. This is
+done to be certain that the
+.B CARRAY
+won't overrun the line when flushed to disk. On a 32-bit system, this number
+is 2**24. It is larger on a 64-bit system.
+
+.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)
diff --git a/man/gd_add_bit.3 b/man/gd_add_bit.3
new file mode 100644
index 0000000..27f4b39
--- /dev/null
+++ b/man/gd_add_bit.3
@@ -0,0 +1,332 @@
+.\" gd_add_bit.3. The gd_add_bit 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_add_bit 3 "3 November 2010" "Version 0.7.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 <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_add_bit(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", gd_bit_t " bitnum ", gd_bit_t " 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_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 ", gd_spf_t " 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 ", gd_bit_t " bitnum ", gd_bit_t " numbits ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_string(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" value ", 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 (),\~ 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_bit_t
+type is a signed 16-bit integer type. The
+.B gd_shift_t
+type is a signed 64-bit integer type. The
+.B gd_spf_t
+type is an unsigned 16-bit integer type.
+
+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_carray (),
+and
+.BR gd_add_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
+.IR field_name
+argument contained invalid characters.
+.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_BOUNDS
+The
+.I array_len
+parameter provided to
+.BR gd_add_carray ()
+was greater than GD_MAX_CARRAY_LENGTH.
+.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_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_RAW_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_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 NOTES
+GetData artifically limits the number of elements in a
+.B CARRAY
+to the value of the symbol GD_MAX_CARRAY_LENGTH defined in getdata.h. This is
+done to be certain that the
+.B CARRAY
+won't overrun the line when flushed to disk. On a 32-bit system, this number
+is 2**24. It is larger on a 64-bit system.
+
+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
+.B #include <getdata.h>
+.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 ", double " cdividend [2],
+.BI "int " fragment_index );
+.hy
+.ad n
+.fi
+.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. 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.
+
+.SH SEE ALSO
+.BR gd_add (3),
+.BR gd_add_spec (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_string (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_add_spec.3 b/man/gd_add_spec.3
new file mode 100644
index 0000000..0af24cf
--- /dev/null
+++ b/man/gd_add_spec.3
@@ -0,0 +1,164 @@
+.\" gd_add_spec.3. The gd_add_spec 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_add_spec 3 "4 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_add_spec, gd_madd_spec \(em add a field to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_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_RAW_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_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)
diff --git a/man/gd_alter_bit.3 b/man/gd_alter_bit.3
new file mode 100644
index 0000000..7e061d5
--- /dev/null
+++ b/man/gd_alter_bit.3
@@ -0,0 +1,297 @@
+.\" gd_alter_bit.3. The gd_alter_bit 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_alter_bit 3 "3 November 2010" "Version 0.7.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 <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_bit(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", gd_bit_t " bitnum ", gd_bit_t " 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_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 ", gd_spf_t " 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 ", gd_bit_t " bitnum ", gd_bit_t " numbits );
+.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_bit_t
+type is a signed 16-bit integer type. The
+.B gd_shift_t
+type is a signed 64-bit integer type. The
+.B gd_spf_t
+type is an unsigned 16-bit integer type.
+
+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. Specifically, if any of the string parameters or
+.IR m ,\~ b ", or " a
+.RI ( cm ,\~ cb ", or " ca )
+are NULL, the old values will be retained. Similarly, if
+.IR spf ,\~ n_fields ,\~ numbits ,\~ cdividend ,
+or
+.I dividend
+is zero, or if
+.IR bitnum
+is -1, or if
+.IR data_type ", or " const_type
+are equal to
+.BR GD_NULL ,
+these parameters will not be modified.
+
+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.
+
+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.
+.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_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_RAW_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_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
+.B #include <getdata.h>
+.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 ", double " cdividend [2]);
+.hy
+.ad n
+.fi
+.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. 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.
+
+.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 dirfile-format (5)
diff --git a/man/gd_alter_encoding.3.in b/man/gd_alter_encoding.3.in
new file mode 100644
index 0000000..acd6011
--- /dev/null
+++ b/man/gd_alter_encoding.3.in
@@ -0,0 +1,148 @@
+.\" gd_alter_encoding.3.in. The gd_alter_encoding man page.
+.\"
+.\" @configure_input@
+.\"
+.\" 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_alter_encoding 3 "20 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_alter_encoding \(em modify the binary encoding of data in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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
+.I byte_sex
+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 byte_sex
+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_TEXT_ENCODED .
+.ad n
+.hy
+.P
+See
+.BR gd_cbopen (3)
+and dirfile-encoding(5) for the meanings of these symbols and details on the
+supported encoding schemes.
+.P
+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. 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_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_RAW_IO
+An I/O error occurred while attempting to recode a binary file.
+.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.
+.P
+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
+ at 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)
diff --git a/man/gd_alter_endianness.3.in b/man/gd_alter_endianness.3.in
new file mode 100644
index 0000000..190233d
--- /dev/null
+++ b/man/gd_alter_endianness.3.in
@@ -0,0 +1,158 @@
+.\" gd_alter_endianness.3. The gd_alter_endianness man page.
+.\"
+.\" @configure_input@
+.\"
+.\" 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_alter_endianness 3 "21 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_alter_endianness \(em modify the byte sex of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+.P
+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.
+.P
+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. 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_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.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_RAW_IO
+An I/O error occurred while attempting to byte swap a binary file.
+.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.
+.P
+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
+ at 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)
diff --git a/man/gd_alter_entry.3 b/man/gd_alter_entry.3
new file mode 100644
index 0000000..a7f75be
--- /dev/null
+++ b/man/gd_alter_entry.3
@@ -0,0 +1,267 @@
+.\" gd_alter_entry.3. The gd_alter_entry 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_alter_entry 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_alter_entry \(em modify the metadata of a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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).
+
+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. 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 field parameters have special values which indicate no change should be
+made to the parameter. Specifically, if any of the string parameters, or
+the parameters
+.RI ( entry -> a ,\~ entry -> b ,\~ entry -> m ,\~ entry -> ca ,\~ entry -> cb ,
+.RI "or " entry -> cm )
+are NULL, the old values will be retained. Similarly, if
+.IR entry -> spf ", " entry -> n_fields ", or " entry -> numbits
+is zero, or if
+.IR entry -> bitnum
+is -1, or if
+.IR entry -> data_type ", or " entry -> const_type
+are equal to
+.BR GD_NULL ,
+these parameters will not be modified.
+
+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 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.
+
+.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. 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_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_RAW_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_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_malter_spec (3),
+.BR gd_metaflush (3),
+.BR gd_move (3),
+.BR gd_open (3),
+.BR gd_rename (3),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_frameoffset.3.in b/man/gd_alter_frameoffset.3.in
new file mode 100644
index 0000000..b917f67
--- /dev/null
+++ b/man/gd_alter_frameoffset.3.in
@@ -0,0 +1,141 @@
+.\" gd_alter_frameoffset.3. The gd_alter_frameoffset man page.
+.\"
+.\" @configure_input@
+.\"
+.\" 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_alter_frameoffset 3 "20 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_alter_frameoffset \(em modify the starting frame of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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. 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_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_RAW_IO
+An I/O error occurred while attempting to shift a binary file.
+.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.
+.P
+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
+ at 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)
diff --git a/man/gd_alter_protection.3 b/man/gd_alter_protection.3
new file mode 100644
index 0000000..cc69bdb
--- /dev/null
+++ b/man/gd_alter_protection.3
@@ -0,0 +1,98 @@
+.\" gd_alter_protection.3. The gd_alter_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_alter_protection 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_alter_protection \(em modify the protection level of a dirfile fragment
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_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)
diff --git a/man/gd_alter_spec.3 b/man/gd_alter_spec.3
new file mode 100644
index 0000000..230a99c
--- /dev/null
+++ b/man/gd_alter_spec.3
@@ -0,0 +1,169 @@
+.\" gd_alter_spec.3. The gd_alter_spec 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_alter_spec 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_alter_spec, gd_malter_spec \(em modify a field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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. 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
+.IR entry -> table
+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_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_RAW_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_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)
diff --git a/man/gd_bof.3 b/man/gd_bof.3
new file mode 100644
index 0000000..9c17f25
--- /dev/null
+++ b/man/gd_bof.3
@@ -0,0 +1,109 @@
+.\" gd_bof.3. The gd_bof 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_bof 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_bof \(em report the start of data in a field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_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_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of its inputs was not recognised.
+.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_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)
diff --git a/man/gd_carray_len.3 b/man/gd_carray_len.3
new file mode 100644
index 0000000..d6ea1e7
--- /dev/null
+++ b/man/gd_carray_len.3
@@ -0,0 +1,80 @@
+.\" gd_carray_len.3. The gd_carray_len 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_carray_len 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_carray_len \(em returns the length of a CARRAY field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_carray_len(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_carray_len ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of length of the
+.B CARRAY
+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_carray_len ()
+returns the length of 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_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
+.B CARRAY
+type.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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)
diff --git a/man/gd_carrays.3 b/man/gd_carrays.3
new file mode 100644
index 0000000..cceb589
--- /dev/null
+++ b/man/gd_carrays.3
@@ -0,0 +1,139 @@
+.\" gd_constants.3. The gd_constants 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_carrays 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_constants \(em retrieve a list of CARRAY values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+.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)
diff --git a/man/gd_cbopen.3 b/man/gd_cbopen.3
new file mode 100644
index 0000000..46b2f80
--- /dev/null
+++ b/man/gd_cbopen.3
@@ -0,0 +1,686 @@
+.\" gd_cbopen.3. The gd_cbopen 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_cbopen 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_cbopen, gd_open \(em open or create a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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
+.B GD_ARM_ENDIAN
+.PD 0
+.TP
+.PD
+.B GD_NOT_ARM_ENDIAN
+Specifies that double precision floating point raw data on disk is, or is not,
+stored in the middle-endian format used by older ARM processors.
+
+These flag are 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
+.B GD_BIG_ENDIAN
+.PD 0
+.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 are 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 .
+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. Behaviour of this flag is undefined if
+.B GD_CREAT
+is not specified. 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 absense 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 is flushed to disk (either explicitly via
+.BR gd_metaflush (),\~ gd_rewrite_fragment (),
+or
+.BR gd_flush ()
+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 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. Subdirectories are
+left untouched. Notably, this operation does not consider the presence of
+subdirfiles declared by
+.B INCLUDE
+directives. If the dirfile does not exist, 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 standard error by the library. Without this flag,
+GetData writes nothing to standard error. (GetData never writes to standard
+output.)
+
+.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_ENDODED
+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_ENDODED
+Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77)
+as implemented in the gzip format.
+.TP
+.B GD_LZMA_ENDODED
+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_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.
+
+.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 pedanitc
+mode, in which the parser adheres strictly to the Standards. 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 specified 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
+.nf
+typedef struct {
+ const DIRFILE* dirfile;
+ int suberror;
+ int linenum;
+ const char* filename;
+ char* line;
+ size_t buflen;
+
+ ...
+} gd_parser_data_t;
+.fi
+.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_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_METARAW
+An attempt was made to add a RAW metafield.
+.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_PARENT
+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.
+.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.
+
+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. 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 create or truncate a dirfile opened read-only (i.e.
+.B GD_CREAT
+or
+.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, or the dirfile 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_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_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.
+.TP
+.B GD_E_OPEN
+The dirfile format specification could not be opened, or
+.I dirfilename
+does not specify a valid dirfile.
+.TP
+.B GD_E_OPEN_FRAGMENT
+A file specified in an
+.B /INCLUDE
+directive could not be opened.
+.TP
+.B GD_E_TRUNC
+The library was unable to truncate 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).
+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 absense 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 artifically limits the size of a
+.B CARRAY
+field to GD_MAX_CARRAY_LENGTH elements, to be certain it is always able to
+write the CARRAY back to disk without overrunning its maximum line length.
+On 32-bit systems, GD_MAX_CARRAY_LENGTH is 2**24. It is larger on 64-bit
+systems. Excess elements are silently truncatd on dirfile open.
+
+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_getdata (3),
+.BR gd_include (3),
+.BR gd_parser_callback (3)
diff --git a/man/gd_close.3 b/man/gd_close.3
new file mode 100644
index 0000000..5a5389a
--- /dev/null
+++ b/man/gd_close.3
@@ -0,0 +1,112 @@
+.\" gd_close.3. The gd_close 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_close 3 "20 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_close, gd_discard \(em close a dirfile and free associated memory.
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_FLUSH
+A temporary file could not be opened into which to write the modified metadata,
+or renaming the temporary file over the original fragment failed.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to flush or close one or more open raw files.
+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)
diff --git a/man/gd_constants.3 b/man/gd_constants.3
new file mode 100644
index 0000000..16ef3c3
--- /dev/null
+++ b/man/gd_constants.3
@@ -0,0 +1,105 @@
+.\" 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 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_constants \(em retrieve a list of constant values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+.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)
diff --git a/man/gd_delete.3 b/man/gd_delete.3
new file mode 100644
index 0000000..14a3c8e
--- /dev/null
+++ b/man/gd_delete.3
@@ -0,0 +1,148 @@
+.\" gd_delete.3. The gd_delete 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_delete 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_delete \(em remove a field from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_delete(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "int " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_delete ()
+function attempts to delete the field 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 field, 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.
+.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_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_RAW_IO
+An error occurred while trying to close or delete the binary file associated
+with a
+.B RAW
+field.
+.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)
diff --git a/man/gd_dirfile_standards.3 b/man/gd_dirfile_standards.3
new file mode 100644
index 0000000..ea1a433
--- /dev/null
+++ b/man/gd_dirfile_standards.3
@@ -0,0 +1,119 @@
+.\" gd_dirfile_standards.3. The gd_dirfile_standards 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_dirfile_standards 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_dirfile_standards \(em change or report the current Dirfile Standards Version
+for a DirFile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_dirfile_standards(DIRFILE *" dirfile ", int version );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_dirfile_standards ()
+version 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_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_VERSION
+The loaded dirfile did not conform to the specified version. Or the dirfile
+conforms to no known Standards Version.
+.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)
diff --git a/man/gd_dirfilename.3 b/man/gd_dirfilename.3
new file mode 100644
index 0000000..0a0e24e
--- /dev/null
+++ b/man/gd_dirfilename.3
@@ -0,0 +1,61 @@
+.\" gd_dirfilename.3. The dirfilename 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_dirfilename 3 "25 May 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_dirfilename \(em retrieve the name of a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char *gd_dirfilename(const 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 the pathname passed to
+.BR gd_cbopen ()
+or
+.BR gd_open ()
+when the dirfile was opened.
+
+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)
diff --git a/man/gd_encoding.3 b/man/gd_encoding.3
new file mode 100644
index 0000000..42cbe3b
--- /dev/null
+++ b/man/gd_encoding.3
@@ -0,0 +1,85 @@
+.\" gd_encoding.3. The gd_encoding 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_encoding 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_encoding \(em report the binary encoding of data in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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 ,\~ GD_TEXT_ENCODED ,\~ GD_SLIM_ENCODED ,\~
+.BR GD_GZIP_ENCODED ,\~ GD_BZIP2_ENCODED ,\~ GD_LZMA_ENCODED ,\~
+.BR GD_ENC_UNSUPPORTED .
+.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. If the encoding scheme specified in the dirfile
+metadata is unknown to GetData,
+.B GD_ENC_UNSUPPORTED
+will be returned.
+.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)
diff --git a/man/gd_endianness.3 b/man/gd_endianness.3
new file mode 100644
index 0000000..24d3b11
--- /dev/null
+++ b/man/gd_endianness.3
@@ -0,0 +1,78 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_entry.3 b/man/gd_entry.3
new file mode 100644
index 0000000..c7b2ffc
--- /dev/null
+++ b/man/gd_entry.3
@@ -0,0 +1,768 @@
+.\" gd_entry.3. The gd_entry 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_entry 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_entry \(em retrieve a dirfile field's metadata
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+
+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_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_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_BAD_SCALAR
+A scalar parameter used in the definition of the field 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 */
+
+ ...
+} 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 ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY ,
+.BR GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ", " GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_ENTRY .
+.ad n
+.hy
+.PP
+.B GD_INDEX_ENTRY
+is a special field type used only for the implicit
+.I INDEX
+field. The meaning of the other symbols should be self-explanatory.
+.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
+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 ", " PHASE ", " POLYNOM ", " RECIP ", " RAW ", or " SBIT )
+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 4
+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 4
+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 4
+For
+.B PHASE
+fields, the first element corresponds to
+.IR shift .
+The remainder are unitialised.
+.IP \(bu 4
+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 4
+For
+.B RECIP
+fields, the first element corresponds to
+.IR cdividend .
+The remainder are unitialised.
+.IP \(bu 4
+For
+.B RAW
+fields, the first element corresponds to
+.IR spf .
+The remainder are unitialised.
+.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 */
+ gd_bit_t bitnum; /* first bit */
+ gd_bit_t 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. The
+.I gd_bit_t
+type is a signed 16-bit integer type. 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 */
+ int comp_scal; /* complex scalar flag */
+ 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, which is defined in getdata.h to the maximum number of input fields
+permitted by a
+.BR LINCOM .
+.PP
+The
+.I comp_scal
+member is non-zero if any of the scale factors or offset terms have a non-zero
+imaginary part. (That is, if comp_scal is zero, the elements of
+.IR cm \~and\~ cb
+equal the corresponding elements of
+.IR m \~and\~ b .)
+members.)
+.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.
+.PP
+The
+.I in_fields
+member is an array of length one containing the input field code.
+
+.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 */
+ int comp_scal; /* complex scalar flag */
+ 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, which is defined in getdata.h to the maximum order of polynomial
+permitted by a
+.BR POLYNOM .
+.PP
+The
+.I comp_scal
+member is non-zero if any of the co-efficients have a non-zero imaginary part.
+(That is, if comp_scal is zero, the elements of
+.I ca
+equal the corresponding elements of
+.IR a .)
+.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 RECIP Members
+A gd_entry_t describing a
+.B RECIP
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+ ...
+
+ int comp_scal; /* complex scalar flag */
+ 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 comp_scal
+member is non-zero if any of the co-efficients have a non-zero imaginary part.
+(That is, if comp_scal is zero,
+.I cdividend
+equals
+.IR dividend .)
+.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 RAW Members
+A gd_entry_t describing a
+.B RAW
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+ ...
+
+ gd_spf_t 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. The
+.I gd_spf_t
+type is an unsigned 16-bit integer type. 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 STRING Members
+A gd_entry_t describing a
+.B STRING
+entry provides no additional data.
+
+.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
+gd_spf_t|spf|gd_spf_t|u.raw.spf
+gd_type_t|data_type|gd_type_t|u.raw.data_type
+int|n_fields|int|u.lincom.n_fields
+double compex|cm[3]|double|u.lincom.cm[3][2]
+double|m[3]|double|u.lincom.m[3]
+double compex|cb[3]|double|u.lincom.cb[3][2]
+double|b[3]|double|u.lincom.b[3]
+int|poly_ord|int|u.polynom.poly_ord
+double compex|ca[3]|double|u.polynom.ca[3][2]
+double|a[3]|double|u.polynom.a[3]
+const char*|table|const char*|u.linterp.table
+gd_bit_t|bitnum|gd_bit_t|u.bit.bitnum
+gd_bit_t|numbits|gd_bit_t|u.bit.numbits
+gd_shift_t|shift|gd_shift_t|u.phase.shift
+double compex|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
+.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_getdata (3),
+.BR gd_raw_filename (3)
diff --git a/man/gd_entry_type.3 b/man/gd_entry_type.3
new file mode 100644
index 0000000..6c3e3b2
--- /dev/null
+++ b/man/gd_entry_type.3
@@ -0,0 +1,87 @@
+.\" gd_entry_type.3. The gd_entry_type 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_entry_type 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_entry_type \(em retrieve the type of a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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 ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY ,
+.BR GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ", " GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_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_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.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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)
diff --git a/man/gd_eof.3 b/man/gd_eof.3
new file mode 100644
index 0000000..2371ca7
--- /dev/null
+++ b/man/gd_eof.3
@@ -0,0 +1,135 @@
+.\" gd_eof.3. The gd_eof 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_eof 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_eof \(em report the number of samples in a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_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_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of its inputs was not recognised.
+.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_RAW_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)
diff --git a/man/gd_error.3 b/man/gd_error.3
new file mode 100644
index 0000000..273ba0f
--- /dev/null
+++ b/man/gd_error.3
@@ -0,0 +1,49 @@
+.\" gd_error.3. The gd_error 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_error 3 "25 May 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_error \(em report a GetData library error
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+
+The
+.I dirfile
+argument should point to a DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+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_open (3),
+.BR gd_error_string (3)
diff --git a/man/gd_error_string.3 b/man/gd_error_string.3
new file mode 100644
index 0000000..8366535
--- /dev/null
+++ b/man/gd_error_string.3
@@ -0,0 +1,75 @@
+.\" gd_error_string.3. The gd_error_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_error_string 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+gd_error_string \(em report a GetData library error
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+
+The
+.I dirfile
+argument should point to a DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.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. Otherwise, it returns a newly malloc'd
+string of sufficient length which should be deallocated by the caller. The
+error state of
+.I dirfile
+is unchanged.
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_error (3)
diff --git a/man/gd_field_list.3 b/man/gd_field_list.3
new file mode 100644
index 0000000..b137cc0
--- /dev/null
+++ b/man/gd_field_list.3
@@ -0,0 +1,81 @@
+.\" gd_field_list.3. The gd_field_list 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_field_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_field_list \(em retrieve a list of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_field_list(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_field_list ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of names of the all 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. 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 (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_field_list ()
+is called again on the same DIRFILE object, or until the array is de-allocated by
+a call to
+.BR gd_close (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_field_list ()
+returns a pointer to an array of strings containing the names of all the fields
+defined in the dirfile database. 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_cbopen (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list_by_type (3),
+.BR gd_mfield_list (3),
+.BR gd_nfields (3),
+.BR gd_vector_list (3)
diff --git a/man/gd_field_list_by_type.3 b/man/gd_field_list_by_type.3
new file mode 100644
index 0000000..9bfb214
--- /dev/null
+++ b/man/gd_field_list_by_type.3
@@ -0,0 +1,108 @@
+.\" gd_field_list_by_type.3. The gd_field_list_by_type 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_field_list_by_type 3 "3 Novmeber 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_field_list_by_type \(em retrieve a list of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_field_list_by_type(DIRFILE *" dirfile ", gd_entype_t "
+.IB type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_field_list_by_type ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of names of the all fields of the indicated type
+which are 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
+.I type
+argument should be one of the following symbols indicating the desired field
+type:
+.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_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ", " GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_ENTRY .
+.ad n
+.hy
+.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 fields 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_field_list_by_type ()
+is called again on the same DIRFILE object with the same
+.I type
+argument, or until the array is de-allocated by a call to
+.BR gd_close (3).
+
+For
+.BR CONST ", " CARRAY ,
+and
+.B STRING
+field types, corresponding lists of values for may be obtained by calling
+.BR gd_constants (3),\~ gd_carrays (3),
+or
+.BR gd_strings (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_field_list_by_type ()
+returns a pointer to an array of strings containing the names of all the fields
+defined in the dirfile database of the specific type. 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_constants (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list (3),
+.BR gd_mfield_list_by_type (3),
+.BR gd_nfields_by_type (3),
+.BR gd_strings (3)
diff --git a/man/gd_flush.3 b/man/gd_flush.3
new file mode 100644
index 0000000..bffa767
--- /dev/null
+++ b/man/gd_flush.3
@@ -0,0 +1,91 @@
+.\" gd_flush.3. The gd_flush 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_flush 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_flush \(em write all pending dirfile changes to disk.
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_flush(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_flush ()
+function flushes and closes all file handles 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 and closed. In this special case, modified metadata will
+also be flushed to disk as if
+.BR gd_metaflush (3)
+had been called.
+.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_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_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_FLUSH
+A temporary file could not be opened into which to write the modified metadata,
+or renaming the temporary file over the original fragment failed. Only returned
+when
+.I field_code
+is NULL.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to flush or close the field(s).
+.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)
diff --git a/man/gd_fragment_index.3 b/man/gd_fragment_index.3
new file mode 100644
index 0000000..eb11e72
--- /dev/null
+++ b/man/gd_fragment_index.3
@@ -0,0 +1,72 @@
+.\" gd_fragment_index.3. The gd_fragment_index 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_fragment_index 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_fragment_index \(em retrieve the fragment containing a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_fragment_index(const DIRFILE *" dirfile ", const char"
+.BI * field_code );
+.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 specified by
+.IR field_code .
+If
+.I field_code
+contains a representation suffix, it will be ignored.
+.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_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.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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)
diff --git a/man/gd_fragmentname.3 b/man/gd_fragmentname.3
new file mode 100644
index 0000000..d2f6ee0
--- /dev/null
+++ b/man/gd_fragmentname.3
@@ -0,0 +1,78 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_framenum_subset.3 b/man/gd_framenum_subset.3
new file mode 100644
index 0000000..9890473
--- /dev/null
+++ b/man/gd_framenum_subset.3
@@ -0,0 +1,176 @@
+.\" gd_framenum_subset.3. The gd_framenum man page.
+.\"
+.\" Copyright (C) 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_framenum_subset 3 "23 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_framenum_subset, gd_framenum \(em perform a reverse look-up on a
+monotonic dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_FIELD_TYPE
+The field specified by
+.I field_code
+was not a vector field.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of its input fields, was not recognised.
+.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
+A scalar field was found where a vector field was expected.
+.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_OPEN_LINFILE
+An error occurred while trying to read a LINTERP table from disk.
+.TP
+.B GD_E_RANGE
+The specified field is constant between the supplied limits.
+.TP
+.B GD_E_RAW_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_error (3),
+.BR gd_error_string (3),
+.BR gd_frameoffset (3),
+.BR gd_nframes (3)
diff --git a/man/gd_framenum_subset64.3 b/man/gd_framenum_subset64.3
new file mode 100644
index 0000000..ac1e96d
--- /dev/null
+++ b/man/gd_framenum_subset64.3
@@ -0,0 +1,51 @@
+.\" gd_framenum_subset64.3. The gd_framenum_subset64 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_framenum_subset64 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_framenum_subset64 \(em perform a reverse look-up on a monotonic dirfile
+field
+.SH SYNOPSIS
+.B #define _LARGEFILE64_SOURCE
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "double gd_framenum_subset64(DIRFILE *" dirfile ,
+.BI "const char *" field_code ", double " value ", off64_t " field_start ,
+.BI "off64_t " field_end );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_framenum_subset (3)
+uses a 64-bit offset type, even if
+.I off_t
+is a 32-bit type. It is only available if one defines
+.IR _LARGEFILE64_SOURCE .
+If
+.I off_t
+is a 64-bit type (i.e. if
+.I _FILE_OFFSET_BITS
+is defined to be 64), this function will be called
+.BR gd_framenum_subset ().
+Otherwise,
+.BR gd_framenum_subset ()
+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)
diff --git a/man/gd_frameoffset.3 b/man/gd_frameoffset.3
new file mode 100644
index 0000000..95fe69e
--- /dev/null
+++ b/man/gd_frameoffset.3
@@ -0,0 +1,71 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_frameoffset64.3 b/man/gd_frameoffset64.3
new file mode 100644
index 0000000..e382efa
--- /dev/null
+++ b/man/gd_frameoffset64.3
@@ -0,0 +1,61 @@
+.\" 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 "16 July 2010" "Version 0.7.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 _LARGEFILE64_SOURCE
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off64_t gd_frameoffset(DIRFILE *" dirfile ", int " fragment_index );
+.HP
+.BI "int gd_alter_frameoffset64(DIRFILE *" dirfile ", off64_t " offset ,
+.BI "int " fragment_index ", int " move );
+.hy
+.ad n
+.SH DESCRIPTION
+These version of
+.BR gd_frameoffset (3)
+and
+.BR gd_alter_frameoffset (3)
+use a 64-bit offset type, even if
+.I off_t
+is a 32-bit type. They are only available if the caller defines
+.I _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (i.e. if
+.I _FILE_OFFSET_BITS
+is defined to be 64), these function will be called
+.BR gd_frameoffset ()
+and
+.BR gd_alter_frameoffset ().
+Otherwise,
+.BR gd_frameoffset ()
+and
+.BR gd_alter_frameoffset ()
+will be versions of these functions 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)
diff --git a/man/gd_free_entry_strings.3 b/man/gd_free_entry_strings.3
new file mode 100644
index 0000000..18845e0
--- /dev/null
+++ b/man/gd_free_entry_strings.3
@@ -0,0 +1,70 @@
+.\" gd_free_entry_strings.3. The gd_free_entry_strings 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_free_entry_strings 3 "16 June 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_free_entry_strings \(em free strings in a GetData gd_entry_t object
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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).
+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 complete description of the gd_entry_t data type.
+.SH RETURN VALUE
+A call to
+.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)
diff --git a/man/gd_get_carray_slice.3 b/man/gd_get_carray_slice.3
new file mode 100644
index 0000000..a548390
--- /dev/null
+++ b/man/gd_get_carray_slice.3
@@ -0,0 +1,192 @@
+.\" gd_get_carray_slice.3. The gd_get_carray_slice 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_get_carray_slice 3 "3 Novmeber 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_get_carray gd_get_carray_slice \(em retrieve CARRAY data from a dirfile
+database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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 );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_get_carray_slice ()
+function queries a dirfile(5) database specified by
+.I dirfile
+for the
+.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.
+
+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
+.B CARRAY
+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
+.I GD_UINT8
+unsigned 8-bit integer
+.TP
+.I GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.I GD_UINT16
+unsigned 16-bit integer
+.TP
+.I GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.I GD_UINT32
+unsigned 32-bit integer
+.TP
+.I GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.I GD_UINT64
+unsigned 64-bit integer
+.TP
+.I GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.IR GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.IR GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.IR GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.IR GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.TP
+.I 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 ()
+and
+.BR gd_get_carray_slice ()
+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_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 a type other than
+.BR CARRAY .
+The caller should use
+.BR gd_getdata (3),
+.BR gd_get_constant (3),
+or
+.BR gd_get_string (3)
+instead.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of the field codes it uses for input, was invalid.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I return_type
+was specified.
+.TP
+.B GE_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)
diff --git a/man/gd_get_constant.3 b/man/gd_get_constant.3
new file mode 100644
index 0000000..77bfcb1
--- /dev/null
+++ b/man/gd_get_constant.3
@@ -0,0 +1,162 @@
+.\" gd_get_constant.3. The gd_get_constant 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_get_constant 3 "3 Novmeber 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_get_constant \(em retrieve a scalar constant from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.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_constant ()
+function queries a dirfile(5) database specified by
+.I dirfile
+for the
+.B CONST
+scalar
+.IR field_code ,
+which may contain a representation suffix.
+The constant is converted to the data type specified by
+.IR return_type ,
+and 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).
+The argument
+.I data_out
+must point to a valid memory location of sufficient size to hold a value of the
+return type specified.
+
+The
+.I return_type
+argument should be one of the following symbols, which indicates the desired
+return type of the data:
+.RS
+.TP 11
+.I GD_UINT8
+unsigned 8-bit integer
+.TP
+.I GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.I GD_UINT16
+unsigned 16-bit integer
+.TP
+.I GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.I GD_UINT32
+unsigned 32-bit integer
+.TP
+.I GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.I GD_UINT64
+unsigned 64-bit integer
+.TP
+.I GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.IR GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.IR GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.IR GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.IR GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.TP
+.I 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 constant 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_constant ()
+returns zero. On error, it returns -1 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 a type other than
+.BR CONST .
+The caller should use
+.BR gd_getdata (3),
+or
+.BR gd_get_string (3)
+instead.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field code ,
+or in one of the field codes it uses for input, was invalid.
+.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_get_carray (3),
+.BR gd_constants (3),
+.BR gd_put_constant (3)
diff --git a/man/gd_get_string.3 b/man/gd_get_string.3
new file mode 100644
index 0000000..042bd98
--- /dev/null
+++ b/man/gd_get_string.3
@@ -0,0 +1,112 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_getdata.3 b/man/gd_getdata.3
new file mode 100644
index 0000000..539afa5
--- /dev/null
+++ b/man/gd_getdata.3
@@ -0,0 +1,289 @@
+.\" gd_getdata.3. The gd_getdata 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_getdata 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_getdata \(em retrieve data from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+
+The first sample returned 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 fetched is, similarly,
+.RS
+.IR num_frames " * " samples_per_frame " + " num_samples .
+.RE
+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.
+
+The
+.I return_type
+argument should be one of the following symbols, which indicates the desired
+return type of the data:
+.RS
+.TP 11
+.I GD_UINT8
+unsigned 8-bit integer
+.TP
+.I GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.I GD_UINT16
+unsigned 16-bit integer
+.TP
+.I GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.I GD_UINT32
+unsigned 32-bit integer
+.TP
+.I GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.I GD_UINT64
+unsigned 64-bit integer
+.TP
+.I GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.IR GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.IR GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.IR GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.IR GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.TP
+.I 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.
+
+.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_FIELD_TYPE
+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.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of the field codes it uses for input, 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_BAD_TYPE
+An invalid
+.I return_type
+was specified.
+.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_OPEN_LINFILE
+An error occurred while trying to read a LINTERP table from disk.
+.TP
+.B GD_E_RAW_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.
+.RE
+.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
+.B PHASE
+field type is poorly defined, since a forward-shifted
+.B PHASE
+field will always encounter the end-of-field marker before its input field does.
+This has ramifications when using
+.BR gd_getdata ()
+with streaming data. The Dirfile
+Standards make tacit admission to this problem by indicating the results of
+reading a
+.B PHASE
+field beyond the beginning- or end-of-field is "implementation dependent" (see
+.BR dirfile-format (5)).
+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 time 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 first
+.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.
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR gd_open (3),
+.BR gd_get_constant (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_nframes (3),
+.BR gd_spf (3),
+.BR gd_get_string (3),
+.BR gd_putdata (3)
diff --git a/man/gd_getdata64.3 b/man/gd_getdata64.3
new file mode 100644
index 0000000..219a8f6
--- /dev/null
+++ b/man/gd_getdata64.3
@@ -0,0 +1,50 @@
+.\" gd_getdata64.3. The gd_getdata64 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_getdata64 3 "25 May 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_getdata64 \(em retrieve data from a dirfile database with largefile support
+.SH SYNOPSIS
+.B #define _LARGEFILE64_SOURCE
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_getdata64(DIRFILE *" dirfile ", const char *" field_code ", off64_t"
+.IB first_frame ", off64_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
+This version of
+.BR gd_getdata (3)
+uses a 64-bit offset type, even if
+.I off_t
+is a 32-bit type. It is only available if one defines
+.IR _LARGEFILE64_SOURCE .
+If
+.I off_t
+is a 64-bit type (i.e. if
+.I _FILE_OFFSET_BITS
+is defined to be 64), this function will be called
+.BR gd_getdata ().
+Otherwise,
+.BR gd_getdata ()
+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)
diff --git a/man/gd_include.3 b/man/gd_include.3
new file mode 100644
index 0000000..f76ea1e
--- /dev/null
+++ b/man/gd_include.3
@@ -0,0 +1,312 @@
+.\" gd_include.3. The gd_include 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_include 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_include \(em add a format specification fragment to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.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 ()
+adds the format specification fragment given by the path
+.I include_file
+to the specified dirfile, possibly creating the fragment. This occurs as if,
+in the existing fragment indexed
+by
+.IR parent_fragment ,
+the following directive were present:
+.IP
+.BI "/INCLUDE " <include_file>
+.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.
+
+The
+.I flags
+argument should be a bitwise-or'd collection of the following flags, or zero
+if no flags are desired:
+.TP
+.B GD_BIG_ENDIAN
+Specifies that raw data on disk is stored as big-endian data (most significant
+byte first). Specifying this flag along with the contradictory
+.BR GD_LITTLE_ENDIAN
+will cause the library to assume that the endianness of the data is opposite to
+that of the native architecture.
+
+This flag is ignored completely if an
+.B ENDIAN
+directive occurs in the fragment, 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. Behaviour of this flag is undefined if
+.B GD_CREAT
+is not specified. 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_LITTLE_ENDIAN
+Specifies that raw data on disk is stored as little-endian data (least
+significant byte first). Specifying this flag along with the contradictory
+.BR GD_BIG_ENDIAN
+will cause the library to assume that the endianness of the data is opposite to
+that of the native architecture.
+
+This flag is ignored completely if an
+.B ENDIAN
+directive occurs in the fragment, unless
+.B GD_FORCE_ENDIAN
+is also specified.
+.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 the
+.BR gd_include ()
+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 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_ENDODED
+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_ENDODED
+Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77)
+as implemented in the gzip format.
+.TP
+.B GD_LZMA_ENDODED
+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_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.
+
+.SH RETURN VALUE
+On success,
+.BR gd_include ()
+returns 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.
+.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_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_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_OPEN_FRAGMENT
+The fragment could not be opened or created.
+.TP
+.B GD_E_PROTECTED
+The metadata of the parent fragment was protected from change.
+.TP
+.B GD_E_REFERENCE
+The included fragment contained a
+.B /REFERENCE
+directive which referred to a non-existent field, or a field that was not of
+type
+.BR RAW .
+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.
+.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 BUGS
+If this function fails with the error
+.BR GD_E_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_parser_callback (3),
+.BR gd_reference (3),
+.BR gd_uninclude (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)
diff --git a/man/gd_invalid_dirfile.3 b/man/gd_invalid_dirfile.3
new file mode 100644
index 0000000..14d6788
--- /dev/null
+++ b/man/gd_invalid_dirfile.3
@@ -0,0 +1,72 @@
+.\" 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 "20 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_invalid_dirfile \(em obtain an pointer to an invalid DIRFILE object
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+
+.SH SEE ALSO
+.BR gd_close (3),
+.BR gd_discard (3),
+.BR gd_error (3),
+.BR gd_open (3)
diff --git a/man/gd_madd_bit.3 b/man/gd_madd_bit.3
new file mode 100644
index 0000000..4b3d060
--- /dev/null
+++ b/man/gd_madd_bit.3
@@ -0,0 +1,283 @@
+.\" gd_madd_bit.3. The gd_madd_bit 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_madd_bit 3 "3 November 2010" "Version 0.7.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 <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_madd_bit(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "const char *" in_field ", gd_bit_t " bitnum ", gd_bit_t " 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_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 ", gd_bit_t " bitnum ", gd_bit_t " numbits );
+.HP
+.BI "int gd_madd_string(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", const char *" value );
+.hy
+.ad n
+.SH DESCRIPTION
+These functions provide alternatives to using the
+.BR gd_madd ()
+function to 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 <parent-field> / <meta-field>
+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_bit_t
+type is a signed 16-bit integer type. The
+.B gd_shift_t
+type is a signed 64-bit integer type.
+
+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
+.B NOTES
+below for information on using
+.BR gd_madd_clincom ()
+and
+.BR gd_madd_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
+.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
+.nf
+.B #define GD_C89_API
+.B #include <getdata.h>
+.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 "[2], int " fragment_index );
+.hy
+.ad n
+.fi
+.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. 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.
+
+.SH SEE ALSO
+.BR gd_add_bit (3),
+.BR gd_add_const (3),
+.BR gd_add_lincom (3),
+.BR gd_add_linterp (3),
+.BR gd_add_multiply (3),
+.BR gd_add_phase (3),
+.BR gd_add_string (3),
+.BR gd_madd (3),
+.BR gd_madd_spec (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile-format (5)
diff --git a/man/gd_mcarrays.3 b/man/gd_mcarrays.3
new file mode 100644
index 0000000..03c7013
--- /dev/null
+++ b/man/gd_mcarrays.3
@@ -0,0 +1,142 @@
+.\" gd_constants.3. The gd_constants 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_mcarrays 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_constants \(em retrieve a list of CARRAY values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+.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)
diff --git a/man/gd_mconstants.3 b/man/gd_mconstants.3
new file mode 100644
index 0000000..0d12fa7
--- /dev/null
+++ b/man/gd_mconstants.3
@@ -0,0 +1,102 @@
+.\" gd_mconstants.3. The gd_mconstants 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_mconstants 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_mconstants \(em retrieve a list of constant values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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.
+.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)
diff --git a/man/gd_metaflush.3 b/man/gd_metaflush.3
new file mode 100644
index 0000000..440437f
--- /dev/null
+++ b/man/gd_metaflush.3
@@ -0,0 +1,83 @@
+.\" gd_metaflush.3. The gd_metaflush 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_metaflush 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_metaflush \(em write modified dirfile metadata to disk
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_flush (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_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_FLUSH
+A temporary file could not be opened into which to write the modified metadata,
+or renaming the temporary file over the original fragment failed.
+.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 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_rewrite_fragment (3)
diff --git a/man/gd_mfield_list.3 b/man/gd_mfield_list.3
new file mode 100644
index 0000000..a60c45f
--- /dev/null
+++ b/man/gd_mfield_list.3
@@ -0,0 +1,84 @@
+.\" gd_mfield_list.3. The gd_mfield_list 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_mfield_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_mfield_list \(em retrieve a list of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_mfield_list(DIRFILE *" dirfile ,
+.BI "const char *" parent );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_mfield_list ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of names of the all metafields for the specified
+parent field in the database.
+
+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_nmfields (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_mfield_list ()
+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_mfield_list ()
+returns a pointer to an array of strings containing the names of all the
+metafields of the given parent. 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_mvector_list (3),
+.BR gd_nfields (3)
diff --git a/man/gd_mfield_list_by_type.3 b/man/gd_mfield_list_by_type.3
new file mode 100644
index 0000000..2c060de
--- /dev/null
+++ b/man/gd_mfield_list_by_type.3
@@ -0,0 +1,109 @@
+.\" gd_mfield_list_by_type.3. The gd_mfield_list_by_type 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_mfield_list_by_type 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_mfield_list_by_type \(em retrieve a list of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_mfield_list_by_type(DIRFILE *" dirfile ,
+.BI "const char *" parent ", gd_entype_t " type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_mfield_list_by_type ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of names of the all metafields of the indicated
+type for the supplied parent field.
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+The
+.I type
+argument should be one of the following symbols indicating the desired field
+type:
+.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_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
+.BR GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_ENTRY .
+.ad n
+.hy
+.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 fields 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_mfield_list_by_type ()
+is called again with the same arguments, or until the array is de-allocated by a
+call to
+.BR gd_close (3).
+
+For
+.BR CONST ", " CARRAY ,
+and
+.B STRING
+field types, corresponding lists of values for may be obtained by calling
+.BR gd_mconstants (3)
+or
+.BR gd_mstrings (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_mfield_list_by_type ()
+returns a pointer to an array of strings containing the names of all the
+metafields of the specific type for the given parent. 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_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list_by_type (3),
+.BR gd_mconstants (3),
+.BR gd_mfield_list (3),
+.BR gd_mstrings (3),
+.BR gd_nmfields_by_type (3),
+.BR gd_open (3)
diff --git a/man/gd_move.3 b/man/gd_move.3
new file mode 100644
index 0000000..c0ebdd0
--- /dev/null
+++ b/man/gd_move.3
@@ -0,0 +1,127 @@
+.\" gd_move.3. The gd_move 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_move 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_move \(em move a dirfile field between format specification fragments
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_move(DIRFILE *" dirfile ", const char"
+.BI * field_code ", int " new_fragment ", int " move_data );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_move ()
+function transfers the field 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 index by
+.IR new_fragment .
+If the field is already defined in the fragment index by
+.IR new_fragment ,
+this function does nothing.
+
+If the flag
+.I move_data
+is non-zero, and
+.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
+.I move_data
+is zero, no changes will be made to the binary file. If
+.I field_code
+specifies a field of type other than
+.BR RAW ,
+the
+.I move_data
+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.
+
+.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.
+.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_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_RAW_IO
+An I/O error occurred while attempting to translate a binary file.
+.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)
diff --git a/man/gd_mstrings.3 b/man/gd_mstrings.3
new file mode 100644
index 0000000..407ca1f
--- /dev/null
+++ b/man/gd_mstrings.3
@@ -0,0 +1,95 @@
+.\" gd_mstrings.3. The gd_mstrings 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_mstrings 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_mstrings \(em retrieve a list of string values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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. 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)
diff --git a/man/gd_mvector_list.3 b/man/gd_mvector_list.3
new file mode 100644
index 0000000..d1875d7
--- /dev/null
+++ b/man/gd_mvector_list.3
@@ -0,0 +1,88 @@
+.\" gd_mvector_list.3. The gd_mvector_list 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_mvector_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_mvector_list \(em retrieve a list of vector fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_mvector_list(DIRFILE *" dirfile ,
+.BI "const char *" parent );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_mvector_list ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of names of the all vector type metafields for
+the specified parent field defined in the database
+.RI ( i.e.
+fields of types
+.BR BIT ,\~ LINCOM ,\~ LINTERP ,\~ MULTIPLY ,\~ PHASE ,\~ POLYNOM ,\~ RAW ,
+.BR SBIT ).
+
+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_nmvectors (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_mvector_list ()
+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_mvector_list ()
+returns a pointer to an array of strings containing the names of all the vector
+metafields for the given parent field. 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 (3),
+.BR gd_nmetavectors (3),
+.BR gd_vector_list (3)
diff --git a/man/gd_native_type.3 b/man/gd_native_type.3
new file mode 100644
index 0000000..a641e85
--- /dev/null
+++ b/man/gd_native_type.3
@@ -0,0 +1,156 @@
+.\" gd_native_type.3. The gd_native_type man page.
+.\"
+.\" Copyright (C) 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_native_type 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_native_type \(em returns the native data type of a field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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 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 SBIT \~Entry:
+.BR GD_INT64 ;
+.TP
+.BR STRING \~Entry:
+.BR GD_NULL .
+.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_NULL ,\~ GD_UINT8 ,\~ GD_INT8 ,\~ GD_UINT16 ,\~ GD_INT16 ,\~ GD_UINT32 ,
+.BR GD_INT32 ,\~ GD_FLOAT32 ,\~ GD_FLOAT64 ,\~ GD_COMPLEX64 ,\~ GD_COMPLEX128 .
+.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_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_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of its input fields, was not recognised.
+.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.
+.TP
+.B GD_E_OPEN_LINFILE
+An error occurred while trying to read a LINTERP table from disk.
+.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)
diff --git a/man/gd_nfields.3 b/man/gd_nfields.3
new file mode 100644
index 0000000..1e89a39
--- /dev/null
+++ b/man/gd_nfields.3
@@ -0,0 +1,63 @@
+.\" gd_nfields.3. The gd_nfields 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_nfields 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nfields \(em report the number of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_nfields(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nfields ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of fields defined in the database. Notably, this count
+does not include /META fields.
+
+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_nfields ()
+returns the number of defined fields 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_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 (3),
+.BR gd_nfields_by_type (3),
+.BR gd_nmfields (3),
+.BR gd_nvectors (3)
diff --git a/man/gd_nfields_by_type.3 b/man/gd_nfields_by_type.3
new file mode 100644
index 0000000..c6b9463
--- /dev/null
+++ b/man/gd_nfields_by_type.3
@@ -0,0 +1,77 @@
+.\" gd_nfields_by_type.3. The gd_nfields_by_type 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_nfields_by_type 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nfields_by_type \(em report the number of fields of a given type in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_nfields_by_type(DIRFILE *" dirfile ", gd_entype_t " type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nfields_by_type ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of fields of type
+.I type
+defined in the database. Notably, this count
+does not include /META fields.
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+The
+.I type
+argument should be one of the following symbols indicating the type of field 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_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ", " GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_ENTRY .
+.ad n
+.hy
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_nfields_by_type ()
+returns the number of defined fields 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_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_nfields (3),
+.BR gd_nmfields_by_type (3)
diff --git a/man/gd_nfragments.3 b/man/gd_nfragments.3
new file mode 100644
index 0000000..5712dd1
--- /dev/null
+++ b/man/gd_nfragments.3
@@ -0,0 +1,63 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_nframes.3 b/man/gd_nframes.3
new file mode 100644
index 0000000..9eeaae2
--- /dev/null
+++ b/man/gd_nframes.3
@@ -0,0 +1,86 @@
+.\" gd_nframes.3. The gd_nframes 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_nframes 3 "22 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nframes \(em report the size of a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_RAW_IO
+An attempt to
+.BR stat (2)
+the 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)
diff --git a/man/gd_nframes64.3 b/man/gd_nframes64.3
new file mode 100644
index 0000000..b505876
--- /dev/null
+++ b/man/gd_nframes64.3
@@ -0,0 +1,48 @@
+.\" gd_nframes64.3. The gd_nframes64 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_nframes64 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nframes64 \(em report the size of a dirfile with largefile support
+.SH SYNOPSIS
+.B #define _LARGEFILE64_SOURCE
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off64_t gd_nframes64(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_nframes (3)
+uses a 64-bit offset type, even if
+.I off_t
+is a 32-bit type. It is only available if one defines
+.IR _LARGEFILE64_SOURCE .
+If
+.I off_t
+is a 64-bit type (i.e. if
+.I _FILE_OFFSET_BITS
+is defined to be 64), this function will be called
+.BR gd_nframes ().
+Otherwise,
+.BR gd_nframes ()
+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)
diff --git a/man/gd_nmfields.3 b/man/gd_nmfields.3
new file mode 100644
index 0000000..d9c7a12
--- /dev/null
+++ b/man/gd_nmfields.3
@@ -0,0 +1,67 @@
+.\" gd_nmfields.3. The gd_nmfields 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_nmfields 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nmfields \(em report the number of metafields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_nmfields(DIRFILE *" dirfile ", const char *" parent );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nmfields ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of metafields defined in the database for the parent
+field specified by
+.IR parent .
+
+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_nmfields ()
+returns the number of defined metafields for the given parent. 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 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 (3),
+.BR gd_nfields (3),
+.BR gd_nmfields_by_type (3),
+.BR gd_nmvectors (3)
diff --git a/man/gd_nmfields_by_type.3 b/man/gd_nmfields_by_type.3
new file mode 100644
index 0000000..6600041
--- /dev/null
+++ b/man/gd_nmfields_by_type.3
@@ -0,0 +1,79 @@
+.\" gd_nmfields_by_type.3. The gd_nmfields_by_type 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_nmfields_by_type 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nmfields_by_type \(em report the number of fields of a given type in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_nmfields_by_type(DIRFILE *" dirfile ,
+.BI "const char *" parent ", gd_entype_t " type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nmfields_by_type ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of metafields defined in the database for the supplied
+parent field.
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+The
+.I type
+argument should be one of the following symbols indicating the type of field 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_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
+.BR GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_ENTRY .
+.ad n
+.hy
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_nmfields_by_type ()
+returns the number of defined metafields for the given parent. 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 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 (3),
+.BR gd_nfields_by_type (3)
diff --git a/man/gd_nmvectors.3 b/man/gd_nmvectors.3
new file mode 100644
index 0000000..aee9fc1
--- /dev/null
+++ b/man/gd_nmvectors.3
@@ -0,0 +1,68 @@
+.\" gd_nmvectors.3. The gd_nmvectors 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_nmvectors 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nmvectors \(em report the number of vector fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_nmvectors(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nmvectors ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of vector metafields defined in the database
+.RI ( i.e.
+fields of types
+.BR BIT ", " LINCOM ", " LINTERP ", " MULTIPLY ", " PHASE ", and " RAW ) for
+the supplied parent field.
+
+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_nmvectors ()
+returns the number of vector metafields in the dirfile for the given parent. 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 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_mvector_list (3),
+.BR gd_nmfields (3),
+.BR gd_nvectors (3)
diff --git a/man/gd_nvectors.3 b/man/gd_nvectors.3
new file mode 100644
index 0000000..bf28ee0
--- /dev/null
+++ b/man/gd_nvectors.3
@@ -0,0 +1,67 @@
+.\" gd_nvectors.3. The gd_nvectors 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_nvectors 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nvectors \(em report the number of vector fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_nvectors(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nvectors ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of vector fields defined in the database
+.RI ( i.e.
+fields of types
+.BR BIT ,\~ LINCOM ,\~ LINTERP ,\~ MULTIPLY ,\~ PHASE ,\~ POLYNOM ,\~ RAW ,
+.BR SBIT ).
+Notably, this count
+does not include /META fields.
+
+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_nvectors ()
+returns the number of vector fields 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_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_nfields (3),
+.BR gd_nmvectors (3),
+.BR gd_vector_list (3)
diff --git a/man/gd_parent_fragment.3 b/man/gd_parent_fragment.3
new file mode 100644
index 0000000..30afa5e
--- /dev/null
+++ b/man/gd_parent_fragment.3
@@ -0,0 +1,66 @@
+.\" gd_parent_fragment.3. The gd_parent_fragment 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_parent_fragment 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_parent_fragment \(em retrieve the parent fragment of a fragment in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_parent_fragment(const 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)
diff --git a/man/gd_parser_callback.3 b/man/gd_parser_callback.3
new file mode 100644
index 0000000..a64c02c
--- /dev/null
+++ b/man/gd_parser_callback.3
@@ -0,0 +1,57 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_protection.3 b/man/gd_protection.3
new file mode 100644
index 0000000..c2a61c2
--- /dev/null
+++ b/man/gd_protection.3
@@ -0,0 +1,70 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_put_carray_slice.3 b/man/gd_put_carray_slice.3
new file mode 100644
index 0000000..a8a4a18
--- /dev/null
+++ b/man/gd_put_carray_slice.3
@@ -0,0 +1,186 @@
+.\" gd_put_carray_slice.3. The gd_put_carray_slice 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_put_carray_slice 3 "4 Novmeber 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_put_carray gd_put_carray_slice \(em write CARRAY data to a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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 );
+.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. These
+interface cannot write to field represetations.
+
+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 the
+.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
+.I GD_UINT8
+unsigned 8-bit integer
+.TP
+.I GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.I GD_UINT16
+unsigned 16-bit integer
+.TP
+.I GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.I GD_UINT32
+unsigned 32-bit integer
+.TP
+.I GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.I GD_UINT64
+unsigned 64-bit integer
+.TP
+.I GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.IR GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.IR GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.IR GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.IR GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.RE
+
+The type of the input data need not be the same as the
+.B CARRAY
+storage type. 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 ()
+and
+.BR gd_put_carray_slice ()
+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_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 a type other than
+.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_REPR
+A representation suffix in the field definition was invalid, or an attempt was
+made to write to a representation, instead of the underlying field.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I data_type
+was specified.
+.TP
+.B GE_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_carray_slice (3),
+.BR gd_open (3),
+.BR gd_put_constant (3)
diff --git a/man/gd_put_constant.3 b/man/gd_put_constant.3
new file mode 100644
index 0000000..8fbc6ff
--- /dev/null
+++ b/man/gd_put_constant.3
@@ -0,0 +1,159 @@
+.\" gd_put_constant.3. The gd_put_constant 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_put_constant 3 "4 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_put_constant \(em retrieve a scalar constant from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.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_constant ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and sets the
+.B CONST
+scalar
+.I field_code ,
+which may not contain a representation suffix, to the value specified in
+.IR data_in ,
+which should be of the type indicated by
+.IR data_type .
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The
+.I data_type
+argument should be one of the following symbols, which indicates the desired
+return type of the data:
+.RS
+.TP 11
+.I GD_UINT8
+unsigned 8-bit integer
+.TP
+.I GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.I GD_UINT16
+unsigned 16-bit integer
+.TP
+.I GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.I GD_UINT32
+unsigned 32-bit integer
+.TP
+.I GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.I GD_UINT64
+unsigned 64-bit integer
+.TP
+.I GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.IR GD_FLOAT32 \~or\~ GD_FLOAT
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.IR GD_FLOAT64 \~or\~ GD_DOUBLE
+IEEE-754 standard 64-bit double precision floating point number
+.RE
+
+The data type of the supplied value need not be the same as the type of the
+storage type of the constant in the database. Type conversion will be performed
+as necessary to return the requested type. The argument
+.I data_out
+must point to valid data type of the specified type.
+
+Because constant 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_constant ()
+returns zero. On error, it returns -1 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 CONST .
+The caller should use
+.BR gd_putdata "(3), " gd_put_carray (3),
+or
+.BR gd_put_string (3)
+instead.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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 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_metaflush (3),
+.BR gd_get_constant (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_open (3),
+.BR gd_put_carray (3),
+.BR gd_put_string (3),
+.BR gd_putdata (3)
diff --git a/man/gd_put_string.3 b/man/gd_put_string.3
new file mode 100644
index 0000000..f620f80
--- /dev/null
+++ b/man/gd_put_string.3
@@ -0,0 +1,107 @@
+.\" gd_put_string.3. The gd_put_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_put_string 3 "25 May 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_put_string \(em retrieve a string from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_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),
+or
+.BR gd_put_constant (3)
+instead.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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)
diff --git a/man/gd_putdata.3 b/man/gd_putdata.3
new file mode 100644
index 0000000..5e54f86
--- /dev/null
+++ b/man/gd_putdata.3
@@ -0,0 +1,226 @@
+.\" gd_putdata.3. The gd_putdata 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_putdata 3 "4 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_putdata \(em write data to a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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).
+
+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.
+
+The
+.I data_type
+argument should be one of the following symbols, which indicates the type of
+the input data:
+.RS
+.TP 11
+.I GD_UINT8
+unsigned 8-bit integer
+.TP
+.I GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.I GD_UINT16
+unsigned 16-bit integer
+.TP
+.I GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.I GD_UINT32
+unsigned 32-bit integer
+.TP
+.I GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.I GD_UINT64
+unsigned 64-bit integer
+.TP
+.I GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.IR GD_FLOAT32 \~or\~ GD_FLOAT
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.IR GD_FLOAT64 \~or\~ GD_DOUBLE
+IEEE-754 standard 64-bit double precision floating point 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.
+.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,
+.BR gd_putdata ()
+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_REPR
+The representation suffix specified in
+.I field_code
+was not recognised, or an attempt was made to write to a field representation,
+instead of the underlying field.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I data_type
+was specified.
+.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_OPEN_LINFILE
+An error occurred while trying to read a LINTERP table from disk.
+.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_RAW_IO
+An error occurred while trying to open, read from, or write to 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_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.
+.RE
+.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_spf (3)
diff --git a/man/gd_putdata64.3 b/man/gd_putdata64.3
new file mode 100644
index 0000000..d0e13a8
--- /dev/null
+++ b/man/gd_putdata64.3
@@ -0,0 +1,50 @@
+.\" gd_putdata64.3. The gd_putdata64 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_putdata64 3 "25 May 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_putdata64 \(em write data to a dirfile database with largefile support
+.SH SYNOPSIS
+.B #define _LARGEFILE64_SOURCE
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_putdata64(DIRFILE *" dirfile ", const char *" field_code ", off64_t"
+.IB first_frame ", off64_t " first_sample ", size_t " num_frames ", size_t"
+.IB num_samples ", gd_type_t " data_type ", const void *" data_out );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_putdata (3)
+uses a 64-bit offset type, even if
+.I off_t
+is a 32-bit type. It is only available if one defines
+.IR _LARGEFILE64_SOURCE .
+If
+.I off_t
+is a 64-bit type (i.e. if
+.I _FILE_OFFSET_BITS
+is defined to be 64), this function will be called
+.BR gd_putdata ().
+Otherwise,
+.BR gd_putdata ()
+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)
diff --git a/man/gd_raw_filename.3 b/man/gd_raw_filename.3
new file mode 100644
index 0000000..ae3a8f8
--- /dev/null
+++ b/man/gd_raw_filename.3
@@ -0,0 +1,86 @@
+.\" gd_raw_filename.3. The gd_raw_filename 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_raw_filename 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_raw_filename \(em retrieve the pathname of a binary file in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char *gd_raw_filename(DIRFILE *" dirfile ", const char"
+.BI * field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_raw_filename ()
+function retrieves 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. 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_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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)
diff --git a/man/gd_reference.3 b/man/gd_reference.3
new file mode 100644
index 0000000..0227d17
--- /dev/null
+++ b/man/gd_reference.3
@@ -0,0 +1,93 @@
+.\" 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 <getdata.h>
+.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)
diff --git a/man/gd_rename.3 b/man/gd_rename.3
new file mode 100644
index 0000000..94d5e4f
--- /dev/null
+++ b/man/gd_rename.3
@@ -0,0 +1,122 @@
+.\" gd_rename.3. The gd_rename 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_rename 3 "20 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_rename \(em change the name of a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_rename(DIRFILE *" dirfile ", const char"
+.BI * old_code ", const char *" new_name ", int " move_data );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_rename ()
+function changes the name of the field 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.
+
+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 the flag
+.I move_data
+is non-zero, and
+.I old_code
+specifies a
+.B RAW
+field, the binary file associated with the field will be renamed as well.
+If
+.I move_data
+is zero, no changes will be made to the binary file. If
+.I field_code
+specifies a field of type other than
+.BR RAW ,
+the
+.I move_data
+flag is ignored.
+
+.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.
+.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_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_DUPLICATE
+The new name specified is already in use by another field.
+.TP
+.B GD_E_PROTECTED
+The metadata of the format specification fragment containing the field was
+protected from change, or the binary data of the fragments was protected from
+change and binary file translation was requested.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while attempting to rename the binary file.
+.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)
diff --git a/man/gd_rewrite_fragment.3 b/man/gd_rewrite_fragment.3
new file mode 100644
index 0000000..429a590
--- /dev/null
+++ b/man/gd_rewrite_fragment.3
@@ -0,0 +1,88 @@
+.\" gd_rewrite_fragment.3. The gd_rewrite_fragment 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_rewrite_fragment 3 "22 March 2011" "Version 0.7.2" "GETDATA"
+.SH NAME
+gd_rewrite_fragment \(em re-write a dirfile format specification fragment
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_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_FLUSH
+A temporary file could not be opened into which to write the modified metadata,
+or renaming the temporary file over the original fragment failed.
+.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 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)
+
diff --git a/man/gd_spf.3 b/man/gd_spf.3
new file mode 100644
index 0000000..af814a1
--- /dev/null
+++ b/man/gd_spf.3
@@ -0,0 +1,89 @@
+.\" gd_spf.3. The gd_spf 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_spf 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_spf \(em returns the samples per frame for a field in a
+dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_spf_t 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
+.IR gd_spf_t
+type is an unsigned 16-bit integer 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
+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_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_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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)
diff --git a/man/gd_strings.3 b/man/gd_strings.3
new file mode 100644
index 0000000..51a2c53
--- /dev/null
+++ b/man/gd_strings.3
@@ -0,0 +1,94 @@
+.\" gd_strings.3. The gd_strings 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_strings 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_strings \(em retrieve a list of string values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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. If no strings 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.
+.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)
diff --git a/man/gd_uninclude.3 b/man/gd_uninclude.3
new file mode 100644
index 0000000..d29311f
--- /dev/null
+++ b/man/gd_uninclude.3
@@ -0,0 +1,123 @@
+.\" gd_uninclude.3. The gd_uninclude 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_uninclude 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_uninclude \(em remove a format specification fragment from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_FLUSH
+A temporary file could not be opened into which to write the metadata of a
+modified, removed fragment, or renaming the temporary file over the original
+fragment failed.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment which included the removed fragment was protected
+from change.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to flush or close a removed 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).
+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)
diff --git a/man/gd_validate.3 b/man/gd_validate.3
new file mode 100644
index 0000000..f3dfe66
--- /dev/null
+++ b/man/gd_validate.3
@@ -0,0 +1,95 @@
+.\" gd_validate.3. The gd_validate man page.
+.\"
+.\" Copyright (C) 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_validate 3 "3 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_validate \(em check a dirfile field code for validity
+.SH SYNOPSIS
+.B #include <getdata.h>
+.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_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.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.
+.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 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)
diff --git a/man/gd_vector_list.3 b/man/gd_vector_list.3
new file mode 100644
index 0000000..a0856b8
--- /dev/null
+++ b/man/gd_vector_list.3
@@ -0,0 +1,85 @@
+.\" gd_vector_list.3. The gd_vector_list 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_vector_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_vector_list \(em retrieve a list of vector fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_vector_list(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_vector_list ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of names of the all vector type fields defined in
+the database
+.RI ( i.e.
+fields of types
+.BR BIT ,\~ LINCOM ,\~ LINTERP ,\~ MULTIPLY ,\~ PHASE ,\~ POLYNOM ,\~ RAW ,
+.BR SBIT ).
+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. The array is terminated by a NULL
+pointer. The number of strings in the array can be obtained from a call to
+.BR gd_nvectors (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_vector_list ()
+is called again on the same DIRFILE object, or until the array is de-allocated by
+a call to
+.BR gd_close (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_vector_list ()
+returns a pointer to an array of strings containing the names of all the vector
+fields defined in the dirfile database. 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 (3),
+.BR gd_mvector_list (3),
+.BR gd_nvectors (3)
diff --git a/missing b/missing
new file mode 100755
index 0000000..28055d2
--- /dev/null
+++ b/missing
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 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 <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake at gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar*)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar*)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..e368196
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,143 @@
+# 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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CC_WALL
+WALL=-Wall
+endif
+
+if CC_WEXTRA
+WEXTRA=-Wextra
+endif
+
+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_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_MODULES
+EXPORT_DYNAMIC=-export-dynamic
+DGETDATA_MODULEDIR=-DGETDATA_MODULEDIR="\"$(moduledir)\""
+else
+EXTERNAL_CPPFLAGS=$(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \
+ $(LZMA_CPPFLAGS)
+EXTERNAL_LDFLAGS=$(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \
+ $(LZMA_LDFLAGS)
+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 = ${WALL} ${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 = ${LIBGETDATASLIM_LA} ${LIBGETDATAGZIP_LA} \
+ ${LIBGETDATABZIP2_LA} ${LIBGETDATALZMA_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 flimits.c flush.c \
+ fragment.c getdata.c globals.c ${GZIP_C} index.c \
+ include.c ${LEGACY_C} ${LZMA_C} meta_list.c mod.c \
+ move.c name.c native.c nfields.c nframes.c nmeta.c \
+ open.c parse.c protect.c putdata.c raw.c ${SLIM_C} \
+ spf.c string.c types.c ${GETDATA_LEGACY_H} internal.h \
+ nan.h
+libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \
+ -version-info \
+ ${GETDATA_IFACE_VERSION}:${GETDATA_IMPL_REVISION}:${GETDATA_IFACE_AGE} \
+ $(EXTERNAL_LDFLAGS)
+libgetdata_la_LIBADD = $(LIBLTDL) $(DLOPEN_LIBGETDATASLIM_LA) \
+ $(DLOPEN_LIBGETDATAGZIP_LA) \
+ $(DLOPEN_LIBGETDATABZIP2_LA) $(DLOPEN_LIBGETDATALZMA_LA)
+
+libgetdataslim_la_SOURCES = slim.c ${DEBUG_C}
+libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \
+ -module
+libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS)
+
+libgetdatagzip_la_SOURCES = gzip.c ${DEBUG_C}
+libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) -module
+libgetdatagzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(GZIP_CPPFLAGS)
+
+libgetdatabzip2_la_SOURCES = bzip.c ${DEBUG_C}
+libgetdatabzip2_la_LDFLAGS = $(BZIP2_LDFLAGS) -release $(PACKAGE_VERSION) \
+ -module
+libgetdatabzip2_la_CPPFLAGS = $(AM_CPPFLAGS) $(BZIP2_CPPFLAGS)
+
+libgetdatalzma_la_SOURCES = lzma.c ${DEBUG_C}
+libgetdatalzma_la_LDFLAGS = $(LZMA_LDFLAGS) -release $(PACKAGE_VERSION) \
+ -module
+libgetdatalzma_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZMA_CPPFLAGS)
+
+clean-local:
+ rm -rf *~ getdata.pc
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..8560856
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,1029 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src
+DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/getdata.h.in $(srcdir)/getdata.pc.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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 = config.h getdata.h
+CONFIG_CLEAN_FILES = getdata.ah 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__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(moduledir)" \
+ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" \
+ "$(DESTDIR)$(includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES) $(module_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at am__DEPENDENCIES_2 = \
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE@ libgetdataslim.la
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at am__DEPENDENCIES_3 = \
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE@ libgetdatagzip.la
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE at am__DEPENDENCIES_4 = \
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE@ libgetdatabzip2.la
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE at am__DEPENDENCIES_5 = \
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE@ libgetdatalzma.la
+libgetdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5)
+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 flimits.c flush.c fragment.c getdata.c \
+ globals.c gzip.c index.c include.c legacy.c lzma.c meta_list.c \
+ mod.c move.c name.c native.c nfields.c nframes.c nmeta.c \
+ open.c parse.c protect.c putdata.c raw.c slim.c spf.c string.c \
+ types.c getdata_legacy.h internal.h nan.h
+ at USE_BZIP2_TRUE@@USE_MODULES_FALSE at am__objects_1 = bzip.lo
+ at GETDATA_DEBUG_TRUE@am__objects_2 = debug.lo
+ at USE_GZIP_TRUE@@USE_MODULES_FALSE at am__objects_3 = gzip.lo
+ at INCLUDE_LEGACY_API_TRUE@am__objects_4 = legacy.lo
+ at USE_LZMA_TRUE@@USE_MODULES_FALSE at am__objects_5 = lzma.lo
+ at USE_MODULES_FALSE@@USE_SLIM_TRUE at am__objects_6 = slim.lo
+am__objects_7 =
+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 \
+ flimits.lo flush.lo fragment.lo getdata.lo globals.lo \
+ $(am__objects_3) index.lo include.lo $(am__objects_4) \
+ $(am__objects_5) meta_list.lo mod.lo move.lo name.lo native.lo \
+ nfields.lo nframes.lo nmeta.lo open.lo parse.lo protect.lo \
+ putdata.lo raw.lo $(am__objects_6) spf.lo string.lo types.lo \
+ $(am__objects_7)
+libgetdata_la_OBJECTS = $(am_libgetdata_la_OBJECTS)
+libgetdata_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libgetdata_la_LDFLAGS) $(LDFLAGS) -o $@
+libgetdatabzip2_la_LIBADD =
+am__libgetdatabzip2_la_SOURCES_DIST = bzip.c debug.c
+ at GETDATA_DEBUG_TRUE@am__objects_8 = libgetdatabzip2_la-debug.lo
+am_libgetdatabzip2_la_OBJECTS = libgetdatabzip2_la-bzip.lo \
+ $(am__objects_8)
+libgetdatabzip2_la_OBJECTS = $(am_libgetdatabzip2_la_OBJECTS)
+libgetdatabzip2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libgetdatabzip2_la_LDFLAGS) $(LDFLAGS) -o $@
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE at am_libgetdatabzip2_la_rpath = \
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE@ -rpath $(moduledir)
+libgetdatagzip_la_LIBADD =
+am__libgetdatagzip_la_SOURCES_DIST = gzip.c debug.c
+ at GETDATA_DEBUG_TRUE@am__objects_9 = libgetdatagzip_la-debug.lo
+am_libgetdatagzip_la_OBJECTS = libgetdatagzip_la-gzip.lo \
+ $(am__objects_9)
+libgetdatagzip_la_OBJECTS = $(am_libgetdatagzip_la_OBJECTS)
+libgetdatagzip_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libgetdatagzip_la_LDFLAGS) $(LDFLAGS) -o $@
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at am_libgetdatagzip_la_rpath = -rpath \
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE@ $(moduledir)
+libgetdatalzma_la_LIBADD =
+am__libgetdatalzma_la_SOURCES_DIST = lzma.c debug.c
+ at GETDATA_DEBUG_TRUE@am__objects_10 = libgetdatalzma_la-debug.lo
+am_libgetdatalzma_la_OBJECTS = libgetdatalzma_la-lzma.lo \
+ $(am__objects_10)
+libgetdatalzma_la_OBJECTS = $(am_libgetdatalzma_la_OBJECTS)
+libgetdatalzma_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libgetdatalzma_la_LDFLAGS) $(LDFLAGS) -o $@
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE at am_libgetdatalzma_la_rpath = -rpath \
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE@ $(moduledir)
+libgetdataslim_la_LIBADD =
+am__libgetdataslim_la_SOURCES_DIST = slim.c debug.c
+ at GETDATA_DEBUG_TRUE@am__objects_11 = libgetdataslim_la-debug.lo
+am_libgetdataslim_la_OBJECTS = libgetdataslim_la-slim.lo \
+ $(am__objects_11)
+libgetdataslim_la_OBJECTS = $(am_libgetdataslim_la_OBJECTS)
+libgetdataslim_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libgetdataslim_la_LDFLAGS) $(LDFLAGS) -o $@
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at am_libgetdataslim_la_rpath = -rpath \
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE@ $(moduledir)
+DEFAULT_INCLUDES = -I. at 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libgetdata_la_SOURCES) $(libgetdatabzip2_la_SOURCES) \
+ $(libgetdatagzip_la_SOURCES) $(libgetdatalzma_la_SOURCES) \
+ $(libgetdataslim_la_SOURCES)
+DIST_SOURCES = $(am__libgetdata_la_SOURCES_DIST) \
+ $(am__libgetdatabzip2_la_SOURCES_DIST) \
+ $(am__libgetdatagzip_la_SOURCES_DIST) \
+ $(am__libgetdatalzma_la_SOURCES_DIST) \
+ $(am__libgetdataslim_la_SOURCES_DIST)
+DATA = $(pkgconfig_DATA)
+am__include_HEADERS_DIST = getdata_legacy.h
+HEADERS = $(include_HEADERS) $(nodist_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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-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
+#
+AUTOMAKE_OPTIONS = foreign
+ at CC_WALL_TRUE@WALL = -Wall
+ at CC_WEXTRA_TRUE@WEXTRA = -Wextra
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at LIBGETDATASLIM_LA = libgetdataslim.la
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at DLOPEN_LIBGETDATASLIM_LA = -dlopen libgetdataslim.la
+ at USE_MODULES_FALSE@@USE_SLIM_TRUE at SLIM_C = slim.c
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at LIBGETDATAGZIP_LA = libgetdatagzip.la
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATAGZIP_LA = -dlopen libgetdatagzip.la
+ at USE_GZIP_TRUE@@USE_MODULES_FALSE at GZIP_C = gzip.c
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE at LIBGETDATABZIP2_LA = libgetdatabzip2.la
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATABZIP2_LA = -dlopen libgetdatabzip2.la
+ at USE_BZIP2_TRUE@@USE_MODULES_FALSE at BZIP2_C = bzip.c
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE at LIBGETDATALZMA_LA = libgetdatalzma.la
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATALZMA_LA = -dlopen libgetdatalzma.la
+ at USE_LZMA_TRUE@@USE_MODULES_FALSE at LZMA_C = lzma.c
+ at USE_MODULES_TRUE@EXPORT_DYNAMIC = -export-dynamic
+ at USE_MODULES_TRUE@DGETDATA_MODULEDIR = -DGETDATA_MODULEDIR="\"$(moduledir)\""
+ at USE_MODULES_FALSE@EXTERNAL_CPPFLAGS = $(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \
+ at USE_MODULES_FALSE@ $(LZMA_CPPFLAGS)
+
+ at USE_MODULES_FALSE@EXTERNAL_LDFLAGS = $(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \
+ at USE_MODULES_FALSE@ $(LZMA_LDFLAGS)
+
+ at INCLUDE_LEGACY_API_TRUE@LEGACY_C = legacy.c
+ at INCLUDE_LEGACY_API_TRUE@GETDATA_LEGACY_H = getdata_legacy.h
+ at GETDATA_DEBUG_TRUE@DEBUG_C = debug.c
+pkgconfigdir = @libdir@/pkgconfig
+AM_CFLAGS = ${WALL} ${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 = ${LIBGETDATASLIM_LA} ${LIBGETDATAGZIP_LA} \
+ ${LIBGETDATABZIP2_LA} ${LIBGETDATALZMA_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 flimits.c flush.c \
+ fragment.c getdata.c globals.c ${GZIP_C} index.c \
+ include.c ${LEGACY_C} ${LZMA_C} meta_list.c mod.c \
+ move.c name.c native.c nfields.c nframes.c nmeta.c \
+ open.c parse.c protect.c putdata.c raw.c ${SLIM_C} \
+ spf.c string.c types.c ${GETDATA_LEGACY_H} internal.h \
+ nan.h
+
+libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \
+ -version-info \
+ ${GETDATA_IFACE_VERSION}:${GETDATA_IMPL_REVISION}:${GETDATA_IFACE_AGE} \
+ $(EXTERNAL_LDFLAGS)
+
+libgetdata_la_LIBADD = $(LIBLTDL) $(DLOPEN_LIBGETDATASLIM_LA) \
+ $(DLOPEN_LIBGETDATAGZIP_LA) \
+ $(DLOPEN_LIBGETDATABZIP2_LA) $(DLOPEN_LIBGETDATALZMA_LA)
+
+libgetdataslim_la_SOURCES = slim.c ${DEBUG_C}
+libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \
+ -module
+
+libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS)
+libgetdatagzip_la_SOURCES = gzip.c ${DEBUG_C}
+libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) -module
+libgetdatagzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(GZIP_CPPFLAGS)
+libgetdatabzip2_la_SOURCES = bzip.c ${DEBUG_C}
+libgetdatabzip2_la_LDFLAGS = $(BZIP2_LDFLAGS) -release $(PACKAGE_VERSION) \
+ -module
+
+libgetdatabzip2_la_CPPFLAGS = $(AM_CPPFLAGS) $(BZIP2_CPPFLAGS)
+libgetdatalzma_la_SOURCES = lzma.c ${DEBUG_C}
+libgetdatalzma_la_LDFLAGS = $(LZMA_LDFLAGS) -release $(PACKAGE_VERSION) \
+ -module
+
+libgetdatalzma_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZMA_CPPFLAGS)
+all: $(BUILT_SOURCES) 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):
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status src/config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+getdata.h: stamp-h2
+ @if test ! -f $@; then \
+ rm -f stamp-h2; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h2; \
+ else :; fi
+
+stamp-h2: getdata.ah $(top_builddir)/config.status
+ @rm -f stamp-h2
+ cd $(top_builddir) && $(SHELL) ./config.status src/getdata.h
+
+distclean-hdr:
+ -rm -f config.h stamp-h1 getdata.h stamp-h2
+getdata.ah: $(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)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+install-moduleLTLIBRARIES: $(module_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(moduledir)" || $(MKDIR_P) "$(DESTDIR)$(moduledir)"
+ @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 " $(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)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libgetdata.la: $(libgetdata_la_OBJECTS) $(libgetdata_la_DEPENDENCIES)
+ $(libgetdata_la_LINK) -rpath $(libdir) $(libgetdata_la_OBJECTS) $(libgetdata_la_LIBADD) $(LIBS)
+libgetdatabzip2.la: $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_DEPENDENCIES)
+ $(libgetdatabzip2_la_LINK) $(am_libgetdatabzip2_la_rpath) $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_LIBADD) $(LIBS)
+libgetdatagzip.la: $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_DEPENDENCIES)
+ $(libgetdatagzip_la_LINK) $(am_libgetdatagzip_la_rpath) $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_LIBADD) $(LIBS)
+libgetdatalzma.la: $(libgetdatalzma_la_OBJECTS) $(libgetdatalzma_la_DEPENDENCIES)
+ $(libgetdatalzma_la_LINK) $(am_libgetdatalzma_la_rpath) $(libgetdatalzma_la_OBJECTS) $(libgetdatalzma_la_LIBADD) $(LIBS)
+libgetdataslim.la: $(libgetdataslim_la_OBJECTS) $(libgetdataslim_la_DEPENDENCIES)
+ $(libgetdataslim_la_LINK) $(am_libgetdataslim_la_rpath) $(libgetdataslim_la_OBJECTS) $(libgetdataslim_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/common.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/compat.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/constant.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encoding.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/errors.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/field_list.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flimits.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getdata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/globals.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatabzip2_la-bzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatabzip2_la-debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatagzip_la-debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatagzip_la-gzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatalzma_la-debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatalzma_la-lzma.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdataslim_la-debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdataslim_la-slim.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/meta_list.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/putdata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/raw.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/string.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/types.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libgetdatabzip2_la-bzip.lo: bzip.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --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
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdatabzip2_la-bzip.Tpo $(DEPDIR)/libgetdatabzip2_la-bzip.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bzip.c' object='libgetdatabzip2_la-bzip.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --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
+
+libgetdatabzip2_la-debug.lo: debug.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatabzip2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatabzip2_la-debug.lo -MD -MP -MF $(DEPDIR)/libgetdatabzip2_la-debug.Tpo -c -o libgetdatabzip2_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdatabzip2_la-debug.Tpo $(DEPDIR)/libgetdatabzip2_la-debug.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debug.c' object='libgetdatabzip2_la-debug.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatabzip2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatabzip2_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+
+libgetdatagzip_la-gzip.lo: gzip.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --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
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdatagzip_la-gzip.Tpo $(DEPDIR)/libgetdatagzip_la-gzip.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gzip.c' object='libgetdatagzip_la-gzip.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --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
+
+libgetdatagzip_la-debug.lo: debug.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatagzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatagzip_la-debug.lo -MD -MP -MF $(DEPDIR)/libgetdatagzip_la-debug.Tpo -c -o libgetdatagzip_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdatagzip_la-debug.Tpo $(DEPDIR)/libgetdatagzip_la-debug.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debug.c' object='libgetdatagzip_la-debug.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatagzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatagzip_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+
+libgetdatalzma_la-lzma.lo: lzma.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --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
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdatalzma_la-lzma.Tpo $(DEPDIR)/libgetdatalzma_la-lzma.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lzma.c' object='libgetdatalzma_la-lzma.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --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
+
+libgetdatalzma_la-debug.lo: debug.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatalzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatalzma_la-debug.lo -MD -MP -MF $(DEPDIR)/libgetdatalzma_la-debug.Tpo -c -o libgetdatalzma_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdatalzma_la-debug.Tpo $(DEPDIR)/libgetdatalzma_la-debug.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debug.c' object='libgetdatalzma_la-debug.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatalzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatalzma_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+
+libgetdataslim_la-slim.lo: slim.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --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
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdataslim_la-slim.Tpo $(DEPDIR)/libgetdataslim_la-slim.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slim.c' object='libgetdataslim_la-slim.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --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
+
+libgetdataslim_la-debug.lo: debug.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdataslim_la-debug.lo -MD -MP -MF $(DEPDIR)/libgetdataslim_la-debug.Tpo -c -o libgetdataslim_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgetdataslim_la-debug.Tpo $(DEPDIR)/libgetdataslim_la-debug.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debug.c' object='libgetdataslim_la-debug.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdataslim_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(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|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(includedir)" && rm -f $$files
+install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+ @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(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|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(includedir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) config.h.in getdata.ah $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in getdata.ah $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) config.h.in getdata.ah $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) config.h.in getdata.ah $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) 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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ at INCLUDE_LEGACY_API_FALSE@install-data-hook:
+ at 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 all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool clean-local \
+ clean-moduleLTLIBRARIES ctags distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-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 uninstall uninstall-am uninstall-hook \
+ uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+ uninstall-moduleLTLIBRARIES uninstall-nodist_includeHEADERS \
+ uninstall-pkgconfigDATA
+
+
+ at INCLUDE_LEGACY_API_TRUE@install-data-hook:
+ at INCLUDE_LEGACY_API_TRUE@ cd $(DESTDIR)$(includedir) && \
+ at INCLUDE_LEGACY_API_TRUE@ $(LN_S) -f getdata.h getdata_struct.h
+
+ at INCLUDE_LEGACY_API_TRUE@uninstall-hook:
+ at INCLUDE_LEGACY_API_TRUE@ cd $(DESTDIR)$(includedir) && rm -rf getdata_struct.h
+
+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:
diff --git a/src/add.c b/src/add.c
new file mode 100644
index 0000000..0237f3b
--- /dev/null
+++ b/src/add.c
@@ -0,0 +1,1809 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+
+/* add an entry */
+static int _GD_Add(DIRFILE* D, const gd_entry_t* entry, const char* parent)
+{
+ char temp_buffer[FILENAME_MAX];
+ int i, is_dot;
+ int copy_scalar[GD_MAX_POLYORD + 1];
+ void* new_list;
+ void* new_ref = NULL;
+ unsigned int u;
+ gd_entry_t* E;
+ gd_entry_t* P = NULL;
+
+ dtrace("%p, %p, \"%s\"", D, entry, parent);
+
+ memset(copy_scalar, 0, sizeof(int) * (GD_MAX_POLYORD + 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 include index out of range */
+ if (P == 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("%i", -1);
+ return -1;
+ }
+
+ /* check protection */
+ if (D->fragment[entry->fragment_index].protection & GD_PROTECT_FORMAT) {
+ _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+ D->fragment[entry->fragment_index].cname);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* check parent */
+ if (parent != NULL) {
+ /* make sure it's not a meta field already */
+ if (strchr(parent, '/') != NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ P = _GD_FindField(D, parent, D->entry, D->n_entries, NULL);
+ if (P == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ snprintf(temp_buffer, FILENAME_MAX, "%s/%s", parent, entry->field);
+ } else
+ snprintf(temp_buffer, FILENAME_MAX, "%s", entry->field);
+
+ /* check for duplicate field */
+ E = _GD_FindField(D, temp_buffer, D->entry, D->n_entries, &u);
+
+ if (E != NULL) { /* matched */
+ _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, temp_buffer);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* check for bad field type */
+ if (entry->field_type != GD_RAW_ENTRY &&
+ entry->field_type != GD_LINCOM_ENTRY &&
+ entry->field_type != GD_LINTERP_ENTRY &&
+ entry->field_type != GD_BIT_ENTRY &&
+ entry->field_type != GD_MULTIPLY_ENTRY &&
+ entry->field_type != GD_PHASE_ENTRY &&
+ entry->field_type != GD_CONST_ENTRY &&
+ entry->field_type != GD_POLYNOM_ENTRY &&
+ entry->field_type != GD_SBIT_ENTRY &&
+ entry->field_type != GD_DIVIDE_ENTRY &&
+ entry->field_type != GD_RECIP_ENTRY &&
+ entry->field_type != GD_CARRAY_ENTRY &&
+ entry->field_type != GD_STRING_ENTRY)
+ {
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_TYPE, NULL,
+ entry->field_type, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* New entry */
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+ if (P)
+ E->fragment_index = P->fragment_index;
+ else
+ E->fragment_index = entry->fragment_index;
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(E);
+ dreturn("%i", -1);
+ return -1;
+ }
+ memset(E->e, 0, sizeof(struct _gd_private_entry));
+ E->e->calculated = 0;
+
+ /* Validate field code */
+ E->field_type = entry->field_type;
+ E->field = _GD_ValidateField(P, entry->field, D->standards, 1, &is_dot);
+
+ if (E->field == entry->field) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, entry->field);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%i", -1);
+ return -1;
+ } else if (E->field == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Set meta indicies */
+ if (parent != 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 (parent != NULL) {
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_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);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ E->EN(raw,data_type) = entry->EN(raw,data_type);
+ E->e->u.raw.file[0].fp = E->e->u.raw.file[1].fp = -1;
+ E->e->u.raw.file[0].encoding = GD_ENC_UNKNOWN;
+
+ if ((E->e->u.raw.filebase = (char *)malloc(FILENAME_MAX)) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+
+ snprintf(E->e->u.raw.filebase, FILENAME_MAX, "%s/%s",
+ D->fragment[E->fragment_index].sname ?
+ D->fragment[E->fragment_index].sname : D->name, E->field);
+
+ if ((E->EN(raw,spf) = entry->EN(raw,spf)) == 0)
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_SPF, NULL,
+ entry->EN(raw,spf), 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_Supports(D, E, GD_EF_TOUCH))
+ ; /* error already set */
+ else if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0))
+ ; /* error already set */
+ else if ((*_gd_ef[E->e->u.raw.file[0].encoding].touch)(E->e->u.raw.file))
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+ NULL);
+ else if (D->fragment[E->fragment_index].ref_name == NULL) {
+ /* This is the first raw field in this fragment */
+ new_ref = strdup(E->field);
+ if (new_ref == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ }
+ copy_scalar[0] = 1;
+ 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_BAD_ENTRY_NFIELDS, NULL,
+ E->EN(lincom,n_fields), NULL);
+ else {
+ if (entry->comp_scal) {
+ int 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 = 1;
+ }
+ E->comp_scal = 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_r2c(E->EN(lincom,cm)[i], E->EN(lincom,m)[i]);
+ _gd_r2c(E->EN(lincom,cb)[i], E->EN(lincom,b)[i]);
+ }
+ E->comp_scal = 0;
+ }
+
+ for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+ if ((E->in_fields[i] = strdup(entry->in_fields[i])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ copy_scalar[i] = copy_scalar[i + GD_MAX_LINCOM] = 1;
+ }
+ }
+ break;
+ case GD_LINTERP_ENTRY:
+ E->e->u.linterp.table_len = -1;
+
+ if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else if ((E->EN(linterp,table) = strdup(entry->EN(linterp,table)))
+ == NULL)
+ {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ }
+ break;
+ case GD_MULTIPLY_ENTRY:
+ case GD_DIVIDE_ENTRY:
+ if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else if ((E->in_fields[1] = strdup(entry->in_fields[1])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ case GD_RECIP_ENTRY:
+ if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+
+ copy_scalar[0] = 1;
+ if (entry->comp_scal) {
+ _gd_c2c(E->EN(recip,cdividend), entry->EN(recip,cdividend));
+ E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
+ E->comp_scal = (cimag(E->EN(recip,cdividend)) == 0) ? 0 : 1;
+ } else {
+ E->EN(recip,dividend) = entry->EN(recip,dividend);
+ _gd_r2c(E->EN(recip,cdividend), E->EN(recip,dividend));
+ E->comp_scal = 0;
+ }
+ 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 ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else if (E->EN(bit,numbits) < 1)
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_NUMBITS, NULL,
+ entry->EN(bit,numbits), NULL);
+ else if (E->EN(bit,bitnum) < 0)
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_BITNUM, NULL,
+ entry->EN(bit,bitnum), NULL);
+ else if (E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63)
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_BITSIZE, NULL,
+ E->EN(bit,bitnum) + E->EN(bit,numbits) - 1, NULL);
+ copy_scalar[0] = copy_scalar[1] = 1;
+ break;
+ case GD_PHASE_ENTRY:
+ E->EN(phase,shift) = entry->EN(phase,shift);
+
+ if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ copy_scalar[0] = 1;
+ 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)));
+ E->e->u.scalar.d = malloc(size);
+ if (!D->error && E->e->u.scalar.d == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else
+ 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 if (E->EN(scalar,array_len) > GD_MAX_CARRAY_LENGTH)
+ _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
+ else {
+ size_t size = GD_SIZE(_GD_ConstType(D, E->EN(scalar,const_type))) *
+ E->EN(scalar,array_len);
+ E->e->u.scalar.d = malloc(size);
+ if (!D->error && E->e->u.scalar.d == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else
+ memset(E->e->u.scalar.d, 0, size);
+ }
+ break;
+ case GD_STRING_ENTRY:
+ E->e->u.string = strdup("");
+ if (E->e->u.string == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ 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_BAD_ENTRY_NFIELDS, NULL,
+ E->EN(polynom,poly_ord), NULL);
+ }
+ else {
+ if (entry->comp_scal) {
+ int 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 = 1;
+ }
+ E->comp_scal = 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_r2c(E->EN(polynom,ca)[i], E->EN(polynom,a)[i]);
+ E->comp_scal = 0;
+ }
+
+ if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ }
+
+ for (i = 0; i < E->EN(polynom,poly_ord); ++i)
+ copy_scalar[i] = 1;
+ break;
+ case GD_INDEX_ENTRY:
+ case GD_NO_ENTRY:
+ _GD_InternalError(D); /* We've already verrified field_type is valid */
+ break;
+ }
+
+ /* copy scalars */
+ for (i = 0; i <= GD_MAX_POLYORD; ++i) {
+ if (!copy_scalar[i] || entry->scalar[i] == NULL)
+ E->scalar[i] = NULL;
+ else {
+ E->scalar[i] = strdup(entry->scalar[i]);
+ if (E->scalar[i] == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ }
+ }
+
+ if (D->error != GD_E_OK) {
+ free(new_ref);
+ _GD_FreeE(E, 1);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ new_list = realloc(D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*));
+ if (new_list == NULL) {
+ free(new_ref);
+ _GD_FreeE(E, 1);
+ dreturn("%i", -1);
+ return -1;
+ }
+ D->entry = (gd_entry_t **)new_list;
+
+ if (is_dot) {
+ new_list = realloc(D->dot_list, (D->n_dot + 1) * sizeof(gd_entry_t*));
+ if (new_list == NULL) {
+ free(new_ref);
+ _GD_FreeE(E, 1);
+ dreturn("%i", -1);
+ return -1;
+ }
+ D->dot_list = (gd_entry_t **)new_list;
+ }
+
+ if (P) {
+ void *ptr = realloc(P->e->p.meta_entry, (P->e->n_meta + 1) *
+ sizeof(gd_entry_t*));
+ if (ptr == NULL) {
+ free(new_ref);
+ _GD_FreeE(E, 1);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* 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++;
+ D->n_meta++;
+
+ }
+
+ if (E->field_type == GD_STRING_ENTRY) {
+ if (P)
+ P->e->n_meta_string++;
+ else
+ D->n_string++;
+ } else if (E->field_type == GD_CONST_ENTRY) {
+ if (P)
+ P->e->n_meta_const++;
+ else
+ D->n_const++;
+ } else if (E->field_type == GD_CARRAY_ENTRY) {
+ if (P)
+ P->e->n_meta_carray++;
+ else
+ D->n_carray++;
+ } else 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 = strdup(new_ref);
+ D->fragment[i].modified = 1;
+ } else
+ break;
+ }
+
+ if (D->reference_field == NULL)
+ D->reference_field = E;
+ }
+ }
+
+ /* 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*), entry_cmp);
+ }
+
+ /* 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;
+
+ /* Invalidate the field lists */
+ D->list_validity = 0;
+ D->type_list_validity = 0;
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+/* 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;
+
+ 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);
+
+ E = _GD_FindField(D, parent, D->entry, D->n_entries, NULL);
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, 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 */
+ n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, in_cols,
+ "dirfile_madd_spec()", 0, D->standards, D->flags & GD_PERMISSIVE);
+
+ /* Directive parsing is skipped -- The Field Spec parser will add the field */
+ if (!D->error)
+ _GD_ParseFieldSpec(D, n_cols, in_cols, E, "dirfile_madd_spec()", 0, me,
+ D->standards, 1, GD_PEDANTIC, 1, &outstring, tok_pos);
+
+ free(outstring);
+
+ if (D->error) {
+ dreturn("%i", -1); /* parser threw an error */
+ return -1;
+ }
+
+ 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;
+
+ 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);
+
+ /* start parsing */
+ n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, in_cols,
+ "dirfile_add_spec()", 0, D->standards, D->flags & GD_PERMISSIVE);
+
+ /* Directive parsing is skipped -- The Field Spec parser will add the field */
+ if (!D->error)
+ _GD_ParseFieldSpec(D, n_cols, in_cols, NULL, "dirfile_add_spec()", 0,
+ fragment_index, D->standards, 1, GD_PEDANTIC, 1, &outstring, tok_pos);
+
+ free(outstring);
+
+ if (D->error) {
+ dreturn("%i", -1); /* parser threw an error */
+ return -1;
+ }
+
+ 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);
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+/* add a RAW entry */
+int gd_add_raw(DIRFILE* D, const char* field_code, gd_type_t data_type,
+ gd_spf_t spf, int fragment_index)
+{
+ gd_entry_t R;
+ int error;
+
+ dtrace("%p, \"%s\", %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;
+ error = _GD_Add(D, &R, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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, error;
+ 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_BAD_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.comp_scal = 0;
+ 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];
+ }
+ error = _GD_Add(D, &L, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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, error;
+ 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_BAD_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.comp_scal = 1;
+ L.fragment_index = fragment_index;
+
+ for (i = 0; i < n_fields; ++i) {
+ L.in_fields[i] = (char *)in_fields[i];
+ _gd_ca2c(L.EN(lincom,cm)[i], cm, i);
+ _gd_ca2c(L.EN(lincom,cb)[i], cb, i);
+ }
+ error = _GD_Add(D, &L, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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;
+ int error;
+
+ 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;
+ error = _GD_Add(D, &L, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a BIT entry */
+int gd_add_bit(DIRFILE* D, const char* field_code, const char* in_field,
+ gd_bit_t bitnum, gd_bit_t numbits, int fragment_index) gd_nothrow
+{
+ gd_entry_t B;
+ int error;
+
+ dtrace("%p, \"%s\", \"%s\", %i, %i, %i\n", 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;
+ error = _GD_Add(D, &B, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a SBIT entry */
+int gd_add_sbit(DIRFILE* D, const char* field_code, const char* in_field,
+ gd_bit_t bitnum, gd_bit_t numbits, int fragment_index) gd_nothrow
+{
+ gd_entry_t B;
+ int error;
+
+ dtrace("%p, \"%s\", \"%s\", %i, %i, %i\n", 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;
+ error = _GD_Add(D, &B, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a MULTIPLY entry */
+int gd_add_multiply(DIRFILE* D, const char* field_code, const char* in_field1,
+ const char* in_field2, int fragment_index) gd_nothrow
+{
+ gd_entry_t M;
+ int error;
+
+ dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, 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 = GD_MULTIPLY_ENTRY;
+ M.in_fields[0] = (char *)in_field1;
+ M.in_fields[1] = (char *)in_field2;
+ M.fragment_index = fragment_index;
+ error = _GD_Add(D, &M, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a DIVIDE entry */
+int gd_add_divide(DIRFILE* D, const char* field_code, const char* in_field1,
+ const char* in_field2, int fragment_index) gd_nothrow
+{
+ gd_entry_t E;
+ int error;
+
+ dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, 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(&E, 0, sizeof(gd_entry_t));
+ E.field = (char *)field_code;
+ E.field_type = GD_DIVIDE_ENTRY;
+ E.in_fields[0] = (char *)in_field1;
+ E.in_fields[1] = (char *)in_field2;
+ E.fragment_index = fragment_index;
+ error = _GD_Add(D, &E, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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;
+ int error;
+
+ 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.comp_scal = 0;
+ E.in_fields[0] = (char *)in_field;
+ E.fragment_index = fragment_index;
+ error = _GD_Add(D, &E, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+#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
+{
+ dtrace("%p, \"%s\", \"%s\", %g;%g, %i", D, field_code, in_field,
+ creal(cdividend), cimag(cdividend), 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;
+ }
+
+ gd_entry_t E;
+ memset(&E, 0, sizeof(gd_entry_t));
+ E.field = (char *)field_code;
+ E.field_type = GD_RECIP_ENTRY;
+ E.EN(recip,cdividend) = cdividend;
+ E.comp_scal = 1;
+ E.in_fields[0] = (char *)in_field;
+ E.fragment_index = fragment_index;
+ int error = _GD_Add(D, &E, NULL);
+
+ 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;
+ int error;
+
+ 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_a2c(E.EN(recip,cdividend), cdividend);
+ E.comp_scal = 1;
+ E.in_fields[0] = (char *)in_field;
+ E.fragment_index = fragment_index;
+ error = _GD_Add(D, &E, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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, error;
+ 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_BAD_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.comp_scal = 0;
+ E.in_fields[0] = (char *)in_field;
+
+ for (i = 0; i <= poly_ord; ++i)
+ E.EN(polynom,a)[i] = a[i];
+
+ error = _GD_Add(D, &E, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+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, error;
+ 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_BAD_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.comp_scal = 1;
+ E.in_fields[0] = (char *)in_field;
+
+ for (i = 0; i <= poly_ord; ++i)
+ _gd_ca2c(E.EN(polynom,ca)[i], ca, i);
+
+ error = _GD_Add(D, &E, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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;
+ int error;
+
+ 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;
+ error = _GD_Add(D, &P, NULL);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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;
+ int error;
+
+ 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;
+ error = _GD_Add(D, &S, NULL);
+
+ /* Actually store the string, now */
+ if (!error) {
+ entry = _GD_FindField(D, field_code, D->entry, D->n_entries, NULL);
+
+ if (entry == NULL)
+ _GD_InternalError(D); /* We should be able to find it: we just added it */
+ else
+ _GD_DoFieldOut(D, entry, 0, 0, 0, GD_NULL, value);
+
+ if (D->error)
+ error = -1;
+ }
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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;
+ int error;
+
+ 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;
+ error = _GD_Add(D, &C, NULL);
+
+ /* Actually store the constant, now */
+ if (!error) {
+ entry = _GD_FindField(D, field_code, D->entry, D->n_entries, NULL);
+
+ if (entry == NULL)
+ _GD_InternalError(D); /* We should be able to find it: we just added it */
+ else
+ _GD_DoFieldOut(D, entry, 0, 0, 1, data_type, value);
+
+ if (D->error)
+ error = -1;
+ }
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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;
+ int error;
+
+ dtrace("%p, \"%s\", 0x%x, %zi, 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;
+ error = _GD_Add(D, &C, NULL);
+
+ /* Actually store the carray, now */
+ if (!error) {
+ entry = _GD_FindField(D, field_code, D->entry, D->n_entries, NULL);
+
+ if (entry == NULL)
+ _GD_InternalError(D); /* We should be able to find it: we just added it */
+ else
+ _GD_DoFieldOut(D, entry, 0, 0, array_len, data_type, values);
+
+ if (D->error)
+ error = -1;
+ }
+
+ dreturn("%i", error);
+ return error;
+}
+
+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);
+
+ 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, error;
+ 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_BAD_ENTRY_NFIELDS, NULL, n_fields,
+ NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ L.field = (char *)field_code;
+ L.field_type = GD_LINCOM_ENTRY;
+ L.EN(lincom,n_fields) = n_fields;
+ L.comp_scal = 0;
+ 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;
+ }
+ error = _GD_Add(D, &L, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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, error;
+ 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_BAD_ENTRY_NFIELDS, NULL, n_fields,
+ NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ L.field = (char *)field_code;
+ L.field_type = GD_LINCOM_ENTRY;
+ L.EN(lincom,n_fields) = n_fields;
+ L.comp_scal = 1;
+ L.fragment_index = 0;
+
+ for (i = 0; i < n_fields; ++i) {
+ L.in_fields[i] = (char *)in_fields[i];
+ _gd_ca2c(L.EN(lincom,cm)[i], cm, i);
+ _gd_ca2c(L.EN(lincom,cb)[i], cb, i);
+ L.scalar[i] = NULL;
+ L.scalar[i + GD_MAX_LINCOM] = NULL;
+ }
+ error = _GD_Add(D, &L, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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;
+ int error;
+
+ 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;
+ }
+
+ 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;
+ error = _GD_Add(D, &L, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a META BIT entry */
+int gd_madd_bit(DIRFILE* D, const char* parent, const char* field_code,
+ const char* in_field, gd_bit_t bitnum, gd_bit_t numbits) gd_nothrow
+{
+ gd_entry_t B;
+ int error;
+
+ 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;
+ }
+
+ 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;
+ error = _GD_Add(D, &B, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a META SBIT entry */
+int gd_madd_sbit(DIRFILE* D, const char* parent, const char* field_code,
+ const char* in_field, gd_bit_t bitnum, gd_bit_t numbits) gd_nothrow
+{
+ gd_entry_t B;
+ int error;
+
+ 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;
+ }
+
+ 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;
+ error = _GD_Add(D, &B, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a META MULTIPLY entry */
+int gd_madd_multiply(DIRFILE* D, const char* parent, const char* field_code,
+ const char* in_field1, const char* in_field2) gd_nothrow
+{
+ gd_entry_t M;
+ int error;
+
+ dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, 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;
+ }
+
+ M.field = (char *)field_code;
+ M.field_type = GD_MULTIPLY_ENTRY;
+ M.in_fields[0] = (char *)in_field1;
+ M.in_fields[1] = (char *)in_field2;
+ M.fragment_index = 0;
+ error = _GD_Add(D, &M, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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
+{
+ int error;
+ 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;
+ }
+
+ 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;
+ error = _GD_Add(D, &P, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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, error;
+ 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_BAD_ENTRY_POLYORD, NULL, poly_ord,
+ NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ E.field = (char *)field_code;
+ E.field_type = GD_POLYNOM_ENTRY;
+ E.EN(polynom,poly_ord) = poly_ord;
+ E.fragment_index = 0;
+ E.comp_scal = 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;
+ }
+
+ error = _GD_Add(D, &E, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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, error;
+ 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_BAD_ENTRY_POLYORD, NULL, poly_ord,
+ NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ E.field = (char *)field_code;
+ E.field_type = GD_POLYNOM_ENTRY;
+ E.EN(polynom,poly_ord) = poly_ord;
+ E.fragment_index = 0;
+ E.comp_scal = 1;
+ E.in_fields[0] = (char *)in_field;
+
+ for (i = 0; i <= poly_ord; ++i) {
+ _gd_ca2c(E.EN(polynom,ca)[i], ca, i);
+ E.scalar[i] = NULL;
+ }
+
+ error = _GD_Add(D, &E, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a META DIVIDE entry */
+int gd_madd_divide(DIRFILE* D, const char *parent, const char* field_code,
+ const char* in_field1, const char* in_field2) gd_nothrow
+{
+ int error;
+ gd_entry_t E;
+
+ dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, parent, 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(&E, 0, sizeof(gd_entry_t));
+ E.field = (char *)field_code;
+ E.field_type = GD_DIVIDE_ENTRY;
+ E.in_fields[0] = (char *)in_field1;
+ E.in_fields[1] = (char *)in_field2;
+ error = _GD_Add(D, &E, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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
+{
+ int error;
+ 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.comp_scal = 0;
+ E.in_fields[0] = (char *)in_field;
+ error = _GD_Add(D, &E, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+#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)
+{
+ dtrace("%p, \"%s\", \"%s\", \"%s\", %g;%g", D, parent, field_code, in_field,
+ creal(cdividend), cimag(cdividend));
+
+ 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_entry_t E;
+ memset(&E, 0, sizeof(gd_entry_t));
+ E.field = (char *)field_code;
+ E.field_type = GD_RECIP_ENTRY;
+ E.EN(recip,cdividend) = cdividend;
+ E.comp_scal = 1;
+ E.in_fields[0] = (char *)in_field;
+ int error = _GD_Add(D, &E, parent);
+
+ 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;
+ int error;
+
+ 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_a2c(E.EN(recip,cdividend), cdividend);
+ E.comp_scal = 1;
+ E.in_fields[0] = (char *)in_field;
+ error = _GD_Add(D, &E, parent);
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* add a META STRING entry */
+int gd_madd_string(DIRFILE* D, const char* parent,
+ const char* field_code, const char* value) gd_nothrow
+{
+ char *buffer;
+ int error;
+ gd_entry_t *entry;
+ gd_entry_t S;
+
+ 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;
+ }
+
+ S.field = (char *)field_code;
+ S.field_type = GD_STRING_ENTRY;
+ S.fragment_index = 0;
+ error = _GD_Add(D, &S, parent);
+
+ /* Actually store the string, now */
+ if (!error) {
+ buffer = (char *)malloc(strlen(parent) + strlen(field_code) + 2);
+ if (buffer == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ sprintf(buffer, "%s/%s", parent, field_code);
+ entry = _GD_FindField(D, buffer, D->entry, D->n_entries, NULL);
+ free(buffer);
+
+ if (entry == NULL)
+ _GD_InternalError(D); /* We should be able to find it: we just added it */
+ else
+ _GD_DoFieldOut(D, entry, 0, 0, 0, GD_NULL, value);
+
+ if (D->error)
+ error = -1;
+ }
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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
+{
+ char *buffer;
+ int error;
+ 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;
+ }
+
+ C.field = (char *)field_code;
+ C.field_type = GD_CONST_ENTRY;
+ C.EN(scalar,const_type) = const_type;
+ C.fragment_index = 0;
+ error = _GD_Add(D, &C, parent);
+
+ /* Actually store the constant, now */
+ if (!error) {
+ buffer = (char *)malloc(strlen(parent) + strlen(field_code) + 2);
+ if (buffer == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ sprintf(buffer, "%s/%s", parent, field_code);
+ entry = _GD_FindField(D, buffer, D->entry, D->n_entries, NULL);
+ free(buffer);
+
+ if (entry == NULL)
+ _GD_InternalError(D); /* We should be able to find it: we just added it */
+ else
+ _GD_DoFieldOut(D, entry, 0, 0, 1, data_type, value);
+
+ if (D->error)
+ error = -1;
+ }
+
+ dreturn("%i", error);
+ return error;
+}
+
+/* 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
+{
+ char *buffer;
+ int error;
+ gd_entry_t *entry;
+ gd_entry_t C;
+
+ dtrace("%p, \"%s\", \"%s\", 0x%x, %zi 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;
+ }
+
+ 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;
+ error = _GD_Add(D, &C, parent);
+
+ /* Actually store the carray, now */
+ if (!error) {
+ buffer = (char *)malloc(strlen(parent) + strlen(field_code) + 2);
+ if (buffer == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ sprintf(buffer, "%s/%s", parent, field_code);
+ entry = _GD_FindField(D, buffer, D->entry, D->n_entries, NULL);
+ free(buffer);
+
+ if (entry == NULL)
+ _GD_InternalError(D); /* We should be able to find it: we just added it */
+ else
+ _GD_DoFieldOut(D, entry, 0, 0, array_len, data_type, values);
+
+ if (D->error)
+ error = -1;
+ }
+
+ dreturn("%i", error);
+ return error;
+}
diff --git a/src/ascii.c b/src/ascii.c
new file mode 100644
index 0000000..89b496c
--- /dev/null
+++ b/src/ascii.c
@@ -0,0 +1,447 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+/* The ASCII encoding uses file->fp as to indicate the current line and
+ * file->edata for the stream pointer */
+
+int _GD_AsciiOpen(struct _gd_raw_file* file, int mode, int creat)
+{
+ int fp;
+
+ dtrace("%p, %i, %i", file, mode, creat);
+
+ fp = open(file->name, ((mode == GD_RDWR) ? O_RDWR : O_RDONLY) |
+ (creat ? O_CREAT : 0) | O_BINARY, 0666);
+
+ file->edata = fdopen(fp, (mode == GD_RDWR) ? "r+" : "r");
+
+ if (file->edata != NULL) {
+ file->fp = 0;
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", -1);
+ return -1;
+}
+
+off64_t _GD_AsciiSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type __gd_unused, int pad)
+{
+ char line[64];
+
+ dtrace("%p, %lli, <unused>, %i", file, count, pad);
+
+ if (count < file->fp) {
+ rewind((FILE *)file->edata);
+ file->fp = 0;
+ }
+
+ for (; count > file->fp; ++file->fp)
+ if (fgets(line, 64, (FILE *)file->edata) == NULL)
+ break;
+
+ if (pad && count > file->fp) {
+ strcpy(line, "0\n");
+ for (; count > file->fp; ++file->fp)
+ fputs(line, (FILE *)file->edata);
+ }
+
+ dreturn("%i", file->fp);
+ return file->fp;
+}
+
+static void _GD_ScanFormat(char* fmt, gd_type_t data_type)
+{
+ dtrace("%p, %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;
+ }
+
+ dreturn("[\"%s\"]", fmt);
+}
+
+ssize_t _GD_AsciiRead(struct _gd_raw_file *file, void *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, %zu", 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 (!feof((FILE *)file->edata))
+ ret = -1;
+ break;
+ }
+ file->fp++;
+ }
+ } else {
+ for (n = 0; n < nmemb; ++n) {
+ if (feof((FILE *)file->edata))
+ break;
+
+
+#ifdef NO_8BIT_INT_PREFIX
+ if (GD_SIZE(data_type) == 1) {
+ if (fscanf((FILE *)file->edata, fmt, &i16) < 1) {
+ if (!feof((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 (!feof((FILE *)file->edata))
+ ret = -1;
+ break;
+ }
+ }
+ file->fp++;
+ }
+ }
+
+ dreturn("%li", (ret) ? (long)ret : (long)n);
+ return (ret) ? ret : (ssize_t)n;
+}
+
+ssize_t _GD_AsciiWrite(struct _gd_raw_file *file, const void *ptr,
+ gd_type_t data_type, size_t nmemb)
+{
+ ssize_t ret = 0;
+ size_t n = 0;
+
+ dtrace("%p, %p, 0x%x, %zu", 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);
+
+ if (!ret)
+ ret = fsync(fileno((FILE *)file->edata));
+
+ 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) {
+ file->fp = -1;
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", 1);
+ return 1;
+}
+
+off64_t _GD_AsciiSize(struct _gd_raw_file* file,
+ gd_type_t data_type __gd_unused)
+{
+ FILE* stream;
+ char *buffer = NULL;
+ size_t len = 0;
+ off64_t n = 0;
+
+ dtrace("%p, <unused>", file);
+
+ stream = fopen(file->name, "r");
+
+ if (stream == NULL) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ while (getdelim(&buffer, &len, '\n', stream) != -1)
+ n++;
+ free(buffer);
+
+ fclose(stream);
+
+ dreturn("%lli", n);
+ return n;
+}
+
+int _GD_AsciiTemp(struct _gd_raw_file *file, int method)
+{
+ int move_error = 0;
+ struct stat stat_buf;
+ mode_t mode;
+ int fp;
+
+ dtrace("%p, %i", file, method);
+
+ switch(method) {
+ case GD_TEMP_OPEN:
+ fp = mkstemp(file[1].name);
+
+ file[1].edata = fdopen(fp, "r+");
+
+ if (file[1].edata == NULL) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ file[1].fp = 0;
+ break;
+ case GD_TEMP_MOVE:
+ if (file[1].name == NULL)
+ break;
+
+ if (stat(file[0].name, &stat_buf))
+ mode = 0644;
+ else
+ mode = stat_buf.st_mode;
+
+ if (!_GD_Rename(file[1].name, file[0].name)) {
+ chmod(file[0].name, mode);
+ free(file[1].name);
+ file[1].name = NULL;
+ dreturn("%i", 0);
+ return 0;
+ }
+ move_error = errno;
+ /* fallthrough on error */
+ case GD_TEMP_DESTROY:
+ if (file[1].name != NULL) {
+ if (file[1].fp >= 0)
+ if (_GD_AsciiClose(file + 1)) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (unlink(file[1].name)) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (method == GD_TEMP_MOVE) {
+ errno = move_error;
+ dreturn("%i", -1);
+ return -1;
+ }
+ free(file[1].name);
+ file[1].name = NULL;
+ }
+ break;
+ }
+
+ dreturn("%i", 0);
+ return 0;
+}
diff --git a/src/bzip.c b/src/bzip.c
new file mode 100644
index 0000000..35f6b15
--- /dev/null
+++ b/src/bzip.c
@@ -0,0 +1,283 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <errno.h>
+#include <time.h>
+#include <stdio.h>
+#include <string.h>
+#endif
+
+#ifdef HAVE_BZLIB_H
+#include <bzlib.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_Bzip2Open libgetdatabzip2_LTX_GD_Bzip2Open
+#define _GD_Bzip2Seek libgetdatabzip2_LTX_GD_Bzip2Seek
+#define _GD_Bzip2Read libgetdatabzip2_LTX_GD_Bzip2Read
+#define _GD_Bzip2Close libgetdatabzip2_LTX_GD_Bzip2Close
+#define _GD_Bzip2Size libgetdatabzip2_LTX_GD_Bzip2Size
+#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, fp = 0 otherwise fp = -1. */
+
+static struct gd_bzdata *_GD_Bzip2DoOpen(struct _gd_raw_file* file)
+{
+ struct gd_bzdata *ptr;
+
+ dtrace("%p", file);
+
+ if ((ptr = (struct gd_bzdata *)malloc(sizeof(struct gd_bzdata))) == NULL) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if ((ptr->stream = fopen(file->name, "rb")) == NULL) {
+ free(ptr);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ ptr->bzerror = ptr->stream_end = 0;
+ ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, ptr->stream, 0, 0, NULL, 0);
+
+ if (ptr->bzfile == NULL || ptr->bzerror != BZ_OK) {
+ fclose(ptr->stream);
+ free(ptr);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ ptr->pos = ptr->end = 0;
+ ptr->base = 0;
+
+ dreturn("%p", ptr);
+ return ptr;
+}
+
+int _GD_Bzip2Open(struct _gd_raw_file* file, int mode __gd_unused,
+ int creat __gd_unused)
+{
+ dtrace("%p, <unused>, <unused>", file);
+
+ file->edata = _GD_Bzip2DoOpen(file);
+
+ if (file->edata == NULL) {
+ dreturn("%i", 1);
+ return 1;
+ }
+
+ file->fp = 0;
+ dreturn("%i", 0);
+ return 0;
+}
+
+off64_t _GD_Bzip2Seek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad __gd_unused)
+{
+ struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
+
+ dtrace("%p, %lli, %x, <unused>", file, (long long)count, data_type);
+
+ count *= GD_SIZE(data_type);
+
+ if (ptr->base > count) {
+ /* a backwards seek -- reopen the file */
+ ptr->bzerror = 0;
+ BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+ ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, ptr->stream, 0, 0, NULL, 0);
+
+ if (ptr->bzfile == NULL || ptr->bzerror != BZ_OK) {
+ 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;
+
+ 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;
+ } else {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* eof */
+ if (ptr->bzerror != BZ_OK) {
+ ptr->stream_end = 1;
+ break;
+ }
+ }
+
+ ptr->pos = (ptr->bzerror == BZ_STREAM_END && count >= ptr->base + ptr->end) ?
+ ptr->end : count - ptr->base;
+
+ dreturn("%lli", (long long)((ptr->base + ptr->pos) / GD_SIZE(data_type)));
+ return (ptr->base + ptr->pos) / GD_SIZE(data_type);
+}
+
+ssize_t _GD_Bzip2Read(struct _gd_raw_file *file, void *data,
+ gd_type_t data_type, size_t nmemb)
+{
+ char* output = (char*)data;
+ struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
+ unsigned long long nbytes = nmemb * GD_SIZE(data_type);
+
+ dtrace("%p, %p, %x, %zu", file, data, data_type, nmemb);
+
+ while (nbytes > (unsigned long long)(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 {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* eof */
+ if (ptr->bzerror != BZ_OK) {
+ ptr->stream_end = 1;
+ break;
+ }
+ }
+
+ if (nbytes > (unsigned long long)(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;
+ }
+
+ dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
+ return nmemb - nbytes / GD_SIZE(data_type);
+}
+
+int _GD_Bzip2Close(struct _gd_raw_file *file)
+{
+ struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
+ dtrace("%p", file);
+
+ ptr->bzerror = 0;
+ BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+ if (!fclose(ptr->stream)) {
+ file->fp = -1;
+ free(file->edata);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", 1);
+ return 1;
+}
+
+off64_t _GD_Bzip2Size(struct _gd_raw_file *file, gd_type_t data_type)
+{
+ struct gd_bzdata *ptr;
+ off_t n;
+
+ dtrace("%p, %x", file, data_type);
+
+ ptr = _GD_Bzip2DoOpen(file);
+
+ 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 {
+ free(ptr);
+ BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+ fclose(ptr->stream);
+ 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;
+}
diff --git a/src/close.c b/src/close.c
new file mode 100644
index 0000000..ca6a90b
--- /dev/null
+++ b/src/close.c
@@ -0,0 +1,123 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+/* _GD_FreeD: free the DIRFILE and its subordinates
+*/
+static void _GD_FreeD(DIRFILE* D)
+{
+ unsigned int i;
+ int j;
+
+ dtrace("%p", D);
+
+ for (i = 0; i < D->n_entries; ++i)
+ _GD_FreeE(D->entry[i], 1);
+
+ for (j = 0; j < D->n_fragment; ++j) {
+ free(D->fragment[j].cname);
+ free(D->fragment[j].sname);
+ free(D->fragment[j].ename);
+ free(D->fragment[j].ref_name);
+ }
+
+ free(D->entry);
+ free(D->dot_list);
+ free(D->error_string);
+ free(D->error_file);
+ free(D->field_list);
+ free(D->vector_list);
+ for (j = 0; j < GD_N_ENTYPES; ++j)
+ free(D->type_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);
+ free(D);
+
+ dreturnvoid();
+}
+
+static int _GD_ShutdownDirfile(DIRFILE* D, int flush_meta)
+{
+ unsigned int i;
+
+ dtrace("%p, %i", D, flush_meta);
+
+ 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]);
+
+ if (D->error) {
+ dreturn("%i", 1);
+ return -1;
+ }
+
+ _GD_FreeD(D);
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+int gd_close(DIRFILE *D)
+{
+ int ret;
+
+ dtrace("%p", D);
+
+ ret = _GD_ShutdownDirfile(D, 1);
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+int gd_discard(DIRFILE* D)
+{
+ int ret;
+
+ dtrace("%p", D);
+
+ ret = _GD_ShutdownDirfile(D, 0);
+
+ dreturn("%i", ret);
+ return ret;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/common.c b/src/common.c
new file mode 100644
index 0000000..665a7c8
--- /dev/null
+++ b/src/common.c
@@ -0,0 +1,887 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <inttypes.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+
+#ifdef GETDATA_DEBUG
+int gd_col_count = 0;
+char gd_debug_col[GD_COL_SIZE + 1] = "";
+#endif
+
+/* _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 *fp, size_t *n, int* 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\" (%zu)", 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(DIRFILE* D, const char* field_code,
+ gd_entry_t** list, unsigned int u, unsigned int *index)
+{
+ int c;
+ unsigned int i, l = 0;
+
+ dtrace("%p, \"%s\", %p, %u, %p", D, field_code, list, u, 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 {
+ if (index != NULL)
+ *index = i;
+
+ dreturn("%p", list[i]);
+ return list[i];
+ }
+ }
+
+ if (index != NULL)
+ *index = u;
+
+ dreturn("%p", NULL);
+ return NULL;
+}
+
+/* Insertion sort the entry list */
+void _GD_InsertSort(DIRFILE* D, gd_entry_t* 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, %zu", 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 = malloc(n * GD_SIZE(type));
+
+ if (ptr == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+
+ 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 *D, gd_entry_t *E, struct _gd_private_entry *e)
+{
+ char *temp_buffer;
+
+ dtrace("%p, %p, %p", D, E, e);
+
+ if (E->EN(linterp,table)[0] == '/') {
+ e->u.linterp.table_path = strdup(E->EN(linterp,table));
+ if (e->u.linterp.table_path == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", 1);
+ return 1;
+ }
+ } else {
+ e->u.linterp.table_path = (char *)malloc(strlen(E->EN(linterp,table)) + 2 +
+ strlen(D->fragment[E->fragment_index].cname));
+ if (e->u.linterp.table_path == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", 1);
+ return 1;
+ }
+ temp_buffer = strdup(D->fragment[E->fragment_index].cname);
+ strcpy(e->u.linterp.table_path, dirname(temp_buffer));
+ strcat(e->u.linterp.table_path, "/");
+ strcat(e->u.linterp.table_path, E->EN(linterp,table));
+ 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* D, gd_entry_t *E)
+{
+ FILE *fp;
+ struct _gd_lut *ptr;
+ int i;
+ int dir = -1;
+ char *line;
+ size_t n = 0;
+ int linenum = 0;
+ double yr, yi;
+ int buf_len = 100;
+
+ dtrace("%p, %p", D, E);
+
+ if (E->e->u.linterp.table_path == NULL)
+ if (_GD_SetTablePath(D, E, E->e)) {
+ dreturnvoid();
+ return;
+ }
+
+ fp = fopen(E->e->u.linterp.table_path, "r");
+ if (fp == NULL) {
+ _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_OPEN, NULL, 0,
+ E->e->u.linterp.table_path);
+ dreturnvoid();
+ return;
+ }
+
+ /* 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 {
+ if (errno == EOVERFLOW)
+ /* line too long */
+ _GD_SetError(D, GD_E_LINE_TOO_LONG, 0, E->e->u.linterp.table_path,
+ linenum, NULL);
+ else
+ /* no data in file! */
+ _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_LENGTH, NULL, 0,
+ E->e->u.linterp.table_path);
+ fclose(fp);
+ dreturnvoid();
+ return;
+ }
+
+ E->e->u.linterp.lut = (struct _gd_lut *)malloc(buf_len *
+ sizeof(struct _gd_lut));
+
+ if (E->e->u.linterp.lut == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ fclose(fp);
+ dreturnvoid();
+ return;
+ }
+
+ /* now read in the data -- we've already read line one */
+ i = 0;
+ do {
+ if (E->e->u.linterp.complex_table) {
+ sscanf(line, "%lg %lg;%lg", &(E->e->u.linterp.lut[i].x), &yr, &yi);
+ _gd_l2c(E->e->u.linterp.lut[i].y.c, yr, yi);
+ } else
+ sscanf(line, "%lg %lg", &(E->e->u.linterp.lut[i].x),
+ &(E->e->u.linterp.lut[i].y.r));
+
+ 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 += 100;
+ ptr = (struct _gd_lut *)realloc(E->e->u.linterp.lut, buf_len *
+ sizeof(struct _gd_lut));
+
+ if (ptr == NULL) {
+ free(E->e->u.linterp.lut);
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ fclose(fp);
+ dreturnvoid();
+ return;
+ }
+
+ E->e->u.linterp.lut = ptr;
+ }
+ free(line);
+ } while ((line = _GD_GetLine(fp, &n, &linenum)));
+
+ if (i < 2) {
+ free(E->e->u.linterp.lut);
+ _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_LENGTH, NULL, 0,
+ E->e->u.linterp.table_path);
+ fclose(fp);
+ dreturnvoid();
+ return;
+ }
+
+ /* Free unused memory */
+ ptr = (struct _gd_lut *)realloc(E->e->u.linterp.lut, i
+ * sizeof(struct _gd_lut));
+
+ if (ptr == NULL) {
+ free(E->e->u.linterp.lut);
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ fclose(fp);
+ dreturnvoid();
+ return;
+ }
+
+ 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();
+}
+
+/* _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, %zu, %zu", 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("%zu", 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* D, void *data, gd_type_t type, int complex_table,
+ const double *data_in, size_t npts, const struct _gd_lut *lut, size_t n_ln)
+{
+ int idx = 0;
+ size_t i;
+ double x;
+
+ dtrace("%p, %p, 0x%x, %i, %p, %zu, %p, %zu", 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* D, int n, void* data1, gd_type_t return_type,
+ double *data2, double *data3, double* m, double *b, gd_spf_t *spf,
+ size_t n_read)
+{
+ size_t i;
+
+ dtrace("%p, %i, %p, 0x%x, %p, %p, %p, %p, %p, %zu", 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* D, int n, void* data1, gd_type_t return_type,
+ GD_DCOMPLEXP(data2), GD_DCOMPLEXP(data3), GD_DCOMPLEXV(m), GD_DCOMPLEXV(b),
+ gd_spf_t *spf, size_t n_read)
+{
+ size_t i;
+
+ dtrace("%p, %i, %p, 0x%x, %p, %p, %p, %p, %p, %zu", 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* D, void* data, gd_type_t return_type,
+ double dividend, size_t n_read)
+{
+ size_t i;
+
+ dtrace("%p, %p, 0x%x, %g, %zu", 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* D, void* data, gd_type_t return_type,
+ GD_DCOMPLEXA(dividend), size_t n_read)
+{
+ size_t i;
+
+ dtrace("%p, %p, 0x%x, %g;%g, %zu", 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* D, const char* field_code_in, char** field_code)
+{
+ int repr = GD_REPR_NONE;
+ const int field_code_len = strlen(field_code_in);
+
+ dtrace("%p, \"%s\", %p", D, field_code_in, field_code);
+
+ *field_code = (char *)field_code_in;
+ /* 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:
+ _GD_SetError(D, GD_E_BAD_REPR, GD_E_REPR_UNKNOWN, NULL, 0,
+ field_code_in + field_code_len - 1);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ /* make a copy of the field code without the representation */
+ *field_code = strdup(field_code_in);
+ if (*field_code == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else
+ (*field_code)[field_code_len - 2] = '\0';
+ }
+
+ dreturn("%i", repr);
+ return repr;
+}
+
+/* Ensure that an input field has been identified (with error checking) */
+int _GD_BadInput(DIRFILE* D, gd_entry_t* E, int i)
+{
+ char* code;
+
+ dtrace("%p, %p, %i", D, E, i);
+
+ if (E->e->entry[i] == NULL) {
+ E->e->entry[i] = _GD_FindFieldAndRepr(D, E->in_fields[i], &code,
+ &E->e->repr[i], NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", 1);
+ return 1;
+ }
+
+ if (code != E->in_fields[i])
+ free(code);
+ }
+
+ /* scalar entries not allowed */
+ if (E->e->entry[i]->field_type & GD_SCALAR_ENTRY) {
+ _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, E->field, 0,
+ E->e->entry[i]->field);
+ dreturn("%i", 1);
+ return 1;
+ }
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+/* Find the entry and the representation */
+gd_entry_t* _GD_FindFieldAndRepr(DIRFILE* D, const char* field_code_in,
+ char** field_code, int* repr, unsigned int *index, int set)
+{
+ gd_entry_t* E = NULL;
+
+ dtrace("%p, \"%s\", %p, %p, %p, %i", D, field_code_in, field_code, repr,
+ index, set);
+
+ E = _GD_FindField(D, field_code_in, D->dot_list, D->n_dot, NULL);
+
+ if (E == NULL) {
+ *repr = _GD_GetRepr(D, field_code_in, field_code);
+
+ 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, index);
+
+ if (E == NULL && set) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, field_code_in);
+ if (field_code_in != *field_code)
+ free(*field_code);
+ }
+
+ dreturn("%p %i", E, *repr);
+ return E;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/compat.c b/src/compat.c
new file mode 100644
index 0000000..4dc387a
--- /dev/null
+++ b/src/compat.c
@@ -0,0 +1,234 @@
+/* Copyright (C) 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <time.h>
+#endif
+
+/* The MSVCRT gmtime() is threadsafe */
+#ifndef HAVE_GMTIME_R
+struct tm *gmtime_r(const time_t *timep, struct tm *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
+
+/* MSVCRT based implementation of mkstemp(3). */
+#ifndef HAVE_MKSTEMP
+int mkstemp(char *template) {
+ int ret = -1;
+ char *template_template;
+
+ dtrace("\"%s\"", template);
+
+ template_template = strdup(template);
+
+ /* for sanity's sake */
+ errno = 0;
+
+ /* loop while open returns EEXIST */
+ do {
+ char *ptr;
+ strcpy(template, template_template);
+ ptr = mktemp(template);
+
+ if (ptr == NULL)
+ errno = EINVAL;
+ else
+ ret = open(ptr, O_RDWR | O_BINARY | O_CREAT | O_EXCL | O_BINARY, 0600);
+ } while (errno == EEXIST);
+
+ free(template_template);
+ dreturn("%i", ret);
+ return ret;
+}
+#endif
+
+/* An overwriting rename for use with the MSVCRT */
+#ifdef __MSVCRT__
+int _GD_Rename(const char *oldname, const char *newname)
+{
+ int ret;
+
+ dtrace("\"%s\", \"%s\"", oldname, newname);
+
+ if (unlink(newname)) {
+ if (errno != ENOENT) {
+ dreturn("%i", -1);
+ return -1;
+ }
+ }
+
+ ret = rename(oldname, newname);
+
+ 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, %zu", errnum, buf, buflen);
+
+ ptr = strerror(errnum);
+ strncpy(buf, ptr, buflen);
+
+ 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
+#define GD_SSIZE_T_MAX ((ssize_t)((size_t)-1>>1))
+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
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..7bf8bf4
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,486 @@
+/* src/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 1 if your processor stores double-precision floats in big-endian
+ order */
+#undef FLOATS_BIGENDIAN
+
+/* 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 <bzlib.h> 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 <complex.h> header file. */
+#undef HAVE_COMPLEX_H
+
+/* 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 <direct.h> header file. */
+#undef HAVE_DIRECT_H
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> 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 <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* 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 `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 `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 <idl_export.h> header file. */
+#undef HAVE_IDL_EXPORT_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+#undef HAVE_LIBBZ2
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_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 <ltdl.h> header file. */
+#undef HAVE_LTDL_H
+
+/* Define to 1 if you have the <lzma.h> header file. */
+#undef HAVE_LZMA_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the `nan' function. */
+#undef HAVE_NAN
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <numpy/arrayobject.h> 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 <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the <Python.h> header file. */
+#undef HAVE_PYTHON_H
+
+/* Define to 1 if you have the <slimlib.h> header file. */
+#undef HAVE_SLIMLIB_H
+
+/* Define to 1 if the system has the type `ssize_t'. */
+#undef HAVE_SSIZE_T
+
+/* Define to 1 if you have the `stat64' function. */
+#undef HAVE_STAT64
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> 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 <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> 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 `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if you have the type `struct stat64' */
+#undef HAVE_STRUCT_STAT64
+
+/* Define to 1 if you have the type `struct _stat64' */
+#undef HAVE_STRUCT__STAT64
+
+/* Define to 1 if you have the type `struct __stat64' */
+#undef HAVE_STRUCT___STAT64
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* 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 `_getcwd' function. */
+#undef HAVE__GETCWD
+
+/* 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 in which 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
+
+/* Define to the full path to the `slim' binary */
+#undef SLIM
+
+/* 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 gzip tests */
+#undef TEST_GZIP
+
+/* Define to enable lzma tests */
+#undef TEST_LZMA
+
+/* Define to enable slim tests */
+#undef TEST_SLIM
+
+/* Define to the full path to the `unslim' binary */
+#undef UNSLIM
+
+/* Define to enable bzip2 support */
+#undef USE_BZIP2
+
+/* 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 to to enable NumPy support in the Python bindings */
+#undef USE_NUMPY
+
+/* Define if you have a POSIX compliant thread library */
+#undef USE_PTHREAD
+
+/* Define to enable slim support */
+#undef USE_SLIM
+
+/* 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
+
+/* Expose BSD-derived definitions */
+#undef _BSD_SOURCE
+
+/* Additional functionality from LFS for large files. */
+#undef _LARGEFILE64_SOURCE
+
+/* Expose POSIX:2008 conforming definitions */
+#undef _POSIX_C_SOURCE
+
+/* Expose POSIX.1-1990 conforming definitions */
+#undef _POSIX_SOURCE
+
+/* Expose System V-derived definitions */
+#undef _SVID_SOURCE
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> 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 <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> 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 <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> 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 `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_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
diff --git a/src/constant.c b/src/constant.c
new file mode 100644
index 0000000..97fb078
--- /dev/null
+++ b/src/constant.c
@@ -0,0 +1,372 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+/* this function is little more than a public boilerplate for _GD_DoField */
+int gd_get_constant(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) {/* don't crash */
+ _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);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (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, 1, 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_slice(DIRFILE* D, const char *field_code_in,
+ unsigned int 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\", %i, %zi, 0x%x, %p", D, field_code_in, (int)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);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (entry->field_type != GD_CARRAY_ENTRY)
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+ else if (start + n > 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);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (entry->field_type != GD_CARRAY_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->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;
+}
+
+size_t gd_carray_len(DIRFILE *D, const char *field_code_in) gd_nothrow
+{
+ gd_entry_t *entry;
+ char* field_code;
+ int repr;
+
+ 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);
+
+ if (D->error) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (entry->field_type != GD_CARRAY_ENTRY)
+ _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);
+
+ if (D->error) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%zu", entry->EN(scalar,array_len));
+ return entry->EN(scalar,array_len);
+}
+
+/* this function is little more than a public boilerplate for _GD_DoFieldOut */
+int gd_put_constant(DIRFILE* D, const char *field_code_in, gd_type_t data_type,
+ const void *data_in) gd_nothrow
+{
+ int i;
+ gd_entry_t *entry;
+ int repr;
+ char* field_code;
+
+ dtrace("%p, \"%s\", 0x%x, %p", D, field_code_in, 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", -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;
+ }
+
+ _GD_ClearError(D);
+
+ entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (entry->field_type != GD_CONST_ENTRY)
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+ else
+ _GD_DoFieldOut(D, entry, repr, 0, 1, data_type, data_in);
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Flag all clients as needing recalculation */
+ for (i = 0; i < entry->e->u.scalar.n_client; ++i)
+ entry->e->u.scalar.client[i]->e->calculated = 0;
+
+ /* Clear the client list */
+ free(entry->e->u.scalar.client);
+ entry->e->u.scalar.client = NULL;
+ entry->e->u.scalar.n_client = 0;
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+int gd_put_carray_slice(DIRFILE* D, const char *field_code_in,
+ unsigned int first, size_t n, gd_type_t data_type, const void *data_in)
+gd_nothrow
+{
+ int i;
+ gd_entry_t *entry;
+ int repr;
+ char* field_code;
+
+ dtrace("%p, \"%s\", %i, %zu, 0x%x, %p", D, field_code_in, 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;
+ }
+
+ 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);
+
+ entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (entry->field_type != GD_CARRAY_ENTRY)
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+ else if (first + n > entry->EN(scalar,array_len))
+ _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
+ else
+ _GD_DoFieldOut(D, entry, repr, first, n, data_type, data_in);
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Flag all clients as needing recalculation */
+ for (i = 0; i < entry->e->u.scalar.n_client; ++i)
+ entry->e->u.scalar.client[i]->e->calculated = 0;
+
+ /* Clear the client list */
+ free(entry->e->u.scalar.client);
+ entry->e->u.scalar.client = NULL;
+ entry->e->u.scalar.n_client = 0;
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+int gd_put_carray(DIRFILE* D, const char *field_code_in, gd_type_t data_type,
+ const void *data_in) gd_nothrow
+{
+ int i;
+ gd_entry_t *entry;
+ int repr;
+ char* field_code;
+
+ dtrace("%p, \"%s\", 0x%x, %p", D, field_code_in, 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;
+ }
+
+ 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);
+
+ entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (entry->field_type != GD_CARRAY_ENTRY)
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+ else
+ _GD_DoFieldOut(D, entry, repr, 0, entry->EN(scalar,array_len), data_type,
+ data_in);
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Flag all clients as needing recalculation */
+ for (i = 0; i < entry->e->u.scalar.n_client; ++i)
+ entry->e->u.scalar.client[i]->e->calculated = 0;
+
+ /* Clear the client list */
+ free(entry->e->u.scalar.client);
+ entry->e->u.scalar.client = NULL;
+ entry->e->u.scalar.n_client = 0;
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/debug.c b/src/debug.c
new file mode 100644
index 0000000..1da8dc1
--- /dev/null
+++ b/src/debug.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2008, 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
+ */
+#include "internal.h"
+
+#include <string.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_colnil());
+
+ if (gd_col_count > 0)
+ gd_debug_col[--gd_col_count] = '\0';
+
+ return buffer;
+}
diff --git a/src/del.c b/src/del.c
new file mode 100644
index 0000000..5eb05b5
--- /dev/null
+++ b/src/del.c
@@ -0,0 +1,481 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+static void _GD_ClearDerived(DIRFILE* D, gd_entry_t* E, const gd_entry_t* 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:
+ 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;
+ }
+
+ dreturnvoid();
+}
+
+static int _GD_DeReferenceOne(DIRFILE* D, gd_entry_t* E, gd_entry_t* C,
+ int check, int i, gd_type_t type, void *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);
+
+ 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* D, gd_entry_t* E, gd_entry_t* 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_UINT16, &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_INT16, &E->EN(bit,bitnum)))
+ break;
+
+ _GD_DeReferenceOne(D, E, C, check, 1, GD_INT16, &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_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:
+ break;
+ }
+
+ dreturnvoid();
+}
+
+int gd_delete(DIRFILE* D, const char* field_code_in, int flags)
+{
+ unsigned int index;
+ unsigned int first, last = 0;
+ int n_del, i, repr, len;
+ unsigned int j;
+ char *field_code;
+ char **new_ref = NULL;
+ gd_entry_t *reference = NULL, *E;
+ gd_entry_t **del_list;
+
+ dtrace("%p, \"%s\", %x", D, field_code_in, 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;
+ }
+
+ 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_FindFieldAndRepr(D, field_code_in, &field_code, &repr, &index, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ len = strlen(field_code);
+
+ /* 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, field_code);
+ 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,
+ &first) == NULL)
+ {
+ _GD_InternalError(D);
+ if (field_code != field_code_in)
+ free(field_code);
+ 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, field_code, len) == 0 &&
+ D->entry[first - 1]->field[len] == '/')
+ first--;
+ else
+ break;
+
+ while (last < D->n_entries - 1)
+ if (strncmp(D->entry[last + 1]->field, field_code, len) == 0 &&
+ D->entry[last + 1]->field[len] == '/')
+ last++;
+ else
+ break;
+ }
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ /* gather a list of fields */
+ del_list = (gd_entry_t **)malloc(sizeof(gd_entry_t*) * ((E->e->n_meta == -1) ?
+ 1 : 1 + E->e->n_meta));
+
+ if (del_list == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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 and derived fields */
+ 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);
+ else if (~del_list[i]->field_type & GD_SCALAR_ENTRY)
+ _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 && 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_UNLINK)) {
+ free(del_list);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0)) {
+ free(del_list);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if ((*_gd_ef[E->e->u.raw.file[0].encoding].unlink)(E->e->u.raw.file)) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ free(del_list);
+ dreturn("%i", -1);
+ return -1;
+ }
+ } else if (E->field_type == GD_RAW_ENTRY && E->e->u.raw.file->fp != -1) {
+ if ((*_gd_ef[E->e->u.raw.file[0].encoding].close)(E->e->u.raw.file)) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ free(del_list);
+ dreturn("%i", -1);
+ return -1;
+ }
+ }
+
+ /* Fix up reference fields */
+ if (E->field_type == GD_RAW_ENTRY) {
+ new_ref = (char **)malloc(sizeof(char*) * D->n_fragment);
+ if (new_ref == NULL) {
+ free(del_list);
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ 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] = strdup(D->entry[j]->field);
+ if (new_ref == NULL) {
+ for (f = 0; f < i; ++f)
+ free(new_ref[f]);
+ free(new_ref);
+ free(del_list);
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ 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_SCALAR_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->entry[j], 1);
+
+ memmove(D->entry + first, D->entry + last + 1,
+ sizeof(gd_entry_t*) * (D->n_entries - last - 1));
+ D->n_meta -= last - first + 1;
+ D->n_entries -= last - first + 1;
+ }
+
+ if (E->field_type == GD_CONST_ENTRY)
+ D->n_const--;
+ else if (E->field_type == GD_CARRAY_ENTRY)
+ D->n_carray--;
+ else if (E->field_type == GD_STRING_ENTRY)
+ D->n_string--;
+ } 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;
+ }
+
+ Pe->n_meta--;
+ if (E->field_type == GD_CONST_ENTRY)
+ Pe->n_meta_const--;
+ else if (E->field_type == GD_CARRAY_ENTRY)
+ Pe->n_meta_carray--;
+ else if (E->field_type == GD_STRING_ENTRY)
+ Pe->n_meta_string--;
+ }
+
+ /* 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 */
+ _GD_FreeE(E, 1);
+
+ memmove(D->entry + index, D->entry + index + 1,
+ sizeof(gd_entry_t *) * (D->n_entries - index - 1));
+ D->n_entries--;
+
+ /* Invalidate the field lists */
+ D->list_validity = 0;
+ D->type_list_validity = 0;
+
+ dreturn("%i", 0);
+ return 0;
+}
diff --git a/src/encoding.c b/src/encoding.c
new file mode 100644
index 0000000..48374ba
--- /dev/null
+++ b/src/encoding.c
@@ -0,0 +1,651 @@
+/* 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"
+
+#ifdef STDC_HEADERS
+#include <inttypes.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#ifdef USE_MODULES
+#ifdef USE_PTHREAD
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+static pthread_mutex_t _gd_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+static int framework_initialised = 0;
+#endif
+
+/* encoding schemas */
+struct encoding_t _gd_ef[GD_N_SUBENCODINGS] = {
+ { GD_UNENCODED, "", 1, NULL, "none", 0,
+ &_GD_RawOpen, &_GD_RawClose, &_GD_GenericTouch, &_GD_RawSeek,
+ &_GD_RawRead, &_GD_RawSize, &_GD_RawWrite, &_GD_RawSync,
+ &_GD_GenericMove, &_GD_GenericUnlink, &_GD_RawTemp
+ },
+#ifdef USE_MODULES
+ /* Modules are external */
+ { GD_GZIP_ENCODED, ".gz", 1, "Gzip", "gzip",
+# ifdef USE_GZIP
+ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE,
+# else
+ 0,
+# endif
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL },
+ { GD_BZIP2_ENCODED, ".bz2", 1, "Bzip2", "bzip2",
+# ifdef USE_BZIP2
+ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE,
+# else
+ 0,
+# endif
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL },
+ { GD_SLIM_ENCODED, ".slm", 1, "Slim", "slim",
+# ifdef USE_SLIM
+ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE,
+# else
+ 0,
+# endif
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL },
+ { GD_LZMA_ENCODED, ".xz", 1, "Lzma", "lzma",
+# ifdef USE_LZMA
+ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE,
+# else
+ 0,
+# endif
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL },
+ { GD_LZMA_ENCODED, ".lzma", 1, "Lzma", "lzma",
+# ifdef USE_LZMA
+ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE,
+# else
+ 0,
+# endif
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL },
+#else
+ /* Modules are internal */
+ { GD_GZIP_ENCODED, ".gz", 1, NULL, "gzip", 0,
+# ifdef USE_GZIP
+ &_GD_GzipOpen, &_GD_GzipClose, NULL /* TOUCH */,
+ &_GD_GzipSeek, &_GD_GzipRead, &_GD_GzipSize, NULL /* WRITE */,
+ NULL /* SYNC */, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* TEMP */
+# else
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL
+# endif
+ },
+ { GD_BZIP2_ENCODED, ".bz2", 1, NULL, "bzip2", 0,
+# ifdef USE_BZIP2
+ &_GD_Bzip2Open, &_GD_Bzip2Close, NULL /* TOUCH */,
+ &_GD_Bzip2Seek, &_GD_Bzip2Read, &_GD_Bzip2Size, NULL /* WRITE */,
+ NULL /* SYNC */, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* TEMP */
+# else
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL
+# endif
+ },
+ { GD_SLIM_ENCODED, ".slm", 1, NULL, "slim", 0,
+# ifdef USE_SLIM
+ &_GD_SlimOpen, &_GD_SlimClose, NULL /* TOUCH */,
+ &_GD_SlimSeek, &_GD_SlimRead, &_GD_SlimSize, NULL /* WRITE */,
+ NULL /* SYNC */, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* TEMP */
+# else
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL
+# endif
+ },
+ { GD_LZMA_ENCODED, ".xz", 1, NULL, "lzma", 0,
+# ifdef USE_LZMA
+ &_GD_LzmaOpen, &_GD_LzmaClose, NULL /* TOUCH */,
+ &_GD_LzmaSeek, &_GD_LzmaRead, &_GD_LzmaSize, NULL /* WRITE */,
+ NULL /* SYNC */, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* TEMP */
+# else
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL
+#endif
+ },
+ { GD_LZMA_ENCODED, ".lzma", 1, NULL, "lzma", 0,
+# ifdef USE_LZMA
+ &_GD_LzmaOpen, &_GD_LzmaClose, NULL /* TOUCH */,
+ &_GD_LzmaSeek, &_GD_LzmaRead, &_GD_LzmaSize, NULL /* WRITE */,
+ NULL /* SYNC */, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* TEMP */
+# else
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, &_GD_GenericMove,
+ &_GD_GenericUnlink, NULL
+# endif
+ },
+#endif
+ { GD_TEXT_ENCODED, ".txt", 0, NULL, "text", 0,
+ &_GD_AsciiOpen, &_GD_AsciiClose, &_GD_GenericTouch,
+ &_GD_AsciiSeek, &_GD_AsciiRead, &_GD_AsciiSize, &_GD_AsciiWrite,
+ &_GD_AsciiSync, &_GD_GenericMove, &_GD_GenericUnlink, &_GD_AsciiTemp },
+ { GD_ENC_UNSUPPORTED, "", 0, "", "", 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+};
+
+void _GD_InitialiseFramework(void)
+{
+ dtracevoid();
+#ifdef USE_MODULES
+#ifdef USE_PTHREAD
+ pthread_mutex_lock(&_gd_mutex);
+#endif
+ 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))
+
+#ifdef USE_MODULES
+static void* _GD_ResolveSymbol(lt_dlhandle lib, struct encoding_t* enc,
+ const char* name)
+{
+ void* func;
+ char symbol[100];
+
+ dtrace("%p, %p, \"%s\"", lib, enc, name);
+ /* create the symbol name */
+ sprintf(symbol, "libgetdata%s_LTX_GD_%s%s", enc->affix, enc->affix, name);
+ symbol[10] -= 'A' - 'a';
+ func = lt_dlsym(lib, symbol);
+
+ dreturn("%p", func);
+ return func;
+}
+#endif
+
+int _GD_MissingFramework(int encoding, unsigned int funcs)
+{
+ int ret;
+
+ dtrace("%x, %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[FILENAME_MAX];
+ lt_dlhandle lib;
+
+ /* make the library name */
+ sprintf(library, "%s/libgetdata%s-%s", GETDATA_MODULEDIR,
+ _gd_ef[encoding].affix, PACKAGE_VERSION);
+ library[sizeof(GETDATA_MODULEDIR) + 10] -= 'A' - 'a';
+
+ /* open */
+ if ((lib = lt_dlopenext(library)) == NULL) {
+ /* if that didn't work, look for it in the search path */
+ sprintf(library, "libgetdata%s-%s", _gd_ef[encoding].affix,
+ PACKAGE_VERSION);
+ library[10] -= 'A' - 'a';
+ if ((lib = lt_dlopenext(library)) == NULL) {
+ _gd_ef[encoding].provides = 0;
+#ifdef USE_PTHREAD
+ pthread_mutex_unlock(&_gd_mutex);
+#endif
+ dreturn("%i", 1);
+ return 1;
+ }
+ }
+
+ /* Try to resolve the symbols */
+ if (_gd_ef[encoding].provides & GD_EF_OPEN)
+ _gd_ef[encoding].open = (int (*)(struct _gd_raw_file*, int,
+ int))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Open");
+ if (_gd_ef[encoding].provides & GD_EF_CLOSE)
+ _gd_ef[encoding].close =
+ (int (*)(struct _gd_raw_file*))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Close");
+ if (_gd_ef[encoding].provides & GD_EF_TOUCH)
+ _gd_ef[encoding].touch = (int (*)(struct _gd_raw_file*))
+ _GD_ResolveSymbol(lib, _gd_ef + encoding, "Touch");
+ if (_gd_ef[encoding].provides & GD_EF_SEEK)
+ _gd_ef[encoding].seek = (off64_t (*)(struct _gd_raw_file*, off64_t,
+ gd_type_t, int))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Seek");
+ if (_gd_ef[encoding].provides & GD_EF_READ)
+ _gd_ef[encoding].read = (ssize_t (*)(struct _gd_raw_file*, void*,
+ gd_type_t, size_t))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Read");
+ if (_gd_ef[encoding].provides & GD_EF_SIZE)
+ _gd_ef[encoding].size = (off64_t (*)(struct _gd_raw_file*,
+ gd_type_t))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Size");
+ if (_gd_ef[encoding].provides & GD_EF_WRITE)
+ _gd_ef[encoding].write = (ssize_t (*)(struct _gd_raw_file*, const void*,
+ gd_type_t, size_t))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Write");
+ if (_gd_ef[encoding].provides & GD_EF_SYNC)
+ _gd_ef[encoding].sync =
+ (int (*)(struct _gd_raw_file*))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Sync");
+ if (_gd_ef[encoding].provides & GD_EF_UNLINK)
+ _gd_ef[encoding].unlink =
+ (int (*)(struct _gd_raw_file*))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Unlink");
+ if (_gd_ef[encoding].provides & GD_EF_TEMP)
+ _gd_ef[encoding].temp = (int (*)(struct _gd_raw_file*,
+ int))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Temp");
+
+ /* 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_OPEN && _gd_ef[encoding].open == NULL) ||
+ (funcs & GD_EF_CLOSE && _gd_ef[encoding].close == NULL) ||
+ (funcs & GD_EF_TOUCH && _gd_ef[encoding].touch == 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_TEMP && _gd_ef[encoding].temp == NULL);
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+/* Figure out the encoding scheme */
+static unsigned long _GD_ResolveEncoding(const char* name, unsigned long scheme,
+ struct _gd_raw_file *file)
+{
+ char candidate[FILENAME_MAX];
+ char* ptr;
+ int i, len = strlen(name);
+ gd_stat64_t statbuf;
+
+ dtrace("\"%s\", 0x%08lx, %p", name, scheme, file);
+
+ strcpy(candidate, name);
+ ptr = candidate + len;
+ len = FILENAME_MAX - len;
+
+ for (i = 0; _gd_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) {
+ if (scheme == GD_AUTO_ENCODED || scheme == _gd_ef[i].scheme) {
+ strcpy(ptr, _gd_ef[i].ext);
+
+ if (gd_stat64(candidate, &statbuf) == 0)
+ if (S_ISREG(statbuf.st_mode)) {
+ if (file != NULL)
+ file->encoding = i;
+ dreturn("%08lx", _gd_ef[i].scheme);
+ return _gd_ef[i].scheme;
+ }
+ }
+ }
+
+ if (scheme != 0 && file != NULL) {
+ for (i = 0; _gd_ef[i].scheme != GD_ENC_UNSUPPORTED; i++)
+ if (scheme == _gd_ef[i].scheme) {
+ file->encoding = 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, gd_entry_t* E, unsigned int funcs)
+{
+ dtrace("%p, %p, %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(E->e->u.raw.filebase, GD_AUTO_ENCODED,
+ 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, 0, NULL, 0, NULL);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ /* Figure out the encoding subtype, if required */
+ if (E->e->u.raw.file[0].encoding == GD_ENC_UNKNOWN)
+ _GD_ResolveEncoding(E->e->u.raw.filebase,
+ D->fragment[E->fragment_index].encoding, E->e->u.raw.file);
+
+ /* check for our function(s) */
+ if (_GD_MissingFramework(E->e->u.raw.file[0].encoding, funcs)) {
+ _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", 1);
+ return 1;
+}
+
+int _GD_SetEncodedName(DIRFILE* D, struct _gd_raw_file* file, const char* base,
+ int temp)
+{
+ dtrace("%p, %p, \"%s\", %i", D, file, base, temp);
+
+ if (file->name == NULL) {
+ file->name = (char *)malloc(FILENAME_MAX);
+ if (file->name == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ snprintf(file->name, FILENAME_MAX, "%s%s", base, temp ? "_XXXXXX" :
+ _gd_ef[file->encoding].ext);
+ }
+
+ dreturn("%i (%s)", 0, file->name);
+ return 0;
+}
+
+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_entry_t **)malloc(sizeof(gd_entry_t*) *
+ D->n_entries);
+
+ if (raw_entry == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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)
+ if (_gd_ef[raw_entry[i]->e->u.raw.file[1].encoding].temp != NULL &&
+ (*_gd_ef[raw_entry[i]->e->u.raw.file[1].encoding].temp)(
+ raw_entry[i]->e->u.raw.file, GD_TEMP_DESTROY))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, raw_entry[i]->e->u.raw.file[0].name,
+ errno, NULL);
+ }
+ } 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].encoding =
+ raw_entry[i]->e->u.raw.file[1].encoding;
+
+ if (_GD_SetEncodedName(D, raw_entry[i]->e->u.raw.file,
+ raw_entry[i]->e->u.raw.filebase, 0))
+ {
+ raw_entry[i]->e->u.raw.file[0].name = temp.name;
+ raw_entry[i]->e->u.raw.file[0].encoding = temp.encoding;
+ } else if (
+ (*_gd_ef[raw_entry[i]->e->u.raw.file[1].encoding].temp)(
+ raw_entry[i]->e->u.raw.file, GD_TEMP_MOVE))
+ {
+ _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].encoding = temp.encoding;
+ } else if ((*_gd_ef[temp.encoding].unlink)(&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].encoding = temp.encoding;
+ } 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 */
+ if (D->entry[i]->e->u.raw.file[0].fp != -1 &&
+ (*_gd_ef[D->entry[i]->e->u.raw.file[0].encoding].close)(
+ D->entry[i]->e->u.raw.file))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, D->entry[i]->e->u.raw.file[1].name,
+ errno, NULL);
+ break;
+ }
+ /* reset encoding subscheme. */
+ D->entry[i]->e->u.raw.file[0].encoding = GD_ENC_UNKNOWN;
+ }
+ }
+
+ 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, 0, 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->entry[i]->e->u.raw.filebase, GD_AUTO_ENCODED,
+ 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;
+}
+
+int _GD_GenericTouch(struct _gd_raw_file* file)
+{
+ int fd;
+
+ dtrace("%p", file);
+
+ fd = open(file->name, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0666);
+
+ if (fd != -1)
+ fd = close(fd);
+
+ dreturn("%i", fd);
+ return fd;
+}
+
+int _GD_GenericUnlink(struct _gd_raw_file* file)
+{
+ int r;
+
+ dtrace("%p", file);
+
+ r = unlink(file->name);
+
+ dreturn("%i", r);
+ return r;
+}
+
+int _GD_GenericMove(struct _gd_raw_file* file, char* new_path)
+{
+ int r, rename_errno;
+
+ dtrace("%p, \"%s\"", file, new_path);
+
+ r = _GD_Rename(file->name, 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
+*/
diff --git a/src/endian.c b/src/endian.c
new file mode 100644
index 0000000..28ad4b4
--- /dev/null
+++ b/src/endian.c
@@ -0,0 +1,223 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+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 **)malloc(sizeof(gd_entry_t*) *
+ D->n_entries);
+
+ if (raw_entry == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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 the field's data type is one byte long, do nothing */
+ if (D->entry[i]->e->u.raw.size == 1)
+ continue;
+
+ /* check subencoding support */
+ if (!_GD_Supports(D, D->entry[i], GD_EF_TEMP))
+ 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, 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)
+ if ((*_gd_ef[raw_entry[i]->e->u.raw.file[0].encoding].temp)(
+ raw_entry[i]->e->u.raw.file, GD_TEMP_DESTROY))
+ _GD_SetError(D, GD_E_RAW_IO, 0, raw_entry[i]->e->u.raw.file[0].name,
+ errno, NULL);
+ } else {
+ for (i = 0; i < n_raw; ++i)
+ if ((*_gd_ef[raw_entry[i]->e->u.raw.file[0].encoding].temp)(
+ raw_entry[i]->e->u.raw.file, GD_TEMP_MOVE))
+ {
+ _GD_SetError(D, GD_E_UNCLEAN_DB, 0,
+ D->fragment[D->entry[i]->fragment_index].cname, 0, NULL);
+ D->flags |= GD_INVALID;
+ }
+ }
+
+ 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_BAD_ENDIANNESS, 0, 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;
+}
+
+void _GD_ArmEndianise(uint64_t* databuffer, int is_complex, size_t ns)
+{
+ uint64_t *p;
+ dtrace("%p, %i, %zi", databuffer, is_complex, ns);
+
+ if (is_complex)
+ ns *= 2;
+
+ for (p = databuffer; p < databuffer + ns; ++p)
+ *p = ((*p & 0xffffffff) << 32) | ((*p & 0xffffffff00000000ULL) >> 32);
+
+ dreturnvoid();
+}
+
+void _GD_FixEndianness(char* databuffer, size_t size, size_t ns)
+{
+ size_t i, j;
+ char b;
+
+ dtrace("%p, %zu, %zu", databuffer, size, ns);
+
+ if (size == 1) {
+ dreturnvoid();
+ return;
+ }
+
+ for (i = 0; i < ns; ++i)
+ for (j = 0; j < size / 2; ++j) {
+ b = databuffer[size * (i + 1) - j - 1];
+ databuffer[size * (i + 1) - j - 1] = databuffer[size * i + j];
+ databuffer[size * i + j] = b;
+ }
+
+ dreturnvoid();
+}
diff --git a/src/entry.c b/src/entry.c
new file mode 100644
index 0000000..94beb0e
--- /dev/null
+++ b/src/entry.c
@@ -0,0 +1,546 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <string.h>
+#include <stdlib.h>
+#endif
+
+void _GD_FreeE(gd_entry_t* entry, int priv)
+{
+ int i;
+
+ dtrace("%p, %i", 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) {
+ free(entry->e->u.linterp.table_path);
+ free(entry->e->u.linterp.lut);
+ }
+ break;
+ case GD_RECIP_ENTRY:
+ free(entry->in_fields[0]);
+ free(entry->scalar[0]);
+ 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[1]);
+ /* fallthrough */
+ case GD_PHASE_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_INDEX_ENTRY:
+ case GD_NO_ENTRY:
+ break;
+ }
+
+ if (priv) {
+ free(entry->e->field_list);
+ free(entry->e->vector_list);
+ free(entry->e->string_value_list);
+ for (i = 0; i < GD_N_ENTYPES; ++i)
+ free(entry->e->type_list[i]);
+ 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);
+ }
+
+ dreturnvoid();
+ return;
+}
+
+gd_entry_t* gd_free_entry_strings(gd_entry_t* entry) gd_nothrow
+{
+ dtrace("%p", entry);
+
+ _GD_FreeE(entry, 0);
+
+ dreturn("%p", entry);
+ return entry;
+}
+
+static void _GD_GetScalar(DIRFILE* D, gd_entry_t* E, int i, gd_type_t type,
+ void* data)
+{
+ void *ptr = NULL;
+ gd_entry_t* C;
+ int repr;
+ char* field_code;
+ const char* scalar = E->scalar[i];
+ int index = E->scalar_ind[i];
+
+ dtrace("%p, %p, %i, %i, %p", D, E, i, type, data);
+
+ if (scalar != NULL) {
+ C = _GD_FindFieldAndRepr(D, scalar, &field_code, &repr, NULL, 0);
+
+ if (D->error) {
+ dreturnvoid();
+ return;
+ }
+
+ if (C == NULL)
+ _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_CODE, E->field, 0,
+ field_code);
+ else if (C->field_type != GD_CONST_ENTRY &&
+ C->field_type != GD_CARRAY_ENTRY)
+ _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_TYPE, E->field, 0,
+ field_code);
+ else {
+ if (C->field_type == GD_CONST_ENTRY) {
+ index = 0;
+ E->scalar_ind[i] = -1;
+ }
+
+ if ((D->flags & GD_ACCMODE) == GD_RDWR) {
+ ptr = realloc(C->e->u.scalar.client, (C->e->u.scalar.n_client + 1) *
+ sizeof(gd_entry_t*));
+ if (ptr == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ }
+
+ _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);
+ }
+
+ dreturnvoid();
+}
+
+/* resolve non-literal scalars */
+int _GD_CalculateEntry(DIRFILE* D, gd_entry_t* E)
+{
+ int i;
+
+ dtrace("%p, %p", D, E);
+
+ switch(E->field_type) {
+ case GD_RAW_ENTRY:
+ _GD_GetScalar(D, E, 0, GD_UINT16, &E->EN(raw,spf));
+ break;
+ case GD_POLYNOM_ENTRY:
+ E->comp_scal = 0;
+ for (i = 0; i <= E->EN(polynom,poly_ord); ++i) {
+ _GD_GetScalar(D, E, i, GD_COMPLEX128, &E->EN(polynom,ca)[i]);
+ E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
+
+ if (cimag(E->EN(polynom,ca)[i]))
+ E->comp_scal = 1;
+
+ if (D->error)
+ break;
+ }
+ break;
+ case GD_LINCOM_ENTRY:
+ E->comp_scal = 0;
+ for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+ _GD_GetScalar(D, E, i, GD_COMPLEX128, &E->EN(lincom,cm)[i]);
+ E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]);
+
+ if (cimag(E->EN(lincom,cm)[i]))
+ E->comp_scal = 1;
+
+ _GD_GetScalar(D, E, i + GD_MAX_LINCOM, GD_COMPLEX128,
+ &E->EN(lincom,cb)[i]);
+ E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
+
+ if (cimag(E->EN(lincom,cb)[i]))
+ E->comp_scal = 1;
+
+ if (D->error)
+ break;
+ }
+ break;
+ case GD_RECIP_ENTRY:
+ _GD_GetScalar(D, E, 0, GD_COMPLEX128, &E->EN(recip,cdividend));
+ E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
+ E->comp_scal = (cimag(E->EN(recip,cdividend)) == 0) ? 0 : 1;
+ break;
+ case GD_BIT_ENTRY:
+ case GD_SBIT_ENTRY:
+ _GD_GetScalar(D, E, 0, GD_INT16, &E->EN(bit,bitnum));
+ _GD_GetScalar(D, E, 1, GD_INT16, &E->EN(bit,numbits));
+ break;
+ case GD_PHASE_ENTRY:
+ _GD_GetScalar(D, E, 0, GD_INT64, &E->EN(phase,shift));
+ 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:
+ break;
+ }
+
+ if (!D->error)
+ E->e->calculated = 1;
+
+ dreturn("%i", E->e->calculated);
+ return E->e->calculated;
+}
+
+const char* gd_raw_filename(DIRFILE* D, const char* field_code_in) gd_nothrow
+{
+ int repr;
+ char* field_code;
+ gd_entry_t *E;
+
+ dtrace("%p, \"%s\"", D, field_code_in);
+
+ _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_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 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 (field_code != field_code_in)
+ free(field_code);
+
+ if (E->e->u.raw.file[0].name == NULL) {
+ /* ensure encoding sybtype is known */
+ if (!_GD_Supports(D, E, 0)) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if (E->e->u.raw.file[0].encoding == GD_ENC_UNKNOWN) {
+ _GD_SetError(D, GD_E_UNKNOWN_ENCODING, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ } else if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ }
+
+ dreturn("%p", E->e->u.raw.file[0].name);
+ return E->e->u.raw.file[0].name;
+}
+
+int gd_entry(DIRFILE* D, const char* field_code_in, gd_entry_t* entry)
+ gd_nothrow
+{
+ int i, repr;
+ gd_entry_t *E;
+ char* field_code;
+
+ dtrace("%p, \"%s\", %p", D, field_code_in, 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);
+
+ /* get rid of the represenation, if any */
+ E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ /* Calculate the entry, if necessary */
+ if (!E->e->calculated)
+ _GD_CalculateEntry(D, E);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* 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_INDEX_ENTRY:
+ case GD_CONST_ENTRY:
+ case GD_CARRAY_ENTRY:
+ case GD_STRING_ENTRY:
+ case GD_NO_ENTRY:
+ break;
+ }
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+gd_entype_t gd_entry_type(DIRFILE* D, const char* field_code_in) gd_nothrow
+{
+ gd_entry_t* E;
+ char* field_code;
+ int repr;
+
+ 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", GD_NO_ENTRY);
+ return GD_NO_ENTRY;
+ }
+
+ _GD_ClearError(D);
+
+ /* get rid of the represenation, if any */
+ E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", GD_NO_ENTRY);
+ return GD_NO_ENTRY;
+ }
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ dreturn("%i", E->field_type);
+ return E->field_type;
+}
+
+int gd_fragment_index(DIRFILE* D, const char* field_code_in) gd_nothrow
+{
+ gd_entry_t* E;
+ char* field_code;
+ int repr;
+
+ 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);
+
+ /* get rid of the represenation, if any */
+ E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ dreturn("%i", E->fragment_index);
+ return E->fragment_index;
+}
+
+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);
+
+ /* get rid of the representation, if any */
+ E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ /* calculate scalars */
+ if (!E->e->calculated)
+ _GD_CalculateEntry(D, E);
+
+ /* 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);
+ break;
+ case GD_DIVIDE_ENTRY:
+ case GD_MULTIPLY_ENTRY:
+ _GD_BadInput(D, E, 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);
+ /* 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:
+ break;
+ }
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ dreturn("%i", 0);
+ return 0;
+}
diff --git a/src/errors.c b/src/errors.c
new file mode 100644
index 0000000..2faaed6
--- /dev/null
+++ b/src/errors.c
@@ -0,0 +1,330 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#endif
+
+/* 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(line), 2 = append sterror(suberror) */
+} error_string[] = {
+ /* GD_E_OPEN: 1 = suberror, 2 = filename */
+ { GD_E_OPEN, GD_E_OPEN_NOT_DIRFILE, "Not a dirfile: {2}", 0 },
+ { GD_E_OPEN, GD_E_OPEN_NO_ACCESS,
+ "Cannot open dirfile {2}: permission denied", 0 },
+ { GD_E_OPEN, GD_E_OPEN_NOT_EXIST, "Dirfile does not exist: {2}", 0 },
+ /* 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 field 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_PARENT,
+ "Meta field defined before parent ({4}) on line {3} of {2}", 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_TRUNC: 1 = suberror, 2 = filename. 3 = errno */
+ { GD_E_TRUNC, 0, "Error truncating {2}: ", 1 },
+ /* GD_E_CREAT: 1 = suberror, 2 = filename, 3 = errno */
+ { GD_E_CREAT, GD_E_CREAT_DIR, "Unable to create directory {2}: ", 1 },
+ { GD_E_CREAT, GD_E_CREAT_FORMAT, "Unable to create format file {2}: ", 1 },
+ { GD_E_CREAT, GD_E_CREAT_EXCL, "Unable to create dirfile {2}: already exists",
+ 1 },
+ /* GD_E_BAD_CODE: 4 = field code */
+ { GD_E_BAD_CODE, 0, "Field not found: {4}", 0 },
+ /* GD_E_BAD_TYPE: 1 = data type */
+ { GD_E_BAD_TYPE, 0, "Unsupported data type: {1}", 0 },
+ /* GD_E_RAW_IO: 1 = suberror, 2 = filename, 3 = errno */
+ { GD_E_RAW_IO, 0, "Error accessing {2}: ", 1 },
+ /* GD_E_OPEN_FRAGMENT: 1 = errno, 2 = format file, 3 = line, 4 = includefile*/
+ { GD_E_OPEN_FRAGMENT, 0,
+ "Unable to open fragment {4} on line {3} of {2}: ", 2 },
+ /* 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_OPEN_LINFILE: 1 = suberror, 2 = errno, 4 = lutfile */
+ { GD_E_OPEN_LINFILE, GD_E_LINFILE_LENGTH, "LINTERP table {4} too short", 0 },
+ { GD_E_OPEN_LINFILE, 0, "Error opening LINTERP table {4}: ", 2 },
+ /* GD_E_RECURSE_LEVEL: 4 = fieldcode */
+ { GD_E_RECURSE_LEVEL, 0, "Recursion too deep resolving field {4}", 0 },
+ /* GD_E_BAD_DIRFILE: (nothing) */
+ { GD_E_BAD_DIRFILE, 0, "Invalid dirfile", 0 },
+ /* GD_E_BAD_FIELD_TYPE: 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_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, 0, "Unable to determine encoding scheme", 0 },
+ /* GD_E_BAD_ENTRY: 3 = parameter */
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_TYPE, "Invalid entry type: {3}", 0 },
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_SPF, "Samples per frame out of range: {3}",
+ 0 },
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_NFIELDS,
+ "LINCOM field count out of range: {3}", 0 },
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_BITNUM, "Starting bit out of range: {3}",
+ 0 },
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_NUMBITS, "Numbits out of range: {3}", 0 },
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_BITSIZE,
+ "End of bitfield out of range: {3}", 0 },
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_METARAW, "Invalid metafield type: {3}", 0 },
+ { GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_POLYORD, "POLYNOM order 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 format file 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_BAD_ENDIANNESS: (nothing) */
+ { GD_E_BAD_ENDIANNESS, 0, "Invalid endianness specified", 0 },
+ /* GD_E_CALLBACK: 3 = response */
+ { GD_E_CALLBACK, 0, "Unrecognised response from callback function: {3}", 0 },
+ /* GD_E_BAD_PROTECTION: (nothing) */
+ { GD_E_BAD_PROTECTION, 0, "Invalid protection level specified", 0 },
+ /* GD_E_UNCLEAN_DB: 3 = fragment */
+ { GD_E_UNCLEAN_DB, 0,
+ "Unexpected system error processing {3}; 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_UNCLEAN_DB: 4 = repr */
+ { GD_E_BAD_REPR, GD_E_REPR_UNKNOWN, "Unknown field representation: .{4}", 0 },
+ { GD_E_BAD_REPR, GD_E_REPR_PUT, "Unable to write to field reprentation: .{4}",
+ 0 },
+ /* GD_E_BAD_VERSION 3 = version */
+ { GD_E_BAD_VERSION, GD_E_VERS_NONE,
+ "Dirfile conforms to no Standards Version", 0 },
+ { GD_E_BAD_VERSION, GD_E_VERS_MISSING,
+ "Dirfile does not conform to Standards Version {3}", 0 },
+ /* GD_E_FLUSH: 3 = suberror, 4 = filename */
+ { GD_E_FLUSH, GD_E_FLUSH_MKTMP, "I/O error creating temporary file: ", 1 },
+ { GD_E_FLUSH, GD_E_FLUSH_OPEN, "I/O error opening temporary file: ", 1 },
+ { GD_E_FLUSH, GD_E_FLUSH_RENAME, "I/O error replacing format metadata: ", 1 },
+ /* 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_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);
+
+ D->error = error;
+ D->suberror = suberror;
+ 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, PACKAGE_NAME ": %s\n", error_string);
+ free(error_string);
+ }
+
+ dreturnvoid();
+}
+
+/* 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, %zu", D, buffer, buflen);
+
+ /* Sanity check */
+ if (D == NULL || (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) {
+#ifdef STRERROR_R_CHAR_P
+ char *ptr = strerror_r((error_string[s].adderr == 2) ? D->suberror :
+ D->error_line, op, bufend - op);
+ if (ptr != op)
+ strncpy(op, ptr, bufend - op);
+#else
+ strerror_r((error_string[s].adderr == 2) ? D->suberror : D->error_line,
+ op, bufend - op);
+#endif
+ }
+ }
+
+ dreturn("\"%s\"", buffer);
+ return buffer;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/field_list.c b/src/field_list.c
new file mode 100644
index 0000000..bd41a71
--- /dev/null
+++ b/src/field_list.c
@@ -0,0 +1,348 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+/* zero length lists */
+static const char* zero_list[1] = { NULL };
+static const gd_carray_t zero_carrays[1] = { {0, NULL} };
+
+/* correspondence between type_list index and gd_enttype_t */
+const gd_entype_t _gd_entype_index[GD_N_ENTYPES] =
+{
+ GD_RAW_ENTRY, GD_LINCOM_ENTRY, GD_LINTERP_ENTRY, GD_BIT_ENTRY,
+ GD_MULTIPLY_ENTRY, GD_PHASE_ENTRY, GD_INDEX_ENTRY, GD_POLYNOM_ENTRY,
+ GD_SBIT_ENTRY, GD_DIVIDE_ENTRY, GD_RECIP_ENTRY, GD_CONST_ENTRY,
+ GD_STRING_ENTRY, GD_CARRAY_ENTRY
+};
+
+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 (D->n_const == 0) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ free(D->const_value_list);
+ fl = (char *)_GD_Alloc(D, return_type, D->n_const);
+
+ if (fl == NULL) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < D->n_entries; ++i) {
+ if (D->entry[i]->field_type == GD_CONST_ENTRY &&
+ D->entry[i]->e->n_meta != -1)
+ if (_GD_DoField(D, D->entry[i], 0, 0, 1, return_type,
+ fl + n++ * GD_SIZE(return_type)) != 1)
+ break;
+ }
+
+ 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 (D->n_carray == 0) {
+ dreturn("%p", zero_carrays);
+ return zero_carrays;
+ }
+
+ 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);
+ fl = (gd_carray_t *)malloc(sizeof(gd_carray_t) * (D->n_carray + 1));
+ memset(fl, 0, sizeof(gd_carray_t) * (D->n_carray + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < D->n_entries; ++i) {
+ if (D->entry[i]->field_type == GD_CARRAY_ENTRY &&
+ D->entry[i]->e->n_meta != -1) {
+ 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;
+
+ 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 (D->n_string == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ if (D->list_validity & LIST_VALID_STRING_VALUE) {
+ /* list already made */
+ dreturn("%p", D->string_value_list);
+ return D->string_value_list;
+ }
+
+ fl = (char **)realloc((char **)D->string_value_list, sizeof(const char*) *
+ (D->n_string + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < D->n_entries; ++i) {
+ if (D->entry[i]->field_type == GD_STRING_ENTRY &&
+ D->entry[i]->e->n_meta != -1)
+ fl[n++] = D->entry[i]->e->u.string;
+ }
+ fl[n] = NULL;
+
+ D->string_value_list = (const char **)fl;
+ D->list_validity |= 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
+{
+ unsigned int i, n;
+ char** fl;
+ int index = -1;
+
+ dtrace("%p, %x", D, 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);
+
+ n = gd_nfields_by_type(D, type);
+
+ if (D->error) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if (n == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ /* find the index -- get_nfields_by_type should have already tripped up
+ * if the type is invalid */
+ for (i = 0; i < GD_N_ENTYPES; ++i)
+ if (_gd_entype_index[i] == type) {
+ index = i;
+ break;
+ }
+
+ if (index == -1) {
+ _GD_InternalError(D);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if (D->type_list_validity & (1 << index)) {
+ /* list already made */
+ dreturn("%p", D->type_list[index]);
+ return D->type_list[index];
+ }
+
+ fl = (char **)realloc((char **)D->type_list[index],
+ sizeof(const char*) * (n + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < D->n_entries; ++i) {
+ if (D->entry[i]->field_type == type && D->entry[i]->e->n_meta != -1)
+ fl[n++] = D->entry[i]->field;
+ }
+ fl[n] = NULL;
+
+ D->type_list[index] = (const char **)fl;
+ D->type_list_validity |= 1 << index;
+
+ dreturn("%p", D->type_list[index]);
+ return D->type_list[index];
+}
+
+const char **gd_vector_list(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);
+
+ n = D->n_entries - D->n_meta - D->n_string - D->n_const - D->n_carray;
+
+ if (n == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ if (D->list_validity & LIST_VALID_VECTOR) {
+ /* list already made */
+ dreturn("%p", D->vector_list);
+ return D->vector_list;
+ }
+
+ fl = (char **)realloc((char **)D->vector_list, sizeof(const char*) * (n + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < D->n_entries; ++i) {
+ if (!(D->entry[i]->field_type & GD_SCALAR_ENTRY) &&
+ D->entry[i]->e->n_meta != -1)
+ fl[n++] = D->entry[i]->field;
+ }
+ fl[n] = NULL;
+
+ D->vector_list = (const char **)fl;
+ D->list_validity |= LIST_VALID_VECTOR;
+
+ dreturn("%p", D->vector_list);
+ return D->vector_list;
+}
+
+const char **gd_field_list(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 (D->n_entries == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ if (D->list_validity & LIST_VALID_FIELD) {
+ /* list already made */
+ dreturn("%p (old)", D->field_list);
+ return D->field_list;
+ }
+
+ fl = (char **)realloc((char **)D->field_list, sizeof(const char*) *
+ (D->n_entries + 1 - D->n_meta));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < D->n_entries; ++i)
+ if (D->entry[i]->e->n_meta != -1)
+ fl[n++] = D->entry[i]->field;
+ fl[n] = NULL;
+
+ D->field_list = (const char **)fl;
+ D->list_validity |= LIST_VALID_FIELD;
+
+ dreturn("%p", D->field_list);
+ return D->field_list;
+}
diff --git a/src/flimits.c b/src/flimits.c
new file mode 100644
index 0000000..e30506c
--- /dev/null
+++ b/src/flimits.c
@@ -0,0 +1,593 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+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_entry_t **)malloc(sizeof(gd_entry_t*) *
+ D->n_entries);
+
+ if (raw_entry == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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_TEMP))
+ 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)
+ if ((*_gd_ef[raw_entry[i]->e->u.raw.file[0].encoding].temp)(
+ raw_entry[i]->e->u.raw.file, GD_TEMP_DESTROY))
+ _GD_SetError(D, GD_E_RAW_IO, 0, raw_entry[i]->e->u.raw.file[0].name,
+ errno, NULL);
+ } else {
+ for (i = 0; i < n_raw; ++i)
+ if ((*_gd_ef[raw_entry[i]->e->u.raw.file[0].encoding].temp)(
+ raw_entry[i]->e->u.raw.file, GD_TEMP_MOVE))
+ {
+ _GD_SetError(D, GD_E_UNCLEAN_DB, 0,
+ D->fragment[D->entry[i]->fragment_index].cname, 0, NULL);
+ D->flags |= GD_INVALID;
+ }
+ }
+
+ 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);
+}
+
+static off64_t _GD_GetEOF(DIRFILE *D, gd_entry_t* E, const char *parent,
+ int *is_index)
+{
+ off64_t ns = -1, ns1;
+ gd_spf_t 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, 0, 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_SIZE))
+ break;
+
+ if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0))
+ break;
+
+ ns = (*_gd_ef[E->e->u.raw.file[0].encoding].size)(E->e->u.raw.file,
+ E->EN(raw,data_type));
+
+ if (ns < 0) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ 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:
+ if (_GD_BadInput(D, E, 0))
+ break;
+
+ ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
+ break;
+ case GD_RECIP_ENTRY:
+ if (_GD_BadInput(D, E, 0))
+ break;
+
+ ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
+ break;
+ case GD_DIVIDE_ENTRY:
+ case GD_MULTIPLY_ENTRY:
+ if (_GD_BadInput(D, E, 0) || _GD_BadInput(D, E, 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))
+ 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)) {
+ 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))
+ 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;
+ }
+
+ D->recurse_level--;
+
+ dreturn("%lli %i", (unsigned long long)ns, *is_index);
+ return ns;
+}
+
+off64_t gd_eof64(DIRFILE* D, const char *field_code_in)
+{
+ off64_t ns;
+ gd_entry_t *entry;
+ int repr, is_index;
+ char* field_code;
+
+ dtrace("%p, \"%s\"", D, field_code_in);
+
+ _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_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 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);
+
+ if (field_code != field_code_in)
+ free(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 *D, gd_entry_t* E, const char *parent,
+ gd_spf_t *spf, long long *ds)
+{
+ off64_t bof = -1, bof1;
+ gd_spf_t spf1;
+ long long 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, 0, 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:
+ if (_GD_BadInput(D, E, 0))
+ break;
+
+ bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
+ break;
+ case GD_PHASE_ENTRY:
+ if (_GD_BadInput(D, E, 0))
+ break;
+
+ bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
+
+ if (!D->error) {
+ *ds -= E->EN(phase,shift);
+
+ 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 = 0;
+ }
+
+ break;
+ case GD_RECIP_ENTRY:
+ if (_GD_BadInput(D, E, 0))
+ break;
+
+ bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
+ break;
+ case GD_MULTIPLY_ENTRY:
+ case GD_DIVIDE_ENTRY:
+ if (_GD_BadInput(D, E, 0) || _GD_BadInput(D, E, 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))
+ 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)) {
+ 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:
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, E->field);
+ break;
+ }
+
+ D->recurse_level--;
+
+ dreturn("%llu %lu %lli", (unsigned long long)bof, (unsigned long)*spf, *ds);
+ return bof;
+}
+
+off64_t gd_bof64(DIRFILE* D, const char *field_code_in) gd_nothrow
+{
+ off64_t bof;
+ gd_entry_t *entry;
+ int repr;
+ char *field_code;
+ gd_spf_t spf;
+ long long ds;
+
+ dtrace("%p, \"%s\"", D, field_code_in);
+
+ _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_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ bof = _GD_GetBOF(D, entry, NULL, &spf, &ds);
+
+ if (bof != -1)
+ bof = bof * spf + ds;
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ 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
+*/
+
diff --git a/src/flush.c b/src/flush.c
new file mode 100644
index 0000000..af55b08
--- /dev/null
+++ b/src/flush.c
@@ -0,0 +1,944 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <limits.h>
+#endif
+
+#define GD_MAX_PRETTY_FIELD_WIDTH 80
+
+void _GD_Flush(DIRFILE* D, gd_entry_t *E)
+{
+ int i;
+
+ dtrace("%p, %p", D, E);
+
+ if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+ _GD_SetError(D, GD_E_RECURSE_LEVEL, 0, NULL, 0, E->field);
+ D->recurse_level--;
+ dreturnvoid();
+ return;
+ }
+
+ switch(E->field_type) {
+ case GD_RAW_ENTRY:
+ if (E->e->u.raw.file[0].fp >= 0) {
+ if ((D->flags & GD_ACCMODE) == GD_RDWR &&
+ _gd_ef[E->e->u.raw.file[0].encoding].sync != NULL &&
+ (*_gd_ef[E->e->u.raw.file[0].encoding].sync)(E->e->u.raw.file))
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+ NULL);
+ else if ((*_gd_ef[E->e->u.raw.file[0].encoding].close)(
+ E->e->u.raw.file))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+ NULL);
+ }
+ }
+ break;
+ case GD_LINCOM_ENTRY:
+ for (i = 2; i < E->EN(lincom,n_fields); ++i)
+ _GD_Flush(D, E->e->entry[i]);
+ /* fallthrough */
+ case GD_MULTIPLY_ENTRY:
+ case GD_DIVIDE_ENTRY:
+ _GD_Flush(D, E->e->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_Flush(D, E->e->entry[0]);
+ case GD_CONST_ENTRY:
+ case GD_CARRAY_ENTRY:
+ case GD_STRING_ENTRY:
+ case GD_INDEX_ENTRY:
+ case GD_NO_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 size_t _GD_StringEscapeise(FILE* stream, const char* in, int permissive,
+ int standards)
+{
+ const char* HexDigit = "0123456789ABCDEF";
+ size_t len = 0;
+
+ dtrace("%p, \"%s\", %i, %i", stream, in, permissive, standards);
+
+ if (!permissive && standards < 6) {
+ fputs(in, stream);
+ dreturn("%zu", strlen(in));
+ return strlen(in);
+ }
+
+ for (; *in != '\0'; ++in) {
+ if (*in == '"') {
+ fputs("\\\"", stream);
+ len += 2;
+ fputc('\\', stream);
+ } else if (*in == '\\' || *in == '#' || *in == '"') {
+ fputc('\\', stream);
+ fputc(*in, stream);
+ len += 2;
+ } else if (*in < 0x20
+#if CHAR_MIN != 0
+ && *in >= 0x00
+#endif
+ ) {
+ fputs("\\x", stream);
+ fputc(HexDigit[*in >> 8], stream);
+ fputc(HexDigit[*in & 0xF], stream);
+ len += 4;
+ } else {
+ fputc(*in, stream);
+ len++;
+ }
+ }
+
+ dreturn("%zu", len);
+ return len;
+}
+
+static void _GD_PadField(FILE* stream, const char* in, size_t len,
+ int permissive, int standards)
+{
+ size_t i;
+
+ dtrace("%p, \"%s\", %zu, %i, %i", stream, in, len, permissive, standards);
+
+ for (i = _GD_StringEscapeise(stream, in, permissive, standards); i < len; ++i)
+ fputc(' ', stream);
+
+ dreturnvoid();
+}
+
+/* Write a litteral parameter or CONST name or CARRAY element */
+static void _GD_WriteConst(DIRFILE *D, FILE* stream, int type,
+ const void* value, const char* scalar, int index, const char* postamble)
+{
+ dtrace("%p, %p, %i, %p, \"%s\", %i, \"%s\"", D, stream, type, value, scalar,
+ index, postamble);
+
+ if (scalar != NULL) {
+ if (index == -1)
+ fprintf(stream, "%s%s", scalar, postamble);
+ else
+ fprintf(stream, "%s<%i>%s", scalar, index, postamble);
+ } else if (type == GD_UINT16)
+ fprintf(stream, "%" PRIu16 "%s", *(uint16_t *)value, postamble);
+ else if (type == GD_INT64)
+ fprintf(stream, "%" PRIi64 "%s", *(uint64_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);
+
+ dreturnvoid();
+}
+
+/* Write a field specification line */
+static void _GD_FieldSpec(DIRFILE* D, FILE* stream, const gd_entry_t* E,
+ int meta, size_t max_len, int pretty, int permissive)
+{
+ int i;
+ size_t z;
+ char *ptr;
+
+ dtrace("%p, %p, %p, %i, %zi, %i, %i", D, stream, E, 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) {
+ dreturnvoid();
+ return;
+ }
+
+ ptr = E->field;
+
+ /* From Standards Version 8 and on, just use Barth-style */
+ if (meta && D->standards < 8) {
+ fputs("META ", stream);
+ for (; *ptr != '/'; ++ptr)
+ fputc(*ptr, stream);
+ fputc(' ', stream);
+ ++ptr;
+ }
+
+ /* field name */
+ _GD_PadField(stream, ptr, max_len, permissive, D->standards);
+
+ switch(E->field_type) {
+ case GD_RAW_ENTRY:
+ 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)));
+ _GD_WriteConst(D, stream, GD_UINT16, &E->EN(raw,spf), E->scalar[0],
+ E->scalar_ind[0], "\n");
+ break;
+ case GD_LINCOM_ENTRY:
+ fprintf(stream, " LINCOM%s %i", pretty ? " " : "",
+ E->EN(lincom,n_fields));
+ for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+ fprintf(stream, " %s ", E->in_fields[i]);
+ if (E->comp_scal) {
+ _GD_WriteConst(D, stream, GD_COMPLEX128, &E->EN(lincom,cm)[i],
+ E->scalar[i], E->scalar_ind[i], " ");
+ _GD_WriteConst(D, stream, GD_COMPLEX128, &E->EN(lincom,cb)[i],
+ E->scalar[i + GD_MAX_LINCOM], E->scalar_ind[i + GD_MAX_LINCOM],
+ "");
+ } else {
+ _GD_WriteConst(D, stream, GD_FLOAT64, &E->EN(lincom,m)[i],
+ E->scalar[i], E->scalar_ind[i], " ");
+ _GD_WriteConst(D, stream, GD_FLOAT64, &E->EN(lincom,b)[i],
+ E->scalar[i + GD_MAX_LINCOM], E->scalar_ind[i + GD_MAX_LINCOM],
+ "");
+ }
+ }
+ fputs("\n", stream);
+ break;
+ case GD_LINTERP_ENTRY:
+ fprintf(stream, " LINTERP%s %s %s\n", pretty ? " " : "", E->in_fields[0],
+ E->EN(linterp,table));
+ break;
+ case GD_BIT_ENTRY:
+ fprintf(stream, " BIT%s %s ", pretty ? " " : "", E->in_fields[0]);
+ _GD_WriteConst(D, stream, GD_INT16, &E->EN(bit,bitnum), E->scalar[0],
+ E->scalar_ind[0], " ");
+ _GD_WriteConst(D, stream, GD_INT16, &E->EN(bit,numbits), E->scalar[1],
+ E->scalar_ind[1], "\n");
+ break;
+ case GD_DIVIDE_ENTRY:
+ fprintf(stream, " DIVIDE%s %s %s", pretty ? " " : "", E->in_fields[1],
+ E->in_fields[0]);
+ break;
+ case GD_RECIP_ENTRY:
+ fprintf(stream, " RECIP%s ", pretty ? " " : "");
+ _GD_WriteConst(D, stream, GD_COMPLEX128, &E->EN(recip,cdividend),
+ E->scalar[0], E->scalar_ind[0], "");
+ fprintf(stream, " %s", E->in_fields[0]);
+ break;
+ case GD_MULTIPLY_ENTRY:
+ fprintf(stream, " MULTIPLY %s %s\n", E->in_fields[0], E->in_fields[1]);
+ break;
+ case GD_PHASE_ENTRY:
+ fprintf(stream, " PHASE%s %s ", pretty ? " " : "", E->in_fields[0]);
+ _GD_WriteConst(D, stream, GD_INT64, &E->EN(phase,shift), E->scalar[0],
+ E->scalar_ind[0], "\n");
+ break;
+ case GD_POLYNOM_ENTRY:
+ fprintf(stream, " POLYNOM%s %s ", pretty ? " " : "", E->in_fields[0]);
+ for (i = 0; i <= E->EN(polynom,poly_ord); ++i)
+ if (E->comp_scal)
+ _GD_WriteConst(D, stream, GD_COMPLEX128, &E->EN(polynom,ca)[i],
+ E->scalar[i], E->scalar_ind[i], (i == E->EN(polynom,poly_ord)) ?
+ "\n" : " ");
+ else
+ _GD_WriteConst(D, stream, GD_FLOAT64, &E->EN(polynom,a)[i],
+ E->scalar[i], E->scalar_ind[i], (i == E->EN(polynom,poly_ord)) ?
+ "\n" : " ");
+ break;
+ case GD_SBIT_ENTRY:
+ fprintf(stream, " SBIT%s %s ", pretty ? " " : "", E->in_fields[0]);
+ _GD_WriteConst(D, stream, GD_INT16, &E->EN(bit,bitnum), E->scalar[0],
+ E->scalar_ind[0], " ");
+ _GD_WriteConst(D, stream, GD_INT16, &E->EN(bit,numbits), E->scalar[1],
+ E->scalar_ind[1], "\n");
+ break;
+ case GD_CONST_ENTRY:
+ fprintf(stream, " CONST%s %s ", pretty ? " " : "", _GD_TypeName(D,
+ E->EN(scalar,const_type)));
+ if (E->EN(scalar,const_type) & GD_SIGNED)
+ fprintf(stream, "%" PRIi64 "\n", *(int64_t*)E->e->u.scalar.d);
+ else if (E->EN(scalar,const_type) & GD_IEEE754)
+ fprintf(stream, "%.15g\n", *(double*)E->e->u.scalar.d);
+ else if (E->EN(scalar,const_type) & GD_COMPLEX)
+ fprintf(stream, "%.15g;%.15g\n", *(double*)E->e->u.scalar.d,
+ *((double*)E->e->u.scalar.d + 1));
+ else
+ fprintf(stream, "%" PRIu64 "\n", *(uint64_t*)E->e->u.scalar.d);
+ break;
+ case GD_CARRAY_ENTRY:
+ fprintf(stream, " CARRAY%s %s", pretty ? " " : "", _GD_TypeName(D,
+ E->EN(scalar,const_type)));
+ if (E->EN(scalar,const_type) & GD_SIGNED)
+ for (z = 0; z < E->EN(scalar,array_len); ++z)
+ fprintf(stream, " %" PRIi64, ((int64_t*)E->e->u.scalar.d)[z]);
+ else if (E->EN(scalar,const_type) & GD_IEEE754)
+ for (z = 0; z < E->EN(scalar,array_len); ++z)
+ fprintf(stream, " %.15g", ((double*)E->e->u.scalar.d)[z]);
+ else if (E->EN(scalar,const_type) & GD_COMPLEX)
+ for (z = 0; z < E->EN(scalar,array_len); ++z)
+ fprintf(stream, " %.15g;%.15g", ((double*)E->e->u.scalar.d)[2 * z],
+ ((double*)E->e->u.scalar.d)[2 * z + 1]);
+ else
+ for (z = 0; z < E->EN(scalar,array_len); ++z)
+ fprintf(stream, " %" PRIu64, ((uint64_t*)E->e->u.scalar.d)[z]);
+ fputs("\n", stream);
+ break;
+ case GD_STRING_ENTRY:
+ fprintf(stream, " STRING%s \"", pretty ? " " : "");
+ _GD_StringEscapeise(stream, E->e->u.string, permissive, D->standards);
+ fputs("\"\n", stream);
+ break;
+ case GD_INDEX_ENTRY:
+ case GD_NO_ENTRY:
+ _GD_InternalError(D);
+ break;
+ }
+
+ dreturnvoid();
+}
+
+static void _GD_FlushFragment(DIRFILE* D, int i, int permissive)
+{
+ int j;
+ FILE* stream;
+ char buffer[GD_MAX_LINE_LENGTH];
+ char *temp_file;
+ char* ptr;
+ struct tm now;
+ int fd;
+ int pretty = 0;
+ size_t max_len = 0;
+ const size_t name_len = strlen(D->name);
+ unsigned int u;
+ mode_t mode;
+ struct stat stat_buf;
+ time_t t;
+
+ dtrace("%p, %i, %i", D, i, permissive);
+
+ /* get the permissions of the old file */
+ if (stat(D->fragment[i].cname, &stat_buf))
+ mode = 0644;
+ else
+ mode = stat_buf.st_mode;
+
+ /* open a temporary file */
+ temp_file = (char *)malloc(name_len + 15);
+ snprintf(temp_file, name_len + 15, "%s/format_XXXXXX", D->name);
+ fd = mkstemp(temp_file);
+ if (fd == -1) {
+ _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_MKTMP, NULL, errno, temp_file);
+ free(temp_file);
+ dreturnvoid();
+ return;
+ }
+ stream = fdopen(fd, "w+");
+ if (stream == NULL) {
+ _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_OPEN, NULL, errno, temp_file);
+ free(temp_file);
+ dreturnvoid();
+ return;
+ }
+
+ if (D->flags & GD_PRETTY_PRINT) {
+ size_t t = 0;
+ size_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) {
+ size_t l = strlen(D->entry[u]->field);
+ if (m < l)
+ m = l;
+ t += l;
+ n++;
+ }
+ max_len = 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));
+
+ 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);
+
+ if ((ptr = getenv("LOGNAME")) != NULL) {
+ fprintf(stream, " by %s", ptr);
+ if ((ptr = getenv("HOSTNAME")) != NULL)
+ fprintf(stream, "@%s", ptr);
+ }
+ fputs(".\n\n", stream);
+
+ if (permissive)
+ fprintf(stream, "# WARNING: This fragment may not conform to any "
+ "Dirfile Standards Version.\n");
+ else if (D->standards >= 5)
+ fprintf(stream, "/VERSION %i\n", D->standards);
+ else
+ fprintf(stream, "# This fragment conforms to "
+ "Dirfile Standards Version %i.\n", D->standards);
+
+ /* Byte Sex */
+ if (permissive || D->standards >= 5)
+ 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" :
+ "");
+
+ if (permissive || D->standards >= 6) {
+ if (D->fragment[i].protection == GD_PROTECT_NONE)
+ fputs("/PROTECT none\n", stream);
+ else if (D->fragment[i].protection == GD_PROTECT_FORMAT)
+ fputs("/PROTECT format\n", stream);
+ else if (D->fragment[i].protection == GD_PROTECT_FORMAT)
+ fputs("/PROTECT data\n", stream);
+ else
+ fputs("/PROTECT all\n", stream);
+ }
+
+ if (permissive || D->standards >= 1)
+ if (D->fragment[i].frame_offset != 0)
+ fprintf(stream, "%sFRAMEOFFSET %llu\n", (D->standards >= 5) ? "/" : "",
+ (unsigned long long)D->fragment[i].frame_offset);
+
+ if (permissive || D->standards >= 6) {
+ switch(D->fragment[i].encoding) {
+ case GD_UNENCODED:
+ fputs("/ENCODING none\n", stream);
+ break;
+ case GD_BZIP2_ENCODED:
+ fputs("/ENCODING bzip2\n", stream);
+ break;
+ case GD_GZIP_ENCODED:
+ fputs("/ENCODING gzip\n", stream);
+ break;
+ case GD_LZMA_ENCODED:
+ fputs("/ENCODING lzma\n", stream);
+ break;
+ case GD_SLIM_ENCODED:
+ fputs("/ENCODING slim\n", stream);
+ break;
+ case GD_TEXT_ENCODED:
+ fputs("/ENCODING text\n", stream);
+ break;
+ case 0:
+ break;
+ default:
+ fprintf(stream, "/ENCODING unknown # (%lx)\n", D->fragment[i].encoding);
+ break;
+ }
+ }
+
+ /* The includes */
+ if (permissive || D->standards >= 3)
+ for (j = 0; j < D->n_fragment; ++j)
+ if (D->fragment[j].parent == i)
+ fprintf(stream, "%sINCLUDE %s\n", (D->standards >= 5) ? "/" : "",
+ D->fragment[j].ename);
+
+ /* The fields */
+ for (u = 0; u < D->n_entries; ++u)
+ if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) {
+ _GD_FieldSpec(D, stream, D->entry[u], 0, max_len, pretty, permissive);
+ if (permissive || D->standards >= 6)
+ for (j = 0; j < D->entry[u]->e->n_meta; ++j)
+ _GD_FieldSpec(D, stream, D->entry[u]->e->p.meta_entry[j], 1, 0,
+ pretty, permissive);
+ }
+
+ /* REFERENCE is written at the end, because its effect can propagate
+ * upwards */
+ if (permissive || D->standards >= 6)
+ if (D->fragment[i].ref_name != NULL) {
+ fputs("/REFERENCE ", stream);
+ _GD_StringEscapeise(stream, D->fragment[i].ref_name, permissive,
+ D->standards);
+ fputc('\n', stream);
+ }
+
+ /* That's all; flush, sync, and close */
+ fflush(stream);
+ fsync(fd);
+#ifdef HAVE_FCHMOD
+ fchmod(fd, mode);
+#endif
+ fclose(stream);
+
+ /* If no error was encountered, move the temporary file over the
+ * old format file, otherwise abort */
+ if (D->error != GD_E_OK) {
+ unlink(temp_file);
+ free(temp_file);
+ dreturnvoid();
+ return;
+ /* Only assume we've synced the file if the rename succeeds */
+ } else if (_GD_Rename(temp_file, D->fragment[i].cname)) {
+ _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_RENAME, NULL, errno,
+ D->fragment[i].cname);
+ unlink(temp_file);
+ free(temp_file);
+ dreturnvoid();
+ return;
+ } else
+ D->fragment[i].modified = 0;
+
+ free(temp_file);
+ 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_PERMISSIVE);
+ } else if (force || D->fragment[fragment].modified)
+ _GD_FlushFragment(D, fragment, D->flags & GD_PERMISSIVE);
+
+ 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;
+}
+
+int gd_flush(DIRFILE* D, const char* field_code)
+{
+ unsigned int i;
+ int repr;
+ char *simple_field_code;
+ 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);
+ 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]);
+ } else {
+ /* discard representation */
+ E = _GD_FindFieldAndRepr(D, field_code, &simple_field_code, &repr, NULL, 1);
+
+ if (!D->error)
+ _GD_Flush(D, E);
+
+ if (field_code != simple_field_code)
+ free(simple_field_code);
+ }
+
+ dreturn("%i", (D->error == GD_E_OK) ? 0 : -1);
+ return (D->error == GD_E_OK) ? 0 : -1;
+}
+
+#define GD_VERS_GE_1 0xFFFFFFFFFFFFFFFELU
+#define GD_VERS_GE_2 0xFFFFFFFFFFFFFFFCLU
+#define GD_VERS_GE_3 0xFFFFFFFFFFFFFFF8LU
+#define GD_VERS_GE_4 0xFFFFFFFFFFFFFFF0LU
+#define GD_VERS_GE_5 0xFFFFFFFFFFFFFFE0LU
+#define GD_VERS_GE_6 0xFFFFFFFFFFFFFFC0LU
+#define GD_VERS_GE_7 0xFFFFFFFFFFFFFF80LU
+#define GD_VERS_GE_8 0xFFFFFFFFFFFFFF00LU
+
+#define GD_VERS_LE_0 0x0000000000000001LU
+#define GD_VERS_LE_1 0x0000000000000003LU
+#define GD_VERS_LE_2 0x0000000000000007LU
+#define GD_VERS_LE_3 0x000000000000000fLU
+#define GD_VERS_LE_4 0x000000000000001fLU
+#define GD_VERS_LE_5 0x000000000000003fLU
+#define GD_VERS_LE_6 0x000000000000007fLU
+#define GD_VERS_LE_7 0x00000000000000ffLU
+#define GD_VERS_LE_8 0x00000000000001ffLU
+
+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) {
+ /* 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 */
+ if (D->fragment[i].byte_sex & GD_ARM_FLAG)
+#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) {
+ 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_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 '.':
+ 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("%04llx", 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_BAD_VERSION, (D->av == 0) ? GD_E_VERS_NONE :
+ GD_E_VERS_MISSING, NULL, vers, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ D->standards = vers;
+ dreturn("%i", vers);
+ return vers;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/fragment.c b/src/fragment.c
new file mode 100644
index 0000000..df08a64
--- /dev/null
+++ b/src/fragment.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2008,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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+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_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;
+}
diff --git a/src/getdata.c b/src/getdata.c
new file mode 100644
index 0000000..6e3e1b0
--- /dev/null
+++ b/src/getdata.c
@@ -0,0 +1,1608 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <inttypes.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#include "nan.h"
+
+#define EXTRACT_REPR(it,ot,f) \
+ for (i = 0; i < n; ++i) ((ot *)rdata)[i] = (ot)f(((it *)cdata)[i])
+
+#ifdef GD_NO_C99_API
+#define fargs(x) (((x) < 0) ? M_PI : 0)
+#define fargu(x) (((x) & (1 << sizeof((x)))) ? M_PI : 0)
+
+#define EXTRACT_REPRC(it,ot,f) \
+ for (i = 0; i < n; ++i) ((ot *)rdata)[i] = (ot)f((it *)cdata + 2 * i)
+
+#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; \
+ }
+
+#define EXTRACT_REPRR2(it,ot,f) \
+ 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,fabs); break; \
+ case GD_REPR_ARG: EXTRACT_REPR(it,ot,f); 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,fargs); break; \
+ case GD_UINT16: EXTRACT_REPRR2( uint16_t, ot,fargu); break; \
+ case GD_INT16: EXTRACT_REPRR2( int16_t, ot,fargs); break; \
+ case GD_UINT32: EXTRACT_REPRR2( uint32_t, ot,fargu); break; \
+ case GD_INT32: EXTRACT_REPRR2( int32_t, ot,fargs); break; \
+ case GD_UINT64: EXTRACT_REPRR2( uint64_t, ot,fargu); break; \
+ case GD_INT64: EXTRACT_REPRR2( int64_t, ot,fargs); break; \
+ case GD_FLOAT32: EXTRACT_REPRR2( float, ot,fargs); break; \
+ case GD_FLOAT64: EXTRACT_REPRR2( double, ot,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); \
+ }
+#else
+#define EXTRACT_REPR2(it,ot) \
+ switch (repr) { \
+ case GD_REPR_REAL: EXTRACT_REPR(it,ot,creal); break; \
+ case GD_REPR_IMAG: EXTRACT_REPR(it,ot,cimag); break; \
+ case GD_REPR_MOD: EXTRACT_REPR(it,ot,cabs); break; \
+ case GD_REPR_ARG: EXTRACT_REPR(it,ot,carg); break; \
+ }
+
+#define EXTRACT_REPRS(ot) \
+ switch (in_type) { \
+ case GD_UINT8: EXTRACT_REPR2( uint8_t, ot); break; \
+ case GD_INT8: EXTRACT_REPR2( int8_t, ot); break; \
+ case GD_UINT16: EXTRACT_REPR2( uint16_t, ot); break; \
+ case GD_INT16: EXTRACT_REPR2( int16_t, ot); break; \
+ case GD_UINT32: EXTRACT_REPR2( uint32_t, ot); break; \
+ case GD_INT32: EXTRACT_REPR2( int32_t, ot); break; \
+ case GD_UINT64: EXTRACT_REPR2( uint64_t, ot); break; \
+ case GD_INT64: EXTRACT_REPR2( int64_t, ot); break; \
+ case GD_FLOAT32: EXTRACT_REPR2( float, ot); break; \
+ case GD_FLOAT64: EXTRACT_REPR2( double, ot); break; \
+ case GD_COMPLEX64: EXTRACT_REPR2( complex float, ot); break; \
+ case GD_COMPLEX128: EXTRACT_REPR2(complex double, ot); break; \
+ case GD_NULL: \
+ break; \
+ default: \
+ _GD_SetError(D, GD_E_BAD_TYPE, in_type, NULL, 0, NULL); \
+ }
+#endif
+
+
+static void _GD_ExtractRepr(DIRFILE* D, const void* cdata, gd_type_t in_type,
+ void* rdata, gd_type_t type, size_t n, int repr)
+{
+ size_t i;
+
+ dtrace("%p, %p, %x, %p, %x, %zu, %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;
+ }
+}
+
+/* _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, %zu", dataout, rtype, 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_r2ca(dataout, i, i + s0, float);
+ break;
+ case GD_COMPLEX128:
+ for (i = 0; i < n; i++)
+ _gd_r2ca(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, %zu", 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("%zu", nz);
+
+ return (nz);
+}
+
+/* _GD_DoRaw: Read from a raw. Returns number of samples read.
+*/
+static size_t _GD_DoRaw(DIRFILE *D, gd_entry_t *E, off64_t s0, size_t ns,
+ gd_type_t return_type, void *data_out)
+{
+ size_t n_read = 0;
+ ssize_t samples_read;
+ char *databuffer;
+ size_t zero_pad = 0;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p)", D, E, 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 = (char *)malloc(ns * E->e->u.raw.size);
+ if (databuffer == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (zero_pad > 0) {
+ n_read = _GD_FillZero(databuffer, E->EN(raw,data_type), (zero_pad > ns) ?
+ ns :
+ zero_pad);
+ ns -= n_read;
+ s0 = 0;
+ }
+
+ if (ns > 0) {
+ /** open the file (and cache the fp) if it hasn't been opened yet. */
+ if (E->e->u.raw.file[0].fp < 0) {
+ if (!_GD_Supports(D, E, GD_EF_OPEN | GD_EF_SEEK | GD_EF_READ)) {
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ } else if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase,
+ 0))
+ {
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ } else if ((*_gd_ef[E->e->u.raw.file[0].encoding].open)(E->e->u.raw.file,
+ D->flags & GD_ACCMODE, 0))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+ NULL);
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ }
+ }
+
+ if ((*_gd_ef[E->e->u.raw.file[0].encoding].seek)(E->e->u.raw.file, s0,
+ E->EN(raw,data_type), 0) == -1)
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ samples_read =
+ (*_gd_ef[E->e->u.raw.file[0].encoding].read)(E->e->u.raw.file,
+ databuffer + n_read * E->e->u.raw.size, E->EN(raw,data_type), ns);
+
+ if (samples_read == -1) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (_gd_ef[E->e->u.raw.file[0].encoding].ecor) {
+ /* convert to/from middle-ended doubles */
+ if ((E->EN(raw,data_type) == GD_FLOAT64 ||
+ E->EN(raw,data_type) == GD_COMPLEX128) &&
+ D->fragment[E->fragment_index].byte_sex & GD_ARM_FLAG)
+ {
+ _GD_ArmEndianise((uint64_t *)(databuffer + n_read * E->e->u.raw.size),
+ E->EN(raw,data_type) & GD_COMPLEX, samples_read);
+ }
+
+ if (D->fragment[E->fragment_index].byte_sex &
+#ifdef WORDS_BIGENDIAN
+ GD_LITTLE_ENDIAN
+#else
+ GD_BIG_ENDIAN
+#endif
+ )
+ {
+ if (E->EN(raw,data_type) & GD_COMPLEX)
+ _GD_FixEndianness(databuffer + n_read * E->e->u.raw.size,
+ E->e->u.raw.size / 2, samples_read * 2);
+ else
+ _GD_FixEndianness(databuffer + n_read * E->e->u.raw.size,
+ E->e->u.raw.size, samples_read);
+ }
+ }
+
+ n_read += samples_read;
+ }
+ _GD_ConvertType(D, databuffer, E->EN(raw,data_type), data_out, return_type,
+ n_read);
+
+ free(databuffer);
+
+ dreturn("%zu", (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: POLYNOM2(t,2 * npts); break; \
+ case 3: POLYNOM3(t,2 * npts); break; \
+ case 4: POLYNOM4(t,2 * npts); break; \
+ case 5: POLYNOM5(t,2 * npts); break; \
+ default: _GD_InternalError(D); \
+ }
+#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* D, void *data, gd_type_t type, size_t npts,
+ int n, double* a)
+{
+ size_t i;
+
+ dtrace("%p, %p, 0x%x, %zu, %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 POLYNOM5
+#undef POLYNOM4
+#undef POLYNOM3
+#undef POLYNOM2
+#undef POLYNOMC
+
+#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][0] \
+ + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[4][0]\
+ + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3][0] \
+ + ((t*)data)[i] * ((t*)data)[i] * a[2][0] \
+ + ((t*)data)[i] * a[1][0] + a[0][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][0] \
+ + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3][0] \
+ + ((t*)data)[i] * ((t*)data)[i] * a[2][0] \
+ + ((t*)data)[i] * a[1][0] + a[0][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][0] \
+ + ((t*)data)[i] * ((t*)data)[i] * a[2][0] \
+ + ((t*)data)[i] * a[1][0] + a[0][0] \
+ )
+
+#define POLYNOM2(t,npts) \
+ for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \
+ ((t*)data)[i] * ((t*)data)[i] * a[2][0] \
+ + ((t*)data)[i] * a[1][0] + a[0][0] \
+ )
+
+#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)
+
+#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); \
+ }
+#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* D, void *data, gd_type_t type,
+ size_t npts, int n, GD_DCOMPLEXV(a))
+{
+ size_t i;
+
+ dtrace("%p, %p, 0x%x, %zu, %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: 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
+#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 B. B is unchanged.
+*/
+static void _GD_MultiplyData(DIRFILE* D, void *A, gd_spf_t spfA, double *B,
+ gd_spf_t spfB, gd_type_t type, size_t n)
+{
+ size_t i;
+
+ dtrace("%p, %p, %u, %p, %u, 0x%x, %zu", 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 MULTIPLY
+#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)
+
+#define MULTIPLY(t) \
+ for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] * \
+ B[2 * (i * spfB / spfA)])
+
+#endif
+
+/* CMultiplyData: Multiply A by B. B is complex.
+*/
+static void _GD_CMultiplyData(DIRFILE* D, void *A, gd_spf_t spfA,
+ GD_DCOMPLEXP(B), gd_spf_t spfB, gd_type_t type, size_t n)
+{
+ size_t i;
+
+ dtrace("%p, %p, %u, %p, %u, 0x%x, %zu", 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
+#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 *D, void *A, gd_spf_t spfA, double *B,
+ gd_spf_t spfB, gd_type_t type, size_t n)
+{
+ size_t i;
+
+ dtrace("%p, %p, %u, %p, %u, 0x%x, %zu", 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 DIVIDE
+#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)((x * B[i2] + y * B[i2 + 1]) / d); \
+ } \
+ } while (0)
+
+#define DIVIDE(t) \
+ for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] / \
+ B[2 * (i * spfB / spfA)])
+
+#endif
+
+/* CDivideData: Divide A by B. B is complex.
+*/
+static void _GD_CDivideData(DIRFILE *D, void *A, gd_spf_t spfA,
+ GD_DCOMPLEXP(B), gd_spf_t spfB, gd_type_t type, size_t n)
+{
+ size_t i;
+
+ dtrace("%p, %p, %u, %p, %u, 0x%x, %zu", 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();
+}
+
+/* _GD_DoLincom: Read from a lincom. Returns number of samples read.
+*/
+static size_t _GD_DoLincom(DIRFILE *D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *data_out)
+{
+ gd_spf_t 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, %zu, 0x%x, %p", D, E, 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)) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ spf[i] = _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 -- 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 <foo> to <bar>. 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("%zu", 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->comp_scal)
+ _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("%zu", n_read);
+ return n_read;
+}
+
+/* _GD_DoMultiply: Read from a multiply. Returns number of samples read.
+*/
+static size_t _GD_DoMultiply(DIRFILE *D, gd_entry_t* E, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *data_out)
+{
+ void *tmpbuf = NULL;
+ gd_spf_t spf1, spf2;
+ size_t n_read, n_read2, num_samp2;
+ off64_t first_samp2;
+ gd_type_t type2;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, return_type,
+ data_out);
+
+ /* Check input fields */
+ if (_GD_BadInput(D, E, 0)) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (_GD_BadInput(D, E, 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, (GD_DCOMPLEXP_t)tmpbuf, spf2,
+ return_type, n_read);
+ else
+ _GD_MultiplyData(D, data_out, spf1, (double *)tmpbuf, spf2, return_type,
+ n_read);
+
+ free(tmpbuf);
+
+ dreturn("%zu", n_read);
+ return n_read;
+}
+
+/* _GD_DoRecip: Read from a recip. Returns number of samples read.
+*/
+static size_t _GD_DoRecip(DIRFILE *D, gd_entry_t* E, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *data_out)
+{
+ size_t n_read;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, return_type,
+ data_out);
+
+ /* Check input fields */
+ if (_GD_BadInput(D, E, 0)) {
+ 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->comp_scal)
+ _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("%zu", n_read);
+ return n_read;
+}
+
+/* _GD_DoDivide: Read from a divide. Returns number of samples read.
+*/
+static size_t _GD_DoDivide(DIRFILE *D, gd_entry_t* E, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *data_out)
+{
+ void *tmpbuf = NULL;
+ gd_spf_t spf1, spf2;
+ size_t n_read, n_read2, num_samp2;
+ off64_t first_samp2;
+ gd_type_t type2;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, return_type,
+ data_out);
+
+ /* Check input fields */
+ if (_GD_BadInput(D, E, 0) || _GD_BadInput(D, E, 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("%zu", 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 *D, gd_entry_t *E, int is_signed,
+ off64_t first_samp, size_t num_samp, gd_type_t return_type, void *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, %zu, 0x%x, %p", D, E, is_signed, first_samp,
+ num_samp, return_type, data_out);
+
+ if (_GD_BadInput(D, E, 0)) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (is_signed)
+ tmpbuf = (int64_t *)malloc(num_samp * sizeof(int64_t));
+ else
+ tmpbuf = (uint64_t *)malloc(num_samp * sizeof(uint64_t));
+ if (tmpbuf == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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 = -1 << (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("%zu", n_read);
+ return n_read;
+}
+
+/* _GD_DoPhase: Read from a phase. Returns number of samples read.
+*/
+static size_t _GD_DoPhase(DIRFILE *D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *data_out)
+{
+ size_t n_read;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, return_type,
+ data_out);
+
+ if (_GD_BadInput(D, E, 0)) {
+ 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("%zu", n_read);
+ return n_read;
+}
+
+/* _GD_DoLinterp: Read from a linterp. Returns number of samples read.
+*/
+static size_t _GD_DoLinterp(DIRFILE *D, gd_entry_t* E, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *data_out)
+{
+ size_t n_read = 0;
+ double* data_in;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, return_type,
+ data_out);
+
+ if (E->e->u.linterp.table_len < 0) {
+ _GD_ReadLinterpFile(D, E);
+ if (D->error != GD_E_OK) {
+ dreturn("%i", 0);
+ return 0;
+ }
+ }
+
+ if (_GD_BadInput(D, E, 0)) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ /* allocate a temporary buffer */
+ data_in = (double *)_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("%zu", n_read);
+ return n_read;
+}
+
+/* _GD_DoPolynom: Read from a polynom. Returns number of samples read.
+*/
+static size_t _GD_DoPolynom(DIRFILE *D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *data_out)
+{
+ size_t n_read;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, return_type,
+ data_out);
+
+ if (_GD_BadInput(D, E, 0)) {
+ 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->comp_scal)
+ _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("%zu", n_read);
+ return n_read;
+}
+
+/* _GD_DoConst: Read from a const. Returns number of samples read (ie. 1).
+*/
+static size_t _GD_DoConst(DIRFILE *D, const gd_entry_t *E, off64_t first,
+ size_t len, gd_type_t return_type, void *data_out)
+{
+ gd_type_t type;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, 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("%i", 1);
+ return 1;
+}
+
+/* _GD_DoString: Read from a string. Returns number of samples read (ie. the
+ * length of the string plus 1).
+ */
+static size_t _GD_DoString(gd_entry_t *E, size_t num_samp, char *data_out)
+{
+ dtrace("%p, %zu, %p", E, num_samp, data_out);
+
+ if (num_samp > 0 && data_out != NULL)
+ strncpy(data_out, E->e->u.string, num_samp);
+
+ dreturn("%zu", strlen(E->e->u.string) + 1);
+ return strlen(E->e->u.string) + 1;
+}
+
+/* _GD_DoField: Locate the field in the database and read it.
+*/
+size_t _GD_DoField(DIRFILE *D, gd_entry_t *E, int repr, off64_t first_samp,
+ size_t num_samp, gd_type_t return_type, void *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, %zu, 0x%x, %p", D, E, E->field, repr,
+ first_samp, num_samp, return_type, data_out);
+
+ if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+ _GD_SetError(D, GD_E_RECURSE_LEVEL, 0, NULL, 0, E->field);
+ D->recurse_level--;
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (!E->e->calculated)
+ _GD_CalculateEntry(D, E);
+
+ if (D->error) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ /* calculate the native type */
+ ntype = _GD_NativeType(D, E, GD_REPR_NONE);
+
+ if (D->error) {
+ 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("%zu", 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_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:
+ n_read = _GD_DoString(E, num_samp, (char *)data_out);
+ break;
+ 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("%zu", 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;
+ gd_spf_t spf;
+
+ dtrace("%p, \"%s\", %lli, %lli, %zu, %zu, 0x%x, %p", D, field_code_in,
+ first_frame, 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);
+
+ if (D->error) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (entry->field_type & GD_SCALAR_ENTRY)
+ _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;
+ }
+
+ /* 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;
+
+ n_read = _GD_DoField(D, entry, repr, first_samp, num_samp, return_type,
+ data_out);
+
+ dreturn("%zu", 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
+*/
diff --git a/src/getdata.h.in b/src/getdata.h.in
new file mode 100644
index 0000000..9b9e9c1
--- /dev/null
+++ b/src/getdata.h.in
@@ -0,0 +1,1053 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2003-2005 Theodore Kisner
+ * Copyright (C) 2005-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
+ */
+
+/* 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_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 8
+
+#include <math.h>
+#include <sys/types.h>
+
+/* If this symbol is defined here, the C99-API is not present in the library */
+ at 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 defined __nonnull
+# define gd_nonnull __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 actualy 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
+
+/* maximum number of elements allowed in a CARRAY. Really the maximum should be
+ * whatever fits on a format file line, but that's hard to calculate. This is
+ * 2**(n-8)-1 on a n-bit system.
+ */
+#define GD_MAX_CARRAY_LENGTH ((int)(((unsigned int)-1) >> 8))
+
+
+/* error codes */
+#define GD_E_OK 0 /* this MUST be zero */
+#define GD_E_OPEN 1
+#define GD_E_FORMAT 2
+#define GD_E_TRUNC 3
+#define GD_E_CREAT 4
+#define GD_E_BAD_CODE 5
+#define GD_E_BAD_TYPE 6
+#define GD_E_RAW_IO 7
+#define GD_E_OPEN_FRAGMENT 8
+#define GD_E_INTERNAL_ERROR 9
+#define GD_E_ALLOC 10
+#define GD_E_RANGE 11
+#define GD_E_OPEN_LINFILE 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_BAD_ENDIANNESS 27
+#define GD_E_CALLBACK 28
+#define GD_E_BAD_PROTECTION 29
+#define GD_E_UNCLEAN_DB 30
+#define GD_E_DOMAIN 31
+#define GD_E_BAD_REPR 32
+#define GD_E_BAD_VERSION 33
+#define GD_E_FLUSH 34
+#define GD_E_BOUNDS 35
+#define GD_E_LINE_TOO_LONG 36
+
+#define GD_N_ERROR_CODES 37
+
+/* Deprecated error codes */
+#define GD_E_OPEN_INCLUDE GD_E_OPEN_FRAGMENT
+
+#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_PARENT 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
+
+/* 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 0x10
+/* 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_CONST_ENTRY = GD_SCALAR_ENTRY | 0x00,
+ GD_STRING_ENTRY = GD_SCALAR_ENTRY | 0x01,
+ GD_CARRAY_ENTRY = GD_SCALAR_ENTRY | 0x02
+} gd_entype_t;
+
+/* GD_NO_ENTRY is not part of this count */
+#define GD_N_ENTYPES 14
+
+ at DEFINE_gd_int16_t@
+ at DEFINE_gd_uint16_t@
+ at DEFINE_gd_int64_t@
+
+#if ! defined GD_C89_API
+# include <inttypes.h>
+# define GD_DCOMPLEXM(v) double _Complex v
+# define GD_DCOMPLEXP(v) double _Complex *v
+typedef int16_t gd_bit_t;
+typedef uint16_t gd_spf_t;
+typedef int64_t gd_shift_t;
+#else
+# define GD_DCOMPLEXM(v) double v[2]
+# define GD_DCOMPLEXP(v) double *v
+typedef gd_int16_t gd_bit_t;
+typedef gd_uint16_t gd_spf_t;
+typedef gd_int64_t gd_shift_t;
+#endif
+
+/* 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
+
+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;
+#define GD_FLOAT GD_FLOAT32
+#define GD_DOUBLE GD_FLOAT64
+
+struct _gd_private_entry;
+
+/* 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;
+ int comp_scal;
+ union {
+ struct { /* RAW */
+ gd_spf_t 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 */
+ gd_bit_t bitnum;
+ gd_bit_t 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 { /* 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 dirifle 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_ENCODING 0x0F000000 /* mask */
+#define GD_AUTO_ENCODED 0x00000000 /* Encoding scheme unknown */
+#define GD_UNENCODED 0x01000000 /* Dirfile is not encoded */
+#define GD_TEXT_ENCODED 0x02000000 /* Dirfile is text encoded */
+#define GD_SLIM_ENCODED 0x03000000 /* Dirfile is slimlib encoded */
+#define GD_GZIP_ENCODED 0x04000000 /* Dirfile is gzip encoded */
+#define GD_BZIP2_ENCODED 0x05000000 /* Dirfile is bzip2 encoded */
+#define GD_LZMA_ENCODED 0x06000000 /* Dirfile is xz encoded */
+#define GD_ENC_UNSUPPORTED GD_ENCODING /* Dirfile encoding unsupported */
+
+/* delete flags */
+#define GD_DEL_META 0x1
+#define GD_DEL_DATA 0x2
+#define GD_DEL_DEREF 0x4
+#define GD_DEL_FORCE 0x8
+
+extern int gd_add_bit(DIRFILE *dirfile, const char *field_code,
+ const char *in_field, gd_bit_t bitnum, gd_bit_t 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_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, gd_bit_t bitnum, gd_bit_t 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_alter_bit(DIRFILE *dirfile, const char *field_code,
+ const char *in_field, gd_bit_t bitnum, gd_bit_t 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_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, gd_bit_t bitnum, gd_bit_t numbits) gd_nothrow
+gd_nonnull((1,2));
+
+extern size_t gd_carray_len(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull((1,2));
+
+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 int 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 int 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 gd_entry_t *gd_free_entry_strings(gd_entry_t *entry) gd_nothrow;
+
+extern unsigned long int gd_encoding(DIRFILE *dirfile,
+ int fragment) gd_nothrow gd_nonnull ((1));
+
+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 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 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 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 DIRFILE *gd_invalid_dirfile(void) gd_nothrow;
+
+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_bit(DIRFILE *dirfile, const char *parent,
+ const char *field_code, const char *in_field, gd_bit_t bitnum,
+ gd_bit_t 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_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, gd_bit_t bitnum,
+ gd_bit_t 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_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 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 gd_type_t gd_native_type(DIRFILE *dirfile,
+ const char *field_code) gd_nothrow gd_nonnull ((1,2));
+
+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 const 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 gd_spf_t 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 int gd_validate(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull((1,2));
+
+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, gd_spf_t 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, gd_spf_t 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,
+ int flags) gd_nonnull ((1,2));
+
+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 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,
+ int move_data) gd_nonnull ((1,2));
+
+extern DIRFILE *gd_open(const char *dirfilename,
+ unsigned long int flags) gd_nonnull ((1));
+
+extern int gd_rename(DIRFILE *dirfile, const char *old_code,
+ const char *new_name, int move_data) gd_nonnull ((1,2,3));
+
+extern int gd_rewrite_fragment(DIRFILE *dirfile, int fragment) gd_nonnull ((1));
+
+extern int gd_uninclude(DIRFILE *dirfile, int fragment_index,
+ int del) gd_nonnull ((1));
+
+/* the following functions are _FILE_OFFSET_BITS sensitive */
+#if !defined _FILE_OFFSET_BITS || _FILE_OFFSET_BITS != 64
+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));
+#else
+# ifdef __REDIRECT_NTH
+extern off_t __REDIRECT_NTH (gd_bof, (DIRFILE *dirfile, const char *field_code),
+ gd_bof64) gd_nonnull ((1,2));
+
+extern off_t __REDIRECT_NTH (gd_frameoffset, (DIRFILE *dirfile, int fragment),
+ gd_frameoffset64) gd_nonnull ((1));
+# else
+# define gd_bof gd_bof64
+# define gd_frameoffset gd_frameoffset64
+# endif
+
+# ifdef __REDIRECT
+extern int __REDIRECT (gd_alter_frameoffset, (DIRFILE *dirfile, off_t offset,
+ int fragment, int recode), gd_alter_frameoffset64) gd_nonnull ((1));
+
+extern size_t __REDIRECT (gd_getdata, (DIRFILE *dirfile, 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), gd_getdata64) gd_nonnull ((1, 2));
+
+extern size_t __REDIRECT (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_putdata64) gd_nonnull ((1, 2));
+
+extern off_t __REDIRECT (gd_nframes, (DIRFILE *dirfile),
+ gd_nframes64) gd_nonnull ((1));
+
+extern off_t __REDIRECT (gd_eof, (DIRFILE *dirfile, const char *field_code),
+ gd_eof64) gd_nonnull ((1,2));
+
+extern double __REDIRECT (gd_framenum_subset, (DIRFILE *dirfile,
+ const char *field_code, double value, off_t field_start, off_t field_end),
+ gd_framenum_subset64) gd_nonnull ((1,2));
+# else
+# define gd_alter_frameoffset gd_alter_frameoffset64
+# define gd_getdata gd_getdata64
+# define gd_putdata gd_putdata64
+# define gd_nframes gd_nframes64
+# define gd_eof gd_eof64
+# define gd_framenum_subset gd_framenum_subset64
+# endif
+#endif
+
+/* if required, declare the LFS transitional extension */
+#if defined _LARGEFILE64_SOURCE || (defined _FILE_OFFSET_BITS && \
+ _FILE_OFFSET_BITS == 64) || (defined __CYGWIN__) || (defined __APPLE__)
+
+#if (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) || \
+ (defined __APPLE__) || (defined __CYGWIN__)
+#define gd_off64_t off_t
+#else
+#define gd_off64_t 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));
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* If this symbol is defined here, the legacy API is present in the library */
+ at 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 <getdata_legacy.h>
+# endif
+#endif
+
+/* 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
diff --git a/src/getdata.pc.in b/src/getdata.pc.in
new file mode 100644
index 0000000..3f600dd
--- /dev/null
+++ b/src/getdata.pc.in
@@ -0,0 +1,13 @@
+# 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}
diff --git a/src/getdata_legacy.h b/src/getdata_legacy.h
new file mode 100644
index 0000000..3439b83
--- /dev/null
+++ b/src/getdata_legacy.h
@@ -0,0 +1,130 @@
+/* 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 <getdata_legacy.h> directly; include <getdata.h> 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
diff --git a/src/globals.c b/src/globals.c
new file mode 100644
index 0000000..fd4c4ad
--- /dev/null
+++ b/src/globals.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <string.h>
+#include <stdlib.h>
+#endif
+
+/* This is nothing other than what the caller gave us. Presumably it should
+ * be better at keeping track of such things than us, but this is present in
+ * the event that it is not. */
+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->name);
+ return D->name;
+}
+
+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, NULL);
+
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, 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 = strdup(E->field);
+
+ if (ptr == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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;
+}
diff --git a/src/gzip.c b/src/gzip.c
new file mode 100644
index 0000000..158c37f
--- /dev/null
+++ b/src/gzip.c
@@ -0,0 +1,149 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_GzipOpen libgetdatagzip_LTX_GD_GzipOpen
+#define _GD_GzipSeek libgetdatagzip_LTX_GD_GzipSeek
+#define _GD_GzipRead libgetdatagzip_LTX_GD_GzipRead
+#define _GD_GzipClose libgetdatagzip_LTX_GD_GzipClose
+#define _GD_GzipSize libgetdatagzip_LTX_GD_GzipSize
+#endif
+
+/* The zlib encoding scheme uses edata as a gzFile object. If a file is
+ * open, fp = 0 otherwise fp = -1. */
+
+int _GD_GzipOpen(struct _gd_raw_file* file, int mode __gd_unused,
+ int creat __gd_unused)
+{
+ dtrace("%p, <unused>, <unused>", file);
+
+ file->edata = gzopen(file->name, "rb" /* writing not supported */);
+
+ if (file->edata != NULL) {
+ file->fp = 0;
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", 1);
+ return 1;
+}
+
+off64_t _GD_GzipSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad __gd_unused)
+{
+ off64_t n;
+
+ dtrace("%p, %lli, %x, <unused>", file, (long long)count, data_type);
+
+ n = (off64_t)gzseek(file->edata, (off_t)count * GD_SIZE(data_type), SEEK_SET);
+
+ if (n == -1) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ dreturn("%lli", (long long)(n / GD_SIZE(data_type)));
+ return n / GD_SIZE(data_type);
+}
+
+ssize_t _GD_GzipRead(struct _gd_raw_file *file, void *ptr, gd_type_t data_type,
+ size_t nmemb)
+{
+ ssize_t n;
+
+ dtrace("%p, %p, %x, %zu", file, ptr, data_type, nmemb);
+
+ n = gzread(file->edata, ptr, GD_SIZE(data_type) * nmemb);
+
+ if (n >= 0)
+ n /= GD_SIZE(data_type);
+
+ dreturn("%zu", n);
+ return n;
+}
+
+int _GD_GzipClose(struct _gd_raw_file *file)
+{
+ int ret;
+
+ dtrace("%p", file);
+
+ ret = gzclose(file->edata);
+ if (!ret) {
+ file->fp = -1;
+ file->edata = NULL;
+ }
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+off64_t _GD_GzipSize(struct _gd_raw_file *file, gd_type_t data_type)
+{
+ int fd;
+ uint32_t size = 0;
+
+ dtrace("%p, %x", file, data_type);
+
+ fd = open(file->name, O_RDONLY | O_BINARY);
+ 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;
+}
diff --git a/src/include.c b/src/include.c
new file mode 100644
index 0000000..be8fea3
--- /dev/null
+++ b/src/include.c
@@ -0,0 +1,445 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+
+/* Include a format file fragment -- returns the include index, or
+ * -1 on error */
+int _GD_Include(DIRFILE* D, const char* ename, const char* format_file,
+ int linenum, char** ref_name, int me, int* standards, unsigned long *flags)
+{
+ int i;
+ int abs = 0;
+ int sname_null_ok = 0;
+ int found = 0;
+ char temp_buf1[FILENAME_MAX];
+ char temp_buf2[FILENAME_MAX];
+ void* ptr;
+ FILE* new_fp = NULL;
+
+ dtrace("%p, \"%s\", \"%s\", %p, %i, %i, %p, %p\n", D, ename, format_file,
+ ref_name, linenum, me, standards, flags);
+
+ /* create the format filename */
+ if (
+ /* check for absolute path */
+#if defined _WIN32 || defined _WIN64
+ ename[0] != '\0' && ename[1] == ':'
+#else
+ ename[0] == '/'
+#endif
+ ) {
+ strncpy(temp_buf1, ename, FILENAME_MAX - 1);
+ temp_buf1[FILENAME_MAX - 1] = '\0';
+ abs = 1;
+ } else
+ snprintf(temp_buf1, FILENAME_MAX, "%s/%s", D->fragment[me].sname ?
+ D->fragment[me].sname : D->name, ename);
+
+ /* Run through the include list to see if we've already included this
+ * file */
+ for (i = 0; i < D->n_fragment; ++i)
+ if (strcmp(temp_buf1, D->fragment[i].cname) == 0) {
+ found = 1;
+ break;
+ }
+
+ /* If we found the file, we won't reopen it. Continue parsing. */
+ if (found) {
+ dreturn("%i", i);
+ return i;
+ }
+
+ /* Otherwise, try to open the file */
+ if ((D->flags & GD_ACCMODE) == GD_RDWR) {
+ i = open(temp_buf1, O_RDWR | ((*flags & GD_CREAT) ? O_CREAT : 0) |
+ ((*flags & GD_TRUNC) ? O_TRUNC : 0) | ((*flags & GD_EXCL) ? O_EXCL : 0)
+ | O_BINARY, 0666);
+ if (i < 0) {
+ _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum,
+ temp_buf1);
+ dreturn("%i", -1);
+ return -1;
+ }
+ new_fp = fdopen(i, "r+");
+ } else
+ new_fp = fopen(temp_buf1, "r");
+
+ /* If opening the file failed, set the error code and abort parsing. */
+ if (new_fp == NULL) {
+ _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum, temp_buf1);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* If we got here, we managed to open the included file; parse it */
+ ptr = realloc(D->fragment, (++D->n_fragment) * sizeof(struct gd_fragment_t));
+ if (ptr == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+ D->fragment = (struct gd_fragment_t *)ptr;
+
+ D->fragment[D->n_fragment - 1].cname = strdup(temp_buf1);
+ D->fragment[D->n_fragment - 1].ename = strdup(ename);
+ D->fragment[D->n_fragment - 1].modified = 0;
+ D->fragment[D->n_fragment - 1].parent = me;
+ D->fragment[D->n_fragment - 1].encoding = *flags & GD_ENCODING;
+ D->fragment[D->n_fragment - 1].byte_sex =
+#ifdef WORDS_BIGENDIAN
+ (*flags & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN
+#else
+ (*flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
+#endif
+ ;
+ D->fragment[D->n_fragment - 1].ref_name = NULL;
+ D->fragment[D->n_fragment - 1].frame_offset = D->fragment[me].frame_offset;
+ D->fragment[D->n_fragment - 1].protection = GD_PROTECT_NONE;
+ D->fragment[D->n_fragment - 1].vers =
+ (*flags & GD_PEDANTIC) ? 1ULL << *standards : 0;
+
+ if (D->fragment[D->n_fragment - 1].cname == NULL ||
+ D->fragment[D->n_fragment - 1].ename == NULL)
+ {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* extract the subdirectory name - dirname both returns a volatile string
+ * and modifies its argument, ergo strcpy */
+ strncpy(temp_buf1, ename, FILENAME_MAX);
+ if (abs)
+ D->fragment[D->n_fragment - 1].sname = strdup(dirname(temp_buf1));
+ else {
+ strcpy(temp_buf2, dirname(temp_buf1));
+ if (temp_buf2[0] == '.' && temp_buf2[1] == '\0') {
+ if (D->fragment[me].sname)
+ D->fragment[D->n_fragment - 1].sname = strdup(D->fragment[me].sname);
+ else {
+ D->fragment[D->n_fragment - 1].sname = NULL;
+ sname_null_ok = 1;
+ }
+ } else {
+ strncpy(temp_buf1, ename, FILENAME_MAX);
+ snprintf(temp_buf2, FILENAME_MAX, "%s/%s", D->fragment[me].sname ?
+ D->fragment[me].sname : D->name, dirname(temp_buf1));
+ D->fragment[D->n_fragment - 1].sname = strdup(temp_buf2);
+ }
+ }
+
+ if (!sname_null_ok && D->fragment[D->n_fragment - 1].sname == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ *ref_name = _GD_ParseFragment(new_fp, D, D->n_fragment - 1, standards, flags);
+
+ fclose(new_fp);
+
+ dreturn("%i", D->n_fragment - 1);
+ return D->n_fragment - 1;
+}
+
+int gd_include(DIRFILE* D, const char* file, int fragment_index,
+ unsigned long flags)
+{
+ int standards = GD_DIRFILE_STANDARDS_VERSION;
+ char* ref_name = NULL;
+ int i, new_fragment;
+
+ dtrace("%p, \"%s\", %i, %lx", D, file, fragment_index, (unsigned long)flags);
+
+ if (~D->flags & GD_HAVE_VERSION)
+ _GD_FindVersion(D);
+
+ /* only set if the dirfile conforms to some standard */
+ if (D->av)
+ standards = D->standards;
+
+ _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 the caller specified no encoding scheme, but we were asked to create
+ * the fragment, inherit it from the parent */
+ if ((flags & (GD_ENCODING | GD_CREAT)) == GD_CREAT)
+ flags |= D->flags & GD_ENCODING;
+
+ new_fragment = _GD_Include(D, file, "dirfile_include()", 0, &ref_name,
+ fragment_index, &standards, &flags);
+
+ 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, 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;
+}
+
+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 = (int *)realloc(*f, sizeof(int) * ++nf);
+ if (new_f == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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]);
+ }
+
+ /* 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)
+ unlink(D->fragment[f[j]].cname);
+
+ /* 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--;
+ if (D->entry[i]->field_type == GD_CONST_ENTRY)
+ D->n_const--;
+ else if (D->entry[i]->field_type == GD_CARRAY_ENTRY)
+ D->n_carray--;
+ else if (D->entry[i]->field_type == GD_STRING_ENTRY)
+ D->n_string--;
+ } else
+ D->n_meta--;
+
+ _GD_FreeE(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) {
+ free(D->fragment[f[j]].cname);
+ free(D->fragment[f[j]].sname);
+ free(D->fragment[f[j]].ename);
+ 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]->e->calculated = 0;
+ for (j = 0; j < GD_MAX_LINCOM; ++j)
+ D->entry[i]->e->entry[j] = NULL;
+ }
+
+ /* Invalidate the field lists */
+ D->list_validity = 0;
+ D->type_list_validity = 0;
+
+ free(f);
+
+ dreturn("%i", 0);
+ return 0;
+}
diff --git a/src/index.c b/src/index.c
new file mode 100644
index 0000000..20ac4ac
--- /dev/null
+++ b/src/index.c
@@ -0,0 +1,299 @@
+/* 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#include "nan.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, limit, eof);
+
+ /* load data */
+ n = _GD_DoField(D, E, repr, limit - eof, 2, GD_FLOAT64, data);
+
+ if (D->error) {
+ dreturn("%g", sample);
+ return sample;
+ } else if (n < 2) {
+ _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
+ dreturn("%g", sample);
+ return sample;
+ }
+
+ sample = limit + (value - data[eof]) / (data[1] - data[0]);
+ dreturn("%g", 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, field_start,
+ 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("%g", sample);
+ return sample;
+ }
+
+ if (n == 0) {
+ _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
+ dreturn("%g", sample);
+ return sample;
+ }
+
+ n = _GD_DoField(D, E, repr, field_end - 1, 1, GD_FLOAT64, &high_v);
+
+ if (D->error) {
+ dreturn("%g", 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("%g", 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("%g", sample);
+ return sample;
+ } else if ((!dir && high_v < value) || (dir && high_v > value)) {
+ sample = _GD_Extrapolate(D, E, repr, value, high - 1, 1);
+ dreturn("%g", 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("%g", 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("%g", sample);
+ return sample;
+ }
+
+ /* low is the EOF -- so, extrapolate */
+ sample = _GD_Extrapolate(D, E, repr, value, low - 1, 1);
+ dreturn("%g", 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, field_start_v, 0);
+ dreturn("%g", 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("%g", 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("%g", 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("%g", sample);
+ return sample;
+ }
+ }
+
+ sample = low + (value - low_v) / (high_v - low_v);
+ dreturn("%g", 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;
+ gd_spf_t spf;
+
+ dtrace("%p, \"%s\", %g, %lli, %lli", D, field_code_in, value, field_start,
+ field_end);
+
+ if (D->flags & GD_INVALID) {/* don't crash */
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%g", frame);
+ return frame;
+ }
+
+ _GD_ClearError(D);
+
+ entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%g", frame);
+ return frame;
+ }
+
+ if (_GD_NativeType(D, entry, repr) & GD_COMPLEX)
+ _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, NULL, 0, NULL);
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ if (D->error) {
+ dreturn("%g", 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 * 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("%g", 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("%g", 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("%g", frame);
+ return frame;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/internal.h b/src/internal.h
new file mode 100644
index 0000000..b409233
--- /dev/null
+++ b/src/internal.h
@@ -0,0 +1,780 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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_INTERNAL_H
+#define GETDATA_INTERNAL_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "getdata.h"
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+/* MSVC types */
+#ifdef _MSC_VER
+typedef size_t ssize_t;
+typedef int mode_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)
+#define snprintf _snprintf
+#endif
+
+#ifdef __APPLE__
+typedef off_t off64_t;
+#endif
+
+#ifdef GD_NO_C99_API
+# define GD_DCOMPLEXP_t double *
+# define GD_DCOMPLEXA(v) double v[2]
+# define GD_DCOMPLEXV(v) double v[][2]
+# define cabs(z) sqrt((z)[0] * (z)[0] + (z)[1] * (z)[1])
+# define carg(z) atan2((z)[1], (z)[0])
+# define creal(z) ((z)[0])
+# define cimag(z) ((z)[1])
+# define _gd_a2c _gd_c2c
+# define _gd_c2c(a,b) do { (a)[0] = (b)[0]; (a)[1] = (b)[1]; } while(0)
+# define _gd_c2cp _gd_c2c
+# define _gd_ca2c(a,b,i) _gd_c2c((a),(b) + 2 * i)
+# define _gd_cp2ca(a,i,b) do { \
+ (a)[2 * i] = (b)[0]; (a)[2 * i + 1] = (b)[1]; \
+} while(0)
+# define _gd_l2c(a,x,y) do { (a)[0] = (x); (a)[1] = (y); } while(0)
+# define _gd_r2c(a,b) do { (a)[0] = b; (a)[1] = 0; } while(0)
+# define _gd_r2ca(a,i,b,t) do { \
+ ((t*)a)[2 * i] = (t)(b); ((t*)a)[2 * i + 1] = 0; \
+} while(0)
+# define _gd_ccmpl(a,x,y) ((a)[0] == x && (a)[1] == y)
+# 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* v
+# define _gd_a2c(a,b) a = *((double complex*)(b))
+# define _gd_c2c(a,b) a = b
+# define _gd_c2cp(a,b) *a = b
+# define _gd_ca2c(a,b,i) a = b[i]
+# define _gd_cp2ca(a,i,b) (a)[i] = *(b)
+# define _gd_l2c(a,x,y) a = (x + _Complex_I * y)
+# define _gd_r2c(a,b) a = b
+# define _gd_r2ca(a,i,b,t) ((complex t*)a)[i] = (complex t)(b)
+# define _gd_ccmpl(a,x,y) (a == (x + _Complex_I * y))
+# define _gd_ccmpc(a,b) (a == b)
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#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
+
+/* For FILENAME_MAX */
+#include <stdio.h>
+
+/* For the C99 integer types */
+#ifdef HAVE_INTTYPES_H
+# ifndef __STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS
+# endif
+#include <inttypes.h>
+#endif
+
+#ifdef HAVE_IO_H
+# include <io.h>
+#endif
+
+#define GD_ARM_FLAG (GD_ARM_ENDIAN | GD_NOT_ARM_ENDIAN)
+
+/* Type conventions:
+ *
+ * - samples per frame is always gd_spf_t (aka uin16_t)
+ * - variables holding offsets or file sizes should be of type off64_t (which
+ * may be simply off_t, depending on local LFS support)
+ * - 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 an 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
+
+#ifdef USE_MODULES
+# ifdef HAVE_LTDL_H
+# include <ltdl.h>
+# endif
+#endif
+
+/* debugging macros */
+#ifdef GETDATA_DEBUG
+#define GD_COL_SIZE 100
+const char* _gd_colnil(void);
+const char* _gd_coladd(void);
+const char* _gd_colsub(void);
+#define dtracevoid() printf("%s %s()\n", _gd_coladd(), __FUNCTION__)
+#define dtrace(fmt, ...) printf("%s %s(" fmt ")\n", _gd_coladd(), \
+ __FUNCTION__, __VA_ARGS__)
+#define dprintf(fmt, ...) printf("%s %s:%i " fmt "\n", _gd_colnil(), \
+ __FUNCTION__, __LINE__, __VA_ARGS__)
+#define dreturnvoid() printf("%s %s = (nil)\n", _gd_colsub(), __FUNCTION__)
+#define dreturn(fmt, ...) printf("%s %s = " fmt "\n", _gd_colsub(), \
+ __FUNCTION__, __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
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+#ifndef O_TEXT
+#define O_TEXT 0
+#define FOPEN_TEXT
+#else
+#define FOPEN_TEXT "t"
+#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
+
+#ifndef HAVE_FTELLO64
+# ifndef HAVE_FTELLO
+# define ftello64 (off64_t)ftell
+# else
+# define ftello64 (off64_t)ftello
+# endif
+#endif
+
+#ifdef HAVE__STRTOI64
+# define gd_strtoll _strtoi64
+#elif defined(HAVE_STRTOLL)
+# define gd_strtoll strtoll
+#else
+# define gd_strtoll strtol
+#endif
+
+#ifdef HAVE__STRTOUI64
+# define gd_strtoull _strtoi64
+#elif defined(HAVE_STRTOULL)
+# define gd_strtoull strtoull
+#else
+# define gd_strtoull strtoul
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__FDOPEN
+#define fdopen _fdopen
+#endif
+
+#if !HAVE_FSYNC && HAVE__COMMIT
+# define fsync _commit
+#endif
+
+#ifndef HAVE_GMTIME_R
+#include <time.h>
+struct tm *gmtime_r(const time_t *timep, struct tm *result);
+#endif
+
+#ifdef HAVE__LSEEKI64
+#define lseek64 (off64_t)_lseeki64
+#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
+
+#ifndef HAVE_MKSTEMP
+int mkstemp(char*);
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__OPEN
+#define open _open
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__READ
+#define read _read
+#endif
+
+/* rename shenanigans: MSVCRT's rename doesn't overwrite existing files, so
+ * we have to make a rename function that will, otherwise we just use the
+ * system function. */
+#ifdef __MSVCRT__
+int _GD_Rename(const char*, const char*);
+#else
+#define _GD_Rename rename
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__RMDIR
+#define rmdir _rmdir
+#endif
+
+#if HAVE_STAT64
+# define gd_stat64 stat64
+#elif HAVE__STAT64
+# define gd_stat64 _stat64
+#else
+# define gd_stat64 stat
+#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;
+#endif
+
+#if ! HAVE_DECL_STRERROR_R
+#ifdef STRERROR_R_CHAR_P
+char* strerror_r(int, char*, size_t);
+#else
+int strerror_r(int, char*, size_t);
+#endif
+#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
+
+
+/* maximum number of recursions */
+#define GD_MAX_RECURSE_LEVEL 32
+
+#define MAX_IN_COLS (3 * GD_MAX_LINCOM + 5) /* for META lincom */
+
+#ifndef FILENAME_MAX
+# define FILENAME_MAX 4096
+#endif
+
+/* Suberror codes */
+#define GD_E_OPEN_NOT_EXIST 1
+#define GD_E_OPEN_NOT_DIRFILE 2
+#define GD_E_OPEN_NO_ACCESS 3
+
+#define GD_E_TRUNC_STAT 1
+#define GD_E_TRUNC_UNLINK 2
+#define GD_E_TRUNC_DIR 3
+
+#define GD_E_CREAT_FORMAT 1
+#define GD_E_CREAT_EXCL 2
+#define GD_E_CREAT_DIR 3
+
+/* GD_E_FORMAT suberrors are in getdata.h */
+
+#define GD_E_LINFILE_LENGTH 1
+#define GD_E_LINFILE_OPEN 2
+
+#define GD_E_FIELD_PUT 1
+#define GD_E_FIELD_BAD 2
+#define GD_E_FIELD_MATCH 3
+
+#define GD_E_BAD_ENTRY_TYPE 1
+#define GD_E_BAD_ENTRY_METARAW 2
+#define GD_E_BAD_ENTRY_SPF 3
+#define GD_E_BAD_ENTRY_NFIELDS 4
+#define GD_E_BAD_ENTRY_NUMBITS 5
+#define GD_E_BAD_ENTRY_BITNUM 6
+#define GD_E_BAD_ENTRY_BITSIZE 7
+#define GD_E_BAD_ENTRY_POLYORD 8
+
+#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_REPR_UNKNOWN 1
+#define GD_E_REPR_PUT 2
+
+#define GD_E_DOMAIN_COMPLEX 1
+#define GD_E_DOMAIN_EMPTY 2
+#define GD_E_DOMAIN_ANTITONIC 3
+
+#define GD_E_OUT_OF_RANGE 1
+#define GD_E_SINGULAR_RANGE 2
+
+#define GD_E_DIM_FORMAT 1
+#define GD_E_DIM_CALLER 2
+
+#define GD_E_FLUSH_MKTMP 1
+#define GD_E_FLUSH_OPEN 2
+#define GD_E_FLUSH_RENAME 3
+
+#define GD_E_VERS_NONE 1
+#define GD_E_VERS_MISSING 2
+
+struct _gd_raw_file {
+ char* name;
+ int fp;
+ void* edata;
+ int encoding;
+};
+
+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 calculated;
+
+ int n_meta;
+ int n_meta_string;
+ int n_meta_carray;
+ int n_meta_const;
+ union {
+ gd_entry_t** meta_entry;
+ const gd_entry_t* parent;
+ } p;
+
+ /* field lists */
+ const char** field_list;
+ const char** vector_list;
+ char** type_list[GD_N_ENTYPES];
+ const char** string_value_list;
+ void* const_value_list;
+ gd_carray_t *carray_value_list;
+
+ union {
+ struct { /* RAW */
+ char* filebase;
+ size_t size;
+ struct _gd_raw_file file[2]; /* encoding framework data */
+ } raw;
+ struct { /* LINTERP */
+ char *table_path;
+ 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;
+ char* string;
+ } u;
+};
+
+#define GD_ENC_NONE 0
+#define GD_ENC_SLIM 1
+#define GD_ENC_GZ_RAW 2
+#define GD_ENC_BZ2_RAW 3
+#define GD_ENC_ASCII 4
+#define GD_ENC_LZMA_RAW 5
+#define GD_ENC_XZ_RAW 6
+#define GD_ENC_UNKNOWN 7
+
+#define GD_N_SUBENCODINGS (GD_ENC_UNKNOWN + 1)
+
+#define GD_EF_OPEN 0x001
+#define GD_EF_CLOSE 0x002
+#define GD_EF_TOUCH 0x004
+#define GD_EF_SEEK 0x008
+#define GD_EF_READ 0x010
+#define GD_EF_SIZE 0x020
+#define GD_EF_WRITE 0x040
+#define GD_EF_SYNC 0x080
+#define GD_EF_MOVE 0x100
+#define GD_EF_UNLINK 0x200
+#define GD_EF_TEMP 0x400
+
+#define GD_TEMP_OPEN 0
+#define GD_TEMP_MOVE 1
+#define GD_TEMP_DESTROY 2
+
+#define BUFFER_SIZE 9000000
+
+#ifndef HAVE_OFF64_T
+# ifndef __APPLE__
+typedef off_t off64_t;
+# endif
+# define lseek64 lseek
+# define stat64 stat
+#endif
+
+/* helper macro */
+#if defined ARM_ENDIAN_FLOATS || \
+ ((defined WORDS_BIGENDIAN) ^ (defined FLOATS_BIGENDIAN))
+# define SCREWY_FLOATS
+#endif
+
+/* Encoding schemes */
+extern struct encoding_t {
+ unsigned long int scheme;
+ const char* ext;
+ int ecor; /* encoding requires byte-sex correction */
+ const char* affix;
+ const char* ffname;
+ unsigned int provides;
+ int (*open)(struct _gd_raw_file*, int, int);
+ int (*close)(struct _gd_raw_file*);
+ int (*touch)(struct _gd_raw_file*);
+ off64_t (*seek)(struct _gd_raw_file*, off64_t, gd_type_t, int);
+ ssize_t (*read)(struct _gd_raw_file*, void*, gd_type_t, size_t);
+ off64_t (*size)(struct _gd_raw_file*, gd_type_t);
+ ssize_t (*write)(struct _gd_raw_file*, const void*, gd_type_t,
+ size_t);
+ int (*sync)(struct _gd_raw_file*);
+ int (*move)(struct _gd_raw_file*, char*);
+ int (*unlink)(struct _gd_raw_file*);
+ int (*temp)(struct _gd_raw_file*, int);
+} _gd_ef[GD_N_SUBENCODINGS];
+
+/* Format file fragment metadata */
+struct gd_fragment_t {
+ /* Canonical name (full path) */
+ char* cname;
+ /* Subdirectory name */
+ char* sname;
+ /* External name (relative to the parent format file fragment) */
+ char* ename;
+ int modified;
+ int parent;
+ unsigned long int encoding;
+ unsigned long int byte_sex;
+ int protection;
+ char* ref_name;
+ off64_t frame_offset;
+ uint32_t vers;
+};
+
+/* internal flags */
+#define GD_HAVE_VERSION 0x40000000 /* have computed the version */
+#define GD_INVALID 0x80000000 /* the dirfile is invalid */
+
+#define LIST_VALID_FIELD 0x01
+#define LIST_VALID_VECTOR 0x02
+#define LIST_VALID_STRING_VALUE 0x04
+
+#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'
+
+#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;
+
+ /* global data */
+ unsigned long int flags;
+ uint64_t av;
+ int standards;
+
+ /* field counts */
+ unsigned int n_entries;
+ unsigned int n_string;
+ unsigned int n_carray;
+ unsigned int n_const;
+ unsigned int n_meta;
+ 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 */
+ char* name;
+
+ /* recursion counter */
+ int recurse_level;
+
+ /* fragment list */
+ struct gd_fragment_t* fragment;
+ int n_fragment;
+
+ /* field lists */
+ const char** field_list;
+ const char** vector_list;
+ const char** type_list[GD_N_ENTYPES];
+ const char** string_value_list;
+ void* const_value_list;
+ gd_carray_t *carray_value_list;
+ int list_validity;
+ int type_list_validity;
+
+ /* syntax error callback */
+ gd_parser_callback_t sehandler;
+ void* sehandler_extra;
+};
+
+extern const gd_entype_t _gd_entype_index[GD_N_ENTYPES];
+
+void* _GD_Alloc(DIRFILE* D, gd_type_t type, size_t n);
+void _GD_ArmEndianise(uint64_t* databuffer, int is_complex, size_t ns);
+int _GD_BadInput(DIRFILE* D, gd_entry_t* E, int i);
+int _GD_CalculateEntry(DIRFILE* D, gd_entry_t* E);
+void _GD_CInvertData(DIRFILE* D, void* data, gd_type_t return_type,
+ GD_DCOMPLEXA(dividend), size_t n_read);
+
+/* _GD_ClearError: Everything's A-OK; clear the last error. */
+#define _GD_ClearError(D) (D)->error = 0
+
+void _GD_CLincomData(DIRFILE* D, int n, void* data1, gd_type_t return_type,
+ GD_DCOMPLEXP(data2), GD_DCOMPLEXP(data3), GD_DCOMPLEXV(m), GD_DCOMPLEXV(b),
+ gd_spf_t *spf, size_t n_read);
+void _GD_ConvertType(DIRFILE* D, const void *data_in, gd_type_t in_type,
+ void *data_out, gd_type_t out_type, size_t n) gd_nothrow;
+gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type);
+size_t _GD_DoField(DIRFILE*, gd_entry_t*, int, off64_t, size_t, gd_type_t,
+ void*);
+size_t _GD_DoFieldOut(DIRFILE*, gd_entry_t*, int, off64_t, size_t, gd_type_t,
+ const void*);
+gd_entry_t* _GD_FindField(DIRFILE* D, const char* field_code,
+ gd_entry_t** list, unsigned int u, unsigned int *index);
+gd_entry_t* _GD_FindFieldAndRepr(DIRFILE* D, const char* field_code_in,
+ char** field_code, int* repr, unsigned int *index, int set);
+uint64_t _GD_FindVersion(DIRFILE *D);
+void _GD_FixEndianness(char* databuffer, size_t size, size_t ns);
+void _GD_Flush(DIRFILE* D, gd_entry_t *E);
+void _GD_FlushMeta(DIRFILE* D, int fragment, int force);
+void _GD_FreeE(gd_entry_t* E, int priv);
+char *_GD_GetLine(FILE *fp, size_t *n, int* linenum);
+int _GD_GetRepr(DIRFILE*, const char*, char**);
+gd_spf_t _GD_GetSPF(DIRFILE* D, gd_entry_t* E);
+int _GD_Include(DIRFILE* D, const char* ename, const char* format_file,
+ int linenum, char** ref_name, int me, int* standards, unsigned long *flags);
+void _GD_InitialiseFramework(void);
+void _GD_InvertData(DIRFILE* D, void* data, gd_type_t return_type,
+ double dividend, size_t n_read);
+void _GD_InsertSort(DIRFILE* D, gd_entry_t* E, int u) gd_nothrow;
+
+#define _GD_InternalError(D) \
+ _GD_SetError(D, GD_E_INTERNAL_ERROR, 0, __FILE__, __LINE__, NULL)
+
+gd_type_t _GD_LegacyType(char c);
+void _GD_LincomData(DIRFILE* D, int n, void* data1, gd_type_t return_type,
+ double *data2, double *data3, double* m, double *b, gd_spf_t *spf,
+ size_t n_read);
+void _GD_LinterpData(DIRFILE* D, void *data, gd_type_t type, int complex_table,
+ const double *data_in, size_t npts, const struct _gd_lut *lut, size_t n_ln);
+int _GD_MissingFramework(int32_t encoding, unsigned int funcs);
+int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long int encoding,
+ unsigned long int byte_sex, off64_t offset, int finalise, int new_fragment,
+ char* new_filebase);
+gd_type_t _GD_NativeType(DIRFILE* D, gd_entry_t* E, int repr);
+gd_entry_t* _GD_ParseFieldSpec(DIRFILE* D, int n_cols, char** in_cols,
+ const gd_entry_t* P, const char* format_file, int linenum, int me,
+ int standards, int creat, unsigned long flags, int insert, char **outstring,
+ const char *tok_pos);
+char* _GD_ParseFragment(FILE* fp, DIRFILE *D, int me, int* standards,
+ unsigned long int *flags);
+void _GD_ReadLinterpFile(DIRFILE* D, gd_entry_t *E);
+int _GD_SetEncodedName(DIRFILE* D, struct _gd_raw_file* file, const char* base,
+ int temp);
+void _GD_SetError(DIRFILE* D, int error, int suberror, const char* format_file,
+ int line, const char* token);
+int _GD_SetTablePath(DIRFILE *D, gd_entry_t *E, struct _gd_private_entry *e);
+int _GD_Supports(DIRFILE* D, gd_entry_t* E, unsigned int funcs);
+int _GD_Tokenise(DIRFILE *D, const char* instring, char **outstring,
+ const char **pos, char** in_cols, const char* format_file, int linenum,
+ int standards, int pedantic);
+char* _GD_ValidateField(const gd_entry_t* parent, const char* field_code,
+ int standards, int pedantic, int* is_dot);
+
+/* generic I/O methods */
+int _GD_GenericTouch(struct _gd_raw_file* file);
+int _GD_GenericMove(struct _gd_raw_file* file, char* new_path);
+int _GD_GenericUnlink(struct _gd_raw_file* file);
+
+/* unencoded I/O methods */
+int _GD_RawOpen(struct _gd_raw_file* file, int mode, int creat);
+off64_t _GD_RawSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad);
+ssize_t _GD_RawRead(struct _gd_raw_file* file, void *ptr, gd_type_t data_type,
+ size_t nmemb);
+ssize_t _GD_RawWrite(struct _gd_raw_file* file, const void *ptr,
+ gd_type_t data_type, size_t nmemb);
+int _GD_RawSync(struct _gd_raw_file* file);
+int _GD_RawClose(struct _gd_raw_file* file);
+off64_t _GD_RawSize(struct _gd_raw_file* file, gd_type_t data_type);
+int _GD_RawTemp(struct _gd_raw_file *file, int mode);
+
+/* text I/O methods */
+int _GD_AsciiOpen(struct _gd_raw_file* file, int mode, int creat);
+off64_t _GD_AsciiSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad);
+ssize_t _GD_AsciiRead(struct _gd_raw_file* file, void *ptr, gd_type_t data_type,
+ size_t nmemb);
+ssize_t _GD_AsciiWrite(struct _gd_raw_file* file, const void *ptr,
+ gd_type_t data_type,
+ size_t nmemb);
+int _GD_AsciiSync(struct _gd_raw_file* file);
+int _GD_AsciiClose(struct _gd_raw_file* file);
+off64_t _GD_AsciiSize(struct _gd_raw_file* file, gd_type_t data_type);
+int _GD_AsciiTemp(struct _gd_raw_file *file, int mode);
+
+/* bzip I/O methods */
+int _GD_Bzip2Open(struct _gd_raw_file* file, int mode, int creat);
+off64_t _GD_Bzip2Seek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad);
+ssize_t _GD_Bzip2Read(struct _gd_raw_file* file, void *ptr, gd_type_t data_type,
+ size_t nmemb);
+int _GD_Bzip2Close(struct _gd_raw_file* file);
+off64_t _GD_Bzip2Size(struct _gd_raw_file* file, gd_type_t data_type);
+
+/* gzip I/O methods */
+int _GD_GzipOpen(struct _gd_raw_file* file, int mode, int creat);
+off64_t _GD_GzipSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad);
+ssize_t _GD_GzipRead(struct _gd_raw_file* file, void *ptr, gd_type_t data_type,
+ size_t nmemb);
+int _GD_GzipClose(struct _gd_raw_file* file);
+off64_t _GD_GzipSize(struct _gd_raw_file* file, gd_type_t data_type);
+
+/* lzma I/O methods */
+int _GD_LzmaOpen(struct _gd_raw_file* file, int mode, int creat);
+off64_t _GD_LzmaSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad);
+ssize_t _GD_LzmaRead(struct _gd_raw_file* file, void *ptr, gd_type_t data_type,
+ size_t nmemb);
+int _GD_LzmaClose(struct _gd_raw_file* file);
+off64_t _GD_LzmaSize(struct _gd_raw_file* file, gd_type_t data_type);
+
+/* slim I/O methods */
+int _GD_SlimOpen(struct _gd_raw_file* file, int mode, int creat);
+off64_t _GD_SlimSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad);
+ssize_t _GD_SlimRead(struct _gd_raw_file* file, void *ptr, gd_type_t data_type,
+ size_t nmemb);
+int _GD_SlimClose(struct _gd_raw_file* file);
+off64_t _GD_SlimSize(struct _gd_raw_file* file, gd_type_t data_type);
+
+#ifdef _MSC_VER
+# define _gd_static_inline static
+#else
+# define _gd_static_inline static inline
+#endif
+_gd_static_inline int entry_cmp(const void *a, const void *b)
+{
+ return strcmp((*(gd_entry_t**)a)->field, (*(gd_entry_t**)b)->field);
+}
+
+#ifndef __cplusplus
+# undef gd_nothrow
+# define gd_nothrow
+#endif
+
+#ifdef GD_C89_API
+# define EN(t,v) u.t.v
+#else
+# define EN(t,v) v
+#endif
+
+#endif
diff --git a/src/legacy.c b/src/legacy.c
new file mode 100644
index 0000000..4d5919c
--- /dev/null
+++ b/src/legacy.c
@@ -0,0 +1,593 @@
+/* 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+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,
+ .flags = GD_INVALID,
+#else
+ 0, 0, NULL, NULL, 0, GD_INVALID
+#endif
+};
+
+/* old error strings */
+const char *GD_ERROR_CODES[GD_N_ERROR_CODES] = {
+ "Success", /* GD_E_OK */
+ "Error opening dirfile", /* GD_E_OPEN */
+ "Error in Format file", /* GD_E_FORMAT */
+ NULL, /* GD_E_TRUNC */
+ NULL, /* GD_E_CREAT */
+ "Bad field code", /* GD_E_BAD_CODE */
+ "Unrecognized data type", /* GD_E_BAD_TYPE */
+ "I/O error accessing field file", /* GD_E_RAW_IO */
+ "Could not open fragment", /* GD_E_OPEN_FRAGMENT */
+ "Internal error", /* GD_E_INTERNAL_ERROR */
+ "Memory allocation failed", /* GD_E_ALLOC */
+ "Request out-of-range", /* GD_E_RANGE */
+ "Could not open interpolation table", /* GD_E_OPEN_LINFILE */
+ "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 */
+ NULL, /* GD_E_BAD_ENDIANNESS */
+ NULL, /* GD_E_CALLBACK */
+ NULL, /* GD_E_BAD_PROTECTION */
+ NULL, /* GD_E_UNCLEAN_DB */
+ "Improper domain", /* GD_E_DOMAIN */
+ "Bad representation", /* GD_E_BAD_REPR */
+ NULL, /* GD_E_BAD_VERSION */
+ NULL, /* GD_E_FLUSH */
+ 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[FILENAME_MAX];
+
+ dtrace("\"%s\", %x", filename_in, mode);
+
+ strncpy(filedir, filename_in, FILENAME_MAX);
+ 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 (strncmp(filedir, _GD_Dirfiles.D[i_dirfile]->name, FILENAME_MAX) == 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 {
+ _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(DIRFILE*));
+ if (ptr == NULL) {
+ *error_code = _GD_GlobalErrors.error = GD_E_ALLOC;
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ _GD_Dirfiles.D = (DIRFILE **)ptr;
+
+ /* Open a dirfile */
+ _GD_Dirfiles.D[_GD_Dirfiles.n] = gd_open(filedir, mode);
+
+ /* 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();
+}
+
+/* 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;
+ 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_NO_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.multiplyEntries);
+ free(Format.bitEntries);
+ free(Format.phaseEntries);
+
+ Format.rawEntries = (struct RawEntryType *)malloc(Format.n_raw *
+ sizeof(struct RawEntryType));
+ Format.lincomEntries = (struct LincomEntryType *)malloc(Format.n_lincom *
+ sizeof(struct LincomEntryType));
+ Format.linterpEntries = (struct LinterpEntryType *)malloc(Format.n_linterp *
+ sizeof(struct LinterpEntryType));
+ Format.multiplyEntries = (struct MultiplyEntryType *)malloc(Format.n_multiply
+ * sizeof(struct MultiplyEntryType));
+ Format.bitEntries = (struct BitEntryType *)malloc(Format.n_bit *
+ sizeof(struct BitEntryType));
+ Format.phaseEntries = (struct PhaseEntryType *)malloc(Format.n_phase *
+ sizeof(struct PhaseEntryType));
+
+ if (Format.rawEntries == NULL || Format.lincomEntries == NULL ||
+ Format.linterpEntries == 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_STRING_ENTRY:
+ case GD_CONST_ENTRY:
+ case GD_CARRAY_ENTRY:
+ case GD_INDEX_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, <unused>", 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
+*/
diff --git a/src/lzma.c b/src/lzma.c
new file mode 100644
index 0000000..dcb671b
--- /dev/null
+++ b/src/lzma.c
@@ -0,0 +1,334 @@
+/* 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <errno.h>
+#include <time.h>
+#include <stdio.h>
+#include <string.h>
+#endif
+
+#ifdef HAVE_LZMA_H
+#include <lzma.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_LzmaOpen libgetdatalzma_LTX_GD_LzmaOpen
+#define _GD_LzmaSeek libgetdatalzma_LTX_GD_LzmaSeek
+#define _GD_LzmaRead libgetdatalzma_LTX_GD_LzmaRead
+#define _GD_LzmaClose libgetdatalzma_LTX_GD_LzmaClose
+#define _GD_LzmaSize libgetdatalzma_LTX_GD_LzmaSize
+#endif
+
+#if SIZEOF_INT < 4
+#define GD_LZMA_BUFFER_SIZE 32767
+#else
+#define GD_LZMA_BUFFER_SIZE 1000000
+#endif
+
+struct gd_lzmadata {
+ lzma_stream xzfile;
+ FILE* stream;
+ int xzerror;
+ int stream_end; /* uncompressed file ran out of data */
+ int input_eof; /* compressed file ran out of data */
+ int read_in; /* location of the end of valid data in data_in */
+ int out_pos; /* library's current position relative to the start of
+ data_out */
+ int end; /* location of the end of valid data in data_out */
+ off64_t base; /* position of the start of data_out in the uncompressed
+ stream */
+ uint8_t data_in[GD_LZMA_BUFFER_SIZE];
+ uint8_t data_out[GD_LZMA_BUFFER_SIZE];
+};
+
+/* The bzip encoding scheme uses edata as a gd_lzmadata pointer. If a file is
+ * open, fp = 0 otherwise fp = -1. */
+
+static struct gd_lzmadata *_GD_LzmaDoOpen(struct _gd_raw_file* file)
+{
+ struct gd_lzmadata *ptr;
+
+ dtrace("%p", file);
+
+ if ((ptr = (struct gd_lzmadata *)malloc(sizeof(struct gd_lzmadata))) == NULL)
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if ((ptr->stream = fopen(file->name, "rb")) == NULL) {
+ free(ptr);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ dprintf("%p = %s", ptr->stream, file->name);
+
+ memset(&ptr->xzfile, 0, sizeof(lzma_stream));
+ ptr->xzfile.next_in = ptr->data_in;
+ ptr->xzfile.next_out = ptr->data_out;
+ ptr->xzfile.avail_in = 0;
+ ptr->xzfile.avail_out = GD_LZMA_BUFFER_SIZE;
+ ptr->xzerror = lzma_auto_decoder(&ptr->xzfile, 1000000000, 0);
+ ptr->xzfile.total_in = 0;
+
+ if (ptr->xzerror != LZMA_OK) {
+ fclose(ptr->stream);
+ free(ptr);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ ptr->read_in = ptr->out_pos = ptr->end = 0;
+ ptr->base = ptr->stream_end = ptr->input_eof = 0;
+
+ dreturn("%p", ptr);
+ return ptr;
+}
+
+int _GD_LzmaOpen(struct _gd_raw_file* file, int mode __gd_unused,
+ int creat __gd_unused)
+{
+ struct gd_lzmadata *ptr;
+
+ dtrace("%p, <unused>, <unused>", file);
+
+ file->edata = ptr = _GD_LzmaDoOpen(file);
+
+ if (file->edata == NULL) {
+ dreturn("%i", 1);
+ return 1;
+ }
+
+ file->fp = 0;
+ dreturn("%i", 0);
+ return 0;
+}
+
+/* Read as much data as possible, and then run the converter on it, leaving
+ * unused input at the front of the input buffer, and updating read_in as
+ * appropriate. Returns -1 on error */
+static int _GD_LzmaDecode(struct gd_lzmadata *ptr)
+{
+ int n = 0;
+
+ dtrace("%p", ptr);
+
+ if (!ptr->input_eof) {
+ n = fread(ptr->data_in + ptr->read_in, 1, GD_LZMA_BUFFER_SIZE -
+ ptr->read_in, ptr->stream);
+ dprintf("n=%i for %i on %p", n, GD_LZMA_BUFFER_SIZE - ptr->read_in,
+ ptr->stream);
+
+ if (n < GD_LZMA_BUFFER_SIZE - ptr->read_in) {
+ if (feof(ptr->stream))
+ ptr->input_eof = 1;
+ else {
+ dreturn("%i", -1);
+ return -1;
+ }
+ }
+ }
+
+ dprintf("read_in=%i n=%i", ptr->read_in, n);
+ ptr->xzfile.avail_in = ptr->read_in + n;
+ dprintf("avail_in=%zu total_in=%llu", ptr->xzfile.avail_in,
+ ptr->xzfile.total_in);
+ dprintf("avail_out=%zu total_out=%llu", ptr->xzfile.avail_out,
+ ptr->xzfile.total_out);
+
+ /* no more data to convert -- end of stream reached */
+ if (ptr->xzfile.avail_in == 0) {
+ ptr->stream_end = 1;
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ /* amount of data = amount already in buffer + amount just now read */
+ ptr->xzerror = lzma_code(&ptr->xzfile, LZMA_RUN);
+ dprintf("avail_in=%zu total_in=%llu", ptr->xzfile.avail_in,
+ ptr->xzfile.total_in);
+ dprintf("avail_out=%zu total_out=%llu", ptr->xzfile.avail_out,
+ ptr->xzfile.total_out);
+
+ if (ptr->xzerror == LZMA_OK || ptr->xzerror == LZMA_STREAM_END) {
+ ptr->base += ptr->end;
+ ptr->end = ptr->xzfile.total_out;
+ /* shift unused input to start of buffer */
+ memmove(ptr->data_in, ptr->data_in + ptr->xzfile.total_in,
+ ptr->xzfile.avail_in);
+ ptr->read_in = ptr->xzfile.avail_in;
+ } else {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+off64_t _GD_LzmaSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad __gd_unused)
+{
+ struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+
+ dtrace("%p, %lli, %x, <unused>", file, (long long)count, data_type);
+
+ count *= GD_SIZE(data_type);
+
+ if (ptr->base > count) {
+ /* a backwards seek -- rewind to the beginning */
+ lzma_end(&ptr->xzfile);
+ ptr->xzfile.avail_in = 0;
+ ptr->xzfile.avail_out = GD_LZMA_BUFFER_SIZE;
+ ptr->xzerror = lzma_auto_decoder(&ptr->xzfile, 1000000000, 0);
+ ptr->xzfile.total_in = GD_LZMA_BUFFER_SIZE;
+ if (ptr->xzerror != LZMA_OK) {
+ file->fp = -1;
+ fclose(ptr->stream);
+ dreturn("%i", 1);
+ return 1;
+ }
+ rewind(ptr->stream);
+ ptr->read_in = ptr->out_pos = ptr->end = 0;
+ ptr->base = ptr->input_eof = ptr->stream_end = 0;
+ }
+
+ /* seek forward the slow way */
+ while (ptr->base + ptr->end < count) {
+ if (_GD_LzmaDecode(ptr)) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* eof */
+ if (ptr->stream_end)
+ break;
+ }
+
+ ptr->out_pos = (ptr->stream_end && count >= ptr->base + ptr->end) ? ptr->end
+ : count - ptr->base;
+
+ dreturn("%lli", (long long)((ptr->base + ptr->out_pos) / GD_SIZE(data_type)));
+ return (ptr->base + ptr->out_pos) / GD_SIZE(data_type);
+}
+
+ssize_t _GD_LzmaRead(struct _gd_raw_file *file, void *data, gd_type_t data_type,
+ size_t nmemb)
+{
+ char* output = (char *)data;
+ struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+ uint64_t nbytes = nmemb * GD_SIZE(data_type);
+
+ dtrace("%p, %p, %x, %zu", file, data, data_type, nmemb);
+
+ /* this loops over chunks of uncompressed data of size data_out until we
+ * have as much data as we need in data_out, or until EOF */
+ while (nbytes > (uint64_t)(ptr->end - ptr->out_pos)) {
+ memcpy(output, ptr->data_out + ptr->out_pos, ptr->end - ptr->out_pos);
+ output += ptr->end - ptr->out_pos;
+ nbytes -= ptr->end - ptr->out_pos;
+ ptr->out_pos = ptr->end;
+
+ if (ptr->stream_end) {
+ dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
+ return nmemb - nbytes / GD_SIZE(data_type);
+ }
+
+ if (_GD_LzmaDecode(ptr)) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* eof */
+ if (ptr->stream_end)
+ break;
+ }
+
+ /* If we still have more data than we need (no EOF), copy it all, otherwise
+ * (reached EOF) copy as much as we have */
+ if (nbytes > (uint64_t)(ptr->end - ptr->out_pos)) {
+ memcpy(output, ptr->data_out + ptr->out_pos, ptr->end - ptr->out_pos);
+ ptr->out_pos = ptr->end;
+ nbytes -= ptr->end;
+ } else {
+ memcpy(output, ptr->data_out + ptr->out_pos, nbytes);
+ ptr->out_pos += nbytes;
+ nbytes = 0;
+ }
+
+ dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
+ return nmemb - nbytes / GD_SIZE(data_type);
+}
+
+int _GD_LzmaClose(struct _gd_raw_file *file)
+{
+ struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+
+ dtrace("%p", file);
+
+ ptr->xzerror = 0;
+ lzma_end(&ptr->xzfile);
+ if (!fclose(ptr->stream)) {
+ file->fp = -1;
+ free(file->edata);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", 1);
+ return 1;
+}
+
+off64_t _GD_LzmaSize(struct _gd_raw_file *file, gd_type_t data_type)
+{
+ struct gd_lzmadata *ptr;
+ off_t n;
+
+ dtrace("%p, %x", file, data_type);
+
+ ptr = _GD_LzmaDoOpen(file);
+
+ if (ptr == NULL) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* seek forward the slow way to the end */
+ while (!ptr->stream_end) {
+ if (_GD_LzmaDecode(ptr)) {
+ lzma_end(&ptr->xzfile);
+ fclose(ptr->stream);
+ dreturn("%i", -1);
+ return -1;
+ }
+ }
+ lzma_end(&ptr->xzfile);
+ fclose(ptr->stream);
+
+ n = (ptr->base + ptr->end) / GD_SIZE(data_type);
+ free(ptr);
+
+ dreturn("%lli", (long long)n);
+ return n;
+}
diff --git a/src/meta_list.c b/src/meta_list.c
new file mode 100644
index 0000000..8d1eb20
--- /dev/null
+++ b/src/meta_list.c
@@ -0,0 +1,392 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+/* a zero length list */
+static const char *zero_list[1] = { NULL };
+static const gd_carray_t zero_carrays[1] = { {0, NULL} };
+
+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, NULL);
+
+ if (P == NULL || P->e->n_meta == -1) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ e = P->e;
+
+ if (e->n_meta_const == 0) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ free(e->const_value_list);
+ fl = (char *)_GD_Alloc(D, return_type, e->n_meta_const);
+
+ 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 (e->p.meta_entry[i]->field_type == 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;
+ }
+
+ 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, NULL);
+
+ if (P == NULL || P->e->n_meta == -1) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ e = P->e;
+
+ if (e->n_meta_carray == 0) {
+ dreturn("%p", zero_carrays);
+ return zero_carrays;
+ }
+
+ 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);
+
+ fl = (gd_carray_t *)malloc(sizeof(gd_carray_t) * (e->n_meta_carray + 1));
+ dwatch("%i", e->n_meta_carray);
+
+ 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 (e->p.meta_entry[i]->field_type == 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;
+
+ 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, NULL);
+
+ if (P == NULL || P->e->n_meta == -1) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ e = P->e;
+
+ if (e->n_meta_string == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ fl = (char **)realloc((char **)e->string_value_list, sizeof(const char*) *
+ (e->n_meta_string + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < e->n_meta; ++i) {
+ if (e->p.meta_entry[i]->field_type == GD_STRING_ENTRY)
+ fl[n++] = e->p.meta_entry[i]->e->u.string;
+ }
+ fl[n] = NULL;
+
+ 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
+{
+ int i, index = -1;
+ unsigned int n;
+ char **fl;
+ gd_entry_t *P;
+ struct _gd_private_entry *e;
+ size_t offs;
+
+ dtrace("%p, \"%s\", %x", D, parent, 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, NULL);
+
+ if (P == NULL || P->e->n_meta == -1) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ e = P->e;
+ offs = strlen(P->field) + 1;
+
+ n = gd_nmfields_by_type(D, parent, type);
+
+ if (D->error) {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if (n == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ /* find the index -- get_nfields_by_type should have already tripped up
+ * if the type is invalid */
+ for (i = 0; i < GD_N_ENTYPES; ++i)
+ if (_gd_entype_index[i] == type) {
+ index = i;
+ break;
+ }
+
+ if (index == -1) {
+ _GD_InternalError(D);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ fl = (char **)realloc(e->type_list[index], sizeof(const char*) * (n + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < e->n_meta; ++i) {
+ if (e->p.meta_entry[i]->field_type == type)
+ fl[n++] = e->p.meta_entry[i]->field + offs;
+ }
+ fl[n] = NULL;
+
+ e->type_list[index] = fl;
+
+ dreturn("%p", e->type_list[index]);
+ return (const char **)e->type_list[index];
+}
+
+const char **gd_mvector_list(DIRFILE* D, const char* parent) gd_nothrow
+{
+ int i, n;
+ char **fl;
+ struct _gd_private_entry* e;
+ size_t offs;
+ gd_entry_t *P;
+
+ 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, NULL);
+
+ if (P == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ e = P->e;
+ offs = strlen(P->field) + 1;
+
+ n = e->n_meta - e->n_meta_string - e->n_meta_const - e->n_meta_carray;
+
+ if (n == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ fl = (char **)realloc((char **)e->vector_list, sizeof(const char*) * (n + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < e->n_meta; ++i) {
+ if (!(e->p.meta_entry[i]->field_type & GD_SCALAR_ENTRY))
+ fl[n++] = e->p.meta_entry[i]->field + offs;
+ }
+ fl[n] = NULL;
+
+ e->vector_list = (const char **)fl;
+
+ dreturn("%p", e->vector_list);
+ return e->vector_list;
+}
+
+const char **gd_mfield_list(DIRFILE* D, const char* parent) gd_nothrow
+{
+ int i, n;
+ char** fl;
+ struct _gd_private_entry *e;
+ gd_entry_t *P;
+ size_t offs;
+
+ 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, NULL);
+
+ if (P == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ e = P->e;
+
+ offs = strlen(P->field) + 1;
+
+ if (e->n_meta == 0) {
+ dreturn("%p", zero_list);
+ return zero_list;
+ }
+
+ fl = (char **)realloc((char **)e->field_list, sizeof(const char*) *
+ (e->n_meta + 1));
+
+ if (fl == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ for (i = n = 0; i < e->n_meta; ++i)
+ fl[n++] = e->p.meta_entry[i]->field + offs;
+ fl[n] = NULL;
+
+ e->field_list = (const char **)fl;
+
+ dreturn("%p", e->field_list);
+ return e->field_list;
+}
diff --git a/src/mod.c b/src/mod.c
new file mode 100644
index 0000000..cda326e
--- /dev/null
+++ b/src/mod.c
@@ -0,0 +1,1594 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+
+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
+/* sold snew 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 r = 0;
+ int set_lout = 0;
+ int error = 0;
+
+ dtrace("%p, %i, %x, %p, %p, %p, %p, \"%s\", %i, %i", D, alter_literal, type,
+ lout, lin, sout, iout, sin, iin, calculated);
+
+ 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)
+ error = 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. */
+ r = GD_AS_FREE_SCALAR | GD_AS_NEED_RECALC | GD_AS_MODIFIED;
+ *sout = strdup(sin);
+ if (*sout == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ *iout = iin;
+ }
+
+ if (!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
+ _GD_InternalError(D);
+ }
+
+ if (error)
+ r |= GD_AS_ERROR;
+
+ dreturn("%i", 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, gd_spf_t spfA, void *B,
+ gd_spf_t spfB, gd_type_t type, size_t n)
+{
+ size_t i;
+
+ dtrace("%p, %p, %u, %p, %u, 0x%x, %zu", 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();
+}
+
+/* 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, NULL))
+ == NULL)
+ {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, 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));
+
+ 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_UINT16, &Q.EN(raw,spf), &N->EN(raw,spf), Q.scalar, Q.scalar_ind,
+ N->scalar[0], N->scalar_ind[0], E->e->calculated);
+
+ if (j & GD_AS_ERROR)
+ break;
+ if (j & GD_AS_FREE_SCALAR)
+ scalar_free |= 1;
+ if (j & GD_AS_NEED_RECALC)
+ Qe.calculated = 0;
+
+ 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 (j & GD_AS_NEED_RECALC)
+ if (gd_get_constant(D, Q.scalar[0], GD_UINT16, &Q.EN(raw,spf)))
+ break;
+
+ nf = 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 |
+ GD_EF_TEMP);
+
+ if (D->error)
+ break;
+
+ enc = _gd_ef + E->e->u.raw.file[0].encoding;
+
+ if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0))
+ ; /* error already set */
+ else if (E->e->u.raw.file[0].fp == -1 && (*enc->open)(E->e->u.raw.file,
+ 0, 0))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+ NULL);
+ } else if ((*enc->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type), 1)
+ == -1)
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+ NULL);
+ }
+
+ if (D->error)
+ break;
+
+ /* Create a temporary file and open it */
+ if (_GD_SetEncodedName(D, E->e->u.raw.file + 1, E->e->u.raw.filebase,
+ 1))
+ {
+ ; /* error already set */
+ } else if ((*enc->temp)(E->e->u.raw.file, GD_TEMP_OPEN))
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+ NULL);
+ else if ((*enc->seek)(E->e->u.raw.file + 1, 0, E->EN(raw,data_type), 1)
+ == -1)
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+ NULL);
+ }
+
+ if (D->error) {
+ (*enc->temp)(E->e->u.raw.file, GD_TEMP_DESTROY);
+ break;
+ }
+
+ buffer1 = malloc(BUFFER_SIZE);
+ buffer2 = malloc(BUFFER_SIZE);
+
+ /* 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_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+ NULL);
+ 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 = (*enc->write)(E->e->u.raw.file + 1, buffer1,
+ Q.EN(raw,data_type), ns_out);
+
+ if (nwrote < ns_out) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+ NULL);
+ break;
+ }
+ }
+
+ free(buffer1);
+ free(buffer2);
+
+ /* An error occurred, clean up */
+ if (D->error)
+ (*enc->temp)(E->e->u.raw.file, GD_TEMP_DESTROY);
+ /* Well, I suppose the copy worked. Close both files */
+ else if ((*enc->close)(E->e->u.raw.file) ||
+ (*enc->sync)(E->e->u.raw.file + 1) ||
+ (*enc->close)(E->e->u.raw.file + 1))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+ NULL);
+ /* Move the temporary file over the old file */
+ } else if ((*enc->temp)(E->e->u.raw.file, GD_TEMP_MOVE))
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+ NULL);
+ }
+ 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_BAD_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.comp_scal = 0;
+
+ for (i = 0; i < Q.EN(lincom,n_fields); ++i) {
+ if (flags & 0x1)
+ if (E->EN(lincom,n_fields) <= i || (N->in_fields[i] != NULL &&
+ strcmp(E->in_fields[i], N->in_fields[i])))
+ {
+ if ((Q.in_fields[i] = strdup(N->in_fields[i])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ modified = 1;
+ field_free |= 1 << i;
+ }
+
+ if (flags & 0x2) {
+ if (N->comp_scal) {
+ 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->e->calculated);
+ 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->e->calculated);
+ _gd_r2c(Q.EN(lincom,cm)[i], Q.EN(lincom,m)[i]);
+ }
+
+ if (j & GD_AS_FREE_SCALAR)
+ scalar_free |= 1 << i;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+ if (j & GD_AS_NEED_RECALC)
+ Qe.calculated = 0;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+ }
+
+ if (flags & 0x4) {
+ if (N->comp_scal) {
+ 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->e->calculated);
+ 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->e->calculated);
+ _gd_r2c(Q.EN(lincom,cb)[i], Q.EN(lincom,b)[i]);
+ }
+
+ 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)
+ Qe.calculated = 0;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+ }
+
+ if (cimag(Q.EN(lincom,cm)[i]) || cimag(Q.EN(lincom,cb)[i]))
+ Q.comp_scal = 1;
+ }
+
+ if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+ modified = 1;
+ break;
+ case GD_LINTERP_ENTRY:
+ if (N->in_fields[0] != NULL && strcmp(E->in_fields[0], N->in_fields[0])) {
+ if ((Q.in_fields[0] = strdup(N->in_fields[0])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ modified = 1;
+ field_free = 1;
+ }
+
+ if (N->EN(linterp,table) != NULL && strcmp(E->EN(linterp,table),
+ N->EN(linterp,table)))
+ {
+ Q.EN(linterp,table) = strdup(N->EN(linterp,table));
+ Qe.u.linterp.table_path = NULL;
+
+ if (Q.EN(linterp,table) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+
+ if (flags) {
+ if (E->e->u.linterp.table_path == NULL)
+ if (_GD_SetTablePath(D, E, E->e))
+ break;
+
+ if (Qe.u.linterp.table_path == NULL)
+ if (_GD_SetTablePath(D, &Q, &Qe))
+ break;
+
+ if (_GD_Rename(E->e->u.linterp.table_path, Qe.u.linterp.table_path)) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.linterp.table_path, errno,
+ 0);
+ break;
+ }
+ }
+
+ modified = 1;
+ free(E->EN(linterp,table));
+ free(E->e->u.linterp.table_path);
+ }
+
+ 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_INT16, &Q.EN(bit,numbits), &N->EN(bit,numbits),
+ Q.scalar + 1, Q.scalar_ind + 1, N->scalar[1], N->scalar_ind[1],
+ E->e->calculated);
+
+ if (j & GD_AS_ERROR)
+ break;
+ if (j & GD_AS_FREE_SCALAR)
+ scalar_free |= 2;
+ if (j & GD_AS_NEED_RECALC)
+ Qe.calculated = 0;
+ 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_INT16, &Q.EN(bit,bitnum), &N->EN(bit,bitnum),
+ Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0],
+ E->e->calculated);
+
+ if (j & GD_AS_ERROR)
+ break;
+ if (j & GD_AS_FREE_SCALAR)
+ scalar_free |= 1;
+ if (j & GD_AS_NEED_RECALC)
+ Qe.calculated = 0;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+
+ if (N->in_fields[0] != NULL && strcmp(E->in_fields[0], N->in_fields[0])) {
+ if ((Q.in_fields[0] = strdup(N->in_fields[0])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ modified = 1;
+ field_free = 1;
+ }
+
+ break;
+ case GD_MULTIPLY_ENTRY:
+ case GD_DIVIDE_ENTRY:
+ if (N->in_fields[0] != NULL && strcmp(E->in_fields[0], N->in_fields[0])) {
+ if ((Q.in_fields[0] = strdup(N->in_fields[0])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ modified = 1;
+ field_free = 1;
+ }
+
+ if (N->in_fields[1] != NULL && strcmp(E->in_fields[1], N->in_fields[1])) {
+ if ((Q.in_fields[1] = strdup(N->in_fields[1])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ modified = 1;
+ field_free |= 2;
+ }
+
+ break;
+ case GD_RECIP_ENTRY:
+ if (N->in_fields[0] != NULL && strcmp(E->in_fields[0], N->in_fields[0])) {
+ if ((Q.in_fields[0] = strdup(N->in_fields[0])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ modified = 1;
+ field_free = 1;
+ }
+
+ Q.comp_scal = 0;
+ if (N->comp_scal) {
+ 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->e->calculated);
+ Q.EN(recip,dividend) = creal(Q.EN(recip,cdividend));
+ if (cimag(Q.EN(recip,cdividend)) != 0)
+ Q.comp_scal = 1;
+ } 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->e->calculated);
+ _gd_r2c(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)
+ Qe.calculated = 0;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+
+ if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+ 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->e->calculated);
+
+ if (j & GD_AS_ERROR)
+ break;
+ if (j & GD_AS_FREE_SCALAR)
+ scalar_free |= 2;
+ if (j & GD_AS_NEED_RECALC)
+ Qe.calculated = 0;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+
+ if (N->in_fields[0] != NULL && strcmp(E->in_fields[0], N->in_fields[0])) {
+ if ((Q.in_fields[0] = strdup(N->in_fields[0])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ modified = 1;
+ field_free = 1;
+ }
+
+ break;
+ case GD_POLYNOM_ENTRY:
+ if (N->in_fields[0] != NULL && strcmp(E->in_fields[0], N->in_fields[0])) {
+ if ((Q.in_fields[0] = strdup(N->in_fields[0])) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ 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;
+
+ Q.comp_scal = 0;
+
+ if (flags & 0x1)
+ for (i = 0; i <= Q.EN(polynom,poly_ord); ++i) {
+ if (N->comp_scal) {
+ 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->e->calculated);
+ 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->e->calculated);
+ _gd_r2c(Q.EN(polynom,ca)[i], Q.EN(polynom,a)[i]);
+ }
+
+ if (j & GD_AS_FREE_SCALAR)
+ scalar_free |= 1 << i;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+ if (j & GD_AS_NEED_RECALC)
+ Qe.calculated = 0;
+ if (j & GD_AS_MODIFIED)
+ modified = 1;
+
+ if (cimag(Q.EN(polynom,ca)[i]))
+ Q.comp_scal = 1;
+ }
+
+ if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+ modified = 1;
+
+ 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 = malloc(GD_SIZE(type));
+ if (Qe.u.scalar.d == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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_IEEE754)
+ *(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) & 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;
+ } else if (E->EN(scalar,array_len) > GD_MAX_CARRAY_LENGTH) {
+ _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (Q.EN(scalar,const_type) != E->EN(scalar,const_type) ||
+ Q.EN(scalar,array_len) != E->EN(scalar,array_len))
+ {
+ modified = 1;
+ }
+
+ type = _GD_ConstType(D, Q.EN(scalar,const_type));
+ Qe.u.scalar.d = malloc(GD_SIZE(type) * Q.EN(scalar,array_len));
+ if (Qe.u.scalar.d == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* 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);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ free(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_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]);
+ }
+
+ 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;
+ }
+
+ /* To ensure .e is NULLed */
+ memcpy(&N, entry, sizeof(gd_entry_t));
+ N.e = NULL;
+
+ /* 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, gd_spf_t spf, int move)
+{
+ int ret;
+ gd_entry_t N;
+
+ dtrace("%p, \"%s\", %u, %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);
+
+ N.field_type = GD_RAW_ENTRY;
+ N.EN(raw,spf) = spf;
+ N.EN(raw,data_type) = data_type;
+ N.e = NULL;
+ 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);
+
+ N.field_type = GD_LINCOM_ENTRY;
+ N.comp_scal = 0;
+ if (n_fields > GD_MAX_LINCOM || n_fields < 0) {
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_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, NULL);
+
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, field_code);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ N.EN(lincom,n_fields) = E->EN(lincom,n_fields);
+ }
+ N.e = NULL;
+
+ 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);
+
+ N.field_type = GD_LINCOM_ENTRY;
+ N.comp_scal = 1;
+ if (n_fields > GD_MAX_LINCOM || n_fields < 0) {
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_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, NULL);
+
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, field_code);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ N.EN(lincom,n_fields) = E->EN(lincom,n_fields);
+ }
+ N.e = NULL;
+
+ 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_ca2c(N.EN(lincom,cm)[i], cm, i);
+ N.scalar[i] = NULL;
+ } else
+ N.scalar[i] = "";
+
+ if (cb != NULL) {
+ flags |= 4;
+ _gd_ca2c(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;
+ }
+
+ N.field_type = GD_LINTERP_ENTRY;
+ N.in_fields[0] = (char *)in_field;
+ N.EN(linterp,table) = (char *)table;
+ N.e = NULL;
+
+ 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,
+ gd_bit_t bitnum, gd_bit_t 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;
+ }
+
+ N.field_type = GD_BIT_ENTRY;
+ N.in_fields[0] = (char *)in_field;
+ N.EN(bit,bitnum) = bitnum;
+ N.EN(bit,numbits) = numbits;
+ N.e = NULL;
+ 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,
+ gd_bit_t bitnum, gd_bit_t 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;
+ }
+
+ N.field_type = GD_SBIT_ENTRY;
+ N.in_fields[0] = (char *)in_field;
+ N.EN(bit,bitnum) = bitnum;
+ N.EN(bit,numbits) = numbits;
+ N.e = NULL;
+ 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;
+ }
+
+ 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;
+ N.comp_scal = 0;
+ N.e = NULL;
+
+ 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;
+ gd_entry_t N;
+
+ dtrace("%p, \"%s\", \"%s\", %g;%g", D, field_code, in_field, creal(cdividend),
+ cimag(cdividend));
+
+ if (D->flags & GD_INVALID) {/* don't crash */
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ N.field_type = GD_RECIP_ENTRY;
+ N.in_fields[0] = (char *)in_field;
+ N.scalar[0] = (cdividend == 0) ? "" : NULL;
+ N.EN(recip,cdividend) = cdividend;
+ N.comp_scal = 1;
+ N.e = NULL;
+
+ ret = _GD_Change(D, field_code, &N, 0);
+
+ 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\", [%g, %g]", D, 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;
+ }
+
+ N.field_type = GD_RECIP_ENTRY;
+ N.in_fields[0] = (char *)in_field;
+ N.scalar[0] = (cdividend[0] == 0 && cdividend[1] == 0) ? (char *)"" : NULL;
+ _gd_a2c(N.EN(recip,cdividend), cdividend);
+ N.scalar_ind[0] = 0;
+ N.comp_scal = 1;
+ N.e = NULL;
+
+ 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
+{
+ int ret;
+ gd_entry_t N;
+
+ dtrace("%p, \"%s\", \"%s\", \"%s\"", D, 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;
+ }
+
+ N.field_type = GD_DIVIDE_ENTRY;
+ N.in_fields[0] = (char *)in_field1;
+ N.in_fields[1] = (char *)in_field2;
+ N.e = NULL;
+
+ ret = _GD_Change(D, field_code, &N, 0);
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+int gd_alter_multiply(DIRFILE* D, const char* field_code, const char* in_field1,
+ const char* in_field2) gd_nothrow
+{
+ int ret;
+ gd_entry_t N;
+
+ dtrace("%p, \"%s\", \"%s\", \"%s\"", D, 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;
+ }
+
+ N.field_type = GD_MULTIPLY_ENTRY;
+ N.in_fields[0] = (char *)in_field1;
+ N.in_fields[1] = (char *)in_field2;
+ N.e = NULL;
+
+ ret = _GD_Change(D, field_code, &N, 0);
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+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;
+ }
+
+ N.field_type = GD_PHASE_ENTRY;
+ N.in_fields[0] = (char *)in_field;
+ N.EN(phase,shift) = shift;
+ N.e = NULL;
+ 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;
+ }
+
+ N.field_type = GD_CONST_ENTRY;
+ N.EN(scalar,const_type) = const_type;
+ N.e = NULL;
+
+ 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, %zu", 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;
+ }
+
+ N.field_type = GD_CARRAY_ENTRY;
+ N.EN(scalar,const_type) = const_type;
+ N.EN(scalar,array_len) = array_len;
+ N.e = NULL;
+
+ 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);
+
+ N.field_type = GD_POLYNOM_ENTRY;
+ N.comp_scal = 0;
+ if (poly_ord > GD_MAX_POLYORD || poly_ord < 0) {
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_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, NULL);
+
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, 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;
+ N.e = NULL;
+
+ 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);
+
+ N.field_type = GD_POLYNOM_ENTRY;
+ N.comp_scal = 1;
+ if (poly_ord > GD_MAX_POLYORD || poly_ord < 0) {
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_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, NULL);
+
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, 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;
+ N.e = NULL;
+
+ if (ca != NULL) {
+ flags |= 1;
+ for (i = 0; i <= N.EN(polynom,poly_ord); ++i) {
+ _gd_ca2c(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_spec(DIRFILE* D, const char* line, int move)
+{
+ const char *tok_pos = NULL;
+ char *outstring = NULL;
+ char *in_cols[MAX_IN_COLS];
+ int n_cols, ret;
+ int standards = GD_DIRFILE_STANDARDS_VERSION;
+ gd_entry_t *N = NULL;
+
+ 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);
+
+ if (~D->flags & GD_HAVE_VERSION)
+ _GD_FindVersion(D);
+
+ if (D->av)
+ standards = D->standards;
+
+ /* start parsing */
+ n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, in_cols,
+ "dirfile_alter_spec()", 0, standards, D->flags & GD_PERMISSIVE);
+
+ 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, NULL);
+
+ if (N == NULL) {
+ free(outstring);
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, in_cols[0]);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Let the parser compose the entry */
+ N = _GD_ParseFieldSpec(D, n_cols, in_cols, NULL, "dirfile_alter_spec()", 0,
+ N->fragment_index, standards, 0, GD_PEDANTIC, 0, &outstring, tok_pos);
+
+ free(outstring);
+
+ if (D->error) {
+ dreturn("%i", -1); /* field spec parser threw an error */
+ return -1;
+ }
+
+ if (N->field_type == GD_LINCOM_ENTRY)
+ move = 7;
+
+ /* Change the entry */
+ ret = _GD_Change(D, N->field, N, move);
+
+ _GD_FreeE(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;
+ int standards = GD_DIRFILE_STANDARDS_VERSION;
+ gd_entry_t *N = NULL;
+
+ 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, NULL);
+ if (N == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (~D->flags & GD_HAVE_VERSION)
+ _GD_FindVersion(D);
+
+ if (D->av)
+ standards = D->standards;
+
+ /* start parsing */
+ n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, in_cols,
+ "dirfile_malter_spec()", 0, standards, D->flags & GD_PERMISSIVE);
+
+ if (!D->error)
+ /* Let the parser compose the entry */
+ N = _GD_ParseFieldSpec(D, n_cols, in_cols, N, "dirfile_malter_spec()", 0,
+ N->fragment_index, standards, 0, GD_PEDANTIC, 0, &outstring, tok_pos);
+
+ free(outstring);
+
+ if (D->error) {
+ dreturn("%i", -1); /* field spec parser threw an error */
+ return -1;
+ }
+
+ if (N->field_type == GD_LINCOM_ENTRY)
+ move = 7;
+
+ /* Change the entry */
+ ret = _GD_Change(D, N->field, N, move);
+
+ _GD_FreeE(N, 1);
+
+ dreturn("%i", ret);
+ return ret;
+}
diff --git a/src/move.c b/src/move.c
new file mode 100644
index 0000000..9b1d078
--- /dev/null
+++ b/src/move.c
@@ -0,0 +1,424 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+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 = BUFFER_SIZE / E->e->u.raw.size;
+ ssize_t nread, nwrote;
+ int subencoding = GD_ENC_UNKNOWN;
+ int i;
+ int arm_endianise;
+ 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 = strdup(E->e->u.raw.filebase);
+ if (new_filebase == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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].encoding != GD_ENC_UNKNOWN) {
+ subencoding = E->e->u.raw.file[0].encoding;
+ } 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, 0, 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_EF_TEMP))
+ {
+ _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_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].encoding;
+
+ /* Need to do the ARM thing? */
+ arm_endianise = (((byte_sex & GD_ARM_FLAG) && enc_out->ecor) ^
+ ((D->fragment[E->fragment_index].byte_sex & GD_ARM_FLAG) && enc_in->ecor))
+ && (E->EN(raw,data_type) == GD_FLOAT64 ||
+ E->EN(raw,data_type) == GD_COMPLEX128);
+
+ /* Normalise endiannesses */
+#ifdef WORDS_BIGENDIAN
+ byte_sex = ((byte_sex & GD_LITTLE_ENDIAN) && enc_out->ecor) ^
+ ((D->fragment[E->fragment_index].byte_sex & GD_LITTLE_ENDIAN) &&
+ enc_in->ecor);
+#else
+ byte_sex = ((byte_sex & GD_BIG_ENDIAN) && enc_out->ecor) ^
+ ((D->fragment[E->fragment_index].byte_sex & GD_BIG_ENDIAN) && enc_in->ecor);
+#endif
+ /* Now byte_sex is true if endianness conversion is required. */
+
+ /* 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 &&
+ !byte_sex && !arm_endianise && strcmp(new_filebase,
+ E->e->u.raw.filebase) == 0)
+ {
+ 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;
+ }
+
+ /* 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].encoding = subencoding;
+
+ if (_GD_SetEncodedName(D, E->e->u.raw.file + 1, new_filebase, 1))
+ ; /* error already set */
+ else if ((*enc_out->temp)(E->e->u.raw.file, GD_TEMP_OPEN))
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
+
+ if (D->error) {
+ free(new_filebase);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Open the input file, if necessary */
+ if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0))
+ ; /* error already set */
+ else if (E->e->u.raw.file[0].fp == -1 && (*enc_in->open)(E->e->u.raw.file, 0,
+ 0))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ }
+
+ if (D->error) {
+ 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), 1) == -1)
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ else if ((*enc_out->seek)(E->e->u.raw.file + 1, -offset * E->EN(raw,spf),
+ E->EN(raw,data_type), 1) == -1)
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
+ }
+ } 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), 0) == -1)
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ } else if ((*enc_out->seek)(E->e->u.raw.file + 1, 0, E->EN(raw,data_type),
+ 1) == -1)
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
+ }
+ }
+
+ if (D->error) {
+ free(new_filebase);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if ((buffer = malloc(BUFFER_SIZE)) == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ break;
+ }
+
+ if (nread == 0)
+ break;
+
+ /* fix army-ness, if required */
+ if (arm_endianise)
+ _GD_ArmEndianise((uint64_t *)buffer, E->EN(raw,data_type) & GD_COMPLEX,
+ nread);
+
+ /* swap endianness, if required */
+ if (byte_sex) {
+ if (E->EN(raw,data_type) & GD_COMPLEX)
+ _GD_FixEndianness((char *)buffer, E->e->u.raw.size / 2, nread * 2);
+ else
+ _GD_FixEndianness((char *)buffer, E->e->u.raw.size, nread);
+ }
+
+ nwrote = (*enc_out->write)(E->e->u.raw.file + 1, buffer,
+ E->EN(raw,data_type), nread);
+
+ if (nwrote < nread) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
+ break;
+ }
+ }
+
+ free(buffer);
+
+ /* Close both files */
+ if ((*enc_in->close)(E->e->u.raw.file))
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+
+ if ((*enc_out->sync)(E->e->u.raw.file + 1) ||
+ (*enc_out->close)(E->e->u.raw.file + 1))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
+ }
+
+ if (finalise) {
+ /* Finalise the conversion: on error delete the temporary file, otherwise
+ * copy it over top of the new one. */
+ if (D->error)
+ (*enc_out->temp)(E->e->u.raw.file, GD_TEMP_DESTROY);
+ else {
+ struct _gd_raw_file temp;
+ memcpy(&temp, E->e->u.raw.file, sizeof(temp));
+
+ E->e->u.raw.file[0].name = NULL;
+ E->e->u.raw.file[0].encoding = subencoding;
+
+ if (_GD_SetEncodedName(D, E->e->u.raw.file, new_filebase, 0)) {
+ E->e->u.raw.file[0].name = temp.name;
+ E->e->u.raw.file[0].encoding = temp.encoding;
+ } else if ((*enc_out->temp)(E->e->u.raw.file, GD_TEMP_MOVE)) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+ NULL);
+ E->e->u.raw.file[0].name = temp.name;
+ E->e->u.raw.file[0].encoding = temp.encoding;
+ } else if ((subencoding != temp.encoding || strcmp(E->e->u.raw.filebase,
+ new_filebase)) && (*enc_in->unlink)(&temp))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, temp.name, errno, NULL);
+ E->e->u.raw.file[0].name = temp.name;
+ E->e->u.raw.file[0].encoding = temp.encoding;
+ } else {
+ free(temp.name);
+ free(E->e->u.raw.filebase);
+ E->e->u.raw.filebase = new_filebase;
+ }
+ }
+ } else
+ free(new_filebase);
+
+ if (D->error) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ dreturn("%i", 0);
+ return 0;
+}
+
+static int 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, const char* field_code, int new_fragment, int move_data)
+{
+ gd_entry_t *E;
+ char *new_filebase;
+ int i;
+
+ dtrace("%p, \"%s\", %i, %i", D, field_code, new_fragment, move_data);
+
+ 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;
+ }
+
+ 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;
+ }
+
+ _GD_ClearError(D);
+
+ E = _GD_FindField(D, field_code, D->entry, D->n_entries, NULL);
+
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, field_code);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (E->fragment_index == new_fragment) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ 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 ||
+ 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;
+ }
+
+ if (move_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 ||
+ strcmpnull(D->fragment[E->fragment_index].sname,
+ D->fragment[new_fragment].sname)))
+ {
+ new_filebase = (char *)malloc(FILENAME_MAX);
+ if (new_filebase == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ snprintf(new_filebase, FILENAME_MAX, "%s/%s",
+ D->fragment[new_fragment].sname ? D->fragment[new_fragment].sname :
+ D->name, E->field);
+
+ 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))
+ {
+ dreturn("%i", -1);
+ return -1;
+ }
+ }
+
+ /* 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 meta fields */
+ for (i = 0; i < E->e->n_meta; ++i)
+ E->e->p.meta_entry[i]->fragment_index = new_fragment;
+
+ dreturn("%i", 0);
+ return 0;
+}
diff --git a/src/name.c b/src/name.c
new file mode 100644
index 0000000..97b05c0
--- /dev/null
+++ b/src/name.c
@@ -0,0 +1,290 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#endif
+
+/* Check for a valid field name -- returns input on error */
+char* _GD_ValidateField(const gd_entry_t* parent, const char* field_code,
+ int standards, int strict, int* is_dot)
+{
+ const size_t len = strlen(field_code);
+ size_t i;
+ char* ptr;
+
+ dtrace("%p, \"%s\", %i, %i, %p", parent, field_code, standards, strict,
+ is_dot);
+
+ if (field_code[0] == '\0' || (strict && ((len > 50 && standards < 5) ||
+ (len > 16 && standards < 3))))
+ {
+ dreturn("%p", field_code);
+ return (char *)field_code;
+ }
+
+ *is_dot = 0;
+ for (i = 0; i < len; ++i)
+ if (field_code[i] == '/') {
+ /* fields may never contain '/', regardless of version and strictness */
+ dreturn("%p", field_code);
+ return (char *)field_code;
+ } else if (field_code[i] < 0x20) {
+ dreturn("%p", field_code);
+ return (char *)field_code;
+ } 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] == '#'))))
+ {
+ dreturn("%p", field_code);
+ return (char *)field_code;
+ } else if (field_code[i] == '.') {
+ if (standards >= 6 && strict) {
+ dreturn("%p", field_code);
+ return (char *)field_code;
+ } else
+ *is_dot = 1;
+ }
+
+ 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("%p", field_code);
+ return (char *)field_code;
+ }
+
+ if (parent != NULL) {
+ ptr = (char *)malloc(strlen(parent->field) + strlen(field_code) + 2);
+ sprintf(ptr, "%s/%s", parent->field, field_code);
+ } else
+ ptr = strdup(field_code);
+
+ dreturn("\"%s\"", ptr);
+ return ptr;
+}
+
+int gd_rename(DIRFILE *D, const char *old_code, const char *new_name,
+ int move_data)
+{
+ gd_entry_t *E, *Q;
+ char* name;
+ int new_dot, old_dot = 0;
+ unsigned int dot_ind;
+
+ dtrace("%p, \"%s\", \"%s\", %i", D, old_code, new_name, move_data);
+
+ 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 a dotted field name */
+ E = _GD_FindField(D, old_code, D->dot_list, D->n_dot, &dot_ind);
+
+ if (E)
+ old_dot = 1;
+ else
+ E = _GD_FindField(D, old_code, D->entry, D->n_entries, NULL);
+
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, 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;
+ }
+
+ name = _GD_ValidateField(E->e->p.parent, new_name, D->standards, 1, &new_dot);
+ if (name == new_name) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, new_name);
+ dreturn("%i", -1);
+ return -1;
+ } else if (name == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Duplicate check */
+ Q = _GD_FindField(D, name, D->entry, D->n_entries, NULL);
+
+ if (Q == E) {
+ 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;
+ }
+
+ if (E->field_type == GD_RAW_ENTRY) {
+ /* Compose the new filename */
+ char* filebase = (char *)malloc(FILENAME_MAX);
+
+ if (filebase == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(name);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ snprintf(filebase, FILENAME_MAX, "%s/%s",
+ D->fragment[E->fragment_index].sname ?
+ D->fragment[E->fragment_index].sname : D->name, new_name);
+
+ /* Close the old file */
+ if (E->e->u.raw.file->fp != -1 &&
+ (*_gd_ef[E->e->u.raw.file[0].encoding].close)(E->e->u.raw.file))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ free(name);
+ free(filebase);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ /* Resize the dot list; this must be done early in case it fails */
+ if (new_dot && !old_dot) {
+ gd_entry_t** ptr = (gd_entry_t **)realloc(D->dot_list,
+ sizeof(gd_entry_t*) * (D->n_dot + 1));
+
+ if (ptr == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(name);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ D->dot_list = ptr;
+ }
+
+ if (move_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_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_SetEncodedName(D, &temp, filebase, 0)) {
+ free(name);
+ free(filebase);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0)) {
+ free(name);
+ free(filebase);
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if ((*_gd_ef[E->e->u.raw.file[0].encoding].move)(E->e->u.raw.file,
+ temp.name))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ 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;
+ }
+
+ free(E->field);
+ E->field = name;
+
+ /* Update the dot list */
+ if (old_dot && !new_dot)
+ memmove(D->dot_list + dot_ind, D->dot_list + dot_ind + 1,
+ sizeof(gd_entry_t*) * (--D->n_dot - dot_ind));
+ else if (new_dot && !old_dot)
+ D->dot_list[D->n_dot++] = E;
+
+ /* re-sort the lists */
+ qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), entry_cmp);
+ if (new_dot)
+ qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), entry_cmp);
+
+ /* Invalidate the field lists */
+ D->list_validity = 0;
+ D->type_list_validity = 0;
+
+ dreturn("%i", 0);
+ return 0;
+}
diff --git a/src/nan.h b/src/nan.h
new file mode 100644
index 0000000..1993b71
--- /dev/null
+++ b/src/nan.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 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_NAN_H
+#define GETDATA_NAN_H
+
+#include <math.h>
+
+#ifndef NAN
+# if HAVE_NAN
+# define NAN nan("")
+# else
+# define NAN strtod("NAN", NULL)
+# endif
+#endif
+
+#endif
diff --git a/src/native.c b/src/native.c
new file mode 100644
index 0000000..c074569
--- /dev/null
+++ b/src/native.c
@@ -0,0 +1,179 @@
+/* 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
+ */
+#include "internal.h"
+#include <stdlib.h>
+
+gd_type_t _GD_NativeType(DIRFILE* D, gd_entry_t* 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, 0, 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->e->calculated)
+ _GD_CalculateEntry(D, E);
+
+ if (E->comp_scal) {
+ type = GD_COMPLEX128;
+ break;
+ }
+
+ for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+ if (_GD_BadInput(D, E, i))
+ break;
+
+ if (_GD_NativeType(D, E->e->entry[i], E->e->repr[i]) & GD_COMPLEX) {
+ type = GD_COMPLEX128;
+ break;
+ }
+ }
+ type = GD_FLOAT64;
+ 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_BadInput(D, E, 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 (_GD_BadInput(D, E, 0))
+ break;
+
+ type = ((_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX)
+ || E->comp_scal) ? GD_COMPLEX128 : GD_FLOAT64;
+ break;
+ case GD_BIT_ENTRY:
+ case GD_INDEX_ENTRY:
+ type = GD_UINT64;
+ break;
+ case GD_PHASE_ENTRY:
+ if (_GD_BadInput(D, E, 0))
+ break;
+
+ type = _GD_NativeType(D, E->e->entry[0], E->e->repr[0]);
+ break;
+ case GD_POLYNOM_ENTRY:
+ if (!E->e->calculated)
+ _GD_CalculateEntry(D, E);
+
+ if (E->comp_scal) {
+ type = GD_COMPLEX128;
+ break;
+ }
+
+ if (_GD_BadInput(D, E, 0))
+ 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 = E->EN(scalar,const_type);
+ break;
+ case GD_STRING_ENTRY:
+ type = GD_NULL;
+ break;
+ case GD_NO_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);
+
+ 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
+*/
diff --git a/src/nfields.c b/src/nfields.c
new file mode 100644
index 0000000..efafba2
--- /dev/null
+++ b/src/nfields.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+unsigned int gd_nfields(DIRFILE* D) gd_nothrow
+{
+ dtrace("%p", D);
+
+ if (D->flags & GD_INVALID) {
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ dreturn("%u", D->n_entries - D->n_meta);
+ return D->n_entries - D->n_meta;
+}
+
+unsigned int gd_nvectors(DIRFILE* D) gd_nothrow
+{
+ dtrace("%p", D);
+
+ if (D->flags & GD_INVALID) {
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ dreturn("%u", D->n_entries - D->n_meta - D->n_string - D->n_const -
+ D->n_carray);
+ return D->n_entries - D->n_meta - D->n_string - D->n_const - D->n_carray;
+}
+
+unsigned int gd_nfields_by_type(DIRFILE* D, gd_entype_t type) gd_nothrow
+{
+ unsigned int i, r = 0;
+
+ dtrace("%p, %i", D, type);
+
+ if (D->flags & GD_INVALID) {
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ switch(type) {
+ case GD_STRING_ENTRY:
+ r = D->n_string;
+ break;
+ case GD_CONST_ENTRY:
+ r = D->n_const;
+ break;
+ case GD_CARRAY_ENTRY:
+ r = D->n_carray;
+ break;
+ case GD_INDEX_ENTRY:
+ r = 1;
+ break;
+ case GD_NO_ENTRY:
+ _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_TYPE, NULL, type, NULL);
+ break;
+ default:
+ for (i = 0; i < D->n_entries; ++i)
+ if (D->entry[i]->field_type == type && D->entry[i]->e->n_meta != -1)
+ r++;
+ break;
+ }
+
+ dreturn("%u", r);
+ return r;
+}
diff --git a/src/nframes.c b/src/nframes.c
new file mode 100644
index 0000000..2542624
--- /dev/null
+++ b/src/nframes.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+#undef gd_nframes64
+
+#ifdef STDC_HEADERS
+#include <errno.h>
+#endif
+
+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_SIZE)) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (_GD_SetEncodedName(D, D->reference_field->e->u.raw.file,
+ D->reference_field->e->u.raw.filebase, 0))
+ {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ nf = (*_gd_ef[D->reference_field->e->u.raw.file[0].encoding].size)(
+ D->reference_field->e->u.raw.file,
+ D->reference_field->EN(raw,data_type));
+
+ if (nf < 0) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, D->reference_field->e->u.raw.file[0].name,
+ errno, NULL);
+ 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
+*/
diff --git a/src/nmeta.c b/src/nmeta.c
new file mode 100644
index 0000000..0c16e43
--- /dev/null
+++ b/src/nmeta.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2008, 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
+ */
+#include "internal.h"
+
+unsigned int gd_nmfields(DIRFILE* D, const char* parent) gd_nothrow
+{
+ gd_entry_t *P;
+
+ dtrace("%p", D);
+
+ if (D->flags & GD_INVALID) {
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ P = _GD_FindField(D, parent, D->entry, D->n_entries, NULL);
+
+ if (P == NULL || P->e->n_meta == -1) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ dreturn("%u", P->e->n_meta);
+ return P->e->n_meta;
+}
+
+unsigned int gd_nmvectors(DIRFILE* D, const char* parent) gd_nothrow
+{
+ gd_entry_t *P;
+
+ dtrace("%p", D);
+
+ if (D->flags & GD_INVALID) {
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ P = _GD_FindField(D, parent, D->entry, D->n_entries, NULL);
+
+ if (P == NULL || P->e->n_meta == -1) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ dreturn("%u", P->e->n_meta - P->e->n_meta_string - P->e->n_meta_const -
+ P->e->n_meta_carray);
+ return P->e->n_meta - P->e->n_meta_string - P->e->n_meta_const -
+ P->e->n_meta_carray;
+}
+
+unsigned int gd_nmfields_by_type(DIRFILE* D, const char* parent,
+ gd_entype_t type) gd_nothrow
+{
+ unsigned int r = 0;
+ int i;
+ gd_entry_t *P;
+
+ dtrace("%p, %i", D, type);
+
+ if (D->flags & GD_INVALID) {
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+
+ P = _GD_FindField(D, parent, D->entry, D->n_entries, NULL);
+
+ if (P == NULL || P->e->n_meta == -1) {
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, parent);
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ _GD_ClearError(D);
+ if (type == GD_STRING_ENTRY)
+ r = P->e->n_meta_string;
+ else if (type == GD_CONST_ENTRY)
+ r = P->e->n_meta_const;
+ else if (type == GD_CARRAY_ENTRY)
+ r = P->e->n_meta_carray;
+ else
+ for (i = 0; i < P->e->n_meta; ++i)
+ if (P->e->p.meta_entry[i]->field_type == type)
+ r++;
+
+ dreturn("%u", r);
+ return r;
+}
diff --git a/src/open.c b/src/open.c
new file mode 100644
index 0000000..3a7b6c4
--- /dev/null
+++ b/src/open.c
@@ -0,0 +1,380 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <ctype.h>
+#include <math.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+
+/* attempt to open or create a new dirfile - set error appropriately */
+static FILE* _GD_CreateDirfile(DIRFILE* D, const char* format_file,
+ const char* filedir)
+{
+ struct stat statbuf;
+ char fullname[FILENAME_MAX];
+ DIR* dir;
+ char* dirfile_end;
+ struct dirent* lamb;
+ int dir_error = 0;
+ int format_error = 0;
+ FILE* fp = NULL;
+
+ dtrace("%p, \"%s\", \"%s\"", D, format_file, filedir);
+
+ /* naively try to open the format file */
+ if ((fp = fopen(format_file, "rb")) == NULL) {
+ format_error = errno;
+
+ /* open failed, try to stat the directory itself */
+ if (stat(filedir, &statbuf))
+ dir_error = errno;
+ else if (!S_ISDIR(statbuf.st_mode))
+ dir_error = ENOTDIR;
+ }
+
+ /* First, cast out our four failure modes */
+
+ /* unable to read the format file */
+ if (format_error == EACCES || dir_error == EACCES) {
+ _GD_SetError(D, GD_E_OPEN, GD_E_OPEN_NO_ACCESS, format_file, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* the directory exists, but it's not a dirfile, do nothing else -- even if we
+ * were asked to truncate it */
+ if (!dir_error && format_error) {
+ _GD_SetError(D, GD_E_OPEN, GD_E_OPEN_NOT_DIRFILE, filedir, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* Couldn't open the file, and we weren't asked to create it */
+ if (format_error && !(D->flags & GD_CREAT)) {
+ _GD_SetError(D, GD_E_OPEN, GD_E_OPEN_NOT_EXIST, filedir, format_error,
+ NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* It does exist, but we were asked to exclusively create it */
+ if (!format_error && (D->flags & GD_CREAT) && (D->flags & GD_EXCL)) {
+ _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_EXCL, filedir, 0, NULL);
+ fclose(fp);
+ 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, which means 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) {
+ /* This file isn't going to be around much longer */
+ fclose(fp);
+
+ /* can't truncate a read-only dirfile */
+ if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+ _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* This code is from defile */
+ if ((dir = opendir(filedir)) == NULL) {
+ _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_DIR, filedir, errno, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ strcpy(fullname, filedir);
+ dirfile_end = fullname + strlen(fullname);
+ if (*(dirfile_end - 1) != '/') {
+ strcat(fullname, "/");
+ dirfile_end++;
+ }
+
+ while ((lamb = readdir(dir)) != NULL) {
+ strcpy(dirfile_end, lamb->d_name);
+
+ if (stat(fullname, &statbuf)) {
+ _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_STAT, fullname, errno, NULL);
+ closedir(dir);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* only delete regular files */
+ if (S_ISREG(statbuf.st_mode)) {
+ if (unlink(fullname)) {
+ _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_UNLINK, fullname, errno, NULL);
+ closedir(dir);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ }
+ }
+
+ closedir(dir);
+ }
+
+ /* Create, if needed */
+ if ((D->flags & GD_CREAT && format_error) || (D->flags & GD_TRUNC))
+ {
+ /* can't create a read-only dirfile */
+ if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+ _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* attempt to create the dirfile directory, if not present */
+ if (dir_error)
+ if (mkdir(filedir, 00777) < 0) {
+ _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_DIR, filedir, errno, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* create a new, empty format file */
+ if ((fp = fopen(format_file, "w")) == NULL) {
+ _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, errno, NULL);
+ 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;
+ }
+
+ /* open succeeds */
+ 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));
+ memset(D, 0, sizeof(DIRFILE));
+ D->flags = GD_INVALID;
+
+ dreturn("%p", D);
+ return D;
+}
+
+/* dirfile_cbopen: open (or, perhaps, create) and parse the specified dirfile
+*/
+DIRFILE* gd_cbopen(const char* filedir, unsigned long flags,
+ gd_parser_callback_t sehandler, void* extra)
+{
+ FILE *fp;
+ char* ref_name;
+ DIRFILE* D;
+ gd_entry_t* E;
+ char format_file[FILENAME_MAX];
+
+ dtrace("\"%s\", 0x%lx, %p, %p", filedir, (unsigned long)flags, sehandler,
+ extra);
+
+ _GD_InitialiseFramework();
+
+ D = (DIRFILE *)malloc(sizeof(DIRFILE));
+ memset(D, 0, sizeof(DIRFILE));
+
+ /* clear GD_PERMISSIVE if it was specified along with GD_PEDANTIC */
+ if (flags & GD_PERMISSIVE && flags & GD_PEDANTIC)
+ flags &= ~GD_PERMISSIVE;
+
+ D->error_string = NULL;
+ D->error_file = NULL;
+ D->name = strdup(filedir);
+ D->flags = (flags | GD_INVALID) & ~GD_IGNORE_REFS;
+ D->sehandler = sehandler;
+ D->sehandler_extra = extra;
+ D->standards = GD_DIRFILE_STANDARDS_VERSION;
+
+ if (D->name == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", D);
+ return D;
+ }
+
+ /* Add the INDEX entry */
+ D->n_entries = 1;
+
+ D->entry = (gd_entry_t **)malloc(sizeof(gd_entry_t*));
+ if (D->entry == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", D);
+ return D;
+ }
+
+ D->entry[0] = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (D->entry == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ 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 =
+ (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ D->entry[0]->field = strdup("INDEX");
+ if (D->entry[0]->field == NULL || D->entry[0]->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", D);
+ return D;
+ }
+ memset(D->entry[0]->e, 0, sizeof(struct _gd_private_entry));
+ D->entry[0]->e->calculated = 1;
+
+ snprintf(format_file, FILENAME_MAX, "%s%sformat", filedir,
+ (filedir[strlen(filedir) - 1] == '/') ? "" : "/");
+
+ /* open the format file (or create it) */
+ if ((fp = _GD_CreateDirfile(D, format_file, filedir)) == NULL) {
+ dreturn("%p", D);
+ return D; /* errors have already been set */
+ }
+
+ /* Parse the file. This will take care of any necessary inclusions */
+ D->n_fragment = 1;
+
+ D->fragment = (struct gd_fragment_t *)malloc(sizeof(struct gd_fragment_t));
+ if (D->fragment == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", D);
+ return D;
+ }
+ D->fragment[0].cname = strdup(format_file);
+ D->fragment[0].sname = NULL;
+ /* The root format file needs no external name */
+ D->fragment[0].ename = NULL;
+ D->fragment[0].modified = 0;
+ D->fragment[0].parent = -1;
+ 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].protection = GD_PROTECT_NONE;
+ D->fragment[0].vers = (flags & GD_PEDANTIC) ? GD_DIRFILE_STANDARDS_VERSION :
+ 0;
+
+ ref_name = _GD_ParseFragment(fp, D, 0, &D->standards, &D->flags);
+ fclose(fp);
+
+ if (D->error != GD_E_OK) {
+ dreturn("%p", D);
+ return D;
+ }
+
+ /* Find the reference field */
+ if (ref_name != NULL) {
+ E = _GD_FindField(D, ref_name, D->entry, D->n_entries, 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, we don't know which version this conforms to;
+ * try to figure it out. */
+ if (!D->error && !(D->flags & GD_PEDANTIC)) {
+ if (_GD_FindVersion(D)) {
+ /* conforms to some standard, use the latest */
+ gd_dirfile_standards(D, GD_VERSION_LATEST); /* can't fail */
+ D->flags &= ~GD_PERMISSIVE;
+ } else
+ /* non-conformant dirfile, flag it */
+ D->flags |= GD_PERMISSIVE;
+ } else
+ D->flags &= ~GD_PERMISSIVE;
+
+ 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_cbopen(filedir, flags, NULL, NULL);
+
+ dreturn("%p", D);
+ return D;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/parse.c b/src/parse.c
new file mode 100644
index 0000000..4d93c64
--- /dev/null
+++ b/src/parse.c
@@ -0,0 +1,1932 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <ctype.h>
+#include <math.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+
+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);
+
+ /* for backwards compatibility */
+ if (strlen(type) == 1 && (!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("%x", t);
+ return t;
+}
+
+/* Returns a newly malloc'd string containing the scalar field name, or NULL on
+ * numeric literal or error */
+static char* _GD_SetScalar(DIRFILE* D, const char* token, void* data, int type,
+ const char* format_file, int line, int *index, int *comp_scal)
+{
+ char *ptr = NULL;
+ char *lt;
+
+ dtrace("%p, \"%s\", %p, %i, \"%s\", %i, %p, %p", D, token, data, type,
+ format_file, line, index, comp_scal);
+
+ if (type & (GD_COMPLEX | GD_IEEE754)) {
+ /* try to convert to double */
+ const char *semicolon;
+ double i = 0;
+ double d = strtod(token, &ptr);
+
+ /* check for a complex value -- look for the semicolon */
+ for (semicolon = token; *semicolon; ++semicolon)
+ if (*semicolon == ';')
+ break;
+
+ /* there were trailing characters in the double or real part of complex */
+ if (ptr != semicolon) {
+ ptr = strdup(token);
+ goto carray_check;
+ }
+
+ /* If there was a semicolon, try to extract the imaginary part */
+ if (*semicolon == ';') {
+ i = strtod(semicolon + 1, &ptr);
+
+ /* there were trailing characters in the imaginary part of complex -- this
+ * can't be a valid field name, since ; is prohibited */
+ if (*ptr != '\0') {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+ token);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* if a complex value is not permitted, complain */
+ if (!(type & GD_COMPLEX)) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+ token);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ *comp_scal = 1;
+ }
+
+ if (type == GD_COMPLEX128) {
+ *(double *)data = d;
+ *((double *)data + 1) = i;
+ } else if (type == GD_COMPLEX64) {
+ *(float *)data = (float)d;
+ *((float *)data + 1) = (float)i;
+ } else 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) {
+ /* try to convert to long long int */
+ long long int lli = gd_strtoll(token, &ptr, 10);
+
+ /* there were trailing characters in the long long int */
+ if (*ptr != '\0') {
+ ptr = strdup(token);
+ 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 {
+ /* try to convert to unsigned long long int */
+ unsigned long long int ulli = gd_strtoull(token, &ptr, 10);
+
+ /* there were trailing characters in the unsigned long long int */
+ if (*ptr != '\0') {
+ ptr = strdup(token);
+ 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 for a < delimeter */
+ *index = -1;
+ for (lt = ptr; *lt; ++lt)
+ if (*lt == '<') {
+ *lt = '\0';
+ *index = atoi(lt + 1);
+ 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* D, char* in_cols[MAX_IN_COLS],
+ int n_cols, const gd_entry_t* parent, int me, const char* format_file,
+ int line, int standards, int pedantic, int *is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, %i, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols,
+ parent, me, format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, 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, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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].fp = E->e->u.raw.file[1].fp = -1;
+ E->e->u.raw.file[0].encoding = GD_ENC_UNKNOWN; /* don't know the encoding
+ subscheme yet */
+
+ E->field = _GD_ValidateField(NULL, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->e->u.raw.filebase = (char *)malloc(FILENAME_MAX);
+ if (E->e->u.raw.filebase == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ snprintf(E->e->u.raw.filebase, FILENAME_MAX, "%s/%s", D->fragment[me].sname ?
+ D->fragment[me].sname : D->name, in_cols[0]);
+
+ E->EN(raw,data_type) = _GD_RawType(in_cols[2], standards, 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, format_file, line,
+ in_cols[2]);
+ else if ((E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(raw,spf),
+ GD_UINT16, format_file, line, E->scalar_ind, NULL)) == NULL)
+ {
+ E->e->calculated = 1;
+ if (E->EN(raw,spf) <= 0)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_SPF, format_file, line,
+ in_cols[3]);
+ }
+
+ if (D->error != GD_E_OK) {
+ _GD_FreeE(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* D, char* in_cols[MAX_IN_COLS],
+ int n_cols, const gd_entry_t* parent, const char* format_file, int line,
+ int standards, int pedantic, int* is_dot)
+{
+ int i;
+ char* ptr = NULL;
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 3) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(E);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E->e, 0, sizeof(struct _gd_private_entry));
+
+ E->field_type = GD_LINCOM_ENTRY;
+ for (i = 0; i < GD_MAX_LINCOM; ++i) {
+ E->in_fields[i] = NULL;
+ E->e->entry[i] = NULL;
+ }
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->e->calculated = 1;
+ 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 <n> 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, format_file, line, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ /* the following two statements are somewhat hacky.... */
+ n_cols++;
+ in_cols--;
+ }
+
+ if (E->field == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else 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, format_file, 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, format_file, line, NULL);
+ else
+ for (i = 0; i < E->EN(lincom,n_fields); i++) {
+ E->in_fields[i] = strdup(in_cols[i * 3 + 3]);
+ if (E->in_fields[i] == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+
+ E->scalar[i] = _GD_SetScalar(D, in_cols[i * 3 + 4], &E->EN(lincom,cm)[i],
+ GD_COMPLEX128, format_file, line, E->scalar_ind + i, &E->comp_scal);
+ E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]);
+ E->scalar[i + GD_MAX_LINCOM] = _GD_SetScalar(D, in_cols[i * 3 + 5],
+ &E->EN(lincom,cb)[i], GD_COMPLEX128, format_file, line,
+ E->scalar_ind + i + GD_MAX_LINCOM, &E->comp_scal);
+ E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
+
+ if (E->scalar[i] != NULL || E->scalar[i + GD_MAX_LINCOM] != NULL)
+ E->e->calculated = 0;
+ }
+
+ if (D->error != GD_E_OK) {
+ _GD_FreeE(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* D,
+ char* in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t* parent,
+ const char* format_file, int line, int standards, int pedantic, int* is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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->e->calculated = 1;
+ E->EN(linterp,table) = NULL;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->in_fields[0] = strdup(in_cols[2]);
+ E->e->u.linterp.table_len = -1; /* linterp file not read yet */
+
+
+ E->EN(linterp,table) = strdup(in_cols[3]);
+
+ if (E->field == NULL || E->in_fields[0] == NULL || E->EN(linterp,table) ==
+ NULL)
+ {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ E = NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParseMultiply: parse MULTIPLY entry in format file.
+*/
+static gd_entry_t* _GD_ParseMultiply(DIRFILE* D,
+ char* in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t* parent,
+ const char* format_file, int line, int standards, int pedantic, int* is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(E);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E->e, 0, sizeof(struct _gd_private_entry));
+
+ E->field_type = GD_MULTIPLY_ENTRY;
+ E->in_fields[0] = E->in_fields[1] = NULL;
+ E->e->entry[0] = E->e->entry[1] = NULL;
+ E->e->calculated = 1;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->in_fields[0] = strdup(in_cols[2]);
+ E->in_fields[1] = strdup(in_cols[3]);
+
+ if (E->field == NULL || E->in_fields[0] == NULL || E->in_fields[1] == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ E = NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParseRecip: parse RECIP entry in format file.
+*/
+static gd_entry_t* _GD_ParseRecip(DIRFILE* D,
+ char* in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t* parent,
+ const char* format_file, int line, int standards, int pedantic, int* is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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;
+ E->e->calculated = 0;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->in_fields[0] = strdup(in_cols[2]);
+
+ if (E->field == NULL || E->in_fields[0] == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(recip,cdividend),
+ GD_COMPLEX128, format_file, line, E->scalar_ind, &E->comp_scal);
+ E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
+ E->comp_scal = (cimag(E->EN(recip,cdividend)) == 0) ? 0 : 1;
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParseDivide: parse DIVIDE entry in format file.
+*/
+static gd_entry_t* _GD_ParseDivide(DIRFILE* D,
+ char* in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t* parent,
+ const char* format_file, int line, int standards, int pedantic, int* is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(E);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E->e, 0, sizeof(struct _gd_private_entry));
+
+ E->field_type = GD_DIVIDE_ENTRY;
+ E->in_fields[0] = E->in_fields[1] = NULL;
+ E->e->entry[0] = E->e->entry[1] = NULL;
+ E->e->calculated = 0;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->in_fields[0] = strdup(in_cols[2]);
+ E->in_fields[1] = strdup(in_cols[3]);
+
+ if (E->field == NULL || E->in_fields[0] == NULL || E->in_fields[1] == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParseBit: parse BIT entry in format file.
+*/
+static gd_entry_t* _GD_ParseBit(DIRFILE* D, int is_signed,
+ char* in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t* parent,
+ const char* format_file, int line, int standards, int pedantic, int* is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %i, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, is_signed, in_cols,
+ n_cols, parent, format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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->e->calculated = 1;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->in_fields[0] = strdup(in_cols[2]);
+
+ if (E->field == NULL || E->in_fields[0] == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+
+
+ E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(bit,bitnum), GD_INT16,
+ format_file, line, E->scalar_ind, NULL);
+
+ if (n_cols > 4)
+ E->scalar[1] = _GD_SetScalar(D, in_cols[4], &E->EN(bit,numbits), GD_INT16,
+ format_file, line, E->scalar_ind + 1, NULL);
+ else
+ E->EN(bit,numbits) = 1;
+
+ if (E->scalar[0] != NULL || E->scalar[1] != NULL)
+ E->e->calculated = 0;
+
+ if (E->scalar[1] == NULL && E->EN(bit,numbits) < 1)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NUMBITS, format_file, line, NULL);
+ else if (E->scalar[0] == NULL && E->EN(bit,bitnum) < 0)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITNUM, format_file, line, NULL);
+ else if (E->e->calculated && E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITSIZE, format_file, line, NULL);
+
+ if (D->error != GD_E_OK) {
+ _GD_FreeE(E, 1);
+ E = NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParsePhase: parse PHASE entry in formats file.
+*/
+static gd_entry_t* _GD_ParsePhase(DIRFILE* D, char* in_cols[MAX_IN_COLS],
+ int n_cols, const gd_entry_t* parent, const char* format_file, int line,
+ int standards, int pedantic, int* is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->in_fields[0] = strdup(in_cols[2]); /* field */
+
+ if (E->field == NULL || E->in_fields[0] == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ E = NULL;
+ }
+
+ if ((E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(phase,shift),
+ GD_INT64, format_file, line, E->scalar_ind, NULL)) == NULL)
+ {
+ E->e->calculated = 1;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParsePolynom: parse a POLYNOM in the format file.
+*/
+static gd_entry_t* _GD_ParsePolynom(DIRFILE* D,
+ char* in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t* parent,
+ const char* format_file, int line, int standards, int pedantic, int* is_dot)
+{
+ int i;
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 5) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(E);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E->e, 0, sizeof(struct _gd_private_entry));
+
+ E->field_type = GD_POLYNOM_ENTRY;
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ 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->e->calculated = 1;
+
+ if (E->field == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else {
+ E->in_fields[0] = strdup(in_cols[2]);
+ if (E->in_fields[0] == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ else
+ for (i = 0; i <= E->EN(polynom,poly_ord); i++) {
+ E->scalar[i] = _GD_SetScalar(D, in_cols[i + 3], &E->EN(polynom,ca)[i],
+ GD_COMPLEX128, format_file, line, E->scalar_ind + i, &E->comp_scal);
+ E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
+
+ if (E->scalar[i] != NULL)
+ E->e->calculated = 0;
+ }
+ }
+
+ if (D->error != GD_E_OK) {
+ _GD_FreeE(E, 1);
+ E = NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type)
+{
+ dtrace("%p, 0x%03x", D, type);
+
+ switch (type) {
+ case GD_UINT8:
+ case GD_UINT16:
+ case GD_UINT32:
+ case GD_UINT64:
+ dreturn("%i", GD_UINT64);
+ return GD_UINT64;
+ case GD_INT8:
+ case GD_INT16:
+ case GD_INT32:
+ case GD_INT64:
+ dreturn("%x", GD_INT64);
+ return GD_INT64;
+ case GD_FLOAT32:
+ case GD_FLOAT64:
+ dreturn("%x", GD_FLOAT64);
+ return GD_FLOAT64;
+ case GD_COMPLEX64:
+ case GD_COMPLEX128:
+ dreturn("%x", GD_COMPLEX128);
+ return GD_COMPLEX128;
+ case GD_NULL:
+ case GD_UNKNOWN:
+ _GD_InternalError(D);
+ }
+
+ dreturn("%x", GD_NULL);
+ return GD_NULL;
+}
+
+/* _GD_ParseConst: parse CONST entry in formats file.
+*/
+static gd_entry_t* _GD_ParseConst(DIRFILE* D, char* in_cols[MAX_IN_COLS],
+ int n_cols, const gd_entry_t* parent, const char* format_file, int line,
+ int standards, int pedantic, int* is_dot)
+{
+ int dummy;
+ char* ptr;
+ gd_type_t type;
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(E);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E->e, 0, sizeof(struct _gd_private_entry));
+
+ E->field_type = GD_CONST_ENTRY;
+ E->e->calculated = 1;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if (E->field == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->EN(scalar,const_type) = _GD_RawType(in_cols[2], standards, 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, format_file, line,
+ in_cols[2]);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ type = _GD_ConstType(D, E->EN(scalar,const_type));
+ E->e->u.scalar.d = malloc(GD_SIZE(type));
+ if (!D->error && E->e->u.scalar.d == NULL)
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+
+ if (D->error) {
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ ptr = _GD_SetScalar(D, in_cols[3], E->e->u.scalar.d, type, format_file, line,
+ &dummy, &dummy);
+ if (ptr) {
+ free(ptr);
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+ in_cols[3]);
+ }
+
+ if (D->error) {
+ _GD_FreeE(E, 1);
+ E = NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParseCarray: parse CARRAY entry in formats file.
+*/
+static gd_entry_t* _GD_ParseCarray(DIRFILE* D, char* in_cols[MAX_IN_COLS],
+ int n_cols, const gd_entry_t* parent, const char* format_file, int line,
+ int standards, int pedantic, int* is_dot, char **outstring,
+ const char *tok_pos)
+{
+ int dummy;
+ int c, first, n, new_z, s, z;
+ gd_type_t t;
+ char* ptr;
+ void *data;
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p, %p, %p", D, in_cols, n_cols,
+ parent, format_file, line, standards, pedantic, is_dot, outstring,
+ tok_pos);
+
+ if (n_cols < 4) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(E);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E->e, 0, sizeof(struct _gd_private_entry));
+
+ E->field_type = GD_CARRAY_ENTRY;
+ E->e->calculated = 1;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if (E->field == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E->EN(scalar,const_type) = _GD_RawType(in_cols[2], standards, pedantic);
+
+ 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, format_file, line,
+ in_cols[2]);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* spool in the data */
+ new_z = MAX_IN_COLS - 2;
+ z = 0;
+ n = 0;
+ first = 3;
+ data = NULL;
+ t = _GD_ConstType(D, E->EN(scalar,const_type));
+ s = GD_SIZE(t);
+
+ for (;;) {
+ if (z < new_z) {
+ void *new_data = (char *)realloc(data, new_z * s);
+ if (new_data == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ free(data);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ data = new_data;
+ z = new_z;
+ }
+
+ for (c = first; c < n_cols; ++c) {
+ ptr = _GD_SetScalar(D, in_cols[c], (char *)data + s * n++, t, format_file,
+ line, &dummy, &dummy);
+ if (n == GD_MAX_CARRAY_LENGTH)
+ break;
+
+ if (ptr) {
+ free(ptr);
+ free(data);
+ _GD_FreeE(E, 1);
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+ in_cols[c]);
+ }
+ }
+
+ if (n_cols < MAX_IN_COLS)
+ break;
+
+ /* get more tokens */
+ free(*outstring);
+ n_cols = _GD_Tokenise(D, tok_pos, outstring, &tok_pos, in_cols, format_file,
+ line, standards, pedantic);
+ if (n_cols == 0 || D->error)
+ break;
+ first = 0;
+ new_z = z + n_cols;
+ }
+ /* save the list */
+ E->e->u.scalar.d = data;
+ E->EN(scalar,array_len) = n;
+
+ if (D->error) {
+ free(data);
+ _GD_FreeE(E, 1);
+ E = NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+/* _GD_ParseString: parse STRING entry in formats file.
+*/
+static gd_entry_t* _GD_ParseString(DIRFILE* D, char *in_cols[MAX_IN_COLS],
+ int n_cols, const gd_entry_t* parent, const char* format_file, int line,
+ int standards, int pedantic, int* is_dot)
+{
+ gd_entry_t *E;
+
+ dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %p", D, in_cols, n_cols, parent,
+ format_file, line, standards, pedantic, is_dot);
+
+ if (n_cols < 3) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ E = (gd_entry_t *)malloc(sizeof(gd_entry_t));
+ if (E == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+ memset(E, 0, sizeof(gd_entry_t));
+
+ E->e = (struct _gd_private_entry *)malloc(sizeof(struct _gd_private_entry));
+ if (E->e == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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 = strdup(in_cols[2]);
+ E->e->calculated = 1;
+
+ E->field = _GD_ValidateField(parent, in_cols[0], standards, pedantic, is_dot);
+ if (E->field == in_cols[0]) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+ in_cols[0]);
+ E->field = NULL;
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ if (E->field == NULL || E->e->u.string == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ dreturn("%p", E);
+ return E;
+}
+
+static int utf8encode(DIRFILE* D, const char* format_file, int linenum,
+ char** op, uint32_t value)
+{
+ dtrace("%p, %p, %llx", D, op, (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_ParseFieldSpec: Parse a format file line fragment containing a field
+ * specification */
+gd_entry_t* _GD_ParseFieldSpec(DIRFILE* D, int n_cols, char** in_cols,
+ const gd_entry_t* P, const char* format_file, int linenum, int me,
+ int standards, int creat, unsigned long flags, int insert, char **outstring,
+ const char *tok_pos)
+{
+ gd_entry_t* E = NULL;
+ void *ptr;
+ char *cptr;
+ int is_dot = 0;
+ const int pedantic = flags & GD_PEDANTIC;
+
+ dtrace("%p, %i, %p, %p, \"%s\", %i, %i, %i, %i, %lx, %i, %p, %p", D, n_cols,
+ in_cols, P, format_file, linenum, me, standards, creat, flags, insert,
+ outstring, tok_pos);
+
+ /* Check for barth-style metafield definition */
+ if (P == NULL && (!pedantic || standards >= 7))
+ for (cptr = in_cols[0] + 1; *cptr != '\0'; ++cptr)
+ if (*cptr == '/') {
+ *cptr = '\0';
+ P = _GD_FindField(D, in_cols[0], D->entry, D->n_entries, NULL);
+ if (P == NULL)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_PARENT,
+ D->fragment[me].cname, linenum, in_cols[0]);
+ else if (P->fragment_index != me)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION,
+ D->fragment[me].cname, linenum, in_cols[0]);
+ else if (n_cols < 2)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
+ linenum, NULL);
+ else {
+ /* point in_cols[0] to the metafield name */
+ in_cols[0] = cptr + 1;
+ E = _GD_ParseFieldSpec(D, n_cols, in_cols, P, D->fragment[me].cname,
+ linenum, me, standards, creat, flags, insert, outstring, tok_pos);
+ }
+ dreturn("%p", (!insert) ? E : NULL);
+ return (!insert) ? E : NULL;
+ }
+
+ ptr = realloc(D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*));
+ if (ptr == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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, format_file, linenum,
+ NULL);
+ else if (P == NULL && (strcmp(in_cols[0], "INDEX") == 0 || (pedantic &&
+ standards < 6 && strcmp(in_cols[0], "FILEFRAM") == 0)))
+ /* reserved field name */
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_RES_NAME, format_file, linenum,
+ NULL);
+ else if (strcmp(in_cols[1], "RAW") == 0) {
+ E = _GD_ParseRaw(D, in_cols, n_cols, P, me, format_file, linenum, standards,
+ pedantic, &is_dot);
+
+ /* 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, 0, NULL, 0, NULL);
+ else if (D->fragment[me].encoding == GD_ENC_UNSUPPORTED)
+ /* If the encoding scheme is unsupported, we can't add the field */
+ _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL);
+ else if (!_GD_Supports(D, E, GD_EF_TOUCH))
+ ; /* error already set */
+ else if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0))
+ ; /* error already set */
+ else if ((*_gd_ef[E->e->u.raw.file[0].encoding].touch)(E->e->u.raw.file))
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ }
+
+ /* 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], "LINCOM") == 0)
+ E = _GD_ParseLincom(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "LINTERP") == 0)
+ E = _GD_ParseLinterp(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "MULTIPLY") == 0 && (!pedantic || standards >= 2))
+ E = _GD_ParseMultiply(D, in_cols, n_cols, P, format_file, linenum,
+ standards, pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "BIT") == 0)
+ E = _GD_ParseBit(D, 0, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "PHASE") == 0 && (!pedantic || standards >= 4))
+ E = _GD_ParsePhase(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "POLYNOM") == 0 && (!pedantic || standards >= 7))
+ E = _GD_ParsePolynom(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "SBIT") == 0 && (!pedantic || standards >= 7))
+ E = _GD_ParseBit(D, 1, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "DIVIDE") == 0 && (!pedantic || standards >= 8))
+ E = _GD_ParseDivide(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "RECIP") == 0 && (!pedantic || standards >= 8))
+ E = _GD_ParseRecip(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ else if (strcmp(in_cols[1], "CONST") == 0 && (!pedantic || standards >= 6)) {
+ E = _GD_ParseConst(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ if (D->error == GD_E_OK && P == NULL)
+ D->n_const++;
+ } else if (strcmp(in_cols[1], "CARRAY") == 0 && (!pedantic || standards >= 8))
+ {
+ E = _GD_ParseCarray(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot, outstring, tok_pos);
+ if (D->error == GD_E_OK && P == NULL)
+ D->n_carray++;
+ } else if (strcmp(in_cols[1], "STRING") == 0 && (!pedantic || standards >= 6))
+ {
+ E = _GD_ParseString(D, in_cols, n_cols, P, format_file, linenum, standards,
+ pedantic, &is_dot);
+ if (D->error == GD_E_OK && P == NULL)
+ D->n_string++;
+ } else if (standards <= GD_DIRFILE_STANDARDS_VERSION || pedantic)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_LINE, format_file, linenum,
+ NULL);
+
+ if (is_dot) {
+ ptr = realloc(D->dot_list, (D->n_dot + 1) * sizeof(gd_entry_t*));
+ if (ptr == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+ D->dot_list = (gd_entry_t **)ptr;
+ }
+
+ if (insert && D->error == GD_E_OK && E != NULL) {
+ /* the Format file fragment index */
+ unsigned int u;
+ gd_entry_t *Q;
+
+ E->fragment_index = me;
+
+ /* Check for duplicate */
+ Q = _GD_FindField(D, E->field, D->entry, D->n_entries, &u);
+
+ if (Q) {
+ if (~flags & GD_IGNORE_DUPS)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, format_file,
+ linenum, E->field);
+ _GD_FreeE(E, 1);
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ /* 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 = realloc(P->e->p.meta_entry, (P->e->n_meta + 1) *
+ sizeof(gd_entry_t*));
+ if (ptr == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn ("%p", NULL);
+ return NULL;
+ }
+ P->e->p.meta_entry = (gd_entry_t **)ptr;
+ P->e->p.meta_entry[P->e->n_meta++] = E;
+
+ D->n_meta++;
+ if (E->field_type == GD_CONST_ENTRY)
+ P->e->n_meta_const++;
+ else if (E->field_type == GD_CARRAY_ENTRY)
+ P->e->n_meta_carray++;
+ else if (E->field_type == GD_STRING_ENTRY)
+ P->e->n_meta_string++;
+ }
+
+ /* update the dot list if necessary */
+ if (is_dot) {
+ D->dot_list[D->n_dot++] = E;
+ qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), entry_cmp);
+ }
+
+ /* 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 *D, const char* instring, char **outstring,
+ const char **pos, char** in_cols, const char* format_file, int linenum,
+ int standards, int pedantic)
+{
+ 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, \"%s\", %p, %p, %p, \"%s\", %i, %i, %i", D, instring, outstring,
+ pos, in_cols, format_file, linenum, standards, pedantic);
+
+ op = *outstring = strdup(instring);
+ if (op == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, 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 >= MAX_IN_COLS)
+ break; /* Ignore trailing data on the line */
+ in_cols[n_cols++] = op;
+ }
+
+ 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, format_file,
+ linenum, NULL);
+ break;
+ }
+
+ *(op++) = (char)accumulator;
+
+ if (*ip < '0' || *ip > '7')
+ ip--; /* rewind */
+ escaped_char = 0;
+ }
+ } 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';
+ else
+ accumulator = accumulator * 16 + *ip - 'a';
+ }
+
+ if (acc_mode == ACC_MODE_HEX && (n_acc == 2 || !isxdigit(*ip))) {
+ if (accumulator == 0) {
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, format_file,
+ linenum, NULL);
+ break;
+ }
+
+ *(op++) = (char)accumulator;
+
+ if (!isxdigit(*ip))
+ ip--; /* rewind */
+ escaped_char = 0;
+ } else if (acc_mode == ACC_MODE_UTF8 && (n_acc == 7 ||
+ accumulator > 0x10FF || !isxdigit(*ip)))
+ {
+ if (utf8encode(D, format_file, linenum, &op, accumulator))
+ break; /* syntax error */
+
+ if (!isxdigit(*ip))
+ ip--; /* rewind */
+ escaped_char = 0;
+ }
+ } 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 == '\\' && (!pedantic || standards >= 6))
+ escaped_char = 1;
+ else if (*ip == '"' && (!pedantic || standards >= 6)) {
+ if ((quotated = !quotated)) {
+ if (ws) {
+ if (n_cols >= MAX_IN_COLS)
+ 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 >= MAX_IN_COLS)
+ break; /* Ignore trailing data on the line */
+ in_cols[n_cols++] = op;
+ ws = 0;
+ }
+ *(op++) = *ip;
+ }
+ }
+ }
+ *op = '\0';
+
+ if (quotated || escaped_char) /* Unterminated token */
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_UNTERM, format_file, linenum,
+ NULL);
+
+ if (pos)
+ *pos = ip;
+
+ dreturn("%i", n_cols);
+ return n_cols;
+}
+
+/* _GD_ParseDirective: Actually parse a single format file line.
+ * Returns 1 if a match was made.
+ */
+static int _GD_ParseDirective(DIRFILE *D, char** in_cols, int n_cols,
+ int me, int* standards, int linenum, char** ref_name, unsigned long *flags,
+ char **outstring, const char *tok_pos)
+{
+ const char* ptr;
+ int i;
+ int pedantic = *flags & GD_PEDANTIC;
+
+ dtrace("%p, %p, %i, %u, %p, %i, %p, %p, %p, %p", D, in_cols, n_cols, me,
+ standards, linenum, ref_name, flags, outstring, tok_pos);
+
+ /* Starting with Standards Version 8, the forward slash is required. */
+ if (*standards >= 8 && pedantic && in_cols[0][0] != '/') {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ /* set up for possibly slashed reserved words */
+ ptr = in_cols[0];
+ if (*standards >= 5 || !pedantic)
+ if (in_cols[0][0] == '/')
+ ptr++;
+
+ if (!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;
+ }
+
+ if (strcmp(ptr, "ENCODING") == 0 && (!pedantic || *standards >= 6)) {
+ if (!(*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;
+ break;
+ }
+ }
+ } else if (strcmp(ptr, "ENDIAN") == 0 && (!pedantic || *standards >= 5)) {
+ if (!(*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,
+ D->fragment[me].cname, linenum, NULL);
+ if (n_cols > 2 && (!pedantic || *standards >= 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,
+ D->fragment[me].cname, linenum, NULL);
+ }
+#ifdef ARM_ENDIAN_DOUBLES
+ else
+ D->fragment[me].byte_sex |= GD_ARM_FLAG;
+#endif
+ }
+ } else if (strcmp(ptr, "FRAMEOFFSET") == 0 && (!pedantic || *standards >= 1))
+ D->fragment[me].frame_offset = gd_strtoll(in_cols[1], NULL, 10);
+ else if (strcmp(ptr, "INCLUDE") == 0 && (!pedantic || *standards >= 3)) {
+ unsigned long subflags = D->fragment[me].encoding | D->fragment[me].byte_sex
+ | (*flags & (GD_PEDANTIC | GD_PERMISSIVE | GD_FORCE_ENDIAN |
+ GD_FORCE_ENCODING | GD_IGNORE_DUPS | GD_IGNORE_REFS));
+ int frag = _GD_Include(D, in_cols[1], D->fragment[me].cname, linenum,
+ ref_name, me, standards, &subflags);
+ if ((pedantic = subflags & GD_PEDANTIC))
+ *flags |= GD_PEDANTIC;
+ if (frag != -1)
+ D->fragment[me].vers |= D->fragment[frag].vers;
+ } else if (strcmp(ptr, "META") == 0 && (!pedantic || *standards >= 6)) {
+ const gd_entry_t* P = _GD_FindField(D, in_cols[1], D->entry, D->n_entries,
+ NULL);
+ if (P == NULL)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_PARENT, D->fragment[me].cname,
+ linenum, in_cols[1]);
+ else if (P->fragment_index != me)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION, D->fragment[me].cname,
+ linenum, in_cols[1]);
+ else if (n_cols < 4)
+ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
+ linenum, NULL);
+ else
+ _GD_ParseFieldSpec(D, n_cols - 2, in_cols + 2, P, D->fragment[me].cname,
+ linenum, me, *standards, 0, *flags, 1, outstring, tok_pos);
+ } else if (strcmp(ptr, "PROTECT") == 0 && (!pedantic || *standards >= 6)) {
+ 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, D->fragment[me].cname,
+ linenum, in_cols[1]);
+ } else if (strcmp(ptr, "REFERENCE") == 0 && (!pedantic || *standards >= 6)) {
+ free(*ref_name);
+ *ref_name = strdup(in_cols[1]);
+ } else if (strcmp(ptr, "VERSION") == 0 && (!pedantic || *standards >= 5)) {
+ *standards = atoi(in_cols[1]);
+ if (!pedantic && ~(*flags) & GD_PERMISSIVE)
+ *flags |= (pedantic = GD_PEDANTIC);
+ if (pedantic)
+ D->fragment[me].vers |= 1ULL << *standards;
+ } else {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", 1);
+ return 1;
+}
+
+/* _GD_ParseFragment: Parse each line of the fragment.
+ *
+ * Returns NULL unless this fragment contains a REFERENCE directive.
+ */
+char* _GD_ParseFragment(FILE* fp, DIRFILE *D, int me, int* standards,
+ unsigned long *flags)
+{
+ 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, %i, %p, %p", fp, D, me, standards, flags);
+
+ /* start parsing */
+ while (rescan || (instring = _GD_GetLine(fp, &n, &linenum))) {
+ rescan = 0;
+ n_cols = _GD_Tokenise(D, instring, &outstring, &tok_pos, in_cols,
+ D->fragment[me].cname, linenum, *standards, *flags & GD_PEDANTIC);
+
+ 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, D->fragment[me].cname,
+ linenum, NULL);
+
+ if (D->error == GD_E_OK)
+ match = _GD_ParseDirective(D, in_cols, n_cols, me, standards, linenum,
+ &ref_name, flags, &outstring, tok_pos);
+
+ if (D->error == GD_E_OK && !match)
+ first_raw = _GD_ParseFieldSpec(D, n_cols, in_cols, NULL,
+ D->fragment[me].cname, linenum, me, *standards, 0, *flags, 1,
+ &outstring, tok_pos);
+
+ if (D->error == GD_E_FORMAT) {
+ /* we guarantee a buffer size of at least GD_MAX_LINE_LENGTH */
+ if (n < GD_MAX_LINE_LENGTH) {
+ char *ptr = (char *)realloc(instring, GD_MAX_LINE_LENGTH);
+ if (ptr == NULL) {
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ break;
+ }
+ instring = ptr;
+ }
+ /* call the callback for this error */
+ if (D->sehandler != NULL) {
+ 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 = strdup(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, D->fragment[me].cname, linenum,
+ 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 = strdup(ref_name);
+ else if (first_raw != NULL)
+ D->fragment[me].ref_name = strdup(first_raw->field);
+ }
+
+ dreturn("%p", ref_name);
+ return ref_name;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/protect.c b/src/protect.c
new file mode 100644
index 0000000..95ef09d
--- /dev/null
+++ b/src/protect.c
@@ -0,0 +1,94 @@
+/* Copyright (C) 2008, 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+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, 0, 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, 0, 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_BAD_PROTECTION, 0, 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;
+}
diff --git a/src/putdata.c b/src/putdata.c
new file mode 100644
index 0000000..1744528
--- /dev/null
+++ b/src/putdata.c
@@ -0,0 +1,725 @@
+/* Copyright (C) 2003-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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <inttypes.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#endif
+
+static size_t _GD_DoRawOut(DIRFILE *D, gd_entry_t *E, off64_t s0,
+ size_t ns, gd_type_t data_type, const void *data_in)
+{
+ size_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, %zu, 0x%x, %p", D, E, 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;
+ }
+
+ if (_gd_ef[E->e->u.raw.file[0].encoding].ecor) {
+ /* convert to/from middle-ended doubles */
+ if ((E->EN(raw,data_type) == GD_FLOAT64 || E->EN(raw,data_type) ==
+ GD_COMPLEX128) &&
+ D->fragment[E->fragment_index].byte_sex & GD_ARM_FLAG)
+ {
+ _GD_ArmEndianise((uint64_t*)databuffer, E->EN(raw,data_type) & GD_COMPLEX,
+ ns);
+ }
+
+ if (D->fragment[E->fragment_index].byte_sex &
+#ifdef WORDS_BIGENDIAN
+ GD_LITTLE_ENDIAN
+#else
+ GD_BIG_ENDIAN
+#endif
+ )
+ {
+ if (E->EN(raw,data_type) & GD_COMPLEX)
+ _GD_FixEndianness((char *)databuffer, E->e->u.raw.size / 2, ns * 2);
+ else
+ _GD_FixEndianness((char *)databuffer, E->e->u.raw.size, ns);
+ }
+ }
+ /* write data to file. */
+
+ if (E->e->u.raw.file[0].fp < 0) {
+ /* open file for reading / writing if not already opened */
+
+ if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0)) {
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ } else if ((*_gd_ef[E->e->u.raw.file[0].encoding].open)(E->e->u.raw.file,
+ D->flags & GD_ACCMODE, 1))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ }
+ }
+
+ if ((*_gd_ef[E->e->u.raw.file[0].encoding].seek)(E->e->u.raw.file, s0,
+ E->EN(raw,data_type), 1) == -1)
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+ free(databuffer);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ n_wrote = (*_gd_ef[E->e->u.raw.file[0].encoding].write)(E->e->u.raw.file,
+ databuffer, E->EN(raw,data_type), ns);
+
+ free(databuffer);
+
+ dreturn("%zu", n_wrote);
+ return n_wrote;
+}
+
+static size_t _GD_DoLinterpOut(DIRFILE* D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t data_type, const void *data_in)
+{
+ size_t n_wrote;
+ int dir = -1, i;
+ double *tmpbuf;
+ struct _gd_lut *tmp_lut;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, data_type,
+ data_in);
+
+ if (_GD_BadInput(D, E, 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 = (double *)_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 = (struct _gd_lut *)malloc(E->e->u.linterp.table_len *
+ sizeof(struct _gd_lut));
+ if (tmp_lut == NULL) {
+ free(tmpbuf);
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ 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], E->e->repr[0], first_samp,
+ num_samp, GD_FLOAT64, tmpbuf);
+
+ free(tmpbuf);
+
+ dreturn("%zu", n_wrote);
+ return n_wrote;
+}
+
+static size_t _GD_DoLincomOut(DIRFILE* D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t data_type, const void *data_in)
+{
+ size_t n_wrote;
+ void* tmpbuf;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, 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)) {
+ 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->comp_scal) {
+#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], E->e->repr[0], first_samp,
+ num_samp, data_type, tmpbuf);
+ free(tmpbuf);
+
+ dreturn("%zu", n_wrote);
+ return n_wrote;
+}
+
+static size_t _GD_DoBitOut(DIRFILE* D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t data_type, const void *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, %zu, 0x%x, %p", D, E, first_samp, num_samp, data_type,
+ data_in);
+
+ if (_GD_BadInput(D, E, 0)) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ tmpbuf = (uint64_t *)_GD_Alloc(D, GD_UINT64, num_samp);
+ readbuf = (uint64_t *)_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], E->e->repr[0], first_samp,
+ num_samp, GD_UINT64, (void*)readbuf);
+
+ free(readbuf);
+ free(tmpbuf);
+
+ dreturn("%zu", n_wrote);
+ return n_wrote;
+}
+
+static size_t _GD_DoPhaseOut(DIRFILE* D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t data_type, const void *data_in)
+{
+ size_t n_wrote;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, data_type,
+ data_in);
+
+ if (_GD_BadInput(D, E, 0)) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp +
+ E->EN(phase,shift), num_samp, data_type, data_in);
+
+ dreturn("%zu", n_wrote);
+
+ return n_wrote;
+}
+
+static size_t _GD_DoRecipOut(DIRFILE* D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t data_type, const void *data_in)
+{
+ size_t n_wrote;
+ void* tmpbuf;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, first_samp, num_samp, data_type,
+ data_in);
+
+ if (_GD_BadInput(D, E, 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->comp_scal)
+ _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], E->e->repr[0], first_samp,
+ num_samp, data_type, tmpbuf);
+ free(tmpbuf);
+
+ dreturn("%zu", n_wrote);
+
+ return n_wrote;
+}
+
+static size_t _GD_DoPolynomOut(DIRFILE* D, gd_entry_t *E, off64_t first_samp,
+ size_t num_samp, gd_type_t data_type, const void *data_in)
+{
+ size_t n_wrote;
+ void* tmpbuf;
+
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, 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)) {
+ 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->comp_scal) {
+#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], E->e->repr[0], first_samp,
+ num_samp, data_type, tmpbuf);
+ free(tmpbuf);
+
+ dreturn("%zu", n_wrote);
+ return n_wrote;
+}
+
+static size_t _GD_DoConstOut(DIRFILE* D, gd_entry_t *E, off64_t first,
+ size_t len, gd_type_t data_type, const void *data_in)
+{
+ dtrace("%p, %p, %lli, %zu, 0x%x, %p", D, E, 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;
+}
+
+static size_t _GD_DoStringOut(DIRFILE* D, gd_entry_t *E, const char *data_in)
+{
+ char* ptr = E->e->u.string;
+
+ dtrace("%p, %p, %p", D, E, 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);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ E->e->u.string = strdup(data_in);
+ if (E->e->u.string == NULL) {
+ E->e->u.string = ptr;
+ _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ dreturn("%i", 0);
+ return 0;
+ }
+ free(ptr);
+ D->fragment[E->fragment_index].modified = 1;
+
+ dreturn("%zu", strlen(E->e->u.string) + 1);
+ return strlen(E->e->u.string) + 1;
+}
+
+size_t _GD_DoFieldOut(DIRFILE *D, gd_entry_t* E, int repr, off64_t first_samp,
+ size_t num_samp, gd_type_t data_type, const void *data_in)
+{
+ size_t n_wrote = 0;
+
+ dtrace("%p, %p, %i, %lli, %zu, 0x%x, %p", D, E, repr, first_samp, num_samp,
+ data_type, data_in);
+
+ if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+ _GD_SetError(D, GD_E_RECURSE_LEVEL, 0, NULL, 0, E->field);
+ D->recurse_level--;
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (!E->e->calculated)
+ _GD_CalculateEntry(D, E);
+
+ if (D->error) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ /* writing to representations is prohibited */
+ if (repr != GD_REPR_NONE) {
+ const char r[2] = {(char)repr, 0};
+ _GD_SetError(D, GD_E_BAD_REPR, GD_E_REPR_PUT, NULL, 0, r);
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ 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_MULTIPLY_ENTRY:
+ case GD_DIVIDE_ENTRY:
+ case GD_INDEX_ENTRY:
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field);
+ 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_STRING_ENTRY:
+ n_wrote = _GD_DoStringOut(D, E, (const char *)data_in);
+ break;
+ case GD_NO_ENTRY:
+ _GD_InternalError(D);
+ break;
+ }
+
+ D->recurse_level--;
+ dreturn("%zu", 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_in, 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;
+ char* field_code;
+ int repr;
+ gd_spf_t spf;
+
+ dtrace("%p, \"%s\", %lli, %lli, %zu, %zu, 0x%x, %p", D, field_code_in,
+ first_frame, 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_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ if (entry->field_type & GD_SCALAR_ENTRY)
+ _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;
+ }
+
+ /* 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;
+
+ n_wrote = _GD_DoFieldOut(D, entry, repr, first_samp, num_samp, data_type,
+ data_in);
+
+ dreturn("%zu", 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
+*/
diff --git a/src/raw.c b/src/raw.c
new file mode 100644
index 0000000..ee92da1
--- /dev/null
+++ b/src/raw.c
@@ -0,0 +1,186 @@
+/* Copyright (C) 2008, 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#endif
+
+int _GD_RawOpen(struct _gd_raw_file* file, int mode, int creat)
+{
+ dtrace("%p, %i, %i", file, mode, creat);
+
+ file->fp = open(file->name, ((mode == GD_RDWR) ? O_RDWR : O_RDONLY) |
+ (creat ? O_CREAT : 0) | O_BINARY, 0666);
+
+ dreturn("%i", file->fp < 0);
+ return (file->fp < 0);
+}
+
+off64_t _GD_RawSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad __gd_unused)
+{
+ off64_t pos;
+
+ dtrace("%p, %lli, %x, <unused>", file, (long long)count, data_type);
+
+ pos = lseek64(file->fp, count * GD_SIZE(data_type), SEEK_SET);
+
+ if (pos == -1) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ dreturn("%lli", (long long)count);
+ return count;
+}
+
+ssize_t _GD_RawRead(struct _gd_raw_file *file, void *ptr, gd_type_t data_type,
+ size_t nmemb)
+{
+ ssize_t nread;
+
+ dtrace("%p, %p, %x, %zu", file, ptr, data_type, nmemb);
+
+ nread = read(file->fp, ptr, nmemb * GD_SIZE(data_type));
+
+ if (nread >= 0)
+ nread /= GD_SIZE(data_type);
+
+ dreturn("%zi", nread);
+ return nread;
+}
+
+ssize_t _GD_RawWrite(struct _gd_raw_file *file, const void *ptr,
+ gd_type_t data_type, size_t nmemb)
+{
+ ssize_t nwrote;
+
+ dtrace("%p, %p, %x, %zu", file, ptr, data_type, nmemb);
+
+ nwrote = write(file->fp, ptr, nmemb * GD_SIZE(data_type));
+
+ if (nwrote >= 0)
+ nwrote /= GD_SIZE(data_type);
+
+ dreturn("%zu", nwrote);
+ return nwrote;
+}
+
+int _GD_RawSync(struct _gd_raw_file *file)
+{
+ return fsync(file->fp);
+}
+
+int _GD_RawClose(struct _gd_raw_file *file)
+{
+ int ret;
+
+ dtrace("%p", file);
+
+ ret = close(file->fp);
+ if (!ret)
+ file->fp = -1;
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+off64_t _GD_RawSize(struct _gd_raw_file *file, gd_type_t data_type)
+{
+ gd_stat64_t statbuf;
+
+ dtrace("%p, %x", file, data_type);
+
+ if (gd_stat64(file->name, &statbuf) < 0) {
+ dreturn("%lli", -1LL);
+ return -1;
+ }
+
+ dreturn("%lli", (long long)statbuf.st_size);
+ return statbuf.st_size / GD_SIZE(data_type);
+}
+
+int _GD_RawTemp(struct _gd_raw_file *file, int method)
+{
+ struct stat stat_buf;
+ int move_error = 0;
+ mode_t mode;
+
+ dtrace("%p, %i", file, method);
+
+ switch(method) {
+ case GD_TEMP_OPEN:
+ file[1].fp = mkstemp(file[1].name);
+
+ if (file[1].fp == -1) {
+ dreturn("%i", -1);
+ return -1;
+ }
+ break;
+ case GD_TEMP_MOVE:
+ if (file[1].name == NULL)
+ break;
+
+ if (stat(file[0].name, &stat_buf))
+ mode = 0644;
+ else
+ mode = stat_buf.st_mode;
+
+ if (!_GD_Rename(file[1].name, file[0].name)) {
+ chmod(file[0].name, mode);
+ free(file[1].name);
+ file[1].name = NULL;
+ dreturn("%i", 0);
+ return 0;
+ }
+ /* fallthrough on error */
+ case GD_TEMP_DESTROY:
+ if (file[1].name != NULL) {
+ if (file[1].fp >= 0)
+ if (_GD_RawClose(file + 1)) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (unlink(file[1].name)) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ if (method == GD_TEMP_MOVE) {
+ errno = move_error;
+ dreturn("%i", -1);
+ return -1;
+ }
+ free(file[1].name);
+ file[1].name = NULL;
+ }
+ break;
+ }
+
+ dreturn("%i", 0);
+ return 0;
+}
diff --git a/src/slim.c b/src/slim.c
new file mode 100644
index 0000000..d7f7af8
--- /dev/null
+++ b/src/slim.c
@@ -0,0 +1,126 @@
+/* Copyright (C) 2008, 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <errno.h>
+#include <time.h>
+#endif
+
+#ifdef HAVE_SLIMLIB_H
+#include <slimlib.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_SlimOpen libgetdataslim_LTX_GD_SlimOpen
+#define _GD_SlimSeek libgetdataslim_LTX_GD_SlimSeek
+#define _GD_SlimRead libgetdataslim_LTX_GD_SlimRead
+#define _GD_SlimClose libgetdataslim_LTX_GD_SlimClose
+#define _GD_SlimSize libgetdataslim_LTX_GD_SlimSize
+#endif
+
+/* The slim encoding scheme uses edata as a slimfile pointer. If a file is
+ * open, fp = 0 otherwise fp = -1. */
+
+int _GD_SlimOpen(struct _gd_raw_file* file, int mode __gd_unused,
+ int creat __gd_unused)
+{
+ dtrace("%p, <unused>, <unused>", file);
+
+ file->edata = slimopen(file->name, "r" /* writing not supported */);
+
+ if (file->edata != NULL) {
+ file->fp = 0;
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ dreturn("%i", 1);
+ return 1;
+}
+
+off64_t _GD_SlimSeek(struct _gd_raw_file* file, off64_t count,
+ gd_type_t data_type, int pad __gd_unused)
+{
+ off64_t n;
+
+ dtrace("%p, %lli, %x, <unused>", file, (long long)count, data_type);
+
+ n = (off64_t)slimseek((SLIMFILE *)file->edata, (off_t)count *
+ GD_SIZE(data_type), SEEK_SET);
+
+ if (n == -1) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ dreturn("%lli", (long long)(n / GD_SIZE(data_type)));
+ return n;
+}
+
+ssize_t _GD_SlimRead(struct _gd_raw_file *file, void *ptr, gd_type_t data_type,
+ size_t nmemb)
+{
+ ssize_t n;
+
+ dtrace("%p, %p, %x, %zu", file, ptr, data_type, nmemb);
+
+ n = slimread(ptr, GD_SIZE(data_type), nmemb, (SLIMFILE *)file->edata);
+
+ dreturn("%zu", n);
+ return n;
+}
+
+int _GD_SlimClose(struct _gd_raw_file *file)
+{
+ int ret;
+
+ dtrace("%p", file);
+
+ ret = slimclose((SLIMFILE *)file->edata);
+ if (!ret) {
+ file->fp = -1;
+ file->edata = NULL;
+ }
+
+ dreturn("%i", ret);
+ return ret;
+}
+
+off64_t _GD_SlimSize(struct _gd_raw_file *file, gd_type_t data_type)
+{
+ off64_t size;
+
+ dtrace("%p, %x", file, data_type);
+
+ size = slimrawsize(file->name);
+
+ if (size < 0) {
+ dreturn("%i", -1);
+ return -1;
+ }
+
+ size /= GD_SIZE(data_type);
+
+ dreturn("%lli", (long long)size);
+ return size;
+}
diff --git a/src/spf.c b/src/spf.c
new file mode 100644
index 0000000..6abce8e
--- /dev/null
+++ b/src/spf.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <string.h>
+#include <stdlib.h>
+#endif
+
+/* _GD_GetSPF: Get samples per frame for field
+*/
+gd_spf_t _GD_GetSPF(DIRFILE* D, gd_entry_t* E)
+{
+ gd_spf_t spf = 0;
+
+ dtrace("%p, %p", D, E);
+
+ if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+ _GD_SetError(D, GD_E_RECURSE_LEVEL, 0, NULL, 0, E->field);
+ dreturn("%u", 0);
+ D->recurse_level--;
+ return 0;
+ }
+
+ switch(E->field_type) {
+ case GD_RAW_ENTRY:
+ if (!E->e->calculated)
+ _GD_CalculateEntry(D, E);
+ 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:
+ if (_GD_BadInput(D, E, 0))
+ 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_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
+*/
+gd_spf_t gd_spf(DIRFILE* D, const char *field_code_in) gd_nothrow
+{
+ gd_spf_t spf = 0;
+ gd_entry_t* entry;
+ char* field_code;
+ int repr;
+
+ 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("%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_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1);
+
+ if (D->error) {
+ dreturn("%u", 0);
+ return 0;
+ }
+
+ if (entry->field_type & GD_SCALAR_ENTRY)
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+ else
+ spf = _GD_GetSPF(D, entry);
+
+ if (field_code != field_code_in)
+ free(field_code);
+
+ dreturn("%u", spf);
+ return spf;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/string.c b/src/string.c
new file mode 100644
index 0000000..999ec84
--- /dev/null
+++ b/src/string.c
@@ -0,0 +1,89 @@
+/* Copyright (C) 2008-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
+ */
+#include "internal.h"
+
+/* this function is little more than a public boilerplate for _GD_DoField */
+size_t gd_get_string(DIRFILE* D, const char *field_code, size_t len,
+ char *data_out) gd_nothrow
+{
+ size_t n_read = 0;
+ gd_entry_t *entry;
+
+ dtrace("%p, \"%s\", %zu, %p", D, field_code, len, 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_FindField(D, field_code, D->entry, D->n_entries, NULL);
+
+ if (entry == NULL)
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, field_code);
+ else if (entry && entry->field_type != GD_STRING_ENTRY)
+ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+ else
+ n_read = _GD_DoField(D, entry, 0, 0, len, GD_NULL, data_out);
+
+ dreturn("%zu", n_read);
+ return n_read;
+}
+
+/* this function is little more than a public boilerplate for _GD_DoFieldOut */
+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 *entry;
+
+ dtrace("%p, \"%s\", \"%s\"", D, field_code, 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, NULL);
+
+ if (entry == NULL)
+ _GD_SetError(D, GD_E_BAD_CODE, 0, NULL, 0, field_code);
+ else if (entry->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_DoFieldOut(D, entry, 0, 0, 0, GD_NULL, data_in);
+
+ dreturn("%zu", n_wrote);
+ return n_wrote;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/types.c b/src/types.c
new file mode 100644
index 0000000..b78b140
--- /dev/null
+++ b/src/types.c
@@ -0,0 +1,695 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * 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
+ */
+#include "internal.h"
+
+#ifdef STDC_HEADERS
+#include <inttypes.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#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* D, const void *data_in, gd_type_t in_type,
+ void *data_out, gd_type_t out_type, size_t n) gd_nothrow
+{
+ size_t i;
+
+ dtrace("%p, %p, 0x%x, %p, 0x%x, %zu", 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;
+ }
+ 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
+*/
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..9a547dc
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,343 @@
+# (C) 2008-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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CC_WALL
+WALL=-Wall
+endif
+
+if CC_WEXTRA
+WEXTRA=-Wextra
+endif
+
+if LFS_TRANSITIONAL_API
+GET64=get64
+GET_OFF64=get_off64
+NFRAMES64=nframes64
+NFRAMES_OFF64=nframes_off64
+PUT64=put64
+PUT_OFF64=put_off64
+endif
+
+LDADD=../src/libgetdata.la
+INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src -D__TEST__=\"$@\"
+
+EXTRA_DIST=test.h
+
+ADD_TESTS=add add_bit add_bit_bitnum add_bit_bitsize add_bit_invalid \
+ add_bit_numbits add_carray add_clincom add_code add_const \
+ add_cpolynom add_crecip add_crecip89 add_divide add_divide_invalid \
+ add_duplicate add_format add_invalid add_lincom add_lincom_invalid \
+ add_lincom_nfields add_linterp add_linterp_invalid add_multiply \
+ add_multiply_invalid add_phase add_phase_invalid add_polynom \
+ add_protect add_raw add_raw_include add_raw_invalid add_raw_spf \
+ add_raw_type add_rdonly add_recip add_sbit add_scalar add_sort \
+ add_spec add_spec_directive add_spec_invalid add_spec_meta \
+ add_string add_type
+
+ALTER_TESTS=alter_bit_bitnum alter_bit_numbits alter_carray_len \
+ alter_carray_type alter_const alter_cpolynom alter_crecip \
+ alter_crecip89 alter_crecip_zero alter_divide alter_entry \
+ alter_entry_recode alter_entry_scalar2a alter_entry_scalar2n \
+ alter_entry_scalar3 alter_entry_scalar4 alter_lincom_23 \
+ alter_lincom_32 alter_lincom_input alter_lincom_offset \
+ alter_lincom_slope alter_linterp alter_linterp_move alter_mspec \
+ 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_spec alter_spec_meta
+
+ASCII_TESTS=ascii_get ascii_get_get ascii_nframes ascii_put
+
+BOF_TESTS=bof bof_lincom bof_phase
+
+BZIP_TESTS=bzip_get bzip_get_get bzip_move_from bzip_nframes
+
+CVLIST_TESTS=cvlist cvlist_array cvlist_array_meta cvlist_invalid cvlist_meta \
+ cvlist_meta_invalid
+
+CLOSE_TESTS=close close_bad 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
+
+DEL_TESTS=del del_carray del_carray_deref del_const del_const_deref \
+ del_const_force del_data del_derived del_derived_force del_meta \
+ del_meta_force
+
+DFES_TESTS=dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \
+ dfes_null dfes_phase dfes_raw dfes_recip dfes_zero
+
+ENCODE_TESTS=encode_alter encode_get encode_move
+
+ENDIAN_TESTS=endian_alter endian_get endian_move
+
+ENTRY_TESTS=entry_bad_code entry_bit entry_bit_scalar entry_invalid \
+ entry_lincom entry_lincom_scalar entry_linterp 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_type
+
+EOF_TESTS=eof eof_index eof_lincom eof_phase
+
+ERROR_TESTS=error error_error error_short
+
+FILE_TESTS=file file_code file_type
+
+FLIST_TESTS=flist flist_invalid flist_meta flist_meta_invalid flist_type \
+ flist_type_invalid flist_type_meta flist_type_meta_invalid
+
+FLUSH_TESTS=flush flush_all flush_bad_code flush_invalid flush_meta flush_spec
+
+FOFFS_TESTS=foffs_alter foffs_get foffs_move
+
+FRAGMENT_TESTS=fragment_index fragment_name fragment_name_oor
+
+GET_TESTS=${GET64} get_bad_code get_bit get_carray get_carray_len \
+ get_carray_slice get_char get_clincom get_complex128 \
+ get_complex64 get_const get_const_complex get_const_repr \
+ get_cpolynom get_divide 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_fs get_int8 get_int16 get_int32 get_int64 \
+ get_invalid get_lincom1 get_lincom2 get_lincom3 get_lincom_noin \
+ get_lincom_non get_linterp get_linterp_noin get_linterp_notab \
+ get_linterp_sort get_multiply get_multiply_noin get_nonexistent \
+ get_null $(GET_OFF64) get_phase get_polynom get_polynom_noin \
+ get_recip get_recip_const get_recurse get_sbit get_sf get_ss \
+ get_type get_uint16 get_uint32 get_uint64 get_zero
+
+GLOBAL_TESTS=global_name global_ref global_ref_empty global_ref_set
+
+GZIP_TESTS=gzip_get gzip_get_get gzip_move_from gzip_nframes
+
+HEADER_TESTS=header_complex
+
+INCLUDE_TESTS=include include_accmode include_auto include_cb include_creat \
+ include_ignore include_index include_invalid include_nonexistent \
+ include_pc include_ref include_syntax
+
+INDEX_TESTS=index index_domain index_range
+
+if INCLUDE_LEGACY_API
+LEGACY_TESTS=legacy_get legacy_get_put legacy_get_rofs legacy_nframes \
+ legacy_nonexistent legacy_put legacy_spf
+endif
+
+LZMA_TESTS=lzma_get lzma_nframes
+
+MADD_TESTS=madd madd_bit madd_bit_invalid madd_carray madd_clincom madd_const \
+ madd_cpolynom madd_crecip madd_crecip89 madd_divide madd_lincom \
+ madd_lincom_invalid madd_linterp madd_linterp_invalid 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_string
+
+MOVE_TESTS=move move_data_enc_ar move_data_enc_ra move_data_endian \
+ move_data_foffs move_data_nop move_index move_meta move_protect \
+ move_subdir
+
+NAME_TESTS=name name_move
+
+NFIELDS_TESTS=nfields nfields_invalid nfields_type nfields_type_invalid
+
+NFRAGMENTS_TESTS=nfragments
+
+NFRAMES_TESTS=nframes ${NFRAMES64} nframes_empty nframes_invalid \
+ $(NFRAMES_OFF64) nframes_spf
+
+NMETA_TESTS=nmeta nmeta_invalid nmeta_parent nmeta_type nmeta_type_invalid \
+ nmeta_type_parent nmeta_vectors nmeta_vectors_del \
+ nmeta_vectors_invalid nmeta_vectors_parent
+
+NVECTORS_TESTS=nvectors nvectors_invalid
+
+OPEN_TESTS=open open_cb_abort open_cb_cont open_cb_ignore open_cb_invalid \
+ open_cb_rescan open_eaccess open_nonexistent open_notdirfile
+
+PARENT_TESTS=parent
+
+PARSE_TESTS=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_ncols parse_divide 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_include parse_include_absolute parse_include_absrel \
+ parse_include_nonexistent parse_include_relabs \
+ parse_include_relrel parse_include_slash 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_meta \
+ parse_meta_implicit parse_meta_implicit2 parse_meta_index \
+ parse_meta_index2 parse_meta_parent parse_meta_raw parse_multiply \
+ parse_multiply_ncols parse_name parse_name_dot parse_name_ext \
+ parse_name_pedantic parse_ncols 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_ncols parse_raw_scalar parse_raw_spf \
+ parse_raw_type parse_recip parse_ref parse_ref_nonexistent \
+ parse_sbit parse_sort parse_string parse_string_ncols \
+ parse_string_null parse_version parse_version_include \
+ parse_version_permissive parse_version_slash parse_whitespace
+
+PROTECT_TESTS=protect_alter protect_get
+
+PUT_TESTS=${PUT64} put_bad_code put_bit put_bof put_carray put_carray_slice \
+ put_char put_complex128 put_complex64 put_const put_const_protect \
+ 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_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_multiply 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_type \
+ put_uint16 put_uint32 put_uint64
+
+REF_TESTS=ref ref_none ref_two
+
+REPR_TESTS=repr_a 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
+
+SLIM_TESTS=slim_get slim_nframes
+
+SVLIST_TESTS=svlist svlist_invalid svlist_meta svlist_meta_invalid
+
+SPF_TESTS=spf spf_divide spf_lincom spf_multiply spf_polynom spf_recip \
+ spf_recurse
+
+TRUNC_TESTS=trunc trunc_rdonly trunc_rofs
+
+UNCLUDE_TESTS=unclude unclude_del unclude_move
+
+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
+
+VLIST_TESTS=vlist vlist_invalid vlist_meta vlist_meta_invalid
+
+XZ_TESTS=xz_get xz_nframes
+
+TESTS=$(ADD_TESTS) $(ALTER_TESTS) $(ASCII_TESTS) \
+ $(BOF_TESTS) $(BZIP_TESTS) $(CLOSE_TESTS) \
+ $(CONVERT_TESTS) $(CREAT_TESTS) $(CVLIST_TESTS) \
+ $(DEL_TESTS) $(DFES_TESTS) $(ENCODE_TESTS) \
+ $(ENDIAN_TESTS) $(ENTRY_TESTS) $(EOF_TESTS) \
+ $(ERROR_TESTS) $(FILE_TESTS) $(FLIST_TESTS) \
+ $(FLUSH_TESTS) $(FOFFS_TESTS) $(FRAGMENT_TESTS) \
+ $(GET_TESTS) $(GLOBAL_TESTS) $(GZIP_TESTS) \
+ $(HEADER_TESTS) $(INCLUDE_TESTS) $(INDEX_TESTS) \
+ $(LEGACY_TESTS) $(LZMA_TESTS) $(MADD_TESTS) \
+ $(MOVE_TESTS) $(NAME_TESTS) $(NFIELDS_TESTS) \
+ $(NFRAGMENTS_TESTS) $(NFRAMES_TESTS) $(NMETA_TESTS) \
+ $(NVECTORS_TESTS) $(OPEN_TESTS) $(PARENT_TESTS) \
+ $(PARSE_TESTS) $(PROTECT_TESTS) $(PUT_TESTS) \
+ $(REF_TESTS) $(REPR_TESTS) $(SLIM_TESTS) \
+ $(SPF_TESTS) $(SVLIST_TESTS) $(TRUNC_TESTS) \
+ $(UNCLUDE_TESTS) $(VERSION_TESTS) $(VLIST_TESTS) \
+ $(XZ_TESTS)
+
+check_PROGRAMS=$(TESTS)
+
+# 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 "/' $$x | sh; \
+ echo $$x = $$? ); done &> $@;
+
+# clean up after the tests
+check-local: check-TESTS
+ $(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+ rm -rvf *odirfile
+
+clean-local:
+ $(MAKE) getdata-clean-dirs
+ rm -rf *~
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 0000000..378b441
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,7364 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+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_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_39) $(am__EXEEXT_40) \
+ $(am__EXEEXT_41) $(am__EXEEXT_42) $(am__EXEEXT_43) \
+ $(am__EXEEXT_44) $(am__EXEEXT_45) $(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)
+check_PROGRAMS = $(am__EXEEXT_59)
+subdir = test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/config.h \
+ $(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 = add$(EXEEXT) add_bit$(EXEEXT) add_bit_bitnum$(EXEEXT) \
+ add_bit_bitsize$(EXEEXT) add_bit_invalid$(EXEEXT) \
+ add_bit_numbits$(EXEEXT) add_carray$(EXEEXT) \
+ add_clincom$(EXEEXT) add_code$(EXEEXT) add_const$(EXEEXT) \
+ add_cpolynom$(EXEEXT) add_crecip$(EXEEXT) \
+ add_crecip89$(EXEEXT) add_divide$(EXEEXT) \
+ add_divide_invalid$(EXEEXT) add_duplicate$(EXEEXT) \
+ add_format$(EXEEXT) add_invalid$(EXEEXT) add_lincom$(EXEEXT) \
+ add_lincom_invalid$(EXEEXT) add_lincom_nfields$(EXEEXT) \
+ add_linterp$(EXEEXT) add_linterp_invalid$(EXEEXT) \
+ add_multiply$(EXEEXT) add_multiply_invalid$(EXEEXT) \
+ add_phase$(EXEEXT) add_phase_invalid$(EXEEXT) \
+ add_polynom$(EXEEXT) add_protect$(EXEEXT) add_raw$(EXEEXT) \
+ add_raw_include$(EXEEXT) add_raw_invalid$(EXEEXT) \
+ add_raw_spf$(EXEEXT) add_raw_type$(EXEEXT) add_rdonly$(EXEEXT) \
+ add_recip$(EXEEXT) add_sbit$(EXEEXT) add_scalar$(EXEEXT) \
+ add_sort$(EXEEXT) add_spec$(EXEEXT) \
+ add_spec_directive$(EXEEXT) add_spec_invalid$(EXEEXT) \
+ add_spec_meta$(EXEEXT) add_string$(EXEEXT) add_type$(EXEEXT)
+am__EXEEXT_2 = alter_bit_bitnum$(EXEEXT) alter_bit_numbits$(EXEEXT) \
+ alter_carray_len$(EXEEXT) alter_carray_type$(EXEEXT) \
+ alter_const$(EXEEXT) alter_cpolynom$(EXEEXT) \
+ alter_crecip$(EXEEXT) alter_crecip89$(EXEEXT) \
+ alter_crecip_zero$(EXEEXT) alter_divide$(EXEEXT) \
+ alter_entry$(EXEEXT) alter_entry_recode$(EXEEXT) \
+ alter_entry_scalar2a$(EXEEXT) alter_entry_scalar2n$(EXEEXT) \
+ alter_entry_scalar3$(EXEEXT) alter_entry_scalar4$(EXEEXT) \
+ alter_lincom_23$(EXEEXT) alter_lincom_32$(EXEEXT) \
+ alter_lincom_input$(EXEEXT) alter_lincom_offset$(EXEEXT) \
+ alter_lincom_slope$(EXEEXT) alter_linterp$(EXEEXT) \
+ alter_linterp_move$(EXEEXT) alter_mspec$(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_spec$(EXEEXT) \
+ alter_spec_meta$(EXEEXT)
+am__EXEEXT_3 = ascii_get$(EXEEXT) ascii_get_get$(EXEEXT) \
+ ascii_nframes$(EXEEXT) ascii_put$(EXEEXT)
+am__EXEEXT_4 = bof$(EXEEXT) bof_lincom$(EXEEXT) bof_phase$(EXEEXT)
+am__EXEEXT_5 = bzip_get$(EXEEXT) bzip_get_get$(EXEEXT) \
+ bzip_move_from$(EXEEXT) bzip_nframes$(EXEEXT)
+am__EXEEXT_6 = close$(EXEEXT) close_bad$(EXEEXT) \
+ close_discard$(EXEEXT) close_null$(EXEEXT)
+am__EXEEXT_7 = 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_8 = creat$(EXEEXT) creat_excl$(EXEEXT) \
+ creat_rdonly$(EXEEXT)
+am__EXEEXT_9 = cvlist$(EXEEXT) cvlist_array$(EXEEXT) \
+ cvlist_array_meta$(EXEEXT) cvlist_invalid$(EXEEXT) \
+ cvlist_meta$(EXEEXT) cvlist_meta_invalid$(EXEEXT)
+am__EXEEXT_10 = del$(EXEEXT) del_carray$(EXEEXT) \
+ del_carray_deref$(EXEEXT) del_const$(EXEEXT) \
+ del_const_deref$(EXEEXT) del_const_force$(EXEEXT) \
+ del_data$(EXEEXT) del_derived$(EXEEXT) \
+ del_derived_force$(EXEEXT) del_meta$(EXEEXT) \
+ del_meta_force$(EXEEXT)
+am__EXEEXT_11 = 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_12 = encode_alter$(EXEEXT) encode_get$(EXEEXT) \
+ encode_move$(EXEEXT)
+am__EXEEXT_13 = endian_alter$(EXEEXT) endian_get$(EXEEXT) \
+ endian_move$(EXEEXT)
+am__EXEEXT_14 = entry_bad_code$(EXEEXT) entry_bit$(EXEEXT) \
+ entry_bit_scalar$(EXEEXT) entry_invalid$(EXEEXT) \
+ entry_lincom$(EXEEXT) entry_lincom_scalar$(EXEEXT) \
+ entry_linterp$(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_type$(EXEEXT)
+am__EXEEXT_15 = eof$(EXEEXT) eof_index$(EXEEXT) eof_lincom$(EXEEXT) \
+ eof_phase$(EXEEXT)
+am__EXEEXT_16 = error$(EXEEXT) error_error$(EXEEXT) \
+ error_short$(EXEEXT)
+am__EXEEXT_17 = file$(EXEEXT) file_code$(EXEEXT) file_type$(EXEEXT)
+am__EXEEXT_18 = flist$(EXEEXT) flist_invalid$(EXEEXT) \
+ flist_meta$(EXEEXT) flist_meta_invalid$(EXEEXT) \
+ flist_type$(EXEEXT) flist_type_invalid$(EXEEXT) \
+ flist_type_meta$(EXEEXT) flist_type_meta_invalid$(EXEEXT)
+am__EXEEXT_19 = flush$(EXEEXT) flush_all$(EXEEXT) \
+ flush_bad_code$(EXEEXT) flush_invalid$(EXEEXT) \
+ flush_meta$(EXEEXT) flush_spec$(EXEEXT)
+am__EXEEXT_20 = foffs_alter$(EXEEXT) foffs_get$(EXEEXT) \
+ foffs_move$(EXEEXT)
+am__EXEEXT_21 = fragment_index$(EXEEXT) fragment_name$(EXEEXT) \
+ fragment_name_oor$(EXEEXT)
+ at LFS_TRANSITIONAL_API_TRUE@am__EXEEXT_22 = get64$(EXEEXT)
+ at LFS_TRANSITIONAL_API_TRUE@am__EXEEXT_23 = get_off64$(EXEEXT)
+am__EXEEXT_24 = $(am__EXEEXT_22) get_bad_code$(EXEEXT) \
+ get_bit$(EXEEXT) get_carray$(EXEEXT) get_carray_len$(EXEEXT) \
+ get_carray_slice$(EXEEXT) get_char$(EXEEXT) \
+ get_clincom$(EXEEXT) get_complex128$(EXEEXT) \
+ get_complex64$(EXEEXT) get_const$(EXEEXT) \
+ get_const_complex$(EXEEXT) get_const_repr$(EXEEXT) \
+ get_cpolynom$(EXEEXT) get_divide$(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_fs$(EXEEXT) get_int8$(EXEEXT) get_int16$(EXEEXT) \
+ get_int32$(EXEEXT) get_int64$(EXEEXT) get_invalid$(EXEEXT) \
+ get_lincom1$(EXEEXT) get_lincom2$(EXEEXT) get_lincom3$(EXEEXT) \
+ get_lincom_noin$(EXEEXT) get_lincom_non$(EXEEXT) \
+ get_linterp$(EXEEXT) get_linterp_noin$(EXEEXT) \
+ get_linterp_notab$(EXEEXT) get_linterp_sort$(EXEEXT) \
+ get_multiply$(EXEEXT) get_multiply_noin$(EXEEXT) \
+ get_nonexistent$(EXEEXT) get_null$(EXEEXT) $(am__EXEEXT_23) \
+ get_phase$(EXEEXT) get_polynom$(EXEEXT) \
+ get_polynom_noin$(EXEEXT) get_recip$(EXEEXT) \
+ get_recip_const$(EXEEXT) get_recurse$(EXEEXT) \
+ get_sbit$(EXEEXT) get_sf$(EXEEXT) get_ss$(EXEEXT) \
+ get_type$(EXEEXT) get_uint16$(EXEEXT) get_uint32$(EXEEXT) \
+ get_uint64$(EXEEXT) get_zero$(EXEEXT)
+am__EXEEXT_25 = global_name$(EXEEXT) global_ref$(EXEEXT) \
+ global_ref_empty$(EXEEXT) global_ref_set$(EXEEXT)
+am__EXEEXT_26 = gzip_get$(EXEEXT) gzip_get_get$(EXEEXT) \
+ gzip_move_from$(EXEEXT) gzip_nframes$(EXEEXT)
+am__EXEEXT_27 = header_complex$(EXEEXT)
+am__EXEEXT_28 = include$(EXEEXT) include_accmode$(EXEEXT) \
+ include_auto$(EXEEXT) include_cb$(EXEEXT) \
+ include_creat$(EXEEXT) include_ignore$(EXEEXT) \
+ include_index$(EXEEXT) include_invalid$(EXEEXT) \
+ include_nonexistent$(EXEEXT) include_pc$(EXEEXT) \
+ include_ref$(EXEEXT) include_syntax$(EXEEXT)
+am__EXEEXT_29 = index$(EXEEXT) index_domain$(EXEEXT) \
+ index_range$(EXEEXT)
+ at INCLUDE_LEGACY_API_TRUE@am__EXEEXT_30 = legacy_get$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@ legacy_get_put$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@ legacy_get_rofs$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@ legacy_nframes$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@ legacy_nonexistent$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@ legacy_put$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@ legacy_spf$(EXEEXT)
+am__EXEEXT_31 = lzma_get$(EXEEXT) lzma_nframes$(EXEEXT)
+am__EXEEXT_32 = madd$(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_lincom$(EXEEXT) madd_lincom_invalid$(EXEEXT) \
+ madd_linterp$(EXEEXT) madd_linterp_invalid$(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_string$(EXEEXT)
+am__EXEEXT_33 = move$(EXEEXT) move_data_enc_ar$(EXEEXT) \
+ move_data_enc_ra$(EXEEXT) move_data_endian$(EXEEXT) \
+ move_data_foffs$(EXEEXT) move_data_nop$(EXEEXT) \
+ move_index$(EXEEXT) move_meta$(EXEEXT) move_protect$(EXEEXT) \
+ move_subdir$(EXEEXT)
+am__EXEEXT_34 = name$(EXEEXT) name_move$(EXEEXT)
+am__EXEEXT_35 = nfields$(EXEEXT) nfields_invalid$(EXEEXT) \
+ nfields_type$(EXEEXT) nfields_type_invalid$(EXEEXT)
+am__EXEEXT_36 = nfragments$(EXEEXT)
+ at LFS_TRANSITIONAL_API_TRUE@am__EXEEXT_37 = nframes64$(EXEEXT)
+ at LFS_TRANSITIONAL_API_TRUE@am__EXEEXT_38 = nframes_off64$(EXEEXT)
+am__EXEEXT_39 = nframes$(EXEEXT) $(am__EXEEXT_37) \
+ nframes_empty$(EXEEXT) nframes_invalid$(EXEEXT) \
+ $(am__EXEEXT_38) nframes_spf$(EXEEXT)
+am__EXEEXT_40 = nmeta$(EXEEXT) nmeta_invalid$(EXEEXT) \
+ nmeta_parent$(EXEEXT) nmeta_type$(EXEEXT) \
+ nmeta_type_invalid$(EXEEXT) nmeta_type_parent$(EXEEXT) \
+ nmeta_vectors$(EXEEXT) nmeta_vectors_del$(EXEEXT) \
+ nmeta_vectors_invalid$(EXEEXT) nmeta_vectors_parent$(EXEEXT)
+am__EXEEXT_41 = nvectors$(EXEEXT) nvectors_invalid$(EXEEXT)
+am__EXEEXT_42 = open$(EXEEXT) open_cb_abort$(EXEEXT) \
+ open_cb_cont$(EXEEXT) open_cb_ignore$(EXEEXT) \
+ open_cb_invalid$(EXEEXT) open_cb_rescan$(EXEEXT) \
+ open_eaccess$(EXEEXT) open_nonexistent$(EXEEXT) \
+ open_notdirfile$(EXEEXT)
+am__EXEEXT_43 = parent$(EXEEXT)
+am__EXEEXT_44 = 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_ncols$(EXEEXT) \
+ parse_divide$(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_include$(EXEEXT) parse_include_absolute$(EXEEXT) \
+ parse_include_absrel$(EXEEXT) \
+ parse_include_nonexistent$(EXEEXT) \
+ parse_include_relabs$(EXEEXT) parse_include_relrel$(EXEEXT) \
+ parse_include_slash$(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_meta$(EXEEXT) parse_meta_implicit$(EXEEXT) \
+ parse_meta_implicit2$(EXEEXT) parse_meta_index$(EXEEXT) \
+ parse_meta_index2$(EXEEXT) parse_meta_parent$(EXEEXT) \
+ parse_meta_raw$(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_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_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_sort$(EXEEXT) parse_string$(EXEEXT) \
+ parse_string_ncols$(EXEEXT) parse_string_null$(EXEEXT) \
+ parse_version$(EXEEXT) parse_version_include$(EXEEXT) \
+ parse_version_permissive$(EXEEXT) parse_version_slash$(EXEEXT) \
+ parse_whitespace$(EXEEXT)
+am__EXEEXT_45 = protect_alter$(EXEEXT) protect_get$(EXEEXT)
+ at LFS_TRANSITIONAL_API_TRUE@am__EXEEXT_46 = put64$(EXEEXT)
+ at LFS_TRANSITIONAL_API_TRUE@am__EXEEXT_47 = put_off64$(EXEEXT)
+am__EXEEXT_48 = $(am__EXEEXT_46) put_bad_code$(EXEEXT) \
+ put_bit$(EXEEXT) put_bof$(EXEEXT) put_carray$(EXEEXT) \
+ put_carray_slice$(EXEEXT) put_char$(EXEEXT) \
+ put_complex128$(EXEEXT) put_complex64$(EXEEXT) \
+ put_const$(EXEEXT) put_const_protect$(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_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_multiply$(EXEEXT) put_null$(EXEEXT) $(am__EXEEXT_47) \
+ 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_type$(EXEEXT) \
+ put_uint16$(EXEEXT) put_uint32$(EXEEXT) put_uint64$(EXEEXT)
+am__EXEEXT_49 = ref$(EXEEXT) ref_none$(EXEEXT) ref_two$(EXEEXT)
+am__EXEEXT_50 = repr_a$(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_51 = slim_get$(EXEEXT) slim_nframes$(EXEEXT)
+am__EXEEXT_52 = spf$(EXEEXT) spf_divide$(EXEEXT) spf_lincom$(EXEEXT) \
+ spf_multiply$(EXEEXT) spf_polynom$(EXEEXT) spf_recip$(EXEEXT) \
+ spf_recurse$(EXEEXT)
+am__EXEEXT_53 = svlist$(EXEEXT) svlist_invalid$(EXEEXT) \
+ svlist_meta$(EXEEXT) svlist_meta_invalid$(EXEEXT)
+am__EXEEXT_54 = trunc$(EXEEXT) trunc_rdonly$(EXEEXT) \
+ trunc_rofs$(EXEEXT)
+am__EXEEXT_55 = unclude$(EXEEXT) unclude_del$(EXEEXT) \
+ unclude_move$(EXEEXT)
+am__EXEEXT_56 = 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)
+am__EXEEXT_57 = vlist$(EXEEXT) vlist_invalid$(EXEEXT) \
+ vlist_meta$(EXEEXT) vlist_meta_invalid$(EXEEXT)
+am__EXEEXT_58 = xz_get$(EXEEXT) xz_nframes$(EXEEXT)
+am__EXEEXT_59 = $(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_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_39) $(am__EXEEXT_40) \
+ $(am__EXEEXT_41) $(am__EXEEXT_42) $(am__EXEEXT_43) \
+ $(am__EXEEXT_44) $(am__EXEEXT_45) $(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)
+add_SOURCES = add.c
+add_OBJECTS = add.$(OBJEXT)
+add_LDADD = $(LDADD)
+add_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_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_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_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_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_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_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_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_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_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_string_SOURCES = add_string.c
+add_string_OBJECTS = add_string.$(OBJEXT)
+add_string_LDADD = $(LDADD)
+add_string_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
+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_const_SOURCES = alter_const.c
+alter_const_OBJECTS = alter_const.$(OBJEXT)
+alter_const_LDADD = $(LDADD)
+alter_const_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_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_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_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_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_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_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_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_mspec_SOURCES = alter_mspec.c
+alter_mspec_OBJECTS = alter_mspec.$(OBJEXT)
+alter_mspec_LDADD = $(LDADD)
+alter_mspec_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_spec_SOURCES = alter_spec.c
+alter_spec_OBJECTS = alter_spec.$(OBJEXT)
+alter_spec_LDADD = $(LDADD)
+alter_spec_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
+ascii_get_SOURCES = ascii_get.c
+ascii_get_OBJECTS = ascii_get.$(OBJEXT)
+ascii_get_LDADD = $(LDADD)
+ascii_get_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_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
+bof_SOURCES = bof.c
+bof_OBJECTS = bof.$(OBJEXT)
+bof_LDADD = $(LDADD)
+bof_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
+bzip_get_SOURCES = bzip_get.c
+bzip_get_OBJECTS = bzip_get.$(OBJEXT)
+bzip_get_LDADD = $(LDADD)
+bzip_get_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_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_nframes_SOURCES = bzip_nframes.c
+bzip_nframes_OBJECTS = bzip_nframes.$(OBJEXT)
+bzip_nframes_LDADD = $(LDADD)
+bzip_nframes_DEPENDENCIES = ../src/libgetdata.la
+close_SOURCES = close.c
+close_OBJECTS = close.$(OBJEXT)
+close_LDADD = $(LDADD)
+close_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_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
+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_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_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_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_SOURCES = del.c
+del_OBJECTS = del.$(OBJEXT)
+del_LDADD = $(LDADD)
+del_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_derived_SOURCES = del_derived.c
+del_derived_OBJECTS = del_derived.$(OBJEXT)
+del_derived_LDADD = $(LDADD)
+del_derived_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
+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
+encode_alter_SOURCES = encode_alter.c
+encode_alter_OBJECTS = encode_alter.$(OBJEXT)
+encode_alter_LDADD = $(LDADD)
+encode_alter_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_move_SOURCES = encode_move.c
+encode_move_OBJECTS = encode_move.$(OBJEXT)
+encode_move_LDADD = $(LDADD)
+encode_move_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_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_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_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_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
+eof_SOURCES = eof.c
+eof_OBJECTS = eof.$(OBJEXT)
+eof_LDADD = $(LDADD)
+eof_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
+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_short_SOURCES = error_short.c
+error_short_OBJECTS = error_short.$(OBJEXT)
+error_short_LDADD = $(LDADD)
+error_short_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
+flist_SOURCES = flist.c
+flist_OBJECTS = flist.$(OBJEXT)
+flist_LDADD = $(LDADD)
+flist_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_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_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_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_SOURCES = flush.c
+flush_OBJECTS = flush.$(OBJEXT)
+flush_LDADD = $(LDADD)
+flush_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_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_invalid_SOURCES = flush_invalid.c
+flush_invalid_OBJECTS = flush_invalid.$(OBJEXT)
+flush_invalid_LDADD = $(LDADD)
+flush_invalid_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_spec_SOURCES = flush_spec.c
+flush_spec_OBJECTS = flush_spec.$(OBJEXT)
+flush_spec_LDADD = $(LDADD)
+flush_spec_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_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_index_SOURCES = fragment_index.c
+fragment_index_OBJECTS = fragment_index.$(OBJEXT)
+fragment_index_LDADD = $(LDADD)
+fragment_index_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
+get64_SOURCES = get64.c
+get64_OBJECTS = get64.$(OBJEXT)
+get64_LDADD = $(LDADD)
+get64_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_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_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_divide_SOURCES = get_divide.c
+get_divide_OBJECTS = get_divide.$(OBJEXT)
+get_divide_LDADD = $(LDADD)
+get_divide_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_fs_SOURCES = get_fs.c
+get_fs_OBJECTS = get_fs.$(OBJEXT)
+get_fs_LDADD = $(LDADD)
+get_fs_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_lincom3_SOURCES = get_lincom3.c
+get_lincom3_OBJECTS = get_lincom3.$(OBJEXT)
+get_lincom3_LDADD = $(LDADD)
+get_lincom3_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_linterp_SOURCES = get_linterp.c
+get_linterp_OBJECTS = get_linterp.$(OBJEXT)
+get_linterp_LDADD = $(LDADD)
+get_linterp_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_multiply_SOURCES = get_multiply.c
+get_multiply_OBJECTS = get_multiply.$(OBJEXT)
+get_multiply_LDADD = $(LDADD)
+get_multiply_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_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_polynom_SOURCES = get_polynom.c
+get_polynom_OBJECTS = get_polynom.$(OBJEXT)
+get_polynom_LDADD = $(LDADD)
+get_polynom_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_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_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_zero_SOURCES = get_zero.c
+get_zero_OBJECTS = get_zero.$(OBJEXT)
+get_zero_LDADD = $(LDADD)
+get_zero_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_get_SOURCES = gzip_get.c
+gzip_get_OBJECTS = gzip_get.$(OBJEXT)
+gzip_get_LDADD = $(LDADD)
+gzip_get_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_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_nframes_SOURCES = gzip_nframes.c
+gzip_nframes_OBJECTS = gzip_nframes.$(OBJEXT)
+gzip_nframes_LDADD = $(LDADD)
+gzip_nframes_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
+include_SOURCES = include.c
+include_OBJECTS = include.$(OBJEXT)
+include_LDADD = $(LDADD)
+include_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_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_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_syntax_SOURCES = include_syntax.c
+include_syntax_OBJECTS = include_syntax.$(OBJEXT)
+include_syntax_LDADD = $(LDADD)
+include_syntax_DEPENDENCIES = ../src/libgetdata.la
+index_SOURCES = index.c
+index_OBJECTS = index.$(OBJEXT)
+index_LDADD = $(LDADD)
+index_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_range_SOURCES = index_range.c
+index_range_OBJECTS = index_range.$(OBJEXT)
+index_range_LDADD = $(LDADD)
+index_range_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
+madd_SOURCES = madd.c
+madd_OBJECTS = madd.$(OBJEXT)
+madd_LDADD = $(LDADD)
+madd_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_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_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_string_SOURCES = madd_string.c
+madd_string_OBJECTS = madd_string.$(OBJEXT)
+madd_string_LDADD = $(LDADD)
+madd_string_DEPENDENCIES = ../src/libgetdata.la
+move_SOURCES = move.c
+move_OBJECTS = move.$(OBJEXT)
+move_LDADD = $(LDADD)
+move_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_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_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_SOURCES = name.c
+name_OBJECTS = name.$(OBJEXT)
+name_LDADD = $(LDADD)
+name_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
+nfields_SOURCES = nfields.c
+nfields_OBJECTS = nfields.$(OBJEXT)
+nfields_LDADD = $(LDADD)
+nfields_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_type_SOURCES = nfields_type.c
+nfields_type_OBJECTS = nfields_type.$(OBJEXT)
+nfields_type_LDADD = $(LDADD)
+nfields_type_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
+nfragments_SOURCES = nfragments.c
+nfragments_OBJECTS = nfragments.$(OBJEXT)
+nfragments_LDADD = $(LDADD)
+nfragments_DEPENDENCIES = ../src/libgetdata.la
+nframes_SOURCES = nframes.c
+nframes_OBJECTS = nframes.$(OBJEXT)
+nframes_LDADD = $(LDADD)
+nframes_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_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_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_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_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
+nvectors_SOURCES = nvectors.c
+nvectors_OBJECTS = nvectors.$(OBJEXT)
+nvectors_LDADD = $(LDADD)
+nvectors_DEPENDENCIES = ../src/libgetdata.la
+nvectors_invalid_SOURCES = nvectors_invalid.c
+nvectors_invalid_OBJECTS = nvectors_invalid.$(OBJEXT)
+nvectors_invalid_LDADD = $(LDADD)
+nvectors_invalid_DEPENDENCIES = ../src/libgetdata.la
+open_SOURCES = open.c
+open_OBJECTS = open.$(OBJEXT)
+open_LDADD = $(LDADD)
+open_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_eaccess_SOURCES = open_eaccess.c
+open_eaccess_OBJECTS = open_eaccess.$(OBJEXT)
+open_eaccess_LDADD = $(LDADD)
+open_eaccess_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
+parent_SOURCES = parent.c
+parent_OBJECTS = parent.$(OBJEXT)
+parent_LDADD = $(LDADD)
+parent_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_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_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_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_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_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_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_meta_SOURCES = parse_meta.c
+parse_meta_OBJECTS = parse_meta.$(OBJEXT)
+parse_meta_LDADD = $(LDADD)
+parse_meta_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_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_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_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_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_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_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_version_SOURCES = parse_version.c
+parse_version_OBJECTS = parse_version.$(OBJEXT)
+parse_version_LDADD = $(LDADD)
+parse_version_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_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
+protect_alter_SOURCES = protect_alter.c
+protect_alter_OBJECTS = protect_alter.$(OBJEXT)
+protect_alter_LDADD = $(LDADD)
+protect_alter_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_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_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_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_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_multiply_SOURCES = put_multiply.c
+put_multiply_OBJECTS = put_multiply.$(OBJEXT)
+put_multiply_LDADD = $(LDADD)
+put_multiply_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_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
+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_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
+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
+spf_SOURCES = spf.c
+spf_OBJECTS = spf.$(OBJEXT)
+spf_LDADD = $(LDADD)
+spf_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_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
+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_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
+trunc_SOURCES = trunc.c
+trunc_OBJECTS = trunc.$(OBJEXT)
+trunc_LDADD = $(LDADD)
+trunc_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
+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
+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
+vlist_SOURCES = vlist.c
+vlist_OBJECTS = vlist.$(OBJEXT)
+vlist_LDADD = $(LDADD)
+vlist_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_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
+xz_get_SOURCES = xz_get.c
+xz_get_OBJECTS = xz_get.$(OBJEXT)
+xz_get_LDADD = $(LDADD)
+xz_get_DEPENDENCIES = ../src/libgetdata.la
+xz_nframes_SOURCES = xz_nframes.c
+xz_nframes_OBJECTS = xz_nframes.$(OBJEXT)
+xz_nframes_LDADD = $(LDADD)
+xz_nframes_DEPENDENCIES = ../src/libgetdata.la
+DEFAULT_INCLUDES = -I. at 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = add.c add_bit.c add_bit_bitnum.c add_bit_bitsize.c \
+ add_bit_invalid.c add_bit_numbits.c add_carray.c add_clincom.c \
+ add_code.c add_const.c add_cpolynom.c add_crecip.c \
+ add_crecip89.c add_divide.c add_divide_invalid.c \
+ add_duplicate.c add_format.c add_invalid.c add_lincom.c \
+ add_lincom_invalid.c add_lincom_nfields.c add_linterp.c \
+ add_linterp_invalid.c add_multiply.c add_multiply_invalid.c \
+ add_phase.c add_phase_invalid.c add_polynom.c add_protect.c \
+ add_raw.c add_raw_include.c add_raw_invalid.c add_raw_spf.c \
+ add_raw_type.c add_rdonly.c add_recip.c add_sbit.c \
+ add_scalar.c add_sort.c add_spec.c add_spec_directive.c \
+ add_spec_invalid.c add_spec_meta.c add_string.c add_type.c \
+ alter_bit_bitnum.c alter_bit_numbits.c alter_carray_len.c \
+ alter_carray_type.c alter_const.c alter_cpolynom.c \
+ alter_crecip.c alter_crecip89.c alter_crecip_zero.c \
+ alter_divide.c alter_entry.c alter_entry_recode.c \
+ alter_entry_scalar2a.c alter_entry_scalar2n.c \
+ alter_entry_scalar3.c alter_entry_scalar4.c alter_lincom_23.c \
+ alter_lincom_32.c alter_lincom_input.c alter_lincom_offset.c \
+ alter_lincom_slope.c alter_linterp.c alter_linterp_move.c \
+ alter_mspec.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_spec.c \
+ alter_spec_meta.c ascii_get.c ascii_get_get.c ascii_nframes.c \
+ ascii_put.c bof.c bof_lincom.c bof_phase.c bzip_get.c \
+ bzip_get_get.c bzip_move_from.c bzip_nframes.c close.c \
+ close_bad.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 cvlist.c cvlist_array.c \
+ cvlist_array_meta.c cvlist_invalid.c cvlist_meta.c \
+ cvlist_meta_invalid.c del.c del_carray.c del_carray_deref.c \
+ del_const.c del_const_deref.c del_const_force.c del_data.c \
+ del_derived.c del_derived_force.c del_meta.c del_meta_force.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 encode_alter.c encode_get.c \
+ encode_move.c endian_alter.c endian_get.c endian_move.c \
+ entry_bad_code.c entry_bit.c entry_bit_scalar.c \
+ entry_invalid.c entry_lincom.c entry_lincom_scalar.c \
+ entry_linterp.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_scalar_repr.c entry_type.c eof.c \
+ eof_index.c eof_lincom.c eof_phase.c error.c error_error.c \
+ error_short.c file.c file_code.c file_type.c flist.c \
+ flist_invalid.c flist_meta.c flist_meta_invalid.c flist_type.c \
+ flist_type_invalid.c flist_type_meta.c \
+ flist_type_meta_invalid.c flush.c flush_all.c flush_bad_code.c \
+ flush_invalid.c flush_meta.c flush_spec.c foffs_alter.c \
+ foffs_get.c foffs_move.c fragment_index.c fragment_name.c \
+ fragment_name_oor.c get64.c get_bad_code.c get_bit.c \
+ get_carray.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_complex.c get_const_repr.c get_cpolynom.c \
+ get_divide.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_fs.c get_int16.c get_int32.c \
+ get_int64.c get_int8.c get_invalid.c get_lincom1.c \
+ get_lincom2.c get_lincom3.c get_lincom_noin.c get_lincom_non.c \
+ get_linterp.c get_linterp_noin.c get_linterp_notab.c \
+ get_linterp_sort.c get_multiply.c get_multiply_noin.c \
+ get_nonexistent.c get_null.c get_off64.c get_phase.c \
+ get_polynom.c get_polynom_noin.c get_recip.c get_recip_const.c \
+ get_recurse.c get_sbit.c get_sf.c get_ss.c get_type.c \
+ get_uint16.c get_uint32.c get_uint64.c get_zero.c \
+ global_name.c global_ref.c global_ref_empty.c global_ref_set.c \
+ gzip_get.c gzip_get_get.c gzip_move_from.c gzip_nframes.c \
+ header_complex.c include.c include_accmode.c include_auto.c \
+ include_cb.c include_creat.c include_ignore.c include_index.c \
+ include_invalid.c include_nonexistent.c include_pc.c \
+ include_ref.c include_syntax.c index.c index_domain.c \
+ index_range.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 madd.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_lincom.c madd_lincom_invalid.c madd_linterp.c \
+ madd_linterp_invalid.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_string.c move.c move_data_enc_ar.c \
+ move_data_enc_ra.c move_data_endian.c move_data_foffs.c \
+ move_data_nop.c move_index.c move_meta.c move_protect.c \
+ move_subdir.c name.c name_move.c nfields.c nfields_invalid.c \
+ nfields_type.c nfields_type_invalid.c nfragments.c nframes.c \
+ nframes64.c nframes_empty.c nframes_invalid.c nframes_off64.c \
+ nframes_spf.c nmeta.c nmeta_invalid.c nmeta_parent.c \
+ nmeta_type.c nmeta_type_invalid.c nmeta_type_parent.c \
+ nmeta_vectors.c nmeta_vectors_del.c nmeta_vectors_invalid.c \
+ nmeta_vectors_parent.c nvectors.c nvectors_invalid.c open.c \
+ open_cb_abort.c open_cb_cont.c open_cb_ignore.c \
+ open_cb_invalid.c open_cb_rescan.c open_eaccess.c \
+ open_nonexistent.c open_notdirfile.c parent.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_ncols.c parse_divide.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_include.c \
+ parse_include_absolute.c parse_include_absrel.c \
+ parse_include_nonexistent.c parse_include_relabs.c \
+ parse_include_relrel.c parse_include_slash.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_meta.c parse_meta_implicit.c parse_meta_implicit2.c \
+ parse_meta_index.c parse_meta_index2.c parse_meta_parent.c \
+ parse_meta_raw.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_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_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_sort.c parse_string.c parse_string_ncols.c \
+ parse_string_null.c parse_version.c parse_version_include.c \
+ parse_version_permissive.c parse_version_slash.c \
+ parse_whitespace.c protect_alter.c protect_get.c put64.c \
+ put_bad_code.c put_bit.c put_bof.c put_carray.c \
+ put_carray_slice.c put_char.c put_complex128.c put_complex64.c \
+ put_const.c put_const_protect.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_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_multiply.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_type.c \
+ put_uint16.c put_uint32.c put_uint64.c ref.c ref_none.c \
+ ref_two.c repr_a.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 slim_get.c slim_nframes.c spf.c spf_divide.c \
+ spf_lincom.c spf_multiply.c spf_polynom.c spf_recip.c \
+ spf_recurse.c svlist.c svlist_invalid.c svlist_meta.c \
+ svlist_meta_invalid.c trunc.c trunc_rdonly.c trunc_rofs.c \
+ unclude.c unclude_del.c unclude_move.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 vlist.c vlist_invalid.c vlist_meta.c \
+ vlist_meta_invalid.c xz_get.c xz_nframes.c
+DIST_SOURCES = add.c add_bit.c add_bit_bitnum.c add_bit_bitsize.c \
+ add_bit_invalid.c add_bit_numbits.c add_carray.c add_clincom.c \
+ add_code.c add_const.c add_cpolynom.c add_crecip.c \
+ add_crecip89.c add_divide.c add_divide_invalid.c \
+ add_duplicate.c add_format.c add_invalid.c add_lincom.c \
+ add_lincom_invalid.c add_lincom_nfields.c add_linterp.c \
+ add_linterp_invalid.c add_multiply.c add_multiply_invalid.c \
+ add_phase.c add_phase_invalid.c add_polynom.c add_protect.c \
+ add_raw.c add_raw_include.c add_raw_invalid.c add_raw_spf.c \
+ add_raw_type.c add_rdonly.c add_recip.c add_sbit.c \
+ add_scalar.c add_sort.c add_spec.c add_spec_directive.c \
+ add_spec_invalid.c add_spec_meta.c add_string.c add_type.c \
+ alter_bit_bitnum.c alter_bit_numbits.c alter_carray_len.c \
+ alter_carray_type.c alter_const.c alter_cpolynom.c \
+ alter_crecip.c alter_crecip89.c alter_crecip_zero.c \
+ alter_divide.c alter_entry.c alter_entry_recode.c \
+ alter_entry_scalar2a.c alter_entry_scalar2n.c \
+ alter_entry_scalar3.c alter_entry_scalar4.c alter_lincom_23.c \
+ alter_lincom_32.c alter_lincom_input.c alter_lincom_offset.c \
+ alter_lincom_slope.c alter_linterp.c alter_linterp_move.c \
+ alter_mspec.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_spec.c \
+ alter_spec_meta.c ascii_get.c ascii_get_get.c ascii_nframes.c \
+ ascii_put.c bof.c bof_lincom.c bof_phase.c bzip_get.c \
+ bzip_get_get.c bzip_move_from.c bzip_nframes.c close.c \
+ close_bad.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 cvlist.c cvlist_array.c \
+ cvlist_array_meta.c cvlist_invalid.c cvlist_meta.c \
+ cvlist_meta_invalid.c del.c del_carray.c del_carray_deref.c \
+ del_const.c del_const_deref.c del_const_force.c del_data.c \
+ del_derived.c del_derived_force.c del_meta.c del_meta_force.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 encode_alter.c encode_get.c \
+ encode_move.c endian_alter.c endian_get.c endian_move.c \
+ entry_bad_code.c entry_bit.c entry_bit_scalar.c \
+ entry_invalid.c entry_lincom.c entry_lincom_scalar.c \
+ entry_linterp.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_scalar_repr.c entry_type.c eof.c \
+ eof_index.c eof_lincom.c eof_phase.c error.c error_error.c \
+ error_short.c file.c file_code.c file_type.c flist.c \
+ flist_invalid.c flist_meta.c flist_meta_invalid.c flist_type.c \
+ flist_type_invalid.c flist_type_meta.c \
+ flist_type_meta_invalid.c flush.c flush_all.c flush_bad_code.c \
+ flush_invalid.c flush_meta.c flush_spec.c foffs_alter.c \
+ foffs_get.c foffs_move.c fragment_index.c fragment_name.c \
+ fragment_name_oor.c get64.c get_bad_code.c get_bit.c \
+ get_carray.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_complex.c get_const_repr.c get_cpolynom.c \
+ get_divide.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_fs.c get_int16.c get_int32.c \
+ get_int64.c get_int8.c get_invalid.c get_lincom1.c \
+ get_lincom2.c get_lincom3.c get_lincom_noin.c get_lincom_non.c \
+ get_linterp.c get_linterp_noin.c get_linterp_notab.c \
+ get_linterp_sort.c get_multiply.c get_multiply_noin.c \
+ get_nonexistent.c get_null.c get_off64.c get_phase.c \
+ get_polynom.c get_polynom_noin.c get_recip.c get_recip_const.c \
+ get_recurse.c get_sbit.c get_sf.c get_ss.c get_type.c \
+ get_uint16.c get_uint32.c get_uint64.c get_zero.c \
+ global_name.c global_ref.c global_ref_empty.c global_ref_set.c \
+ gzip_get.c gzip_get_get.c gzip_move_from.c gzip_nframes.c \
+ header_complex.c include.c include_accmode.c include_auto.c \
+ include_cb.c include_creat.c include_ignore.c include_index.c \
+ include_invalid.c include_nonexistent.c include_pc.c \
+ include_ref.c include_syntax.c index.c index_domain.c \
+ index_range.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 madd.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_lincom.c madd_lincom_invalid.c madd_linterp.c \
+ madd_linterp_invalid.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_string.c move.c move_data_enc_ar.c \
+ move_data_enc_ra.c move_data_endian.c move_data_foffs.c \
+ move_data_nop.c move_index.c move_meta.c move_protect.c \
+ move_subdir.c name.c name_move.c nfields.c nfields_invalid.c \
+ nfields_type.c nfields_type_invalid.c nfragments.c nframes.c \
+ nframes64.c nframes_empty.c nframes_invalid.c nframes_off64.c \
+ nframes_spf.c nmeta.c nmeta_invalid.c nmeta_parent.c \
+ nmeta_type.c nmeta_type_invalid.c nmeta_type_parent.c \
+ nmeta_vectors.c nmeta_vectors_del.c nmeta_vectors_invalid.c \
+ nmeta_vectors_parent.c nvectors.c nvectors_invalid.c open.c \
+ open_cb_abort.c open_cb_cont.c open_cb_ignore.c \
+ open_cb_invalid.c open_cb_rescan.c open_eaccess.c \
+ open_nonexistent.c open_notdirfile.c parent.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_ncols.c parse_divide.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_include.c \
+ parse_include_absolute.c parse_include_absrel.c \
+ parse_include_nonexistent.c parse_include_relabs.c \
+ parse_include_relrel.c parse_include_slash.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_meta.c parse_meta_implicit.c parse_meta_implicit2.c \
+ parse_meta_index.c parse_meta_index2.c parse_meta_parent.c \
+ parse_meta_raw.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_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_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_sort.c parse_string.c parse_string_ncols.c \
+ parse_string_null.c parse_version.c parse_version_include.c \
+ parse_version_permissive.c parse_version_slash.c \
+ parse_whitespace.c protect_alter.c protect_get.c put64.c \
+ put_bad_code.c put_bit.c put_bof.c put_carray.c \
+ put_carray_slice.c put_char.c put_complex128.c put_complex64.c \
+ put_const.c put_const_protect.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_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_multiply.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_type.c \
+ put_uint16.c put_uint32.c put_uint64.c ref.c ref_none.c \
+ ref_two.c repr_a.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 slim_get.c slim_nframes.c spf.c spf_divide.c \
+ spf_lincom.c spf_multiply.c spf_polynom.c spf_recip.c \
+ spf_recurse.c svlist.c svlist_invalid.c svlist_meta.c \
+ svlist_meta_invalid.c trunc.c trunc_rdonly.c trunc_rofs.c \
+ unclude.c unclude_del.c unclude_move.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 vlist.c vlist_invalid.c vlist_meta.c \
+ vlist_meta_invalid.c xz_get.c xz_nframes.c
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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@
+
+# (C) 2008-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
+#
+AUTOMAKE_OPTIONS = foreign
+ at CC_WALL_TRUE@WALL = -Wall
+ at CC_WEXTRA_TRUE@WEXTRA = -Wextra
+ at LFS_TRANSITIONAL_API_TRUE@GET64 = get64
+ at LFS_TRANSITIONAL_API_TRUE@GET_OFF64 = get_off64
+ at LFS_TRANSITIONAL_API_TRUE@NFRAMES64 = nframes64
+ at LFS_TRANSITIONAL_API_TRUE@NFRAMES_OFF64 = nframes_off64
+ at LFS_TRANSITIONAL_API_TRUE@PUT64 = put64
+ at LFS_TRANSITIONAL_API_TRUE@PUT_OFF64 = put_off64
+LDADD = ../src/libgetdata.la
+INCLUDES = ${WALL} $(WEXTRA) -I$(top_srcdir)/src -D__TEST__=\"$@\"
+EXTRA_DIST = test.h
+ADD_TESTS = add add_bit add_bit_bitnum add_bit_bitsize add_bit_invalid \
+ add_bit_numbits add_carray add_clincom add_code add_const \
+ add_cpolynom add_crecip add_crecip89 add_divide add_divide_invalid \
+ add_duplicate add_format add_invalid add_lincom add_lincom_invalid \
+ add_lincom_nfields add_linterp add_linterp_invalid add_multiply \
+ add_multiply_invalid add_phase add_phase_invalid add_polynom \
+ add_protect add_raw add_raw_include add_raw_invalid add_raw_spf \
+ add_raw_type add_rdonly add_recip add_sbit add_scalar add_sort \
+ add_spec add_spec_directive add_spec_invalid add_spec_meta \
+ add_string add_type
+
+ALTER_TESTS = alter_bit_bitnum alter_bit_numbits alter_carray_len \
+ alter_carray_type alter_const alter_cpolynom alter_crecip \
+ alter_crecip89 alter_crecip_zero alter_divide alter_entry \
+ alter_entry_recode alter_entry_scalar2a alter_entry_scalar2n \
+ alter_entry_scalar3 alter_entry_scalar4 alter_lincom_23 \
+ alter_lincom_32 alter_lincom_input alter_lincom_offset \
+ alter_lincom_slope alter_linterp alter_linterp_move alter_mspec \
+ 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_spec alter_spec_meta
+
+ASCII_TESTS = ascii_get ascii_get_get ascii_nframes ascii_put
+BOF_TESTS = bof bof_lincom bof_phase
+BZIP_TESTS = bzip_get bzip_get_get bzip_move_from bzip_nframes
+CVLIST_TESTS = cvlist cvlist_array cvlist_array_meta cvlist_invalid cvlist_meta \
+ cvlist_meta_invalid
+
+CLOSE_TESTS = close close_bad 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
+DEL_TESTS = del del_carray del_carray_deref del_const del_const_deref \
+ del_const_force del_data del_derived del_derived_force del_meta \
+ del_meta_force
+
+DFES_TESTS = dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \
+ dfes_null dfes_phase dfes_raw dfes_recip dfes_zero
+
+ENCODE_TESTS = encode_alter encode_get encode_move
+ENDIAN_TESTS = endian_alter endian_get endian_move
+ENTRY_TESTS = entry_bad_code entry_bit entry_bit_scalar entry_invalid \
+ entry_lincom entry_lincom_scalar entry_linterp 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_type
+
+EOF_TESTS = eof eof_index eof_lincom eof_phase
+ERROR_TESTS = error error_error error_short
+FILE_TESTS = file file_code file_type
+FLIST_TESTS = flist flist_invalid flist_meta flist_meta_invalid flist_type \
+ flist_type_invalid flist_type_meta flist_type_meta_invalid
+
+FLUSH_TESTS = flush flush_all flush_bad_code flush_invalid flush_meta flush_spec
+FOFFS_TESTS = foffs_alter foffs_get foffs_move
+FRAGMENT_TESTS = fragment_index fragment_name fragment_name_oor
+GET_TESTS = ${GET64} get_bad_code get_bit get_carray get_carray_len \
+ get_carray_slice get_char get_clincom get_complex128 \
+ get_complex64 get_const get_const_complex get_const_repr \
+ get_cpolynom get_divide 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_fs get_int8 get_int16 get_int32 get_int64 \
+ get_invalid get_lincom1 get_lincom2 get_lincom3 get_lincom_noin \
+ get_lincom_non get_linterp get_linterp_noin get_linterp_notab \
+ get_linterp_sort get_multiply get_multiply_noin get_nonexistent \
+ get_null $(GET_OFF64) get_phase get_polynom get_polynom_noin \
+ get_recip get_recip_const get_recurse get_sbit get_sf get_ss \
+ get_type get_uint16 get_uint32 get_uint64 get_zero
+
+GLOBAL_TESTS = global_name global_ref global_ref_empty global_ref_set
+GZIP_TESTS = gzip_get gzip_get_get gzip_move_from gzip_nframes
+HEADER_TESTS = header_complex
+INCLUDE_TESTS = include include_accmode include_auto include_cb include_creat \
+ include_ignore include_index include_invalid include_nonexistent \
+ include_pc include_ref include_syntax
+
+INDEX_TESTS = index index_domain index_range
+ at INCLUDE_LEGACY_API_TRUE@LEGACY_TESTS = legacy_get legacy_get_put legacy_get_rofs legacy_nframes \
+ at INCLUDE_LEGACY_API_TRUE@ legacy_nonexistent legacy_put legacy_spf
+
+LZMA_TESTS = lzma_get lzma_nframes
+MADD_TESTS = madd madd_bit madd_bit_invalid madd_carray madd_clincom madd_const \
+ madd_cpolynom madd_crecip madd_crecip89 madd_divide madd_lincom \
+ madd_lincom_invalid madd_linterp madd_linterp_invalid 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_string
+
+MOVE_TESTS = move move_data_enc_ar move_data_enc_ra move_data_endian \
+ move_data_foffs move_data_nop move_index move_meta move_protect \
+ move_subdir
+
+NAME_TESTS = name name_move
+NFIELDS_TESTS = nfields nfields_invalid nfields_type nfields_type_invalid
+NFRAGMENTS_TESTS = nfragments
+NFRAMES_TESTS = nframes ${NFRAMES64} nframes_empty nframes_invalid \
+ $(NFRAMES_OFF64) nframes_spf
+
+NMETA_TESTS = nmeta nmeta_invalid nmeta_parent nmeta_type nmeta_type_invalid \
+ nmeta_type_parent nmeta_vectors nmeta_vectors_del \
+ nmeta_vectors_invalid nmeta_vectors_parent
+
+NVECTORS_TESTS = nvectors nvectors_invalid
+OPEN_TESTS = open open_cb_abort open_cb_cont open_cb_ignore open_cb_invalid \
+ open_cb_rescan open_eaccess open_nonexistent open_notdirfile
+
+PARENT_TESTS = parent
+PARSE_TESTS = 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_ncols parse_divide 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_include parse_include_absolute parse_include_absrel \
+ parse_include_nonexistent parse_include_relabs \
+ parse_include_relrel parse_include_slash 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_meta \
+ parse_meta_implicit parse_meta_implicit2 parse_meta_index \
+ parse_meta_index2 parse_meta_parent parse_meta_raw parse_multiply \
+ parse_multiply_ncols parse_name parse_name_dot parse_name_ext \
+ parse_name_pedantic parse_ncols 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_ncols parse_raw_scalar parse_raw_spf \
+ parse_raw_type parse_recip parse_ref parse_ref_nonexistent \
+ parse_sbit parse_sort parse_string parse_string_ncols \
+ parse_string_null parse_version parse_version_include \
+ parse_version_permissive parse_version_slash parse_whitespace
+
+PROTECT_TESTS = protect_alter protect_get
+PUT_TESTS = ${PUT64} put_bad_code put_bit put_bof put_carray put_carray_slice \
+ put_char put_complex128 put_complex64 put_const put_const_protect \
+ 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_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_multiply 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_type \
+ put_uint16 put_uint32 put_uint64
+
+REF_TESTS = ref ref_none ref_two
+REPR_TESTS = repr_a 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
+
+SLIM_TESTS = slim_get slim_nframes
+SVLIST_TESTS = svlist svlist_invalid svlist_meta svlist_meta_invalid
+SPF_TESTS = spf spf_divide spf_lincom spf_multiply spf_polynom spf_recip \
+ spf_recurse
+
+TRUNC_TESTS = trunc trunc_rdonly trunc_rofs
+UNCLUDE_TESTS = unclude unclude_del unclude_move
+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
+
+VLIST_TESTS = vlist vlist_invalid vlist_meta vlist_meta_invalid
+XZ_TESTS = xz_get xz_nframes
+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$(EXEEXT): $(add_OBJECTS) $(add_DEPENDENCIES)
+ @rm -f add$(EXEEXT)
+ $(LINK) $(add_OBJECTS) $(add_LDADD) $(LIBS)
+add_bit$(EXEEXT): $(add_bit_OBJECTS) $(add_bit_DEPENDENCIES)
+ @rm -f add_bit$(EXEEXT)
+ $(LINK) $(add_bit_OBJECTS) $(add_bit_LDADD) $(LIBS)
+add_bit_bitnum$(EXEEXT): $(add_bit_bitnum_OBJECTS) $(add_bit_bitnum_DEPENDENCIES)
+ @rm -f add_bit_bitnum$(EXEEXT)
+ $(LINK) $(add_bit_bitnum_OBJECTS) $(add_bit_bitnum_LDADD) $(LIBS)
+add_bit_bitsize$(EXEEXT): $(add_bit_bitsize_OBJECTS) $(add_bit_bitsize_DEPENDENCIES)
+ @rm -f add_bit_bitsize$(EXEEXT)
+ $(LINK) $(add_bit_bitsize_OBJECTS) $(add_bit_bitsize_LDADD) $(LIBS)
+add_bit_invalid$(EXEEXT): $(add_bit_invalid_OBJECTS) $(add_bit_invalid_DEPENDENCIES)
+ @rm -f add_bit_invalid$(EXEEXT)
+ $(LINK) $(add_bit_invalid_OBJECTS) $(add_bit_invalid_LDADD) $(LIBS)
+add_bit_numbits$(EXEEXT): $(add_bit_numbits_OBJECTS) $(add_bit_numbits_DEPENDENCIES)
+ @rm -f add_bit_numbits$(EXEEXT)
+ $(LINK) $(add_bit_numbits_OBJECTS) $(add_bit_numbits_LDADD) $(LIBS)
+add_carray$(EXEEXT): $(add_carray_OBJECTS) $(add_carray_DEPENDENCIES)
+ @rm -f add_carray$(EXEEXT)
+ $(LINK) $(add_carray_OBJECTS) $(add_carray_LDADD) $(LIBS)
+add_clincom$(EXEEXT): $(add_clincom_OBJECTS) $(add_clincom_DEPENDENCIES)
+ @rm -f add_clincom$(EXEEXT)
+ $(LINK) $(add_clincom_OBJECTS) $(add_clincom_LDADD) $(LIBS)
+add_code$(EXEEXT): $(add_code_OBJECTS) $(add_code_DEPENDENCIES)
+ @rm -f add_code$(EXEEXT)
+ $(LINK) $(add_code_OBJECTS) $(add_code_LDADD) $(LIBS)
+add_const$(EXEEXT): $(add_const_OBJECTS) $(add_const_DEPENDENCIES)
+ @rm -f add_const$(EXEEXT)
+ $(LINK) $(add_const_OBJECTS) $(add_const_LDADD) $(LIBS)
+add_cpolynom$(EXEEXT): $(add_cpolynom_OBJECTS) $(add_cpolynom_DEPENDENCIES)
+ @rm -f add_cpolynom$(EXEEXT)
+ $(LINK) $(add_cpolynom_OBJECTS) $(add_cpolynom_LDADD) $(LIBS)
+add_crecip$(EXEEXT): $(add_crecip_OBJECTS) $(add_crecip_DEPENDENCIES)
+ @rm -f add_crecip$(EXEEXT)
+ $(LINK) $(add_crecip_OBJECTS) $(add_crecip_LDADD) $(LIBS)
+add_crecip89$(EXEEXT): $(add_crecip89_OBJECTS) $(add_crecip89_DEPENDENCIES)
+ @rm -f add_crecip89$(EXEEXT)
+ $(LINK) $(add_crecip89_OBJECTS) $(add_crecip89_LDADD) $(LIBS)
+add_divide$(EXEEXT): $(add_divide_OBJECTS) $(add_divide_DEPENDENCIES)
+ @rm -f add_divide$(EXEEXT)
+ $(LINK) $(add_divide_OBJECTS) $(add_divide_LDADD) $(LIBS)
+add_divide_invalid$(EXEEXT): $(add_divide_invalid_OBJECTS) $(add_divide_invalid_DEPENDENCIES)
+ @rm -f add_divide_invalid$(EXEEXT)
+ $(LINK) $(add_divide_invalid_OBJECTS) $(add_divide_invalid_LDADD) $(LIBS)
+add_duplicate$(EXEEXT): $(add_duplicate_OBJECTS) $(add_duplicate_DEPENDENCIES)
+ @rm -f add_duplicate$(EXEEXT)
+ $(LINK) $(add_duplicate_OBJECTS) $(add_duplicate_LDADD) $(LIBS)
+add_format$(EXEEXT): $(add_format_OBJECTS) $(add_format_DEPENDENCIES)
+ @rm -f add_format$(EXEEXT)
+ $(LINK) $(add_format_OBJECTS) $(add_format_LDADD) $(LIBS)
+add_invalid$(EXEEXT): $(add_invalid_OBJECTS) $(add_invalid_DEPENDENCIES)
+ @rm -f add_invalid$(EXEEXT)
+ $(LINK) $(add_invalid_OBJECTS) $(add_invalid_LDADD) $(LIBS)
+add_lincom$(EXEEXT): $(add_lincom_OBJECTS) $(add_lincom_DEPENDENCIES)
+ @rm -f add_lincom$(EXEEXT)
+ $(LINK) $(add_lincom_OBJECTS) $(add_lincom_LDADD) $(LIBS)
+add_lincom_invalid$(EXEEXT): $(add_lincom_invalid_OBJECTS) $(add_lincom_invalid_DEPENDENCIES)
+ @rm -f add_lincom_invalid$(EXEEXT)
+ $(LINK) $(add_lincom_invalid_OBJECTS) $(add_lincom_invalid_LDADD) $(LIBS)
+add_lincom_nfields$(EXEEXT): $(add_lincom_nfields_OBJECTS) $(add_lincom_nfields_DEPENDENCIES)
+ @rm -f add_lincom_nfields$(EXEEXT)
+ $(LINK) $(add_lincom_nfields_OBJECTS) $(add_lincom_nfields_LDADD) $(LIBS)
+add_linterp$(EXEEXT): $(add_linterp_OBJECTS) $(add_linterp_DEPENDENCIES)
+ @rm -f add_linterp$(EXEEXT)
+ $(LINK) $(add_linterp_OBJECTS) $(add_linterp_LDADD) $(LIBS)
+add_linterp_invalid$(EXEEXT): $(add_linterp_invalid_OBJECTS) $(add_linterp_invalid_DEPENDENCIES)
+ @rm -f add_linterp_invalid$(EXEEXT)
+ $(LINK) $(add_linterp_invalid_OBJECTS) $(add_linterp_invalid_LDADD) $(LIBS)
+add_multiply$(EXEEXT): $(add_multiply_OBJECTS) $(add_multiply_DEPENDENCIES)
+ @rm -f add_multiply$(EXEEXT)
+ $(LINK) $(add_multiply_OBJECTS) $(add_multiply_LDADD) $(LIBS)
+add_multiply_invalid$(EXEEXT): $(add_multiply_invalid_OBJECTS) $(add_multiply_invalid_DEPENDENCIES)
+ @rm -f add_multiply_invalid$(EXEEXT)
+ $(LINK) $(add_multiply_invalid_OBJECTS) $(add_multiply_invalid_LDADD) $(LIBS)
+add_phase$(EXEEXT): $(add_phase_OBJECTS) $(add_phase_DEPENDENCIES)
+ @rm -f add_phase$(EXEEXT)
+ $(LINK) $(add_phase_OBJECTS) $(add_phase_LDADD) $(LIBS)
+add_phase_invalid$(EXEEXT): $(add_phase_invalid_OBJECTS) $(add_phase_invalid_DEPENDENCIES)
+ @rm -f add_phase_invalid$(EXEEXT)
+ $(LINK) $(add_phase_invalid_OBJECTS) $(add_phase_invalid_LDADD) $(LIBS)
+add_polynom$(EXEEXT): $(add_polynom_OBJECTS) $(add_polynom_DEPENDENCIES)
+ @rm -f add_polynom$(EXEEXT)
+ $(LINK) $(add_polynom_OBJECTS) $(add_polynom_LDADD) $(LIBS)
+add_protect$(EXEEXT): $(add_protect_OBJECTS) $(add_protect_DEPENDENCIES)
+ @rm -f add_protect$(EXEEXT)
+ $(LINK) $(add_protect_OBJECTS) $(add_protect_LDADD) $(LIBS)
+add_raw$(EXEEXT): $(add_raw_OBJECTS) $(add_raw_DEPENDENCIES)
+ @rm -f add_raw$(EXEEXT)
+ $(LINK) $(add_raw_OBJECTS) $(add_raw_LDADD) $(LIBS)
+add_raw_include$(EXEEXT): $(add_raw_include_OBJECTS) $(add_raw_include_DEPENDENCIES)
+ @rm -f add_raw_include$(EXEEXT)
+ $(LINK) $(add_raw_include_OBJECTS) $(add_raw_include_LDADD) $(LIBS)
+add_raw_invalid$(EXEEXT): $(add_raw_invalid_OBJECTS) $(add_raw_invalid_DEPENDENCIES)
+ @rm -f add_raw_invalid$(EXEEXT)
+ $(LINK) $(add_raw_invalid_OBJECTS) $(add_raw_invalid_LDADD) $(LIBS)
+add_raw_spf$(EXEEXT): $(add_raw_spf_OBJECTS) $(add_raw_spf_DEPENDENCIES)
+ @rm -f add_raw_spf$(EXEEXT)
+ $(LINK) $(add_raw_spf_OBJECTS) $(add_raw_spf_LDADD) $(LIBS)
+add_raw_type$(EXEEXT): $(add_raw_type_OBJECTS) $(add_raw_type_DEPENDENCIES)
+ @rm -f add_raw_type$(EXEEXT)
+ $(LINK) $(add_raw_type_OBJECTS) $(add_raw_type_LDADD) $(LIBS)
+add_rdonly$(EXEEXT): $(add_rdonly_OBJECTS) $(add_rdonly_DEPENDENCIES)
+ @rm -f add_rdonly$(EXEEXT)
+ $(LINK) $(add_rdonly_OBJECTS) $(add_rdonly_LDADD) $(LIBS)
+add_recip$(EXEEXT): $(add_recip_OBJECTS) $(add_recip_DEPENDENCIES)
+ @rm -f add_recip$(EXEEXT)
+ $(LINK) $(add_recip_OBJECTS) $(add_recip_LDADD) $(LIBS)
+add_sbit$(EXEEXT): $(add_sbit_OBJECTS) $(add_sbit_DEPENDENCIES)
+ @rm -f add_sbit$(EXEEXT)
+ $(LINK) $(add_sbit_OBJECTS) $(add_sbit_LDADD) $(LIBS)
+add_scalar$(EXEEXT): $(add_scalar_OBJECTS) $(add_scalar_DEPENDENCIES)
+ @rm -f add_scalar$(EXEEXT)
+ $(LINK) $(add_scalar_OBJECTS) $(add_scalar_LDADD) $(LIBS)
+add_sort$(EXEEXT): $(add_sort_OBJECTS) $(add_sort_DEPENDENCIES)
+ @rm -f add_sort$(EXEEXT)
+ $(LINK) $(add_sort_OBJECTS) $(add_sort_LDADD) $(LIBS)
+add_spec$(EXEEXT): $(add_spec_OBJECTS) $(add_spec_DEPENDENCIES)
+ @rm -f add_spec$(EXEEXT)
+ $(LINK) $(add_spec_OBJECTS) $(add_spec_LDADD) $(LIBS)
+add_spec_directive$(EXEEXT): $(add_spec_directive_OBJECTS) $(add_spec_directive_DEPENDENCIES)
+ @rm -f add_spec_directive$(EXEEXT)
+ $(LINK) $(add_spec_directive_OBJECTS) $(add_spec_directive_LDADD) $(LIBS)
+add_spec_invalid$(EXEEXT): $(add_spec_invalid_OBJECTS) $(add_spec_invalid_DEPENDENCIES)
+ @rm -f add_spec_invalid$(EXEEXT)
+ $(LINK) $(add_spec_invalid_OBJECTS) $(add_spec_invalid_LDADD) $(LIBS)
+add_spec_meta$(EXEEXT): $(add_spec_meta_OBJECTS) $(add_spec_meta_DEPENDENCIES)
+ @rm -f add_spec_meta$(EXEEXT)
+ $(LINK) $(add_spec_meta_OBJECTS) $(add_spec_meta_LDADD) $(LIBS)
+add_string$(EXEEXT): $(add_string_OBJECTS) $(add_string_DEPENDENCIES)
+ @rm -f add_string$(EXEEXT)
+ $(LINK) $(add_string_OBJECTS) $(add_string_LDADD) $(LIBS)
+add_type$(EXEEXT): $(add_type_OBJECTS) $(add_type_DEPENDENCIES)
+ @rm -f add_type$(EXEEXT)
+ $(LINK) $(add_type_OBJECTS) $(add_type_LDADD) $(LIBS)
+alter_bit_bitnum$(EXEEXT): $(alter_bit_bitnum_OBJECTS) $(alter_bit_bitnum_DEPENDENCIES)
+ @rm -f alter_bit_bitnum$(EXEEXT)
+ $(LINK) $(alter_bit_bitnum_OBJECTS) $(alter_bit_bitnum_LDADD) $(LIBS)
+alter_bit_numbits$(EXEEXT): $(alter_bit_numbits_OBJECTS) $(alter_bit_numbits_DEPENDENCIES)
+ @rm -f alter_bit_numbits$(EXEEXT)
+ $(LINK) $(alter_bit_numbits_OBJECTS) $(alter_bit_numbits_LDADD) $(LIBS)
+alter_carray_len$(EXEEXT): $(alter_carray_len_OBJECTS) $(alter_carray_len_DEPENDENCIES)
+ @rm -f alter_carray_len$(EXEEXT)
+ $(LINK) $(alter_carray_len_OBJECTS) $(alter_carray_len_LDADD) $(LIBS)
+alter_carray_type$(EXEEXT): $(alter_carray_type_OBJECTS) $(alter_carray_type_DEPENDENCIES)
+ @rm -f alter_carray_type$(EXEEXT)
+ $(LINK) $(alter_carray_type_OBJECTS) $(alter_carray_type_LDADD) $(LIBS)
+alter_const$(EXEEXT): $(alter_const_OBJECTS) $(alter_const_DEPENDENCIES)
+ @rm -f alter_const$(EXEEXT)
+ $(LINK) $(alter_const_OBJECTS) $(alter_const_LDADD) $(LIBS)
+alter_cpolynom$(EXEEXT): $(alter_cpolynom_OBJECTS) $(alter_cpolynom_DEPENDENCIES)
+ @rm -f alter_cpolynom$(EXEEXT)
+ $(LINK) $(alter_cpolynom_OBJECTS) $(alter_cpolynom_LDADD) $(LIBS)
+alter_crecip$(EXEEXT): $(alter_crecip_OBJECTS) $(alter_crecip_DEPENDENCIES)
+ @rm -f alter_crecip$(EXEEXT)
+ $(LINK) $(alter_crecip_OBJECTS) $(alter_crecip_LDADD) $(LIBS)
+alter_crecip89$(EXEEXT): $(alter_crecip89_OBJECTS) $(alter_crecip89_DEPENDENCIES)
+ @rm -f alter_crecip89$(EXEEXT)
+ $(LINK) $(alter_crecip89_OBJECTS) $(alter_crecip89_LDADD) $(LIBS)
+alter_crecip_zero$(EXEEXT): $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_DEPENDENCIES)
+ @rm -f alter_crecip_zero$(EXEEXT)
+ $(LINK) $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_LDADD) $(LIBS)
+alter_divide$(EXEEXT): $(alter_divide_OBJECTS) $(alter_divide_DEPENDENCIES)
+ @rm -f alter_divide$(EXEEXT)
+ $(LINK) $(alter_divide_OBJECTS) $(alter_divide_LDADD) $(LIBS)
+alter_entry$(EXEEXT): $(alter_entry_OBJECTS) $(alter_entry_DEPENDENCIES)
+ @rm -f alter_entry$(EXEEXT)
+ $(LINK) $(alter_entry_OBJECTS) $(alter_entry_LDADD) $(LIBS)
+alter_entry_recode$(EXEEXT): $(alter_entry_recode_OBJECTS) $(alter_entry_recode_DEPENDENCIES)
+ @rm -f alter_entry_recode$(EXEEXT)
+ $(LINK) $(alter_entry_recode_OBJECTS) $(alter_entry_recode_LDADD) $(LIBS)
+alter_entry_scalar2a$(EXEEXT): $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_DEPENDENCIES)
+ @rm -f alter_entry_scalar2a$(EXEEXT)
+ $(LINK) $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_LDADD) $(LIBS)
+alter_entry_scalar2n$(EXEEXT): $(alter_entry_scalar2n_OBJECTS) $(alter_entry_scalar2n_DEPENDENCIES)
+ @rm -f alter_entry_scalar2n$(EXEEXT)
+ $(LINK) $(alter_entry_scalar2n_OBJECTS) $(alter_entry_scalar2n_LDADD) $(LIBS)
+alter_entry_scalar3$(EXEEXT): $(alter_entry_scalar3_OBJECTS) $(alter_entry_scalar3_DEPENDENCIES)
+ @rm -f alter_entry_scalar3$(EXEEXT)
+ $(LINK) $(alter_entry_scalar3_OBJECTS) $(alter_entry_scalar3_LDADD) $(LIBS)
+alter_entry_scalar4$(EXEEXT): $(alter_entry_scalar4_OBJECTS) $(alter_entry_scalar4_DEPENDENCIES)
+ @rm -f alter_entry_scalar4$(EXEEXT)
+ $(LINK) $(alter_entry_scalar4_OBJECTS) $(alter_entry_scalar4_LDADD) $(LIBS)
+alter_lincom_23$(EXEEXT): $(alter_lincom_23_OBJECTS) $(alter_lincom_23_DEPENDENCIES)
+ @rm -f alter_lincom_23$(EXEEXT)
+ $(LINK) $(alter_lincom_23_OBJECTS) $(alter_lincom_23_LDADD) $(LIBS)
+alter_lincom_32$(EXEEXT): $(alter_lincom_32_OBJECTS) $(alter_lincom_32_DEPENDENCIES)
+ @rm -f alter_lincom_32$(EXEEXT)
+ $(LINK) $(alter_lincom_32_OBJECTS) $(alter_lincom_32_LDADD) $(LIBS)
+alter_lincom_input$(EXEEXT): $(alter_lincom_input_OBJECTS) $(alter_lincom_input_DEPENDENCIES)
+ @rm -f alter_lincom_input$(EXEEXT)
+ $(LINK) $(alter_lincom_input_OBJECTS) $(alter_lincom_input_LDADD) $(LIBS)
+alter_lincom_offset$(EXEEXT): $(alter_lincom_offset_OBJECTS) $(alter_lincom_offset_DEPENDENCIES)
+ @rm -f alter_lincom_offset$(EXEEXT)
+ $(LINK) $(alter_lincom_offset_OBJECTS) $(alter_lincom_offset_LDADD) $(LIBS)
+alter_lincom_slope$(EXEEXT): $(alter_lincom_slope_OBJECTS) $(alter_lincom_slope_DEPENDENCIES)
+ @rm -f alter_lincom_slope$(EXEEXT)
+ $(LINK) $(alter_lincom_slope_OBJECTS) $(alter_lincom_slope_LDADD) $(LIBS)
+alter_linterp$(EXEEXT): $(alter_linterp_OBJECTS) $(alter_linterp_DEPENDENCIES)
+ @rm -f alter_linterp$(EXEEXT)
+ $(LINK) $(alter_linterp_OBJECTS) $(alter_linterp_LDADD) $(LIBS)
+alter_linterp_move$(EXEEXT): $(alter_linterp_move_OBJECTS) $(alter_linterp_move_DEPENDENCIES)
+ @rm -f alter_linterp_move$(EXEEXT)
+ $(LINK) $(alter_linterp_move_OBJECTS) $(alter_linterp_move_LDADD) $(LIBS)
+alter_mspec$(EXEEXT): $(alter_mspec_OBJECTS) $(alter_mspec_DEPENDENCIES)
+ @rm -f alter_mspec$(EXEEXT)
+ $(LINK) $(alter_mspec_OBJECTS) $(alter_mspec_LDADD) $(LIBS)
+alter_multiply$(EXEEXT): $(alter_multiply_OBJECTS) $(alter_multiply_DEPENDENCIES)
+ @rm -f alter_multiply$(EXEEXT)
+ $(LINK) $(alter_multiply_OBJECTS) $(alter_multiply_LDADD) $(LIBS)
+alter_phase$(EXEEXT): $(alter_phase_OBJECTS) $(alter_phase_DEPENDENCIES)
+ @rm -f alter_phase$(EXEEXT)
+ $(LINK) $(alter_phase_OBJECTS) $(alter_phase_LDADD) $(LIBS)
+alter_polynom_coeff$(EXEEXT): $(alter_polynom_coeff_OBJECTS) $(alter_polynom_coeff_DEPENDENCIES)
+ @rm -f alter_polynom_coeff$(EXEEXT)
+ $(LINK) $(alter_polynom_coeff_OBJECTS) $(alter_polynom_coeff_LDADD) $(LIBS)
+alter_polynom_input$(EXEEXT): $(alter_polynom_input_OBJECTS) $(alter_polynom_input_DEPENDENCIES)
+ @rm -f alter_polynom_input$(EXEEXT)
+ $(LINK) $(alter_polynom_input_OBJECTS) $(alter_polynom_input_LDADD) $(LIBS)
+alter_polynom_ord$(EXEEXT): $(alter_polynom_ord_OBJECTS) $(alter_polynom_ord_DEPENDENCIES)
+ @rm -f alter_polynom_ord$(EXEEXT)
+ $(LINK) $(alter_polynom_ord_OBJECTS) $(alter_polynom_ord_LDADD) $(LIBS)
+alter_raw_spf$(EXEEXT): $(alter_raw_spf_OBJECTS) $(alter_raw_spf_DEPENDENCIES)
+ @rm -f alter_raw_spf$(EXEEXT)
+ $(LINK) $(alter_raw_spf_OBJECTS) $(alter_raw_spf_LDADD) $(LIBS)
+alter_raw_type$(EXEEXT): $(alter_raw_type_OBJECTS) $(alter_raw_type_DEPENDENCIES)
+ @rm -f alter_raw_type$(EXEEXT)
+ $(LINK) $(alter_raw_type_OBJECTS) $(alter_raw_type_LDADD) $(LIBS)
+alter_recip$(EXEEXT): $(alter_recip_OBJECTS) $(alter_recip_DEPENDENCIES)
+ @rm -f alter_recip$(EXEEXT)
+ $(LINK) $(alter_recip_OBJECTS) $(alter_recip_LDADD) $(LIBS)
+alter_recip_zero$(EXEEXT): $(alter_recip_zero_OBJECTS) $(alter_recip_zero_DEPENDENCIES)
+ @rm -f alter_recip_zero$(EXEEXT)
+ $(LINK) $(alter_recip_zero_OBJECTS) $(alter_recip_zero_LDADD) $(LIBS)
+alter_spec$(EXEEXT): $(alter_spec_OBJECTS) $(alter_spec_DEPENDENCIES)
+ @rm -f alter_spec$(EXEEXT)
+ $(LINK) $(alter_spec_OBJECTS) $(alter_spec_LDADD) $(LIBS)
+alter_spec_meta$(EXEEXT): $(alter_spec_meta_OBJECTS) $(alter_spec_meta_DEPENDENCIES)
+ @rm -f alter_spec_meta$(EXEEXT)
+ $(LINK) $(alter_spec_meta_OBJECTS) $(alter_spec_meta_LDADD) $(LIBS)
+ascii_get$(EXEEXT): $(ascii_get_OBJECTS) $(ascii_get_DEPENDENCIES)
+ @rm -f ascii_get$(EXEEXT)
+ $(LINK) $(ascii_get_OBJECTS) $(ascii_get_LDADD) $(LIBS)
+ascii_get_get$(EXEEXT): $(ascii_get_get_OBJECTS) $(ascii_get_get_DEPENDENCIES)
+ @rm -f ascii_get_get$(EXEEXT)
+ $(LINK) $(ascii_get_get_OBJECTS) $(ascii_get_get_LDADD) $(LIBS)
+ascii_nframes$(EXEEXT): $(ascii_nframes_OBJECTS) $(ascii_nframes_DEPENDENCIES)
+ @rm -f ascii_nframes$(EXEEXT)
+ $(LINK) $(ascii_nframes_OBJECTS) $(ascii_nframes_LDADD) $(LIBS)
+ascii_put$(EXEEXT): $(ascii_put_OBJECTS) $(ascii_put_DEPENDENCIES)
+ @rm -f ascii_put$(EXEEXT)
+ $(LINK) $(ascii_put_OBJECTS) $(ascii_put_LDADD) $(LIBS)
+bof$(EXEEXT): $(bof_OBJECTS) $(bof_DEPENDENCIES)
+ @rm -f bof$(EXEEXT)
+ $(LINK) $(bof_OBJECTS) $(bof_LDADD) $(LIBS)
+bof_lincom$(EXEEXT): $(bof_lincom_OBJECTS) $(bof_lincom_DEPENDENCIES)
+ @rm -f bof_lincom$(EXEEXT)
+ $(LINK) $(bof_lincom_OBJECTS) $(bof_lincom_LDADD) $(LIBS)
+bof_phase$(EXEEXT): $(bof_phase_OBJECTS) $(bof_phase_DEPENDENCIES)
+ @rm -f bof_phase$(EXEEXT)
+ $(LINK) $(bof_phase_OBJECTS) $(bof_phase_LDADD) $(LIBS)
+bzip_get$(EXEEXT): $(bzip_get_OBJECTS) $(bzip_get_DEPENDENCIES)
+ @rm -f bzip_get$(EXEEXT)
+ $(LINK) $(bzip_get_OBJECTS) $(bzip_get_LDADD) $(LIBS)
+bzip_get_get$(EXEEXT): $(bzip_get_get_OBJECTS) $(bzip_get_get_DEPENDENCIES)
+ @rm -f bzip_get_get$(EXEEXT)
+ $(LINK) $(bzip_get_get_OBJECTS) $(bzip_get_get_LDADD) $(LIBS)
+bzip_move_from$(EXEEXT): $(bzip_move_from_OBJECTS) $(bzip_move_from_DEPENDENCIES)
+ @rm -f bzip_move_from$(EXEEXT)
+ $(LINK) $(bzip_move_from_OBJECTS) $(bzip_move_from_LDADD) $(LIBS)
+bzip_nframes$(EXEEXT): $(bzip_nframes_OBJECTS) $(bzip_nframes_DEPENDENCIES)
+ @rm -f bzip_nframes$(EXEEXT)
+ $(LINK) $(bzip_nframes_OBJECTS) $(bzip_nframes_LDADD) $(LIBS)
+close$(EXEEXT): $(close_OBJECTS) $(close_DEPENDENCIES)
+ @rm -f close$(EXEEXT)
+ $(LINK) $(close_OBJECTS) $(close_LDADD) $(LIBS)
+close_bad$(EXEEXT): $(close_bad_OBJECTS) $(close_bad_DEPENDENCIES)
+ @rm -f close_bad$(EXEEXT)
+ $(LINK) $(close_bad_OBJECTS) $(close_bad_LDADD) $(LIBS)
+close_discard$(EXEEXT): $(close_discard_OBJECTS) $(close_discard_DEPENDENCIES)
+ @rm -f close_discard$(EXEEXT)
+ $(LINK) $(close_discard_OBJECTS) $(close_discard_LDADD) $(LIBS)
+close_null$(EXEEXT): $(close_null_OBJECTS) $(close_null_DEPENDENCIES)
+ @rm -f close_null$(EXEEXT)
+ $(LINK) $(close_null_OBJECTS) $(close_null_LDADD) $(LIBS)
+convert_complex128_complex64$(EXEEXT): $(convert_complex128_complex64_OBJECTS) $(convert_complex128_complex64_DEPENDENCIES)
+ @rm -f convert_complex128_complex64$(EXEEXT)
+ $(LINK) $(convert_complex128_complex64_OBJECTS) $(convert_complex128_complex64_LDADD) $(LIBS)
+convert_complex128_float64$(EXEEXT): $(convert_complex128_float64_OBJECTS) $(convert_complex128_float64_DEPENDENCIES)
+ @rm -f convert_complex128_float64$(EXEEXT)
+ $(LINK) $(convert_complex128_float64_OBJECTS) $(convert_complex128_float64_LDADD) $(LIBS)
+convert_complex128_int64$(EXEEXT): $(convert_complex128_int64_OBJECTS) $(convert_complex128_int64_DEPENDENCIES)
+ @rm -f convert_complex128_int64$(EXEEXT)
+ $(LINK) $(convert_complex128_int64_OBJECTS) $(convert_complex128_int64_LDADD) $(LIBS)
+convert_complex128_uint64$(EXEEXT): $(convert_complex128_uint64_OBJECTS) $(convert_complex128_uint64_DEPENDENCIES)
+ @rm -f convert_complex128_uint64$(EXEEXT)
+ $(LINK) $(convert_complex128_uint64_OBJECTS) $(convert_complex128_uint64_LDADD) $(LIBS)
+convert_complex64_complex128$(EXEEXT): $(convert_complex64_complex128_OBJECTS) $(convert_complex64_complex128_DEPENDENCIES)
+ @rm -f convert_complex64_complex128$(EXEEXT)
+ $(LINK) $(convert_complex64_complex128_OBJECTS) $(convert_complex64_complex128_LDADD) $(LIBS)
+convert_complex64_float64$(EXEEXT): $(convert_complex64_float64_OBJECTS) $(convert_complex64_float64_DEPENDENCIES)
+ @rm -f convert_complex64_float64$(EXEEXT)
+ $(LINK) $(convert_complex64_float64_OBJECTS) $(convert_complex64_float64_LDADD) $(LIBS)
+convert_complex64_int64$(EXEEXT): $(convert_complex64_int64_OBJECTS) $(convert_complex64_int64_DEPENDENCIES)
+ @rm -f convert_complex64_int64$(EXEEXT)
+ $(LINK) $(convert_complex64_int64_OBJECTS) $(convert_complex64_int64_LDADD) $(LIBS)
+convert_complex64_uint64$(EXEEXT): $(convert_complex64_uint64_OBJECTS) $(convert_complex64_uint64_DEPENDENCIES)
+ @rm -f convert_complex64_uint64$(EXEEXT)
+ $(LINK) $(convert_complex64_uint64_OBJECTS) $(convert_complex64_uint64_LDADD) $(LIBS)
+convert_float32_complex128$(EXEEXT): $(convert_float32_complex128_OBJECTS) $(convert_float32_complex128_DEPENDENCIES)
+ @rm -f convert_float32_complex128$(EXEEXT)
+ $(LINK) $(convert_float32_complex128_OBJECTS) $(convert_float32_complex128_LDADD) $(LIBS)
+convert_float32_complex64$(EXEEXT): $(convert_float32_complex64_OBJECTS) $(convert_float32_complex64_DEPENDENCIES)
+ @rm -f convert_float32_complex64$(EXEEXT)
+ $(LINK) $(convert_float32_complex64_OBJECTS) $(convert_float32_complex64_LDADD) $(LIBS)
+convert_float32_float64$(EXEEXT): $(convert_float32_float64_OBJECTS) $(convert_float32_float64_DEPENDENCIES)
+ @rm -f convert_float32_float64$(EXEEXT)
+ $(LINK) $(convert_float32_float64_OBJECTS) $(convert_float32_float64_LDADD) $(LIBS)
+convert_float32_int16$(EXEEXT): $(convert_float32_int16_OBJECTS) $(convert_float32_int16_DEPENDENCIES)
+ @rm -f convert_float32_int16$(EXEEXT)
+ $(LINK) $(convert_float32_int16_OBJECTS) $(convert_float32_int16_LDADD) $(LIBS)
+convert_float32_int32$(EXEEXT): $(convert_float32_int32_OBJECTS) $(convert_float32_int32_DEPENDENCIES)
+ @rm -f convert_float32_int32$(EXEEXT)
+ $(LINK) $(convert_float32_int32_OBJECTS) $(convert_float32_int32_LDADD) $(LIBS)
+convert_float32_int64$(EXEEXT): $(convert_float32_int64_OBJECTS) $(convert_float32_int64_DEPENDENCIES)
+ @rm -f convert_float32_int64$(EXEEXT)
+ $(LINK) $(convert_float32_int64_OBJECTS) $(convert_float32_int64_LDADD) $(LIBS)
+convert_float32_int8$(EXEEXT): $(convert_float32_int8_OBJECTS) $(convert_float32_int8_DEPENDENCIES)
+ @rm -f convert_float32_int8$(EXEEXT)
+ $(LINK) $(convert_float32_int8_OBJECTS) $(convert_float32_int8_LDADD) $(LIBS)
+convert_float32_uint16$(EXEEXT): $(convert_float32_uint16_OBJECTS) $(convert_float32_uint16_DEPENDENCIES)
+ @rm -f convert_float32_uint16$(EXEEXT)
+ $(LINK) $(convert_float32_uint16_OBJECTS) $(convert_float32_uint16_LDADD) $(LIBS)
+convert_float32_uint32$(EXEEXT): $(convert_float32_uint32_OBJECTS) $(convert_float32_uint32_DEPENDENCIES)
+ @rm -f convert_float32_uint32$(EXEEXT)
+ $(LINK) $(convert_float32_uint32_OBJECTS) $(convert_float32_uint32_LDADD) $(LIBS)
+convert_float32_uint64$(EXEEXT): $(convert_float32_uint64_OBJECTS) $(convert_float32_uint64_DEPENDENCIES)
+ @rm -f convert_float32_uint64$(EXEEXT)
+ $(LINK) $(convert_float32_uint64_OBJECTS) $(convert_float32_uint64_LDADD) $(LIBS)
+convert_float32_uint8$(EXEEXT): $(convert_float32_uint8_OBJECTS) $(convert_float32_uint8_DEPENDENCIES)
+ @rm -f convert_float32_uint8$(EXEEXT)
+ $(LINK) $(convert_float32_uint8_OBJECTS) $(convert_float32_uint8_LDADD) $(LIBS)
+convert_float64_complex128$(EXEEXT): $(convert_float64_complex128_OBJECTS) $(convert_float64_complex128_DEPENDENCIES)
+ @rm -f convert_float64_complex128$(EXEEXT)
+ $(LINK) $(convert_float64_complex128_OBJECTS) $(convert_float64_complex128_LDADD) $(LIBS)
+convert_float64_complex64$(EXEEXT): $(convert_float64_complex64_OBJECTS) $(convert_float64_complex64_DEPENDENCIES)
+ @rm -f convert_float64_complex64$(EXEEXT)
+ $(LINK) $(convert_float64_complex64_OBJECTS) $(convert_float64_complex64_LDADD) $(LIBS)
+convert_float64_float32$(EXEEXT): $(convert_float64_float32_OBJECTS) $(convert_float64_float32_DEPENDENCIES)
+ @rm -f convert_float64_float32$(EXEEXT)
+ $(LINK) $(convert_float64_float32_OBJECTS) $(convert_float64_float32_LDADD) $(LIBS)
+convert_float64_int16$(EXEEXT): $(convert_float64_int16_OBJECTS) $(convert_float64_int16_DEPENDENCIES)
+ @rm -f convert_float64_int16$(EXEEXT)
+ $(LINK) $(convert_float64_int16_OBJECTS) $(convert_float64_int16_LDADD) $(LIBS)
+convert_float64_int32$(EXEEXT): $(convert_float64_int32_OBJECTS) $(convert_float64_int32_DEPENDENCIES)
+ @rm -f convert_float64_int32$(EXEEXT)
+ $(LINK) $(convert_float64_int32_OBJECTS) $(convert_float64_int32_LDADD) $(LIBS)
+convert_float64_int64$(EXEEXT): $(convert_float64_int64_OBJECTS) $(convert_float64_int64_DEPENDENCIES)
+ @rm -f convert_float64_int64$(EXEEXT)
+ $(LINK) $(convert_float64_int64_OBJECTS) $(convert_float64_int64_LDADD) $(LIBS)
+convert_float64_int8$(EXEEXT): $(convert_float64_int8_OBJECTS) $(convert_float64_int8_DEPENDENCIES)
+ @rm -f convert_float64_int8$(EXEEXT)
+ $(LINK) $(convert_float64_int8_OBJECTS) $(convert_float64_int8_LDADD) $(LIBS)
+convert_float64_uint16$(EXEEXT): $(convert_float64_uint16_OBJECTS) $(convert_float64_uint16_DEPENDENCIES)
+ @rm -f convert_float64_uint16$(EXEEXT)
+ $(LINK) $(convert_float64_uint16_OBJECTS) $(convert_float64_uint16_LDADD) $(LIBS)
+convert_float64_uint32$(EXEEXT): $(convert_float64_uint32_OBJECTS) $(convert_float64_uint32_DEPENDENCIES)
+ @rm -f convert_float64_uint32$(EXEEXT)
+ $(LINK) $(convert_float64_uint32_OBJECTS) $(convert_float64_uint32_LDADD) $(LIBS)
+convert_float64_uint64$(EXEEXT): $(convert_float64_uint64_OBJECTS) $(convert_float64_uint64_DEPENDENCIES)
+ @rm -f convert_float64_uint64$(EXEEXT)
+ $(LINK) $(convert_float64_uint64_OBJECTS) $(convert_float64_uint64_LDADD) $(LIBS)
+convert_float64_uint8$(EXEEXT): $(convert_float64_uint8_OBJECTS) $(convert_float64_uint8_DEPENDENCIES)
+ @rm -f convert_float64_uint8$(EXEEXT)
+ $(LINK) $(convert_float64_uint8_OBJECTS) $(convert_float64_uint8_LDADD) $(LIBS)
+convert_int16_complex128$(EXEEXT): $(convert_int16_complex128_OBJECTS) $(convert_int16_complex128_DEPENDENCIES)
+ @rm -f convert_int16_complex128$(EXEEXT)
+ $(LINK) $(convert_int16_complex128_OBJECTS) $(convert_int16_complex128_LDADD) $(LIBS)
+convert_int16_complex64$(EXEEXT): $(convert_int16_complex64_OBJECTS) $(convert_int16_complex64_DEPENDENCIES)
+ @rm -f convert_int16_complex64$(EXEEXT)
+ $(LINK) $(convert_int16_complex64_OBJECTS) $(convert_int16_complex64_LDADD) $(LIBS)
+convert_int16_float32$(EXEEXT): $(convert_int16_float32_OBJECTS) $(convert_int16_float32_DEPENDENCIES)
+ @rm -f convert_int16_float32$(EXEEXT)
+ $(LINK) $(convert_int16_float32_OBJECTS) $(convert_int16_float32_LDADD) $(LIBS)
+convert_int16_float64$(EXEEXT): $(convert_int16_float64_OBJECTS) $(convert_int16_float64_DEPENDENCIES)
+ @rm -f convert_int16_float64$(EXEEXT)
+ $(LINK) $(convert_int16_float64_OBJECTS) $(convert_int16_float64_LDADD) $(LIBS)
+convert_int16_int32$(EXEEXT): $(convert_int16_int32_OBJECTS) $(convert_int16_int32_DEPENDENCIES)
+ @rm -f convert_int16_int32$(EXEEXT)
+ $(LINK) $(convert_int16_int32_OBJECTS) $(convert_int16_int32_LDADD) $(LIBS)
+convert_int16_int64$(EXEEXT): $(convert_int16_int64_OBJECTS) $(convert_int16_int64_DEPENDENCIES)
+ @rm -f convert_int16_int64$(EXEEXT)
+ $(LINK) $(convert_int16_int64_OBJECTS) $(convert_int16_int64_LDADD) $(LIBS)
+convert_int16_int8$(EXEEXT): $(convert_int16_int8_OBJECTS) $(convert_int16_int8_DEPENDENCIES)
+ @rm -f convert_int16_int8$(EXEEXT)
+ $(LINK) $(convert_int16_int8_OBJECTS) $(convert_int16_int8_LDADD) $(LIBS)
+convert_int16_uint16$(EXEEXT): $(convert_int16_uint16_OBJECTS) $(convert_int16_uint16_DEPENDENCIES)
+ @rm -f convert_int16_uint16$(EXEEXT)
+ $(LINK) $(convert_int16_uint16_OBJECTS) $(convert_int16_uint16_LDADD) $(LIBS)
+convert_int16_uint32$(EXEEXT): $(convert_int16_uint32_OBJECTS) $(convert_int16_uint32_DEPENDENCIES)
+ @rm -f convert_int16_uint32$(EXEEXT)
+ $(LINK) $(convert_int16_uint32_OBJECTS) $(convert_int16_uint32_LDADD) $(LIBS)
+convert_int16_uint64$(EXEEXT): $(convert_int16_uint64_OBJECTS) $(convert_int16_uint64_DEPENDENCIES)
+ @rm -f convert_int16_uint64$(EXEEXT)
+ $(LINK) $(convert_int16_uint64_OBJECTS) $(convert_int16_uint64_LDADD) $(LIBS)
+convert_int16_uint8$(EXEEXT): $(convert_int16_uint8_OBJECTS) $(convert_int16_uint8_DEPENDENCIES)
+ @rm -f convert_int16_uint8$(EXEEXT)
+ $(LINK) $(convert_int16_uint8_OBJECTS) $(convert_int16_uint8_LDADD) $(LIBS)
+convert_int32_complex128$(EXEEXT): $(convert_int32_complex128_OBJECTS) $(convert_int32_complex128_DEPENDENCIES)
+ @rm -f convert_int32_complex128$(EXEEXT)
+ $(LINK) $(convert_int32_complex128_OBJECTS) $(convert_int32_complex128_LDADD) $(LIBS)
+convert_int32_complex64$(EXEEXT): $(convert_int32_complex64_OBJECTS) $(convert_int32_complex64_DEPENDENCIES)
+ @rm -f convert_int32_complex64$(EXEEXT)
+ $(LINK) $(convert_int32_complex64_OBJECTS) $(convert_int32_complex64_LDADD) $(LIBS)
+convert_int32_float32$(EXEEXT): $(convert_int32_float32_OBJECTS) $(convert_int32_float32_DEPENDENCIES)
+ @rm -f convert_int32_float32$(EXEEXT)
+ $(LINK) $(convert_int32_float32_OBJECTS) $(convert_int32_float32_LDADD) $(LIBS)
+convert_int32_float64$(EXEEXT): $(convert_int32_float64_OBJECTS) $(convert_int32_float64_DEPENDENCIES)
+ @rm -f convert_int32_float64$(EXEEXT)
+ $(LINK) $(convert_int32_float64_OBJECTS) $(convert_int32_float64_LDADD) $(LIBS)
+convert_int32_int16$(EXEEXT): $(convert_int32_int16_OBJECTS) $(convert_int32_int16_DEPENDENCIES)
+ @rm -f convert_int32_int16$(EXEEXT)
+ $(LINK) $(convert_int32_int16_OBJECTS) $(convert_int32_int16_LDADD) $(LIBS)
+convert_int32_int64$(EXEEXT): $(convert_int32_int64_OBJECTS) $(convert_int32_int64_DEPENDENCIES)
+ @rm -f convert_int32_int64$(EXEEXT)
+ $(LINK) $(convert_int32_int64_OBJECTS) $(convert_int32_int64_LDADD) $(LIBS)
+convert_int32_int8$(EXEEXT): $(convert_int32_int8_OBJECTS) $(convert_int32_int8_DEPENDENCIES)
+ @rm -f convert_int32_int8$(EXEEXT)
+ $(LINK) $(convert_int32_int8_OBJECTS) $(convert_int32_int8_LDADD) $(LIBS)
+convert_int32_uint16$(EXEEXT): $(convert_int32_uint16_OBJECTS) $(convert_int32_uint16_DEPENDENCIES)
+ @rm -f convert_int32_uint16$(EXEEXT)
+ $(LINK) $(convert_int32_uint16_OBJECTS) $(convert_int32_uint16_LDADD) $(LIBS)
+convert_int32_uint32$(EXEEXT): $(convert_int32_uint32_OBJECTS) $(convert_int32_uint32_DEPENDENCIES)
+ @rm -f convert_int32_uint32$(EXEEXT)
+ $(LINK) $(convert_int32_uint32_OBJECTS) $(convert_int32_uint32_LDADD) $(LIBS)
+convert_int32_uint64$(EXEEXT): $(convert_int32_uint64_OBJECTS) $(convert_int32_uint64_DEPENDENCIES)
+ @rm -f convert_int32_uint64$(EXEEXT)
+ $(LINK) $(convert_int32_uint64_OBJECTS) $(convert_int32_uint64_LDADD) $(LIBS)
+convert_int32_uint8$(EXEEXT): $(convert_int32_uint8_OBJECTS) $(convert_int32_uint8_DEPENDENCIES)
+ @rm -f convert_int32_uint8$(EXEEXT)
+ $(LINK) $(convert_int32_uint8_OBJECTS) $(convert_int32_uint8_LDADD) $(LIBS)
+convert_int64_complex128$(EXEEXT): $(convert_int64_complex128_OBJECTS) $(convert_int64_complex128_DEPENDENCIES)
+ @rm -f convert_int64_complex128$(EXEEXT)
+ $(LINK) $(convert_int64_complex128_OBJECTS) $(convert_int64_complex128_LDADD) $(LIBS)
+convert_int64_complex64$(EXEEXT): $(convert_int64_complex64_OBJECTS) $(convert_int64_complex64_DEPENDENCIES)
+ @rm -f convert_int64_complex64$(EXEEXT)
+ $(LINK) $(convert_int64_complex64_OBJECTS) $(convert_int64_complex64_LDADD) $(LIBS)
+convert_int64_float32$(EXEEXT): $(convert_int64_float32_OBJECTS) $(convert_int64_float32_DEPENDENCIES)
+ @rm -f convert_int64_float32$(EXEEXT)
+ $(LINK) $(convert_int64_float32_OBJECTS) $(convert_int64_float32_LDADD) $(LIBS)
+convert_int64_float64$(EXEEXT): $(convert_int64_float64_OBJECTS) $(convert_int64_float64_DEPENDENCIES)
+ @rm -f convert_int64_float64$(EXEEXT)
+ $(LINK) $(convert_int64_float64_OBJECTS) $(convert_int64_float64_LDADD) $(LIBS)
+convert_int64_int16$(EXEEXT): $(convert_int64_int16_OBJECTS) $(convert_int64_int16_DEPENDENCIES)
+ @rm -f convert_int64_int16$(EXEEXT)
+ $(LINK) $(convert_int64_int16_OBJECTS) $(convert_int64_int16_LDADD) $(LIBS)
+convert_int64_int32$(EXEEXT): $(convert_int64_int32_OBJECTS) $(convert_int64_int32_DEPENDENCIES)
+ @rm -f convert_int64_int32$(EXEEXT)
+ $(LINK) $(convert_int64_int32_OBJECTS) $(convert_int64_int32_LDADD) $(LIBS)
+convert_int64_int8$(EXEEXT): $(convert_int64_int8_OBJECTS) $(convert_int64_int8_DEPENDENCIES)
+ @rm -f convert_int64_int8$(EXEEXT)
+ $(LINK) $(convert_int64_int8_OBJECTS) $(convert_int64_int8_LDADD) $(LIBS)
+convert_int64_uint16$(EXEEXT): $(convert_int64_uint16_OBJECTS) $(convert_int64_uint16_DEPENDENCIES)
+ @rm -f convert_int64_uint16$(EXEEXT)
+ $(LINK) $(convert_int64_uint16_OBJECTS) $(convert_int64_uint16_LDADD) $(LIBS)
+convert_int64_uint32$(EXEEXT): $(convert_int64_uint32_OBJECTS) $(convert_int64_uint32_DEPENDENCIES)
+ @rm -f convert_int64_uint32$(EXEEXT)
+ $(LINK) $(convert_int64_uint32_OBJECTS) $(convert_int64_uint32_LDADD) $(LIBS)
+convert_int64_uint64$(EXEEXT): $(convert_int64_uint64_OBJECTS) $(convert_int64_uint64_DEPENDENCIES)
+ @rm -f convert_int64_uint64$(EXEEXT)
+ $(LINK) $(convert_int64_uint64_OBJECTS) $(convert_int64_uint64_LDADD) $(LIBS)
+convert_int64_uint8$(EXEEXT): $(convert_int64_uint8_OBJECTS) $(convert_int64_uint8_DEPENDENCIES)
+ @rm -f convert_int64_uint8$(EXEEXT)
+ $(LINK) $(convert_int64_uint8_OBJECTS) $(convert_int64_uint8_LDADD) $(LIBS)
+convert_int8_complex128$(EXEEXT): $(convert_int8_complex128_OBJECTS) $(convert_int8_complex128_DEPENDENCIES)
+ @rm -f convert_int8_complex128$(EXEEXT)
+ $(LINK) $(convert_int8_complex128_OBJECTS) $(convert_int8_complex128_LDADD) $(LIBS)
+convert_int8_complex64$(EXEEXT): $(convert_int8_complex64_OBJECTS) $(convert_int8_complex64_DEPENDENCIES)
+ @rm -f convert_int8_complex64$(EXEEXT)
+ $(LINK) $(convert_int8_complex64_OBJECTS) $(convert_int8_complex64_LDADD) $(LIBS)
+convert_int8_float32$(EXEEXT): $(convert_int8_float32_OBJECTS) $(convert_int8_float32_DEPENDENCIES)
+ @rm -f convert_int8_float32$(EXEEXT)
+ $(LINK) $(convert_int8_float32_OBJECTS) $(convert_int8_float32_LDADD) $(LIBS)
+convert_int8_float64$(EXEEXT): $(convert_int8_float64_OBJECTS) $(convert_int8_float64_DEPENDENCIES)
+ @rm -f convert_int8_float64$(EXEEXT)
+ $(LINK) $(convert_int8_float64_OBJECTS) $(convert_int8_float64_LDADD) $(LIBS)
+convert_int8_int16$(EXEEXT): $(convert_int8_int16_OBJECTS) $(convert_int8_int16_DEPENDENCIES)
+ @rm -f convert_int8_int16$(EXEEXT)
+ $(LINK) $(convert_int8_int16_OBJECTS) $(convert_int8_int16_LDADD) $(LIBS)
+convert_int8_int32$(EXEEXT): $(convert_int8_int32_OBJECTS) $(convert_int8_int32_DEPENDENCIES)
+ @rm -f convert_int8_int32$(EXEEXT)
+ $(LINK) $(convert_int8_int32_OBJECTS) $(convert_int8_int32_LDADD) $(LIBS)
+convert_int8_int64$(EXEEXT): $(convert_int8_int64_OBJECTS) $(convert_int8_int64_DEPENDENCIES)
+ @rm -f convert_int8_int64$(EXEEXT)
+ $(LINK) $(convert_int8_int64_OBJECTS) $(convert_int8_int64_LDADD) $(LIBS)
+convert_int8_uint16$(EXEEXT): $(convert_int8_uint16_OBJECTS) $(convert_int8_uint16_DEPENDENCIES)
+ @rm -f convert_int8_uint16$(EXEEXT)
+ $(LINK) $(convert_int8_uint16_OBJECTS) $(convert_int8_uint16_LDADD) $(LIBS)
+convert_int8_uint32$(EXEEXT): $(convert_int8_uint32_OBJECTS) $(convert_int8_uint32_DEPENDENCIES)
+ @rm -f convert_int8_uint32$(EXEEXT)
+ $(LINK) $(convert_int8_uint32_OBJECTS) $(convert_int8_uint32_LDADD) $(LIBS)
+convert_int8_uint64$(EXEEXT): $(convert_int8_uint64_OBJECTS) $(convert_int8_uint64_DEPENDENCIES)
+ @rm -f convert_int8_uint64$(EXEEXT)
+ $(LINK) $(convert_int8_uint64_OBJECTS) $(convert_int8_uint64_LDADD) $(LIBS)
+convert_int8_uint8$(EXEEXT): $(convert_int8_uint8_OBJECTS) $(convert_int8_uint8_DEPENDENCIES)
+ @rm -f convert_int8_uint8$(EXEEXT)
+ $(LINK) $(convert_int8_uint8_OBJECTS) $(convert_int8_uint8_LDADD) $(LIBS)
+convert_uint16_complex128$(EXEEXT): $(convert_uint16_complex128_OBJECTS) $(convert_uint16_complex128_DEPENDENCIES)
+ @rm -f convert_uint16_complex128$(EXEEXT)
+ $(LINK) $(convert_uint16_complex128_OBJECTS) $(convert_uint16_complex128_LDADD) $(LIBS)
+convert_uint16_complex64$(EXEEXT): $(convert_uint16_complex64_OBJECTS) $(convert_uint16_complex64_DEPENDENCIES)
+ @rm -f convert_uint16_complex64$(EXEEXT)
+ $(LINK) $(convert_uint16_complex64_OBJECTS) $(convert_uint16_complex64_LDADD) $(LIBS)
+convert_uint16_float32$(EXEEXT): $(convert_uint16_float32_OBJECTS) $(convert_uint16_float32_DEPENDENCIES)
+ @rm -f convert_uint16_float32$(EXEEXT)
+ $(LINK) $(convert_uint16_float32_OBJECTS) $(convert_uint16_float32_LDADD) $(LIBS)
+convert_uint16_float64$(EXEEXT): $(convert_uint16_float64_OBJECTS) $(convert_uint16_float64_DEPENDENCIES)
+ @rm -f convert_uint16_float64$(EXEEXT)
+ $(LINK) $(convert_uint16_float64_OBJECTS) $(convert_uint16_float64_LDADD) $(LIBS)
+convert_uint16_int16$(EXEEXT): $(convert_uint16_int16_OBJECTS) $(convert_uint16_int16_DEPENDENCIES)
+ @rm -f convert_uint16_int16$(EXEEXT)
+ $(LINK) $(convert_uint16_int16_OBJECTS) $(convert_uint16_int16_LDADD) $(LIBS)
+convert_uint16_int32$(EXEEXT): $(convert_uint16_int32_OBJECTS) $(convert_uint16_int32_DEPENDENCIES)
+ @rm -f convert_uint16_int32$(EXEEXT)
+ $(LINK) $(convert_uint16_int32_OBJECTS) $(convert_uint16_int32_LDADD) $(LIBS)
+convert_uint16_int64$(EXEEXT): $(convert_uint16_int64_OBJECTS) $(convert_uint16_int64_DEPENDENCIES)
+ @rm -f convert_uint16_int64$(EXEEXT)
+ $(LINK) $(convert_uint16_int64_OBJECTS) $(convert_uint16_int64_LDADD) $(LIBS)
+convert_uint16_int8$(EXEEXT): $(convert_uint16_int8_OBJECTS) $(convert_uint16_int8_DEPENDENCIES)
+ @rm -f convert_uint16_int8$(EXEEXT)
+ $(LINK) $(convert_uint16_int8_OBJECTS) $(convert_uint16_int8_LDADD) $(LIBS)
+convert_uint16_uint32$(EXEEXT): $(convert_uint16_uint32_OBJECTS) $(convert_uint16_uint32_DEPENDENCIES)
+ @rm -f convert_uint16_uint32$(EXEEXT)
+ $(LINK) $(convert_uint16_uint32_OBJECTS) $(convert_uint16_uint32_LDADD) $(LIBS)
+convert_uint16_uint64$(EXEEXT): $(convert_uint16_uint64_OBJECTS) $(convert_uint16_uint64_DEPENDENCIES)
+ @rm -f convert_uint16_uint64$(EXEEXT)
+ $(LINK) $(convert_uint16_uint64_OBJECTS) $(convert_uint16_uint64_LDADD) $(LIBS)
+convert_uint16_uint8$(EXEEXT): $(convert_uint16_uint8_OBJECTS) $(convert_uint16_uint8_DEPENDENCIES)
+ @rm -f convert_uint16_uint8$(EXEEXT)
+ $(LINK) $(convert_uint16_uint8_OBJECTS) $(convert_uint16_uint8_LDADD) $(LIBS)
+convert_uint32_complex128$(EXEEXT): $(convert_uint32_complex128_OBJECTS) $(convert_uint32_complex128_DEPENDENCIES)
+ @rm -f convert_uint32_complex128$(EXEEXT)
+ $(LINK) $(convert_uint32_complex128_OBJECTS) $(convert_uint32_complex128_LDADD) $(LIBS)
+convert_uint32_complex64$(EXEEXT): $(convert_uint32_complex64_OBJECTS) $(convert_uint32_complex64_DEPENDENCIES)
+ @rm -f convert_uint32_complex64$(EXEEXT)
+ $(LINK) $(convert_uint32_complex64_OBJECTS) $(convert_uint32_complex64_LDADD) $(LIBS)
+convert_uint32_float32$(EXEEXT): $(convert_uint32_float32_OBJECTS) $(convert_uint32_float32_DEPENDENCIES)
+ @rm -f convert_uint32_float32$(EXEEXT)
+ $(LINK) $(convert_uint32_float32_OBJECTS) $(convert_uint32_float32_LDADD) $(LIBS)
+convert_uint32_float64$(EXEEXT): $(convert_uint32_float64_OBJECTS) $(convert_uint32_float64_DEPENDENCIES)
+ @rm -f convert_uint32_float64$(EXEEXT)
+ $(LINK) $(convert_uint32_float64_OBJECTS) $(convert_uint32_float64_LDADD) $(LIBS)
+convert_uint32_int16$(EXEEXT): $(convert_uint32_int16_OBJECTS) $(convert_uint32_int16_DEPENDENCIES)
+ @rm -f convert_uint32_int16$(EXEEXT)
+ $(LINK) $(convert_uint32_int16_OBJECTS) $(convert_uint32_int16_LDADD) $(LIBS)
+convert_uint32_int32$(EXEEXT): $(convert_uint32_int32_OBJECTS) $(convert_uint32_int32_DEPENDENCIES)
+ @rm -f convert_uint32_int32$(EXEEXT)
+ $(LINK) $(convert_uint32_int32_OBJECTS) $(convert_uint32_int32_LDADD) $(LIBS)
+convert_uint32_int64$(EXEEXT): $(convert_uint32_int64_OBJECTS) $(convert_uint32_int64_DEPENDENCIES)
+ @rm -f convert_uint32_int64$(EXEEXT)
+ $(LINK) $(convert_uint32_int64_OBJECTS) $(convert_uint32_int64_LDADD) $(LIBS)
+convert_uint32_int8$(EXEEXT): $(convert_uint32_int8_OBJECTS) $(convert_uint32_int8_DEPENDENCIES)
+ @rm -f convert_uint32_int8$(EXEEXT)
+ $(LINK) $(convert_uint32_int8_OBJECTS) $(convert_uint32_int8_LDADD) $(LIBS)
+convert_uint32_uint16$(EXEEXT): $(convert_uint32_uint16_OBJECTS) $(convert_uint32_uint16_DEPENDENCIES)
+ @rm -f convert_uint32_uint16$(EXEEXT)
+ $(LINK) $(convert_uint32_uint16_OBJECTS) $(convert_uint32_uint16_LDADD) $(LIBS)
+convert_uint32_uint64$(EXEEXT): $(convert_uint32_uint64_OBJECTS) $(convert_uint32_uint64_DEPENDENCIES)
+ @rm -f convert_uint32_uint64$(EXEEXT)
+ $(LINK) $(convert_uint32_uint64_OBJECTS) $(convert_uint32_uint64_LDADD) $(LIBS)
+convert_uint32_uint8$(EXEEXT): $(convert_uint32_uint8_OBJECTS) $(convert_uint32_uint8_DEPENDENCIES)
+ @rm -f convert_uint32_uint8$(EXEEXT)
+ $(LINK) $(convert_uint32_uint8_OBJECTS) $(convert_uint32_uint8_LDADD) $(LIBS)
+convert_uint64_complex128$(EXEEXT): $(convert_uint64_complex128_OBJECTS) $(convert_uint64_complex128_DEPENDENCIES)
+ @rm -f convert_uint64_complex128$(EXEEXT)
+ $(LINK) $(convert_uint64_complex128_OBJECTS) $(convert_uint64_complex128_LDADD) $(LIBS)
+convert_uint64_complex64$(EXEEXT): $(convert_uint64_complex64_OBJECTS) $(convert_uint64_complex64_DEPENDENCIES)
+ @rm -f convert_uint64_complex64$(EXEEXT)
+ $(LINK) $(convert_uint64_complex64_OBJECTS) $(convert_uint64_complex64_LDADD) $(LIBS)
+convert_uint64_float32$(EXEEXT): $(convert_uint64_float32_OBJECTS) $(convert_uint64_float32_DEPENDENCIES)
+ @rm -f convert_uint64_float32$(EXEEXT)
+ $(LINK) $(convert_uint64_float32_OBJECTS) $(convert_uint64_float32_LDADD) $(LIBS)
+convert_uint64_float64$(EXEEXT): $(convert_uint64_float64_OBJECTS) $(convert_uint64_float64_DEPENDENCIES)
+ @rm -f convert_uint64_float64$(EXEEXT)
+ $(LINK) $(convert_uint64_float64_OBJECTS) $(convert_uint64_float64_LDADD) $(LIBS)
+convert_uint64_int16$(EXEEXT): $(convert_uint64_int16_OBJECTS) $(convert_uint64_int16_DEPENDENCIES)
+ @rm -f convert_uint64_int16$(EXEEXT)
+ $(LINK) $(convert_uint64_int16_OBJECTS) $(convert_uint64_int16_LDADD) $(LIBS)
+convert_uint64_int32$(EXEEXT): $(convert_uint64_int32_OBJECTS) $(convert_uint64_int32_DEPENDENCIES)
+ @rm -f convert_uint64_int32$(EXEEXT)
+ $(LINK) $(convert_uint64_int32_OBJECTS) $(convert_uint64_int32_LDADD) $(LIBS)
+convert_uint64_int64$(EXEEXT): $(convert_uint64_int64_OBJECTS) $(convert_uint64_int64_DEPENDENCIES)
+ @rm -f convert_uint64_int64$(EXEEXT)
+ $(LINK) $(convert_uint64_int64_OBJECTS) $(convert_uint64_int64_LDADD) $(LIBS)
+convert_uint64_int8$(EXEEXT): $(convert_uint64_int8_OBJECTS) $(convert_uint64_int8_DEPENDENCIES)
+ @rm -f convert_uint64_int8$(EXEEXT)
+ $(LINK) $(convert_uint64_int8_OBJECTS) $(convert_uint64_int8_LDADD) $(LIBS)
+convert_uint64_uint16$(EXEEXT): $(convert_uint64_uint16_OBJECTS) $(convert_uint64_uint16_DEPENDENCIES)
+ @rm -f convert_uint64_uint16$(EXEEXT)
+ $(LINK) $(convert_uint64_uint16_OBJECTS) $(convert_uint64_uint16_LDADD) $(LIBS)
+convert_uint64_uint32$(EXEEXT): $(convert_uint64_uint32_OBJECTS) $(convert_uint64_uint32_DEPENDENCIES)
+ @rm -f convert_uint64_uint32$(EXEEXT)
+ $(LINK) $(convert_uint64_uint32_OBJECTS) $(convert_uint64_uint32_LDADD) $(LIBS)
+convert_uint64_uint8$(EXEEXT): $(convert_uint64_uint8_OBJECTS) $(convert_uint64_uint8_DEPENDENCIES)
+ @rm -f convert_uint64_uint8$(EXEEXT)
+ $(LINK) $(convert_uint64_uint8_OBJECTS) $(convert_uint64_uint8_LDADD) $(LIBS)
+convert_uint8_complex128$(EXEEXT): $(convert_uint8_complex128_OBJECTS) $(convert_uint8_complex128_DEPENDENCIES)
+ @rm -f convert_uint8_complex128$(EXEEXT)
+ $(LINK) $(convert_uint8_complex128_OBJECTS) $(convert_uint8_complex128_LDADD) $(LIBS)
+convert_uint8_complex64$(EXEEXT): $(convert_uint8_complex64_OBJECTS) $(convert_uint8_complex64_DEPENDENCIES)
+ @rm -f convert_uint8_complex64$(EXEEXT)
+ $(LINK) $(convert_uint8_complex64_OBJECTS) $(convert_uint8_complex64_LDADD) $(LIBS)
+convert_uint8_float32$(EXEEXT): $(convert_uint8_float32_OBJECTS) $(convert_uint8_float32_DEPENDENCIES)
+ @rm -f convert_uint8_float32$(EXEEXT)
+ $(LINK) $(convert_uint8_float32_OBJECTS) $(convert_uint8_float32_LDADD) $(LIBS)
+convert_uint8_float64$(EXEEXT): $(convert_uint8_float64_OBJECTS) $(convert_uint8_float64_DEPENDENCIES)
+ @rm -f convert_uint8_float64$(EXEEXT)
+ $(LINK) $(convert_uint8_float64_OBJECTS) $(convert_uint8_float64_LDADD) $(LIBS)
+convert_uint8_int16$(EXEEXT): $(convert_uint8_int16_OBJECTS) $(convert_uint8_int16_DEPENDENCIES)
+ @rm -f convert_uint8_int16$(EXEEXT)
+ $(LINK) $(convert_uint8_int16_OBJECTS) $(convert_uint8_int16_LDADD) $(LIBS)
+convert_uint8_int32$(EXEEXT): $(convert_uint8_int32_OBJECTS) $(convert_uint8_int32_DEPENDENCIES)
+ @rm -f convert_uint8_int32$(EXEEXT)
+ $(LINK) $(convert_uint8_int32_OBJECTS) $(convert_uint8_int32_LDADD) $(LIBS)
+convert_uint8_int64$(EXEEXT): $(convert_uint8_int64_OBJECTS) $(convert_uint8_int64_DEPENDENCIES)
+ @rm -f convert_uint8_int64$(EXEEXT)
+ $(LINK) $(convert_uint8_int64_OBJECTS) $(convert_uint8_int64_LDADD) $(LIBS)
+convert_uint8_int8$(EXEEXT): $(convert_uint8_int8_OBJECTS) $(convert_uint8_int8_DEPENDENCIES)
+ @rm -f convert_uint8_int8$(EXEEXT)
+ $(LINK) $(convert_uint8_int8_OBJECTS) $(convert_uint8_int8_LDADD) $(LIBS)
+convert_uint8_uint16$(EXEEXT): $(convert_uint8_uint16_OBJECTS) $(convert_uint8_uint16_DEPENDENCIES)
+ @rm -f convert_uint8_uint16$(EXEEXT)
+ $(LINK) $(convert_uint8_uint16_OBJECTS) $(convert_uint8_uint16_LDADD) $(LIBS)
+convert_uint8_uint32$(EXEEXT): $(convert_uint8_uint32_OBJECTS) $(convert_uint8_uint32_DEPENDENCIES)
+ @rm -f convert_uint8_uint32$(EXEEXT)
+ $(LINK) $(convert_uint8_uint32_OBJECTS) $(convert_uint8_uint32_LDADD) $(LIBS)
+convert_uint8_uint64$(EXEEXT): $(convert_uint8_uint64_OBJECTS) $(convert_uint8_uint64_DEPENDENCIES)
+ @rm -f convert_uint8_uint64$(EXEEXT)
+ $(LINK) $(convert_uint8_uint64_OBJECTS) $(convert_uint8_uint64_LDADD) $(LIBS)
+creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES)
+ @rm -f creat$(EXEEXT)
+ $(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS)
+creat_excl$(EXEEXT): $(creat_excl_OBJECTS) $(creat_excl_DEPENDENCIES)
+ @rm -f creat_excl$(EXEEXT)
+ $(LINK) $(creat_excl_OBJECTS) $(creat_excl_LDADD) $(LIBS)
+creat_rdonly$(EXEEXT): $(creat_rdonly_OBJECTS) $(creat_rdonly_DEPENDENCIES)
+ @rm -f creat_rdonly$(EXEEXT)
+ $(LINK) $(creat_rdonly_OBJECTS) $(creat_rdonly_LDADD) $(LIBS)
+cvlist$(EXEEXT): $(cvlist_OBJECTS) $(cvlist_DEPENDENCIES)
+ @rm -f cvlist$(EXEEXT)
+ $(LINK) $(cvlist_OBJECTS) $(cvlist_LDADD) $(LIBS)
+cvlist_array$(EXEEXT): $(cvlist_array_OBJECTS) $(cvlist_array_DEPENDENCIES)
+ @rm -f cvlist_array$(EXEEXT)
+ $(LINK) $(cvlist_array_OBJECTS) $(cvlist_array_LDADD) $(LIBS)
+cvlist_array_meta$(EXEEXT): $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_DEPENDENCIES)
+ @rm -f cvlist_array_meta$(EXEEXT)
+ $(LINK) $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_LDADD) $(LIBS)
+cvlist_invalid$(EXEEXT): $(cvlist_invalid_OBJECTS) $(cvlist_invalid_DEPENDENCIES)
+ @rm -f cvlist_invalid$(EXEEXT)
+ $(LINK) $(cvlist_invalid_OBJECTS) $(cvlist_invalid_LDADD) $(LIBS)
+cvlist_meta$(EXEEXT): $(cvlist_meta_OBJECTS) $(cvlist_meta_DEPENDENCIES)
+ @rm -f cvlist_meta$(EXEEXT)
+ $(LINK) $(cvlist_meta_OBJECTS) $(cvlist_meta_LDADD) $(LIBS)
+cvlist_meta_invalid$(EXEEXT): $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_invalid_DEPENDENCIES)
+ @rm -f cvlist_meta_invalid$(EXEEXT)
+ $(LINK) $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_invalid_LDADD) $(LIBS)
+del$(EXEEXT): $(del_OBJECTS) $(del_DEPENDENCIES)
+ @rm -f del$(EXEEXT)
+ $(LINK) $(del_OBJECTS) $(del_LDADD) $(LIBS)
+del_carray$(EXEEXT): $(del_carray_OBJECTS) $(del_carray_DEPENDENCIES)
+ @rm -f del_carray$(EXEEXT)
+ $(LINK) $(del_carray_OBJECTS) $(del_carray_LDADD) $(LIBS)
+del_carray_deref$(EXEEXT): $(del_carray_deref_OBJECTS) $(del_carray_deref_DEPENDENCIES)
+ @rm -f del_carray_deref$(EXEEXT)
+ $(LINK) $(del_carray_deref_OBJECTS) $(del_carray_deref_LDADD) $(LIBS)
+del_const$(EXEEXT): $(del_const_OBJECTS) $(del_const_DEPENDENCIES)
+ @rm -f del_const$(EXEEXT)
+ $(LINK) $(del_const_OBJECTS) $(del_const_LDADD) $(LIBS)
+del_const_deref$(EXEEXT): $(del_const_deref_OBJECTS) $(del_const_deref_DEPENDENCIES)
+ @rm -f del_const_deref$(EXEEXT)
+ $(LINK) $(del_const_deref_OBJECTS) $(del_const_deref_LDADD) $(LIBS)
+del_const_force$(EXEEXT): $(del_const_force_OBJECTS) $(del_const_force_DEPENDENCIES)
+ @rm -f del_const_force$(EXEEXT)
+ $(LINK) $(del_const_force_OBJECTS) $(del_const_force_LDADD) $(LIBS)
+del_data$(EXEEXT): $(del_data_OBJECTS) $(del_data_DEPENDENCIES)
+ @rm -f del_data$(EXEEXT)
+ $(LINK) $(del_data_OBJECTS) $(del_data_LDADD) $(LIBS)
+del_derived$(EXEEXT): $(del_derived_OBJECTS) $(del_derived_DEPENDENCIES)
+ @rm -f del_derived$(EXEEXT)
+ $(LINK) $(del_derived_OBJECTS) $(del_derived_LDADD) $(LIBS)
+del_derived_force$(EXEEXT): $(del_derived_force_OBJECTS) $(del_derived_force_DEPENDENCIES)
+ @rm -f del_derived_force$(EXEEXT)
+ $(LINK) $(del_derived_force_OBJECTS) $(del_derived_force_LDADD) $(LIBS)
+del_meta$(EXEEXT): $(del_meta_OBJECTS) $(del_meta_DEPENDENCIES)
+ @rm -f del_meta$(EXEEXT)
+ $(LINK) $(del_meta_OBJECTS) $(del_meta_LDADD) $(LIBS)
+del_meta_force$(EXEEXT): $(del_meta_force_OBJECTS) $(del_meta_force_DEPENDENCIES)
+ @rm -f del_meta_force$(EXEEXT)
+ $(LINK) $(del_meta_force_OBJECTS) $(del_meta_force_LDADD) $(LIBS)
+dfes_bit$(EXEEXT): $(dfes_bit_OBJECTS) $(dfes_bit_DEPENDENCIES)
+ @rm -f dfes_bit$(EXEEXT)
+ $(LINK) $(dfes_bit_OBJECTS) $(dfes_bit_LDADD) $(LIBS)
+dfes_divide$(EXEEXT): $(dfes_divide_OBJECTS) $(dfes_divide_DEPENDENCIES)
+ @rm -f dfes_divide$(EXEEXT)
+ $(LINK) $(dfes_divide_OBJECTS) $(dfes_divide_LDADD) $(LIBS)
+dfes_lincom$(EXEEXT): $(dfes_lincom_OBJECTS) $(dfes_lincom_DEPENDENCIES)
+ @rm -f dfes_lincom$(EXEEXT)
+ $(LINK) $(dfes_lincom_OBJECTS) $(dfes_lincom_LDADD) $(LIBS)
+dfes_linterp$(EXEEXT): $(dfes_linterp_OBJECTS) $(dfes_linterp_DEPENDENCIES)
+ @rm -f dfes_linterp$(EXEEXT)
+ $(LINK) $(dfes_linterp_OBJECTS) $(dfes_linterp_LDADD) $(LIBS)
+dfes_multiply$(EXEEXT): $(dfes_multiply_OBJECTS) $(dfes_multiply_DEPENDENCIES)
+ @rm -f dfes_multiply$(EXEEXT)
+ $(LINK) $(dfes_multiply_OBJECTS) $(dfes_multiply_LDADD) $(LIBS)
+dfes_null$(EXEEXT): $(dfes_null_OBJECTS) $(dfes_null_DEPENDENCIES)
+ @rm -f dfes_null$(EXEEXT)
+ $(LINK) $(dfes_null_OBJECTS) $(dfes_null_LDADD) $(LIBS)
+dfes_phase$(EXEEXT): $(dfes_phase_OBJECTS) $(dfes_phase_DEPENDENCIES)
+ @rm -f dfes_phase$(EXEEXT)
+ $(LINK) $(dfes_phase_OBJECTS) $(dfes_phase_LDADD) $(LIBS)
+dfes_raw$(EXEEXT): $(dfes_raw_OBJECTS) $(dfes_raw_DEPENDENCIES)
+ @rm -f dfes_raw$(EXEEXT)
+ $(LINK) $(dfes_raw_OBJECTS) $(dfes_raw_LDADD) $(LIBS)
+dfes_recip$(EXEEXT): $(dfes_recip_OBJECTS) $(dfes_recip_DEPENDENCIES)
+ @rm -f dfes_recip$(EXEEXT)
+ $(LINK) $(dfes_recip_OBJECTS) $(dfes_recip_LDADD) $(LIBS)
+dfes_zero$(EXEEXT): $(dfes_zero_OBJECTS) $(dfes_zero_DEPENDENCIES)
+ @rm -f dfes_zero$(EXEEXT)
+ $(LINK) $(dfes_zero_OBJECTS) $(dfes_zero_LDADD) $(LIBS)
+encode_alter$(EXEEXT): $(encode_alter_OBJECTS) $(encode_alter_DEPENDENCIES)
+ @rm -f encode_alter$(EXEEXT)
+ $(LINK) $(encode_alter_OBJECTS) $(encode_alter_LDADD) $(LIBS)
+encode_get$(EXEEXT): $(encode_get_OBJECTS) $(encode_get_DEPENDENCIES)
+ @rm -f encode_get$(EXEEXT)
+ $(LINK) $(encode_get_OBJECTS) $(encode_get_LDADD) $(LIBS)
+encode_move$(EXEEXT): $(encode_move_OBJECTS) $(encode_move_DEPENDENCIES)
+ @rm -f encode_move$(EXEEXT)
+ $(LINK) $(encode_move_OBJECTS) $(encode_move_LDADD) $(LIBS)
+endian_alter$(EXEEXT): $(endian_alter_OBJECTS) $(endian_alter_DEPENDENCIES)
+ @rm -f endian_alter$(EXEEXT)
+ $(LINK) $(endian_alter_OBJECTS) $(endian_alter_LDADD) $(LIBS)
+endian_get$(EXEEXT): $(endian_get_OBJECTS) $(endian_get_DEPENDENCIES)
+ @rm -f endian_get$(EXEEXT)
+ $(LINK) $(endian_get_OBJECTS) $(endian_get_LDADD) $(LIBS)
+endian_move$(EXEEXT): $(endian_move_OBJECTS) $(endian_move_DEPENDENCIES)
+ @rm -f endian_move$(EXEEXT)
+ $(LINK) $(endian_move_OBJECTS) $(endian_move_LDADD) $(LIBS)
+entry_bad_code$(EXEEXT): $(entry_bad_code_OBJECTS) $(entry_bad_code_DEPENDENCIES)
+ @rm -f entry_bad_code$(EXEEXT)
+ $(LINK) $(entry_bad_code_OBJECTS) $(entry_bad_code_LDADD) $(LIBS)
+entry_bit$(EXEEXT): $(entry_bit_OBJECTS) $(entry_bit_DEPENDENCIES)
+ @rm -f entry_bit$(EXEEXT)
+ $(LINK) $(entry_bit_OBJECTS) $(entry_bit_LDADD) $(LIBS)
+entry_bit_scalar$(EXEEXT): $(entry_bit_scalar_OBJECTS) $(entry_bit_scalar_DEPENDENCIES)
+ @rm -f entry_bit_scalar$(EXEEXT)
+ $(LINK) $(entry_bit_scalar_OBJECTS) $(entry_bit_scalar_LDADD) $(LIBS)
+entry_invalid$(EXEEXT): $(entry_invalid_OBJECTS) $(entry_invalid_DEPENDENCIES)
+ @rm -f entry_invalid$(EXEEXT)
+ $(LINK) $(entry_invalid_OBJECTS) $(entry_invalid_LDADD) $(LIBS)
+entry_lincom$(EXEEXT): $(entry_lincom_OBJECTS) $(entry_lincom_DEPENDENCIES)
+ @rm -f entry_lincom$(EXEEXT)
+ $(LINK) $(entry_lincom_OBJECTS) $(entry_lincom_LDADD) $(LIBS)
+entry_lincom_scalar$(EXEEXT): $(entry_lincom_scalar_OBJECTS) $(entry_lincom_scalar_DEPENDENCIES)
+ @rm -f entry_lincom_scalar$(EXEEXT)
+ $(LINK) $(entry_lincom_scalar_OBJECTS) $(entry_lincom_scalar_LDADD) $(LIBS)
+entry_linterp$(EXEEXT): $(entry_linterp_OBJECTS) $(entry_linterp_DEPENDENCIES)
+ @rm -f entry_linterp$(EXEEXT)
+ $(LINK) $(entry_linterp_OBJECTS) $(entry_linterp_LDADD) $(LIBS)
+entry_multiply$(EXEEXT): $(entry_multiply_OBJECTS) $(entry_multiply_DEPENDENCIES)
+ @rm -f entry_multiply$(EXEEXT)
+ $(LINK) $(entry_multiply_OBJECTS) $(entry_multiply_LDADD) $(LIBS)
+entry_phase$(EXEEXT): $(entry_phase_OBJECTS) $(entry_phase_DEPENDENCIES)
+ @rm -f entry_phase$(EXEEXT)
+ $(LINK) $(entry_phase_OBJECTS) $(entry_phase_LDADD) $(LIBS)
+entry_phase_scalar$(EXEEXT): $(entry_phase_scalar_OBJECTS) $(entry_phase_scalar_DEPENDENCIES)
+ @rm -f entry_phase_scalar$(EXEEXT)
+ $(LINK) $(entry_phase_scalar_OBJECTS) $(entry_phase_scalar_LDADD) $(LIBS)
+entry_polynom$(EXEEXT): $(entry_polynom_OBJECTS) $(entry_polynom_DEPENDENCIES)
+ @rm -f entry_polynom$(EXEEXT)
+ $(LINK) $(entry_polynom_OBJECTS) $(entry_polynom_LDADD) $(LIBS)
+entry_polynom_scalar$(EXEEXT): $(entry_polynom_scalar_OBJECTS) $(entry_polynom_scalar_DEPENDENCIES)
+ @rm -f entry_polynom_scalar$(EXEEXT)
+ $(LINK) $(entry_polynom_scalar_OBJECTS) $(entry_polynom_scalar_LDADD) $(LIBS)
+entry_raw$(EXEEXT): $(entry_raw_OBJECTS) $(entry_raw_DEPENDENCIES)
+ @rm -f entry_raw$(EXEEXT)
+ $(LINK) $(entry_raw_OBJECTS) $(entry_raw_LDADD) $(LIBS)
+entry_raw_scalar$(EXEEXT): $(entry_raw_scalar_OBJECTS) $(entry_raw_scalar_DEPENDENCIES)
+ @rm -f entry_raw_scalar$(EXEEXT)
+ $(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)
+ @rm -f entry_raw_scalar_code$(EXEEXT)
+ $(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)
+ @rm -f entry_raw_scalar_type$(EXEEXT)
+ $(LINK) $(entry_raw_scalar_type_OBJECTS) $(entry_raw_scalar_type_LDADD) $(LIBS)
+entry_scalar_repr$(EXEEXT): $(entry_scalar_repr_OBJECTS) $(entry_scalar_repr_DEPENDENCIES)
+ @rm -f entry_scalar_repr$(EXEEXT)
+ $(LINK) $(entry_scalar_repr_OBJECTS) $(entry_scalar_repr_LDADD) $(LIBS)
+entry_type$(EXEEXT): $(entry_type_OBJECTS) $(entry_type_DEPENDENCIES)
+ @rm -f entry_type$(EXEEXT)
+ $(LINK) $(entry_type_OBJECTS) $(entry_type_LDADD) $(LIBS)
+eof$(EXEEXT): $(eof_OBJECTS) $(eof_DEPENDENCIES)
+ @rm -f eof$(EXEEXT)
+ $(LINK) $(eof_OBJECTS) $(eof_LDADD) $(LIBS)
+eof_index$(EXEEXT): $(eof_index_OBJECTS) $(eof_index_DEPENDENCIES)
+ @rm -f eof_index$(EXEEXT)
+ $(LINK) $(eof_index_OBJECTS) $(eof_index_LDADD) $(LIBS)
+eof_lincom$(EXEEXT): $(eof_lincom_OBJECTS) $(eof_lincom_DEPENDENCIES)
+ @rm -f eof_lincom$(EXEEXT)
+ $(LINK) $(eof_lincom_OBJECTS) $(eof_lincom_LDADD) $(LIBS)
+eof_phase$(EXEEXT): $(eof_phase_OBJECTS) $(eof_phase_DEPENDENCIES)
+ @rm -f eof_phase$(EXEEXT)
+ $(LINK) $(eof_phase_OBJECTS) $(eof_phase_LDADD) $(LIBS)
+error$(EXEEXT): $(error_OBJECTS) $(error_DEPENDENCIES)
+ @rm -f error$(EXEEXT)
+ $(LINK) $(error_OBJECTS) $(error_LDADD) $(LIBS)
+error_error$(EXEEXT): $(error_error_OBJECTS) $(error_error_DEPENDENCIES)
+ @rm -f error_error$(EXEEXT)
+ $(LINK) $(error_error_OBJECTS) $(error_error_LDADD) $(LIBS)
+error_short$(EXEEXT): $(error_short_OBJECTS) $(error_short_DEPENDENCIES)
+ @rm -f error_short$(EXEEXT)
+ $(LINK) $(error_short_OBJECTS) $(error_short_LDADD) $(LIBS)
+file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES)
+ @rm -f file$(EXEEXT)
+ $(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS)
+file_code$(EXEEXT): $(file_code_OBJECTS) $(file_code_DEPENDENCIES)
+ @rm -f file_code$(EXEEXT)
+ $(LINK) $(file_code_OBJECTS) $(file_code_LDADD) $(LIBS)
+file_type$(EXEEXT): $(file_type_OBJECTS) $(file_type_DEPENDENCIES)
+ @rm -f file_type$(EXEEXT)
+ $(LINK) $(file_type_OBJECTS) $(file_type_LDADD) $(LIBS)
+flist$(EXEEXT): $(flist_OBJECTS) $(flist_DEPENDENCIES)
+ @rm -f flist$(EXEEXT)
+ $(LINK) $(flist_OBJECTS) $(flist_LDADD) $(LIBS)
+flist_invalid$(EXEEXT): $(flist_invalid_OBJECTS) $(flist_invalid_DEPENDENCIES)
+ @rm -f flist_invalid$(EXEEXT)
+ $(LINK) $(flist_invalid_OBJECTS) $(flist_invalid_LDADD) $(LIBS)
+flist_meta$(EXEEXT): $(flist_meta_OBJECTS) $(flist_meta_DEPENDENCIES)
+ @rm -f flist_meta$(EXEEXT)
+ $(LINK) $(flist_meta_OBJECTS) $(flist_meta_LDADD) $(LIBS)
+flist_meta_invalid$(EXEEXT): $(flist_meta_invalid_OBJECTS) $(flist_meta_invalid_DEPENDENCIES)
+ @rm -f flist_meta_invalid$(EXEEXT)
+ $(LINK) $(flist_meta_invalid_OBJECTS) $(flist_meta_invalid_LDADD) $(LIBS)
+flist_type$(EXEEXT): $(flist_type_OBJECTS) $(flist_type_DEPENDENCIES)
+ @rm -f flist_type$(EXEEXT)
+ $(LINK) $(flist_type_OBJECTS) $(flist_type_LDADD) $(LIBS)
+flist_type_invalid$(EXEEXT): $(flist_type_invalid_OBJECTS) $(flist_type_invalid_DEPENDENCIES)
+ @rm -f flist_type_invalid$(EXEEXT)
+ $(LINK) $(flist_type_invalid_OBJECTS) $(flist_type_invalid_LDADD) $(LIBS)
+flist_type_meta$(EXEEXT): $(flist_type_meta_OBJECTS) $(flist_type_meta_DEPENDENCIES)
+ @rm -f flist_type_meta$(EXEEXT)
+ $(LINK) $(flist_type_meta_OBJECTS) $(flist_type_meta_LDADD) $(LIBS)
+flist_type_meta_invalid$(EXEEXT): $(flist_type_meta_invalid_OBJECTS) $(flist_type_meta_invalid_DEPENDENCIES)
+ @rm -f flist_type_meta_invalid$(EXEEXT)
+ $(LINK) $(flist_type_meta_invalid_OBJECTS) $(flist_type_meta_invalid_LDADD) $(LIBS)
+flush$(EXEEXT): $(flush_OBJECTS) $(flush_DEPENDENCIES)
+ @rm -f flush$(EXEEXT)
+ $(LINK) $(flush_OBJECTS) $(flush_LDADD) $(LIBS)
+flush_all$(EXEEXT): $(flush_all_OBJECTS) $(flush_all_DEPENDENCIES)
+ @rm -f flush_all$(EXEEXT)
+ $(LINK) $(flush_all_OBJECTS) $(flush_all_LDADD) $(LIBS)
+flush_bad_code$(EXEEXT): $(flush_bad_code_OBJECTS) $(flush_bad_code_DEPENDENCIES)
+ @rm -f flush_bad_code$(EXEEXT)
+ $(LINK) $(flush_bad_code_OBJECTS) $(flush_bad_code_LDADD) $(LIBS)
+flush_invalid$(EXEEXT): $(flush_invalid_OBJECTS) $(flush_invalid_DEPENDENCIES)
+ @rm -f flush_invalid$(EXEEXT)
+ $(LINK) $(flush_invalid_OBJECTS) $(flush_invalid_LDADD) $(LIBS)
+flush_meta$(EXEEXT): $(flush_meta_OBJECTS) $(flush_meta_DEPENDENCIES)
+ @rm -f flush_meta$(EXEEXT)
+ $(LINK) $(flush_meta_OBJECTS) $(flush_meta_LDADD) $(LIBS)
+flush_spec$(EXEEXT): $(flush_spec_OBJECTS) $(flush_spec_DEPENDENCIES)
+ @rm -f flush_spec$(EXEEXT)
+ $(LINK) $(flush_spec_OBJECTS) $(flush_spec_LDADD) $(LIBS)
+foffs_alter$(EXEEXT): $(foffs_alter_OBJECTS) $(foffs_alter_DEPENDENCIES)
+ @rm -f foffs_alter$(EXEEXT)
+ $(LINK) $(foffs_alter_OBJECTS) $(foffs_alter_LDADD) $(LIBS)
+foffs_get$(EXEEXT): $(foffs_get_OBJECTS) $(foffs_get_DEPENDENCIES)
+ @rm -f foffs_get$(EXEEXT)
+ $(LINK) $(foffs_get_OBJECTS) $(foffs_get_LDADD) $(LIBS)
+foffs_move$(EXEEXT): $(foffs_move_OBJECTS) $(foffs_move_DEPENDENCIES)
+ @rm -f foffs_move$(EXEEXT)
+ $(LINK) $(foffs_move_OBJECTS) $(foffs_move_LDADD) $(LIBS)
+fragment_index$(EXEEXT): $(fragment_index_OBJECTS) $(fragment_index_DEPENDENCIES)
+ @rm -f fragment_index$(EXEEXT)
+ $(LINK) $(fragment_index_OBJECTS) $(fragment_index_LDADD) $(LIBS)
+fragment_name$(EXEEXT): $(fragment_name_OBJECTS) $(fragment_name_DEPENDENCIES)
+ @rm -f fragment_name$(EXEEXT)
+ $(LINK) $(fragment_name_OBJECTS) $(fragment_name_LDADD) $(LIBS)
+fragment_name_oor$(EXEEXT): $(fragment_name_oor_OBJECTS) $(fragment_name_oor_DEPENDENCIES)
+ @rm -f fragment_name_oor$(EXEEXT)
+ $(LINK) $(fragment_name_oor_OBJECTS) $(fragment_name_oor_LDADD) $(LIBS)
+get64$(EXEEXT): $(get64_OBJECTS) $(get64_DEPENDENCIES)
+ @rm -f get64$(EXEEXT)
+ $(LINK) $(get64_OBJECTS) $(get64_LDADD) $(LIBS)
+get_bad_code$(EXEEXT): $(get_bad_code_OBJECTS) $(get_bad_code_DEPENDENCIES)
+ @rm -f get_bad_code$(EXEEXT)
+ $(LINK) $(get_bad_code_OBJECTS) $(get_bad_code_LDADD) $(LIBS)
+get_bit$(EXEEXT): $(get_bit_OBJECTS) $(get_bit_DEPENDENCIES)
+ @rm -f get_bit$(EXEEXT)
+ $(LINK) $(get_bit_OBJECTS) $(get_bit_LDADD) $(LIBS)
+get_carray$(EXEEXT): $(get_carray_OBJECTS) $(get_carray_DEPENDENCIES)
+ @rm -f get_carray$(EXEEXT)
+ $(LINK) $(get_carray_OBJECTS) $(get_carray_LDADD) $(LIBS)
+get_carray_len$(EXEEXT): $(get_carray_len_OBJECTS) $(get_carray_len_DEPENDENCIES)
+ @rm -f get_carray_len$(EXEEXT)
+ $(LINK) $(get_carray_len_OBJECTS) $(get_carray_len_LDADD) $(LIBS)
+get_carray_slice$(EXEEXT): $(get_carray_slice_OBJECTS) $(get_carray_slice_DEPENDENCIES)
+ @rm -f get_carray_slice$(EXEEXT)
+ $(LINK) $(get_carray_slice_OBJECTS) $(get_carray_slice_LDADD) $(LIBS)
+get_char$(EXEEXT): $(get_char_OBJECTS) $(get_char_DEPENDENCIES)
+ @rm -f get_char$(EXEEXT)
+ $(LINK) $(get_char_OBJECTS) $(get_char_LDADD) $(LIBS)
+get_clincom$(EXEEXT): $(get_clincom_OBJECTS) $(get_clincom_DEPENDENCIES)
+ @rm -f get_clincom$(EXEEXT)
+ $(LINK) $(get_clincom_OBJECTS) $(get_clincom_LDADD) $(LIBS)
+get_complex128$(EXEEXT): $(get_complex128_OBJECTS) $(get_complex128_DEPENDENCIES)
+ @rm -f get_complex128$(EXEEXT)
+ $(LINK) $(get_complex128_OBJECTS) $(get_complex128_LDADD) $(LIBS)
+get_complex64$(EXEEXT): $(get_complex64_OBJECTS) $(get_complex64_DEPENDENCIES)
+ @rm -f get_complex64$(EXEEXT)
+ $(LINK) $(get_complex64_OBJECTS) $(get_complex64_LDADD) $(LIBS)
+get_const$(EXEEXT): $(get_const_OBJECTS) $(get_const_DEPENDENCIES)
+ @rm -f get_const$(EXEEXT)
+ $(LINK) $(get_const_OBJECTS) $(get_const_LDADD) $(LIBS)
+get_const_complex$(EXEEXT): $(get_const_complex_OBJECTS) $(get_const_complex_DEPENDENCIES)
+ @rm -f get_const_complex$(EXEEXT)
+ $(LINK) $(get_const_complex_OBJECTS) $(get_const_complex_LDADD) $(LIBS)
+get_const_repr$(EXEEXT): $(get_const_repr_OBJECTS) $(get_const_repr_DEPENDENCIES)
+ @rm -f get_const_repr$(EXEEXT)
+ $(LINK) $(get_const_repr_OBJECTS) $(get_const_repr_LDADD) $(LIBS)
+get_cpolynom$(EXEEXT): $(get_cpolynom_OBJECTS) $(get_cpolynom_DEPENDENCIES)
+ @rm -f get_cpolynom$(EXEEXT)
+ $(LINK) $(get_cpolynom_OBJECTS) $(get_cpolynom_LDADD) $(LIBS)
+get_divide$(EXEEXT): $(get_divide_OBJECTS) $(get_divide_DEPENDENCIES)
+ @rm -f get_divide$(EXEEXT)
+ $(LINK) $(get_divide_OBJECTS) $(get_divide_LDADD) $(LIBS)
+get_endian16$(EXEEXT): $(get_endian16_OBJECTS) $(get_endian16_DEPENDENCIES)
+ @rm -f get_endian16$(EXEEXT)
+ $(LINK) $(get_endian16_OBJECTS) $(get_endian16_LDADD) $(LIBS)
+get_endian32$(EXEEXT): $(get_endian32_OBJECTS) $(get_endian32_DEPENDENCIES)
+ @rm -f get_endian32$(EXEEXT)
+ $(LINK) $(get_endian32_OBJECTS) $(get_endian32_LDADD) $(LIBS)
+get_endian64$(EXEEXT): $(get_endian64_OBJECTS) $(get_endian64_DEPENDENCIES)
+ @rm -f get_endian64$(EXEEXT)
+ $(LINK) $(get_endian64_OBJECTS) $(get_endian64_LDADD) $(LIBS)
+get_endian8$(EXEEXT): $(get_endian8_OBJECTS) $(get_endian8_DEPENDENCIES)
+ @rm -f get_endian8$(EXEEXT)
+ $(LINK) $(get_endian8_OBJECTS) $(get_endian8_LDADD) $(LIBS)
+get_endian_complex128_arm$(EXEEXT): $(get_endian_complex128_arm_OBJECTS) $(get_endian_complex128_arm_DEPENDENCIES)
+ @rm -f get_endian_complex128_arm$(EXEEXT)
+ $(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)
+ @rm -f get_endian_complex128_big$(EXEEXT)
+ $(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)
+ @rm -f get_endian_complex128_little$(EXEEXT)
+ $(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)
+ @rm -f get_endian_complex64_arm$(EXEEXT)
+ $(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)
+ @rm -f get_endian_complex64_big$(EXEEXT)
+ $(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)
+ @rm -f get_endian_complex64_little$(EXEEXT)
+ $(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)
+ @rm -f get_endian_float32_arm$(EXEEXT)
+ $(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)
+ @rm -f get_endian_float32_big$(EXEEXT)
+ $(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)
+ @rm -f get_endian_float32_little$(EXEEXT)
+ $(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)
+ @rm -f get_endian_float64_arm$(EXEEXT)
+ $(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)
+ @rm -f get_endian_float64_big$(EXEEXT)
+ $(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)
+ @rm -f get_endian_float64_little$(EXEEXT)
+ $(LINK) $(get_endian_float64_little_OBJECTS) $(get_endian_float64_little_LDADD) $(LIBS)
+get_ff$(EXEEXT): $(get_ff_OBJECTS) $(get_ff_DEPENDENCIES)
+ @rm -f get_ff$(EXEEXT)
+ $(LINK) $(get_ff_OBJECTS) $(get_ff_LDADD) $(LIBS)
+get_float32$(EXEEXT): $(get_float32_OBJECTS) $(get_float32_DEPENDENCIES)
+ @rm -f get_float32$(EXEEXT)
+ $(LINK) $(get_float32_OBJECTS) $(get_float32_LDADD) $(LIBS)
+get_float64$(EXEEXT): $(get_float64_OBJECTS) $(get_float64_DEPENDENCIES)
+ @rm -f get_float64$(EXEEXT)
+ $(LINK) $(get_float64_OBJECTS) $(get_float64_LDADD) $(LIBS)
+get_foffs$(EXEEXT): $(get_foffs_OBJECTS) $(get_foffs_DEPENDENCIES)
+ @rm -f get_foffs$(EXEEXT)
+ $(LINK) $(get_foffs_OBJECTS) $(get_foffs_LDADD) $(LIBS)
+get_fs$(EXEEXT): $(get_fs_OBJECTS) $(get_fs_DEPENDENCIES)
+ @rm -f get_fs$(EXEEXT)
+ $(LINK) $(get_fs_OBJECTS) $(get_fs_LDADD) $(LIBS)
+get_int16$(EXEEXT): $(get_int16_OBJECTS) $(get_int16_DEPENDENCIES)
+ @rm -f get_int16$(EXEEXT)
+ $(LINK) $(get_int16_OBJECTS) $(get_int16_LDADD) $(LIBS)
+get_int32$(EXEEXT): $(get_int32_OBJECTS) $(get_int32_DEPENDENCIES)
+ @rm -f get_int32$(EXEEXT)
+ $(LINK) $(get_int32_OBJECTS) $(get_int32_LDADD) $(LIBS)
+get_int64$(EXEEXT): $(get_int64_OBJECTS) $(get_int64_DEPENDENCIES)
+ @rm -f get_int64$(EXEEXT)
+ $(LINK) $(get_int64_OBJECTS) $(get_int64_LDADD) $(LIBS)
+get_int8$(EXEEXT): $(get_int8_OBJECTS) $(get_int8_DEPENDENCIES)
+ @rm -f get_int8$(EXEEXT)
+ $(LINK) $(get_int8_OBJECTS) $(get_int8_LDADD) $(LIBS)
+get_invalid$(EXEEXT): $(get_invalid_OBJECTS) $(get_invalid_DEPENDENCIES)
+ @rm -f get_invalid$(EXEEXT)
+ $(LINK) $(get_invalid_OBJECTS) $(get_invalid_LDADD) $(LIBS)
+get_lincom1$(EXEEXT): $(get_lincom1_OBJECTS) $(get_lincom1_DEPENDENCIES)
+ @rm -f get_lincom1$(EXEEXT)
+ $(LINK) $(get_lincom1_OBJECTS) $(get_lincom1_LDADD) $(LIBS)
+get_lincom2$(EXEEXT): $(get_lincom2_OBJECTS) $(get_lincom2_DEPENDENCIES)
+ @rm -f get_lincom2$(EXEEXT)
+ $(LINK) $(get_lincom2_OBJECTS) $(get_lincom2_LDADD) $(LIBS)
+get_lincom3$(EXEEXT): $(get_lincom3_OBJECTS) $(get_lincom3_DEPENDENCIES)
+ @rm -f get_lincom3$(EXEEXT)
+ $(LINK) $(get_lincom3_OBJECTS) $(get_lincom3_LDADD) $(LIBS)
+get_lincom_noin$(EXEEXT): $(get_lincom_noin_OBJECTS) $(get_lincom_noin_DEPENDENCIES)
+ @rm -f get_lincom_noin$(EXEEXT)
+ $(LINK) $(get_lincom_noin_OBJECTS) $(get_lincom_noin_LDADD) $(LIBS)
+get_lincom_non$(EXEEXT): $(get_lincom_non_OBJECTS) $(get_lincom_non_DEPENDENCIES)
+ @rm -f get_lincom_non$(EXEEXT)
+ $(LINK) $(get_lincom_non_OBJECTS) $(get_lincom_non_LDADD) $(LIBS)
+get_linterp$(EXEEXT): $(get_linterp_OBJECTS) $(get_linterp_DEPENDENCIES)
+ @rm -f get_linterp$(EXEEXT)
+ $(LINK) $(get_linterp_OBJECTS) $(get_linterp_LDADD) $(LIBS)
+get_linterp_noin$(EXEEXT): $(get_linterp_noin_OBJECTS) $(get_linterp_noin_DEPENDENCIES)
+ @rm -f get_linterp_noin$(EXEEXT)
+ $(LINK) $(get_linterp_noin_OBJECTS) $(get_linterp_noin_LDADD) $(LIBS)
+get_linterp_notab$(EXEEXT): $(get_linterp_notab_OBJECTS) $(get_linterp_notab_DEPENDENCIES)
+ @rm -f get_linterp_notab$(EXEEXT)
+ $(LINK) $(get_linterp_notab_OBJECTS) $(get_linterp_notab_LDADD) $(LIBS)
+get_linterp_sort$(EXEEXT): $(get_linterp_sort_OBJECTS) $(get_linterp_sort_DEPENDENCIES)
+ @rm -f get_linterp_sort$(EXEEXT)
+ $(LINK) $(get_linterp_sort_OBJECTS) $(get_linterp_sort_LDADD) $(LIBS)
+get_multiply$(EXEEXT): $(get_multiply_OBJECTS) $(get_multiply_DEPENDENCIES)
+ @rm -f get_multiply$(EXEEXT)
+ $(LINK) $(get_multiply_OBJECTS) $(get_multiply_LDADD) $(LIBS)
+get_multiply_noin$(EXEEXT): $(get_multiply_noin_OBJECTS) $(get_multiply_noin_DEPENDENCIES)
+ @rm -f get_multiply_noin$(EXEEXT)
+ $(LINK) $(get_multiply_noin_OBJECTS) $(get_multiply_noin_LDADD) $(LIBS)
+get_nonexistent$(EXEEXT): $(get_nonexistent_OBJECTS) $(get_nonexistent_DEPENDENCIES)
+ @rm -f get_nonexistent$(EXEEXT)
+ $(LINK) $(get_nonexistent_OBJECTS) $(get_nonexistent_LDADD) $(LIBS)
+get_null$(EXEEXT): $(get_null_OBJECTS) $(get_null_DEPENDENCIES)
+ @rm -f get_null$(EXEEXT)
+ $(LINK) $(get_null_OBJECTS) $(get_null_LDADD) $(LIBS)
+get_off64$(EXEEXT): $(get_off64_OBJECTS) $(get_off64_DEPENDENCIES)
+ @rm -f get_off64$(EXEEXT)
+ $(LINK) $(get_off64_OBJECTS) $(get_off64_LDADD) $(LIBS)
+get_phase$(EXEEXT): $(get_phase_OBJECTS) $(get_phase_DEPENDENCIES)
+ @rm -f get_phase$(EXEEXT)
+ $(LINK) $(get_phase_OBJECTS) $(get_phase_LDADD) $(LIBS)
+get_polynom$(EXEEXT): $(get_polynom_OBJECTS) $(get_polynom_DEPENDENCIES)
+ @rm -f get_polynom$(EXEEXT)
+ $(LINK) $(get_polynom_OBJECTS) $(get_polynom_LDADD) $(LIBS)
+get_polynom_noin$(EXEEXT): $(get_polynom_noin_OBJECTS) $(get_polynom_noin_DEPENDENCIES)
+ @rm -f get_polynom_noin$(EXEEXT)
+ $(LINK) $(get_polynom_noin_OBJECTS) $(get_polynom_noin_LDADD) $(LIBS)
+get_recip$(EXEEXT): $(get_recip_OBJECTS) $(get_recip_DEPENDENCIES)
+ @rm -f get_recip$(EXEEXT)
+ $(LINK) $(get_recip_OBJECTS) $(get_recip_LDADD) $(LIBS)
+get_recip_const$(EXEEXT): $(get_recip_const_OBJECTS) $(get_recip_const_DEPENDENCIES)
+ @rm -f get_recip_const$(EXEEXT)
+ $(LINK) $(get_recip_const_OBJECTS) $(get_recip_const_LDADD) $(LIBS)
+get_recurse$(EXEEXT): $(get_recurse_OBJECTS) $(get_recurse_DEPENDENCIES)
+ @rm -f get_recurse$(EXEEXT)
+ $(LINK) $(get_recurse_OBJECTS) $(get_recurse_LDADD) $(LIBS)
+get_sbit$(EXEEXT): $(get_sbit_OBJECTS) $(get_sbit_DEPENDENCIES)
+ @rm -f get_sbit$(EXEEXT)
+ $(LINK) $(get_sbit_OBJECTS) $(get_sbit_LDADD) $(LIBS)
+get_sf$(EXEEXT): $(get_sf_OBJECTS) $(get_sf_DEPENDENCIES)
+ @rm -f get_sf$(EXEEXT)
+ $(LINK) $(get_sf_OBJECTS) $(get_sf_LDADD) $(LIBS)
+get_ss$(EXEEXT): $(get_ss_OBJECTS) $(get_ss_DEPENDENCIES)
+ @rm -f get_ss$(EXEEXT)
+ $(LINK) $(get_ss_OBJECTS) $(get_ss_LDADD) $(LIBS)
+get_type$(EXEEXT): $(get_type_OBJECTS) $(get_type_DEPENDENCIES)
+ @rm -f get_type$(EXEEXT)
+ $(LINK) $(get_type_OBJECTS) $(get_type_LDADD) $(LIBS)
+get_uint16$(EXEEXT): $(get_uint16_OBJECTS) $(get_uint16_DEPENDENCIES)
+ @rm -f get_uint16$(EXEEXT)
+ $(LINK) $(get_uint16_OBJECTS) $(get_uint16_LDADD) $(LIBS)
+get_uint32$(EXEEXT): $(get_uint32_OBJECTS) $(get_uint32_DEPENDENCIES)
+ @rm -f get_uint32$(EXEEXT)
+ $(LINK) $(get_uint32_OBJECTS) $(get_uint32_LDADD) $(LIBS)
+get_uint64$(EXEEXT): $(get_uint64_OBJECTS) $(get_uint64_DEPENDENCIES)
+ @rm -f get_uint64$(EXEEXT)
+ $(LINK) $(get_uint64_OBJECTS) $(get_uint64_LDADD) $(LIBS)
+get_zero$(EXEEXT): $(get_zero_OBJECTS) $(get_zero_DEPENDENCIES)
+ @rm -f get_zero$(EXEEXT)
+ $(LINK) $(get_zero_OBJECTS) $(get_zero_LDADD) $(LIBS)
+global_name$(EXEEXT): $(global_name_OBJECTS) $(global_name_DEPENDENCIES)
+ @rm -f global_name$(EXEEXT)
+ $(LINK) $(global_name_OBJECTS) $(global_name_LDADD) $(LIBS)
+global_ref$(EXEEXT): $(global_ref_OBJECTS) $(global_ref_DEPENDENCIES)
+ @rm -f global_ref$(EXEEXT)
+ $(LINK) $(global_ref_OBJECTS) $(global_ref_LDADD) $(LIBS)
+global_ref_empty$(EXEEXT): $(global_ref_empty_OBJECTS) $(global_ref_empty_DEPENDENCIES)
+ @rm -f global_ref_empty$(EXEEXT)
+ $(LINK) $(global_ref_empty_OBJECTS) $(global_ref_empty_LDADD) $(LIBS)
+global_ref_set$(EXEEXT): $(global_ref_set_OBJECTS) $(global_ref_set_DEPENDENCIES)
+ @rm -f global_ref_set$(EXEEXT)
+ $(LINK) $(global_ref_set_OBJECTS) $(global_ref_set_LDADD) $(LIBS)
+gzip_get$(EXEEXT): $(gzip_get_OBJECTS) $(gzip_get_DEPENDENCIES)
+ @rm -f gzip_get$(EXEEXT)
+ $(LINK) $(gzip_get_OBJECTS) $(gzip_get_LDADD) $(LIBS)
+gzip_get_get$(EXEEXT): $(gzip_get_get_OBJECTS) $(gzip_get_get_DEPENDENCIES)
+ @rm -f gzip_get_get$(EXEEXT)
+ $(LINK) $(gzip_get_get_OBJECTS) $(gzip_get_get_LDADD) $(LIBS)
+gzip_move_from$(EXEEXT): $(gzip_move_from_OBJECTS) $(gzip_move_from_DEPENDENCIES)
+ @rm -f gzip_move_from$(EXEEXT)
+ $(LINK) $(gzip_move_from_OBJECTS) $(gzip_move_from_LDADD) $(LIBS)
+gzip_nframes$(EXEEXT): $(gzip_nframes_OBJECTS) $(gzip_nframes_DEPENDENCIES)
+ @rm -f gzip_nframes$(EXEEXT)
+ $(LINK) $(gzip_nframes_OBJECTS) $(gzip_nframes_LDADD) $(LIBS)
+header_complex$(EXEEXT): $(header_complex_OBJECTS) $(header_complex_DEPENDENCIES)
+ @rm -f header_complex$(EXEEXT)
+ $(LINK) $(header_complex_OBJECTS) $(header_complex_LDADD) $(LIBS)
+include$(EXEEXT): $(include_OBJECTS) $(include_DEPENDENCIES)
+ @rm -f include$(EXEEXT)
+ $(LINK) $(include_OBJECTS) $(include_LDADD) $(LIBS)
+include_accmode$(EXEEXT): $(include_accmode_OBJECTS) $(include_accmode_DEPENDENCIES)
+ @rm -f include_accmode$(EXEEXT)
+ $(LINK) $(include_accmode_OBJECTS) $(include_accmode_LDADD) $(LIBS)
+include_auto$(EXEEXT): $(include_auto_OBJECTS) $(include_auto_DEPENDENCIES)
+ @rm -f include_auto$(EXEEXT)
+ $(LINK) $(include_auto_OBJECTS) $(include_auto_LDADD) $(LIBS)
+include_cb$(EXEEXT): $(include_cb_OBJECTS) $(include_cb_DEPENDENCIES)
+ @rm -f include_cb$(EXEEXT)
+ $(LINK) $(include_cb_OBJECTS) $(include_cb_LDADD) $(LIBS)
+include_creat$(EXEEXT): $(include_creat_OBJECTS) $(include_creat_DEPENDENCIES)
+ @rm -f include_creat$(EXEEXT)
+ $(LINK) $(include_creat_OBJECTS) $(include_creat_LDADD) $(LIBS)
+include_ignore$(EXEEXT): $(include_ignore_OBJECTS) $(include_ignore_DEPENDENCIES)
+ @rm -f include_ignore$(EXEEXT)
+ $(LINK) $(include_ignore_OBJECTS) $(include_ignore_LDADD) $(LIBS)
+include_index$(EXEEXT): $(include_index_OBJECTS) $(include_index_DEPENDENCIES)
+ @rm -f include_index$(EXEEXT)
+ $(LINK) $(include_index_OBJECTS) $(include_index_LDADD) $(LIBS)
+include_invalid$(EXEEXT): $(include_invalid_OBJECTS) $(include_invalid_DEPENDENCIES)
+ @rm -f include_invalid$(EXEEXT)
+ $(LINK) $(include_invalid_OBJECTS) $(include_invalid_LDADD) $(LIBS)
+include_nonexistent$(EXEEXT): $(include_nonexistent_OBJECTS) $(include_nonexistent_DEPENDENCIES)
+ @rm -f include_nonexistent$(EXEEXT)
+ $(LINK) $(include_nonexistent_OBJECTS) $(include_nonexistent_LDADD) $(LIBS)
+include_pc$(EXEEXT): $(include_pc_OBJECTS) $(include_pc_DEPENDENCIES)
+ @rm -f include_pc$(EXEEXT)
+ $(LINK) $(include_pc_OBJECTS) $(include_pc_LDADD) $(LIBS)
+include_ref$(EXEEXT): $(include_ref_OBJECTS) $(include_ref_DEPENDENCIES)
+ @rm -f include_ref$(EXEEXT)
+ $(LINK) $(include_ref_OBJECTS) $(include_ref_LDADD) $(LIBS)
+include_syntax$(EXEEXT): $(include_syntax_OBJECTS) $(include_syntax_DEPENDENCIES)
+ @rm -f include_syntax$(EXEEXT)
+ $(LINK) $(include_syntax_OBJECTS) $(include_syntax_LDADD) $(LIBS)
+index$(EXEEXT): $(index_OBJECTS) $(index_DEPENDENCIES)
+ @rm -f index$(EXEEXT)
+ $(LINK) $(index_OBJECTS) $(index_LDADD) $(LIBS)
+index_domain$(EXEEXT): $(index_domain_OBJECTS) $(index_domain_DEPENDENCIES)
+ @rm -f index_domain$(EXEEXT)
+ $(LINK) $(index_domain_OBJECTS) $(index_domain_LDADD) $(LIBS)
+index_range$(EXEEXT): $(index_range_OBJECTS) $(index_range_DEPENDENCIES)
+ @rm -f index_range$(EXEEXT)
+ $(LINK) $(index_range_OBJECTS) $(index_range_LDADD) $(LIBS)
+legacy_get$(EXEEXT): $(legacy_get_OBJECTS) $(legacy_get_DEPENDENCIES)
+ @rm -f legacy_get$(EXEEXT)
+ $(LINK) $(legacy_get_OBJECTS) $(legacy_get_LDADD) $(LIBS)
+legacy_get_put$(EXEEXT): $(legacy_get_put_OBJECTS) $(legacy_get_put_DEPENDENCIES)
+ @rm -f legacy_get_put$(EXEEXT)
+ $(LINK) $(legacy_get_put_OBJECTS) $(legacy_get_put_LDADD) $(LIBS)
+legacy_get_rofs$(EXEEXT): $(legacy_get_rofs_OBJECTS) $(legacy_get_rofs_DEPENDENCIES)
+ @rm -f legacy_get_rofs$(EXEEXT)
+ $(LINK) $(legacy_get_rofs_OBJECTS) $(legacy_get_rofs_LDADD) $(LIBS)
+legacy_nframes$(EXEEXT): $(legacy_nframes_OBJECTS) $(legacy_nframes_DEPENDENCIES)
+ @rm -f legacy_nframes$(EXEEXT)
+ $(LINK) $(legacy_nframes_OBJECTS) $(legacy_nframes_LDADD) $(LIBS)
+legacy_nonexistent$(EXEEXT): $(legacy_nonexistent_OBJECTS) $(legacy_nonexistent_DEPENDENCIES)
+ @rm -f legacy_nonexistent$(EXEEXT)
+ $(LINK) $(legacy_nonexistent_OBJECTS) $(legacy_nonexistent_LDADD) $(LIBS)
+legacy_put$(EXEEXT): $(legacy_put_OBJECTS) $(legacy_put_DEPENDENCIES)
+ @rm -f legacy_put$(EXEEXT)
+ $(LINK) $(legacy_put_OBJECTS) $(legacy_put_LDADD) $(LIBS)
+legacy_spf$(EXEEXT): $(legacy_spf_OBJECTS) $(legacy_spf_DEPENDENCIES)
+ @rm -f legacy_spf$(EXEEXT)
+ $(LINK) $(legacy_spf_OBJECTS) $(legacy_spf_LDADD) $(LIBS)
+lzma_get$(EXEEXT): $(lzma_get_OBJECTS) $(lzma_get_DEPENDENCIES)
+ @rm -f lzma_get$(EXEEXT)
+ $(LINK) $(lzma_get_OBJECTS) $(lzma_get_LDADD) $(LIBS)
+lzma_nframes$(EXEEXT): $(lzma_nframes_OBJECTS) $(lzma_nframes_DEPENDENCIES)
+ @rm -f lzma_nframes$(EXEEXT)
+ $(LINK) $(lzma_nframes_OBJECTS) $(lzma_nframes_LDADD) $(LIBS)
+madd$(EXEEXT): $(madd_OBJECTS) $(madd_DEPENDENCIES)
+ @rm -f madd$(EXEEXT)
+ $(LINK) $(madd_OBJECTS) $(madd_LDADD) $(LIBS)
+madd_bit$(EXEEXT): $(madd_bit_OBJECTS) $(madd_bit_DEPENDENCIES)
+ @rm -f madd_bit$(EXEEXT)
+ $(LINK) $(madd_bit_OBJECTS) $(madd_bit_LDADD) $(LIBS)
+madd_bit_invalid$(EXEEXT): $(madd_bit_invalid_OBJECTS) $(madd_bit_invalid_DEPENDENCIES)
+ @rm -f madd_bit_invalid$(EXEEXT)
+ $(LINK) $(madd_bit_invalid_OBJECTS) $(madd_bit_invalid_LDADD) $(LIBS)
+madd_carray$(EXEEXT): $(madd_carray_OBJECTS) $(madd_carray_DEPENDENCIES)
+ @rm -f madd_carray$(EXEEXT)
+ $(LINK) $(madd_carray_OBJECTS) $(madd_carray_LDADD) $(LIBS)
+madd_clincom$(EXEEXT): $(madd_clincom_OBJECTS) $(madd_clincom_DEPENDENCIES)
+ @rm -f madd_clincom$(EXEEXT)
+ $(LINK) $(madd_clincom_OBJECTS) $(madd_clincom_LDADD) $(LIBS)
+madd_const$(EXEEXT): $(madd_const_OBJECTS) $(madd_const_DEPENDENCIES)
+ @rm -f madd_const$(EXEEXT)
+ $(LINK) $(madd_const_OBJECTS) $(madd_const_LDADD) $(LIBS)
+madd_cpolynom$(EXEEXT): $(madd_cpolynom_OBJECTS) $(madd_cpolynom_DEPENDENCIES)
+ @rm -f madd_cpolynom$(EXEEXT)
+ $(LINK) $(madd_cpolynom_OBJECTS) $(madd_cpolynom_LDADD) $(LIBS)
+madd_crecip$(EXEEXT): $(madd_crecip_OBJECTS) $(madd_crecip_DEPENDENCIES)
+ @rm -f madd_crecip$(EXEEXT)
+ $(LINK) $(madd_crecip_OBJECTS) $(madd_crecip_LDADD) $(LIBS)
+madd_crecip89$(EXEEXT): $(madd_crecip89_OBJECTS) $(madd_crecip89_DEPENDENCIES)
+ @rm -f madd_crecip89$(EXEEXT)
+ $(LINK) $(madd_crecip89_OBJECTS) $(madd_crecip89_LDADD) $(LIBS)
+madd_divide$(EXEEXT): $(madd_divide_OBJECTS) $(madd_divide_DEPENDENCIES)
+ @rm -f madd_divide$(EXEEXT)
+ $(LINK) $(madd_divide_OBJECTS) $(madd_divide_LDADD) $(LIBS)
+madd_lincom$(EXEEXT): $(madd_lincom_OBJECTS) $(madd_lincom_DEPENDENCIES)
+ @rm -f madd_lincom$(EXEEXT)
+ $(LINK) $(madd_lincom_OBJECTS) $(madd_lincom_LDADD) $(LIBS)
+madd_lincom_invalid$(EXEEXT): $(madd_lincom_invalid_OBJECTS) $(madd_lincom_invalid_DEPENDENCIES)
+ @rm -f madd_lincom_invalid$(EXEEXT)
+ $(LINK) $(madd_lincom_invalid_OBJECTS) $(madd_lincom_invalid_LDADD) $(LIBS)
+madd_linterp$(EXEEXT): $(madd_linterp_OBJECTS) $(madd_linterp_DEPENDENCIES)
+ @rm -f madd_linterp$(EXEEXT)
+ $(LINK) $(madd_linterp_OBJECTS) $(madd_linterp_LDADD) $(LIBS)
+madd_linterp_invalid$(EXEEXT): $(madd_linterp_invalid_OBJECTS) $(madd_linterp_invalid_DEPENDENCIES)
+ @rm -f madd_linterp_invalid$(EXEEXT)
+ $(LINK) $(madd_linterp_invalid_OBJECTS) $(madd_linterp_invalid_LDADD) $(LIBS)
+madd_multiply$(EXEEXT): $(madd_multiply_OBJECTS) $(madd_multiply_DEPENDENCIES)
+ @rm -f madd_multiply$(EXEEXT)
+ $(LINK) $(madd_multiply_OBJECTS) $(madd_multiply_LDADD) $(LIBS)
+madd_multiply_invalid$(EXEEXT): $(madd_multiply_invalid_OBJECTS) $(madd_multiply_invalid_DEPENDENCIES)
+ @rm -f madd_multiply_invalid$(EXEEXT)
+ $(LINK) $(madd_multiply_invalid_OBJECTS) $(madd_multiply_invalid_LDADD) $(LIBS)
+madd_phase$(EXEEXT): $(madd_phase_OBJECTS) $(madd_phase_DEPENDENCIES)
+ @rm -f madd_phase$(EXEEXT)
+ $(LINK) $(madd_phase_OBJECTS) $(madd_phase_LDADD) $(LIBS)
+madd_phase_invalid$(EXEEXT): $(madd_phase_invalid_OBJECTS) $(madd_phase_invalid_DEPENDENCIES)
+ @rm -f madd_phase_invalid$(EXEEXT)
+ $(LINK) $(madd_phase_invalid_OBJECTS) $(madd_phase_invalid_LDADD) $(LIBS)
+madd_polynom$(EXEEXT): $(madd_polynom_OBJECTS) $(madd_polynom_DEPENDENCIES)
+ @rm -f madd_polynom$(EXEEXT)
+ $(LINK) $(madd_polynom_OBJECTS) $(madd_polynom_LDADD) $(LIBS)
+madd_recip$(EXEEXT): $(madd_recip_OBJECTS) $(madd_recip_DEPENDENCIES)
+ @rm -f madd_recip$(EXEEXT)
+ $(LINK) $(madd_recip_OBJECTS) $(madd_recip_LDADD) $(LIBS)
+madd_sbit$(EXEEXT): $(madd_sbit_OBJECTS) $(madd_sbit_DEPENDENCIES)
+ @rm -f madd_sbit$(EXEEXT)
+ $(LINK) $(madd_sbit_OBJECTS) $(madd_sbit_LDADD) $(LIBS)
+madd_spec$(EXEEXT): $(madd_spec_OBJECTS) $(madd_spec_DEPENDENCIES)
+ @rm -f madd_spec$(EXEEXT)
+ $(LINK) $(madd_spec_OBJECTS) $(madd_spec_LDADD) $(LIBS)
+madd_spec_directive$(EXEEXT): $(madd_spec_directive_OBJECTS) $(madd_spec_directive_DEPENDENCIES)
+ @rm -f madd_spec_directive$(EXEEXT)
+ $(LINK) $(madd_spec_directive_OBJECTS) $(madd_spec_directive_LDADD) $(LIBS)
+madd_spec_invalid$(EXEEXT): $(madd_spec_invalid_OBJECTS) $(madd_spec_invalid_DEPENDENCIES)
+ @rm -f madd_spec_invalid$(EXEEXT)
+ $(LINK) $(madd_spec_invalid_OBJECTS) $(madd_spec_invalid_LDADD) $(LIBS)
+madd_string$(EXEEXT): $(madd_string_OBJECTS) $(madd_string_DEPENDENCIES)
+ @rm -f madd_string$(EXEEXT)
+ $(LINK) $(madd_string_OBJECTS) $(madd_string_LDADD) $(LIBS)
+move$(EXEEXT): $(move_OBJECTS) $(move_DEPENDENCIES)
+ @rm -f move$(EXEEXT)
+ $(LINK) $(move_OBJECTS) $(move_LDADD) $(LIBS)
+move_data_enc_ar$(EXEEXT): $(move_data_enc_ar_OBJECTS) $(move_data_enc_ar_DEPENDENCIES)
+ @rm -f move_data_enc_ar$(EXEEXT)
+ $(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)
+ @rm -f move_data_enc_ra$(EXEEXT)
+ $(LINK) $(move_data_enc_ra_OBJECTS) $(move_data_enc_ra_LDADD) $(LIBS)
+move_data_endian$(EXEEXT): $(move_data_endian_OBJECTS) $(move_data_endian_DEPENDENCIES)
+ @rm -f move_data_endian$(EXEEXT)
+ $(LINK) $(move_data_endian_OBJECTS) $(move_data_endian_LDADD) $(LIBS)
+move_data_foffs$(EXEEXT): $(move_data_foffs_OBJECTS) $(move_data_foffs_DEPENDENCIES)
+ @rm -f move_data_foffs$(EXEEXT)
+ $(LINK) $(move_data_foffs_OBJECTS) $(move_data_foffs_LDADD) $(LIBS)
+move_data_nop$(EXEEXT): $(move_data_nop_OBJECTS) $(move_data_nop_DEPENDENCIES)
+ @rm -f move_data_nop$(EXEEXT)
+ $(LINK) $(move_data_nop_OBJECTS) $(move_data_nop_LDADD) $(LIBS)
+move_index$(EXEEXT): $(move_index_OBJECTS) $(move_index_DEPENDENCIES)
+ @rm -f move_index$(EXEEXT)
+ $(LINK) $(move_index_OBJECTS) $(move_index_LDADD) $(LIBS)
+move_meta$(EXEEXT): $(move_meta_OBJECTS) $(move_meta_DEPENDENCIES)
+ @rm -f move_meta$(EXEEXT)
+ $(LINK) $(move_meta_OBJECTS) $(move_meta_LDADD) $(LIBS)
+move_protect$(EXEEXT): $(move_protect_OBJECTS) $(move_protect_DEPENDENCIES)
+ @rm -f move_protect$(EXEEXT)
+ $(LINK) $(move_protect_OBJECTS) $(move_protect_LDADD) $(LIBS)
+move_subdir$(EXEEXT): $(move_subdir_OBJECTS) $(move_subdir_DEPENDENCIES)
+ @rm -f move_subdir$(EXEEXT)
+ $(LINK) $(move_subdir_OBJECTS) $(move_subdir_LDADD) $(LIBS)
+name$(EXEEXT): $(name_OBJECTS) $(name_DEPENDENCIES)
+ @rm -f name$(EXEEXT)
+ $(LINK) $(name_OBJECTS) $(name_LDADD) $(LIBS)
+name_move$(EXEEXT): $(name_move_OBJECTS) $(name_move_DEPENDENCIES)
+ @rm -f name_move$(EXEEXT)
+ $(LINK) $(name_move_OBJECTS) $(name_move_LDADD) $(LIBS)
+nfields$(EXEEXT): $(nfields_OBJECTS) $(nfields_DEPENDENCIES)
+ @rm -f nfields$(EXEEXT)
+ $(LINK) $(nfields_OBJECTS) $(nfields_LDADD) $(LIBS)
+nfields_invalid$(EXEEXT): $(nfields_invalid_OBJECTS) $(nfields_invalid_DEPENDENCIES)
+ @rm -f nfields_invalid$(EXEEXT)
+ $(LINK) $(nfields_invalid_OBJECTS) $(nfields_invalid_LDADD) $(LIBS)
+nfields_type$(EXEEXT): $(nfields_type_OBJECTS) $(nfields_type_DEPENDENCIES)
+ @rm -f nfields_type$(EXEEXT)
+ $(LINK) $(nfields_type_OBJECTS) $(nfields_type_LDADD) $(LIBS)
+nfields_type_invalid$(EXEEXT): $(nfields_type_invalid_OBJECTS) $(nfields_type_invalid_DEPENDENCIES)
+ @rm -f nfields_type_invalid$(EXEEXT)
+ $(LINK) $(nfields_type_invalid_OBJECTS) $(nfields_type_invalid_LDADD) $(LIBS)
+nfragments$(EXEEXT): $(nfragments_OBJECTS) $(nfragments_DEPENDENCIES)
+ @rm -f nfragments$(EXEEXT)
+ $(LINK) $(nfragments_OBJECTS) $(nfragments_LDADD) $(LIBS)
+nframes$(EXEEXT): $(nframes_OBJECTS) $(nframes_DEPENDENCIES)
+ @rm -f nframes$(EXEEXT)
+ $(LINK) $(nframes_OBJECTS) $(nframes_LDADD) $(LIBS)
+nframes64$(EXEEXT): $(nframes64_OBJECTS) $(nframes64_DEPENDENCIES)
+ @rm -f nframes64$(EXEEXT)
+ $(LINK) $(nframes64_OBJECTS) $(nframes64_LDADD) $(LIBS)
+nframes_empty$(EXEEXT): $(nframes_empty_OBJECTS) $(nframes_empty_DEPENDENCIES)
+ @rm -f nframes_empty$(EXEEXT)
+ $(LINK) $(nframes_empty_OBJECTS) $(nframes_empty_LDADD) $(LIBS)
+nframes_invalid$(EXEEXT): $(nframes_invalid_OBJECTS) $(nframes_invalid_DEPENDENCIES)
+ @rm -f nframes_invalid$(EXEEXT)
+ $(LINK) $(nframes_invalid_OBJECTS) $(nframes_invalid_LDADD) $(LIBS)
+nframes_off64$(EXEEXT): $(nframes_off64_OBJECTS) $(nframes_off64_DEPENDENCIES)
+ @rm -f nframes_off64$(EXEEXT)
+ $(LINK) $(nframes_off64_OBJECTS) $(nframes_off64_LDADD) $(LIBS)
+nframes_spf$(EXEEXT): $(nframes_spf_OBJECTS) $(nframes_spf_DEPENDENCIES)
+ @rm -f nframes_spf$(EXEEXT)
+ $(LINK) $(nframes_spf_OBJECTS) $(nframes_spf_LDADD) $(LIBS)
+nmeta$(EXEEXT): $(nmeta_OBJECTS) $(nmeta_DEPENDENCIES)
+ @rm -f nmeta$(EXEEXT)
+ $(LINK) $(nmeta_OBJECTS) $(nmeta_LDADD) $(LIBS)
+nmeta_invalid$(EXEEXT): $(nmeta_invalid_OBJECTS) $(nmeta_invalid_DEPENDENCIES)
+ @rm -f nmeta_invalid$(EXEEXT)
+ $(LINK) $(nmeta_invalid_OBJECTS) $(nmeta_invalid_LDADD) $(LIBS)
+nmeta_parent$(EXEEXT): $(nmeta_parent_OBJECTS) $(nmeta_parent_DEPENDENCIES)
+ @rm -f nmeta_parent$(EXEEXT)
+ $(LINK) $(nmeta_parent_OBJECTS) $(nmeta_parent_LDADD) $(LIBS)
+nmeta_type$(EXEEXT): $(nmeta_type_OBJECTS) $(nmeta_type_DEPENDENCIES)
+ @rm -f nmeta_type$(EXEEXT)
+ $(LINK) $(nmeta_type_OBJECTS) $(nmeta_type_LDADD) $(LIBS)
+nmeta_type_invalid$(EXEEXT): $(nmeta_type_invalid_OBJECTS) $(nmeta_type_invalid_DEPENDENCIES)
+ @rm -f nmeta_type_invalid$(EXEEXT)
+ $(LINK) $(nmeta_type_invalid_OBJECTS) $(nmeta_type_invalid_LDADD) $(LIBS)
+nmeta_type_parent$(EXEEXT): $(nmeta_type_parent_OBJECTS) $(nmeta_type_parent_DEPENDENCIES)
+ @rm -f nmeta_type_parent$(EXEEXT)
+ $(LINK) $(nmeta_type_parent_OBJECTS) $(nmeta_type_parent_LDADD) $(LIBS)
+nmeta_vectors$(EXEEXT): $(nmeta_vectors_OBJECTS) $(nmeta_vectors_DEPENDENCIES)
+ @rm -f nmeta_vectors$(EXEEXT)
+ $(LINK) $(nmeta_vectors_OBJECTS) $(nmeta_vectors_LDADD) $(LIBS)
+nmeta_vectors_del$(EXEEXT): $(nmeta_vectors_del_OBJECTS) $(nmeta_vectors_del_DEPENDENCIES)
+ @rm -f nmeta_vectors_del$(EXEEXT)
+ $(LINK) $(nmeta_vectors_del_OBJECTS) $(nmeta_vectors_del_LDADD) $(LIBS)
+nmeta_vectors_invalid$(EXEEXT): $(nmeta_vectors_invalid_OBJECTS) $(nmeta_vectors_invalid_DEPENDENCIES)
+ @rm -f nmeta_vectors_invalid$(EXEEXT)
+ $(LINK) $(nmeta_vectors_invalid_OBJECTS) $(nmeta_vectors_invalid_LDADD) $(LIBS)
+nmeta_vectors_parent$(EXEEXT): $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_parent_DEPENDENCIES)
+ @rm -f nmeta_vectors_parent$(EXEEXT)
+ $(LINK) $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_parent_LDADD) $(LIBS)
+nvectors$(EXEEXT): $(nvectors_OBJECTS) $(nvectors_DEPENDENCIES)
+ @rm -f nvectors$(EXEEXT)
+ $(LINK) $(nvectors_OBJECTS) $(nvectors_LDADD) $(LIBS)
+nvectors_invalid$(EXEEXT): $(nvectors_invalid_OBJECTS) $(nvectors_invalid_DEPENDENCIES)
+ @rm -f nvectors_invalid$(EXEEXT)
+ $(LINK) $(nvectors_invalid_OBJECTS) $(nvectors_invalid_LDADD) $(LIBS)
+open$(EXEEXT): $(open_OBJECTS) $(open_DEPENDENCIES)
+ @rm -f open$(EXEEXT)
+ $(LINK) $(open_OBJECTS) $(open_LDADD) $(LIBS)
+open_cb_abort$(EXEEXT): $(open_cb_abort_OBJECTS) $(open_cb_abort_DEPENDENCIES)
+ @rm -f open_cb_abort$(EXEEXT)
+ $(LINK) $(open_cb_abort_OBJECTS) $(open_cb_abort_LDADD) $(LIBS)
+open_cb_cont$(EXEEXT): $(open_cb_cont_OBJECTS) $(open_cb_cont_DEPENDENCIES)
+ @rm -f open_cb_cont$(EXEEXT)
+ $(LINK) $(open_cb_cont_OBJECTS) $(open_cb_cont_LDADD) $(LIBS)
+open_cb_ignore$(EXEEXT): $(open_cb_ignore_OBJECTS) $(open_cb_ignore_DEPENDENCIES)
+ @rm -f open_cb_ignore$(EXEEXT)
+ $(LINK) $(open_cb_ignore_OBJECTS) $(open_cb_ignore_LDADD) $(LIBS)
+open_cb_invalid$(EXEEXT): $(open_cb_invalid_OBJECTS) $(open_cb_invalid_DEPENDENCIES)
+ @rm -f open_cb_invalid$(EXEEXT)
+ $(LINK) $(open_cb_invalid_OBJECTS) $(open_cb_invalid_LDADD) $(LIBS)
+open_cb_rescan$(EXEEXT): $(open_cb_rescan_OBJECTS) $(open_cb_rescan_DEPENDENCIES)
+ @rm -f open_cb_rescan$(EXEEXT)
+ $(LINK) $(open_cb_rescan_OBJECTS) $(open_cb_rescan_LDADD) $(LIBS)
+open_eaccess$(EXEEXT): $(open_eaccess_OBJECTS) $(open_eaccess_DEPENDENCIES)
+ @rm -f open_eaccess$(EXEEXT)
+ $(LINK) $(open_eaccess_OBJECTS) $(open_eaccess_LDADD) $(LIBS)
+open_nonexistent$(EXEEXT): $(open_nonexistent_OBJECTS) $(open_nonexistent_DEPENDENCIES)
+ @rm -f open_nonexistent$(EXEEXT)
+ $(LINK) $(open_nonexistent_OBJECTS) $(open_nonexistent_LDADD) $(LIBS)
+open_notdirfile$(EXEEXT): $(open_notdirfile_OBJECTS) $(open_notdirfile_DEPENDENCIES)
+ @rm -f open_notdirfile$(EXEEXT)
+ $(LINK) $(open_notdirfile_OBJECTS) $(open_notdirfile_LDADD) $(LIBS)
+parent$(EXEEXT): $(parent_OBJECTS) $(parent_DEPENDENCIES)
+ @rm -f parent$(EXEEXT)
+ $(LINK) $(parent_OBJECTS) $(parent_LDADD) $(LIBS)
+parse_badline$(EXEEXT): $(parse_badline_OBJECTS) $(parse_badline_DEPENDENCIES)
+ @rm -f parse_badline$(EXEEXT)
+ $(LINK) $(parse_badline_OBJECTS) $(parse_badline_LDADD) $(LIBS)
+parse_bit$(EXEEXT): $(parse_bit_OBJECTS) $(parse_bit_DEPENDENCIES)
+ @rm -f parse_bit$(EXEEXT)
+ $(LINK) $(parse_bit_OBJECTS) $(parse_bit_LDADD) $(LIBS)
+parse_bit4$(EXEEXT): $(parse_bit4_OBJECTS) $(parse_bit4_DEPENDENCIES)
+ @rm -f parse_bit4$(EXEEXT)
+ $(LINK) $(parse_bit4_OBJECTS) $(parse_bit4_LDADD) $(LIBS)
+parse_bit_bitnum$(EXEEXT): $(parse_bit_bitnum_OBJECTS) $(parse_bit_bitnum_DEPENDENCIES)
+ @rm -f parse_bit_bitnum$(EXEEXT)
+ $(LINK) $(parse_bit_bitnum_OBJECTS) $(parse_bit_bitnum_LDADD) $(LIBS)
+parse_bit_bitsize$(EXEEXT): $(parse_bit_bitsize_OBJECTS) $(parse_bit_bitsize_DEPENDENCIES)
+ @rm -f parse_bit_bitsize$(EXEEXT)
+ $(LINK) $(parse_bit_bitsize_OBJECTS) $(parse_bit_bitsize_LDADD) $(LIBS)
+parse_bit_ncols$(EXEEXT): $(parse_bit_ncols_OBJECTS) $(parse_bit_ncols_DEPENDENCIES)
+ @rm -f parse_bit_ncols$(EXEEXT)
+ $(LINK) $(parse_bit_ncols_OBJECTS) $(parse_bit_ncols_LDADD) $(LIBS)
+parse_bit_numbits$(EXEEXT): $(parse_bit_numbits_OBJECTS) $(parse_bit_numbits_DEPENDENCIES)
+ @rm -f parse_bit_numbits$(EXEEXT)
+ $(LINK) $(parse_bit_numbits_OBJECTS) $(parse_bit_numbits_LDADD) $(LIBS)
+parse_bit_scalar$(EXEEXT): $(parse_bit_scalar_OBJECTS) $(parse_bit_scalar_DEPENDENCIES)
+ @rm -f parse_bit_scalar$(EXEEXT)
+ $(LINK) $(parse_bit_scalar_OBJECTS) $(parse_bit_scalar_LDADD) $(LIBS)
+parse_carray$(EXEEXT): $(parse_carray_OBJECTS) $(parse_carray_DEPENDENCIES)
+ @rm -f parse_carray$(EXEEXT)
+ $(LINK) $(parse_carray_OBJECTS) $(parse_carray_LDADD) $(LIBS)
+parse_carray_long$(EXEEXT): $(parse_carray_long_OBJECTS) $(parse_carray_long_DEPENDENCIES)
+ @rm -f parse_carray_long$(EXEEXT)
+ $(LINK) $(parse_carray_long_OBJECTS) $(parse_carray_long_LDADD) $(LIBS)
+parse_const$(EXEEXT): $(parse_const_OBJECTS) $(parse_const_DEPENDENCIES)
+ @rm -f parse_const$(EXEEXT)
+ $(LINK) $(parse_const_OBJECTS) $(parse_const_LDADD) $(LIBS)
+parse_const_ncols$(EXEEXT): $(parse_const_ncols_OBJECTS) $(parse_const_ncols_DEPENDENCIES)
+ @rm -f parse_const_ncols$(EXEEXT)
+ $(LINK) $(parse_const_ncols_OBJECTS) $(parse_const_ncols_LDADD) $(LIBS)
+parse_divide$(EXEEXT): $(parse_divide_OBJECTS) $(parse_divide_DEPENDENCIES)
+ @rm -f parse_divide$(EXEEXT)
+ $(LINK) $(parse_divide_OBJECTS) $(parse_divide_LDADD) $(LIBS)
+parse_duplicate$(EXEEXT): $(parse_duplicate_OBJECTS) $(parse_duplicate_DEPENDENCIES)
+ @rm -f parse_duplicate$(EXEEXT)
+ $(LINK) $(parse_duplicate_OBJECTS) $(parse_duplicate_LDADD) $(LIBS)
+parse_duplicate_ignore$(EXEEXT): $(parse_duplicate_ignore_OBJECTS) $(parse_duplicate_ignore_DEPENDENCIES)
+ @rm -f parse_duplicate_ignore$(EXEEXT)
+ $(LINK) $(parse_duplicate_ignore_OBJECTS) $(parse_duplicate_ignore_LDADD) $(LIBS)
+parse_endian_bad$(EXEEXT): $(parse_endian_bad_OBJECTS) $(parse_endian_bad_DEPENDENCIES)
+ @rm -f parse_endian_bad$(EXEEXT)
+ $(LINK) $(parse_endian_bad_OBJECTS) $(parse_endian_bad_LDADD) $(LIBS)
+parse_endian_big$(EXEEXT): $(parse_endian_big_OBJECTS) $(parse_endian_big_DEPENDENCIES)
+ @rm -f parse_endian_big$(EXEEXT)
+ $(LINK) $(parse_endian_big_OBJECTS) $(parse_endian_big_LDADD) $(LIBS)
+parse_endian_force$(EXEEXT): $(parse_endian_force_OBJECTS) $(parse_endian_force_DEPENDENCIES)
+ @rm -f parse_endian_force$(EXEEXT)
+ $(LINK) $(parse_endian_force_OBJECTS) $(parse_endian_force_LDADD) $(LIBS)
+parse_endian_little$(EXEEXT): $(parse_endian_little_OBJECTS) $(parse_endian_little_DEPENDENCIES)
+ @rm -f parse_endian_little$(EXEEXT)
+ $(LINK) $(parse_endian_little_OBJECTS) $(parse_endian_little_LDADD) $(LIBS)
+parse_endian_slash$(EXEEXT): $(parse_endian_slash_OBJECTS) $(parse_endian_slash_DEPENDENCIES)
+ @rm -f parse_endian_slash$(EXEEXT)
+ $(LINK) $(parse_endian_slash_OBJECTS) $(parse_endian_slash_LDADD) $(LIBS)
+parse_eol$(EXEEXT): $(parse_eol_OBJECTS) $(parse_eol_DEPENDENCIES)
+ @rm -f parse_eol$(EXEEXT)
+ $(LINK) $(parse_eol_OBJECTS) $(parse_eol_LDADD) $(LIBS)
+parse_foffs$(EXEEXT): $(parse_foffs_OBJECTS) $(parse_foffs_DEPENDENCIES)
+ @rm -f parse_foffs$(EXEEXT)
+ $(LINK) $(parse_foffs_OBJECTS) $(parse_foffs_LDADD) $(LIBS)
+parse_foffs_include$(EXEEXT): $(parse_foffs_include_OBJECTS) $(parse_foffs_include_DEPENDENCIES)
+ @rm -f parse_foffs_include$(EXEEXT)
+ $(LINK) $(parse_foffs_include_OBJECTS) $(parse_foffs_include_LDADD) $(LIBS)
+parse_foffs_slash$(EXEEXT): $(parse_foffs_slash_OBJECTS) $(parse_foffs_slash_DEPENDENCIES)
+ @rm -f parse_foffs_slash$(EXEEXT)
+ $(LINK) $(parse_foffs_slash_OBJECTS) $(parse_foffs_slash_LDADD) $(LIBS)
+parse_include$(EXEEXT): $(parse_include_OBJECTS) $(parse_include_DEPENDENCIES)
+ @rm -f parse_include$(EXEEXT)
+ $(LINK) $(parse_include_OBJECTS) $(parse_include_LDADD) $(LIBS)
+parse_include_absolute$(EXEEXT): $(parse_include_absolute_OBJECTS) $(parse_include_absolute_DEPENDENCIES)
+ @rm -f parse_include_absolute$(EXEEXT)
+ $(LINK) $(parse_include_absolute_OBJECTS) $(parse_include_absolute_LDADD) $(LIBS)
+parse_include_absrel$(EXEEXT): $(parse_include_absrel_OBJECTS) $(parse_include_absrel_DEPENDENCIES)
+ @rm -f parse_include_absrel$(EXEEXT)
+ $(LINK) $(parse_include_absrel_OBJECTS) $(parse_include_absrel_LDADD) $(LIBS)
+parse_include_nonexistent$(EXEEXT): $(parse_include_nonexistent_OBJECTS) $(parse_include_nonexistent_DEPENDENCIES)
+ @rm -f parse_include_nonexistent$(EXEEXT)
+ $(LINK) $(parse_include_nonexistent_OBJECTS) $(parse_include_nonexistent_LDADD) $(LIBS)
+parse_include_relabs$(EXEEXT): $(parse_include_relabs_OBJECTS) $(parse_include_relabs_DEPENDENCIES)
+ @rm -f parse_include_relabs$(EXEEXT)
+ $(LINK) $(parse_include_relabs_OBJECTS) $(parse_include_relabs_LDADD) $(LIBS)
+parse_include_relrel$(EXEEXT): $(parse_include_relrel_OBJECTS) $(parse_include_relrel_DEPENDENCIES)
+ @rm -f parse_include_relrel$(EXEEXT)
+ $(LINK) $(parse_include_relrel_OBJECTS) $(parse_include_relrel_LDADD) $(LIBS)
+parse_include_slash$(EXEEXT): $(parse_include_slash_OBJECTS) $(parse_include_slash_DEPENDENCIES)
+ @rm -f parse_include_slash$(EXEEXT)
+ $(LINK) $(parse_include_slash_OBJECTS) $(parse_include_slash_LDADD) $(LIBS)
+parse_index$(EXEEXT): $(parse_index_OBJECTS) $(parse_index_DEPENDENCIES)
+ @rm -f parse_index$(EXEEXT)
+ $(LINK) $(parse_index_OBJECTS) $(parse_index_LDADD) $(LIBS)
+parse_lincom$(EXEEXT): $(parse_lincom_OBJECTS) $(parse_lincom_DEPENDENCIES)
+ @rm -f parse_lincom$(EXEEXT)
+ $(LINK) $(parse_lincom_OBJECTS) $(parse_lincom_LDADD) $(LIBS)
+parse_lincom_ncols1$(EXEEXT): $(parse_lincom_ncols1_OBJECTS) $(parse_lincom_ncols1_DEPENDENCIES)
+ @rm -f parse_lincom_ncols1$(EXEEXT)
+ $(LINK) $(parse_lincom_ncols1_OBJECTS) $(parse_lincom_ncols1_LDADD) $(LIBS)
+parse_lincom_ncols2$(EXEEXT): $(parse_lincom_ncols2_OBJECTS) $(parse_lincom_ncols2_DEPENDENCIES)
+ @rm -f parse_lincom_ncols2$(EXEEXT)
+ $(LINK) $(parse_lincom_ncols2_OBJECTS) $(parse_lincom_ncols2_LDADD) $(LIBS)
+parse_lincom_nfields$(EXEEXT): $(parse_lincom_nfields_OBJECTS) $(parse_lincom_nfields_DEPENDENCIES)
+ @rm -f parse_lincom_nfields$(EXEEXT)
+ $(LINK) $(parse_lincom_nfields_OBJECTS) $(parse_lincom_nfields_LDADD) $(LIBS)
+parse_lincom_nofields$(EXEEXT): $(parse_lincom_nofields_OBJECTS) $(parse_lincom_nofields_DEPENDENCIES)
+ @rm -f parse_lincom_nofields$(EXEEXT)
+ $(LINK) $(parse_lincom_nofields_OBJECTS) $(parse_lincom_nofields_LDADD) $(LIBS)
+parse_lincom_non$(EXEEXT): $(parse_lincom_non_OBJECTS) $(parse_lincom_non_DEPENDENCIES)
+ @rm -f parse_lincom_non$(EXEEXT)
+ $(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)
+ @rm -f parse_lincom_non_ncols$(EXEEXT)
+ $(LINK) $(parse_lincom_non_ncols_OBJECTS) $(parse_lincom_non_ncols_LDADD) $(LIBS)
+parse_lincom_scalar$(EXEEXT): $(parse_lincom_scalar_OBJECTS) $(parse_lincom_scalar_DEPENDENCIES)
+ @rm -f parse_lincom_scalar$(EXEEXT)
+ $(LINK) $(parse_lincom_scalar_OBJECTS) $(parse_lincom_scalar_LDADD) $(LIBS)
+parse_linterp$(EXEEXT): $(parse_linterp_OBJECTS) $(parse_linterp_DEPENDENCIES)
+ @rm -f parse_linterp$(EXEEXT)
+ $(LINK) $(parse_linterp_OBJECTS) $(parse_linterp_LDADD) $(LIBS)
+parse_linterp_ncols$(EXEEXT): $(parse_linterp_ncols_OBJECTS) $(parse_linterp_ncols_DEPENDENCIES)
+ @rm -f parse_linterp_ncols$(EXEEXT)
+ $(LINK) $(parse_linterp_ncols_OBJECTS) $(parse_linterp_ncols_LDADD) $(LIBS)
+parse_meta$(EXEEXT): $(parse_meta_OBJECTS) $(parse_meta_DEPENDENCIES)
+ @rm -f parse_meta$(EXEEXT)
+ $(LINK) $(parse_meta_OBJECTS) $(parse_meta_LDADD) $(LIBS)
+parse_meta_implicit$(EXEEXT): $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_DEPENDENCIES)
+ @rm -f parse_meta_implicit$(EXEEXT)
+ $(LINK) $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_LDADD) $(LIBS)
+parse_meta_implicit2$(EXEEXT): $(parse_meta_implicit2_OBJECTS) $(parse_meta_implicit2_DEPENDENCIES)
+ @rm -f parse_meta_implicit2$(EXEEXT)
+ $(LINK) $(parse_meta_implicit2_OBJECTS) $(parse_meta_implicit2_LDADD) $(LIBS)
+parse_meta_index$(EXEEXT): $(parse_meta_index_OBJECTS) $(parse_meta_index_DEPENDENCIES)
+ @rm -f parse_meta_index$(EXEEXT)
+ $(LINK) $(parse_meta_index_OBJECTS) $(parse_meta_index_LDADD) $(LIBS)
+parse_meta_index2$(EXEEXT): $(parse_meta_index2_OBJECTS) $(parse_meta_index2_DEPENDENCIES)
+ @rm -f parse_meta_index2$(EXEEXT)
+ $(LINK) $(parse_meta_index2_OBJECTS) $(parse_meta_index2_LDADD) $(LIBS)
+parse_meta_parent$(EXEEXT): $(parse_meta_parent_OBJECTS) $(parse_meta_parent_DEPENDENCIES)
+ @rm -f parse_meta_parent$(EXEEXT)
+ $(LINK) $(parse_meta_parent_OBJECTS) $(parse_meta_parent_LDADD) $(LIBS)
+parse_meta_raw$(EXEEXT): $(parse_meta_raw_OBJECTS) $(parse_meta_raw_DEPENDENCIES)
+ @rm -f parse_meta_raw$(EXEEXT)
+ $(LINK) $(parse_meta_raw_OBJECTS) $(parse_meta_raw_LDADD) $(LIBS)
+parse_multiply$(EXEEXT): $(parse_multiply_OBJECTS) $(parse_multiply_DEPENDENCIES)
+ @rm -f parse_multiply$(EXEEXT)
+ $(LINK) $(parse_multiply_OBJECTS) $(parse_multiply_LDADD) $(LIBS)
+parse_multiply_ncols$(EXEEXT): $(parse_multiply_ncols_OBJECTS) $(parse_multiply_ncols_DEPENDENCIES)
+ @rm -f parse_multiply_ncols$(EXEEXT)
+ $(LINK) $(parse_multiply_ncols_OBJECTS) $(parse_multiply_ncols_LDADD) $(LIBS)
+parse_name$(EXEEXT): $(parse_name_OBJECTS) $(parse_name_DEPENDENCIES)
+ @rm -f parse_name$(EXEEXT)
+ $(LINK) $(parse_name_OBJECTS) $(parse_name_LDADD) $(LIBS)
+parse_name_dot$(EXEEXT): $(parse_name_dot_OBJECTS) $(parse_name_dot_DEPENDENCIES)
+ @rm -f parse_name_dot$(EXEEXT)
+ $(LINK) $(parse_name_dot_OBJECTS) $(parse_name_dot_LDADD) $(LIBS)
+parse_name_ext$(EXEEXT): $(parse_name_ext_OBJECTS) $(parse_name_ext_DEPENDENCIES)
+ @rm -f parse_name_ext$(EXEEXT)
+ $(LINK) $(parse_name_ext_OBJECTS) $(parse_name_ext_LDADD) $(LIBS)
+parse_name_pedantic$(EXEEXT): $(parse_name_pedantic_OBJECTS) $(parse_name_pedantic_DEPENDENCIES)
+ @rm -f parse_name_pedantic$(EXEEXT)
+ $(LINK) $(parse_name_pedantic_OBJECTS) $(parse_name_pedantic_LDADD) $(LIBS)
+parse_ncols$(EXEEXT): $(parse_ncols_OBJECTS) $(parse_ncols_DEPENDENCIES)
+ @rm -f parse_ncols$(EXEEXT)
+ $(LINK) $(parse_ncols_OBJECTS) $(parse_ncols_LDADD) $(LIBS)
+parse_phase$(EXEEXT): $(parse_phase_OBJECTS) $(parse_phase_DEPENDENCIES)
+ @rm -f parse_phase$(EXEEXT)
+ $(LINK) $(parse_phase_OBJECTS) $(parse_phase_LDADD) $(LIBS)
+parse_phase_ncols$(EXEEXT): $(parse_phase_ncols_OBJECTS) $(parse_phase_ncols_DEPENDENCIES)
+ @rm -f parse_phase_ncols$(EXEEXT)
+ $(LINK) $(parse_phase_ncols_OBJECTS) $(parse_phase_ncols_LDADD) $(LIBS)
+parse_phase_scalar$(EXEEXT): $(parse_phase_scalar_OBJECTS) $(parse_phase_scalar_DEPENDENCIES)
+ @rm -f parse_phase_scalar$(EXEEXT)
+ $(LINK) $(parse_phase_scalar_OBJECTS) $(parse_phase_scalar_LDADD) $(LIBS)
+parse_polynom$(EXEEXT): $(parse_polynom_OBJECTS) $(parse_polynom_DEPENDENCIES)
+ @rm -f parse_polynom$(EXEEXT)
+ $(LINK) $(parse_polynom_OBJECTS) $(parse_polynom_LDADD) $(LIBS)
+parse_polynom_ncols1$(EXEEXT): $(parse_polynom_ncols1_OBJECTS) $(parse_polynom_ncols1_DEPENDENCIES)
+ @rm -f parse_polynom_ncols1$(EXEEXT)
+ $(LINK) $(parse_polynom_ncols1_OBJECTS) $(parse_polynom_ncols1_LDADD) $(LIBS)
+parse_polynom_ncols2$(EXEEXT): $(parse_polynom_ncols2_OBJECTS) $(parse_polynom_ncols2_DEPENDENCIES)
+ @rm -f parse_polynom_ncols2$(EXEEXT)
+ $(LINK) $(parse_polynom_ncols2_OBJECTS) $(parse_polynom_ncols2_LDADD) $(LIBS)
+parse_polynom_scalar$(EXEEXT): $(parse_polynom_scalar_OBJECTS) $(parse_polynom_scalar_DEPENDENCIES)
+ @rm -f parse_polynom_scalar$(EXEEXT)
+ $(LINK) $(parse_polynom_scalar_OBJECTS) $(parse_polynom_scalar_LDADD) $(LIBS)
+parse_protect_all$(EXEEXT): $(parse_protect_all_OBJECTS) $(parse_protect_all_DEPENDENCIES)
+ @rm -f parse_protect_all$(EXEEXT)
+ $(LINK) $(parse_protect_all_OBJECTS) $(parse_protect_all_LDADD) $(LIBS)
+parse_protect_bad$(EXEEXT): $(parse_protect_bad_OBJECTS) $(parse_protect_bad_DEPENDENCIES)
+ @rm -f parse_protect_bad$(EXEEXT)
+ $(LINK) $(parse_protect_bad_OBJECTS) $(parse_protect_bad_LDADD) $(LIBS)
+parse_protect_data$(EXEEXT): $(parse_protect_data_OBJECTS) $(parse_protect_data_DEPENDENCIES)
+ @rm -f parse_protect_data$(EXEEXT)
+ $(LINK) $(parse_protect_data_OBJECTS) $(parse_protect_data_LDADD) $(LIBS)
+parse_protect_format$(EXEEXT): $(parse_protect_format_OBJECTS) $(parse_protect_format_DEPENDENCIES)
+ @rm -f parse_protect_format$(EXEEXT)
+ $(LINK) $(parse_protect_format_OBJECTS) $(parse_protect_format_LDADD) $(LIBS)
+parse_protect_none$(EXEEXT): $(parse_protect_none_OBJECTS) $(parse_protect_none_DEPENDENCIES)
+ @rm -f parse_protect_none$(EXEEXT)
+ $(LINK) $(parse_protect_none_OBJECTS) $(parse_protect_none_LDADD) $(LIBS)
+parse_quote$(EXEEXT): $(parse_quote_OBJECTS) $(parse_quote_DEPENDENCIES)
+ @rm -f parse_quote$(EXEEXT)
+ $(LINK) $(parse_quote_OBJECTS) $(parse_quote_LDADD) $(LIBS)
+parse_quote_mismatch$(EXEEXT): $(parse_quote_mismatch_OBJECTS) $(parse_quote_mismatch_DEPENDENCIES)
+ @rm -f parse_quote_mismatch$(EXEEXT)
+ $(LINK) $(parse_quote_mismatch_OBJECTS) $(parse_quote_mismatch_LDADD) $(LIBS)
+parse_raw$(EXEEXT): $(parse_raw_OBJECTS) $(parse_raw_DEPENDENCIES)
+ @rm -f parse_raw$(EXEEXT)
+ $(LINK) $(parse_raw_OBJECTS) $(parse_raw_LDADD) $(LIBS)
+parse_raw_char$(EXEEXT): $(parse_raw_char_OBJECTS) $(parse_raw_char_DEPENDENCIES)
+ @rm -f parse_raw_char$(EXEEXT)
+ $(LINK) $(parse_raw_char_OBJECTS) $(parse_raw_char_LDADD) $(LIBS)
+parse_raw_ncols$(EXEEXT): $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_DEPENDENCIES)
+ @rm -f parse_raw_ncols$(EXEEXT)
+ $(LINK) $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_LDADD) $(LIBS)
+parse_raw_scalar$(EXEEXT): $(parse_raw_scalar_OBJECTS) $(parse_raw_scalar_DEPENDENCIES)
+ @rm -f parse_raw_scalar$(EXEEXT)
+ $(LINK) $(parse_raw_scalar_OBJECTS) $(parse_raw_scalar_LDADD) $(LIBS)
+parse_raw_spf$(EXEEXT): $(parse_raw_spf_OBJECTS) $(parse_raw_spf_DEPENDENCIES)
+ @rm -f parse_raw_spf$(EXEEXT)
+ $(LINK) $(parse_raw_spf_OBJECTS) $(parse_raw_spf_LDADD) $(LIBS)
+parse_raw_type$(EXEEXT): $(parse_raw_type_OBJECTS) $(parse_raw_type_DEPENDENCIES)
+ @rm -f parse_raw_type$(EXEEXT)
+ $(LINK) $(parse_raw_type_OBJECTS) $(parse_raw_type_LDADD) $(LIBS)
+parse_recip$(EXEEXT): $(parse_recip_OBJECTS) $(parse_recip_DEPENDENCIES)
+ @rm -f parse_recip$(EXEEXT)
+ $(LINK) $(parse_recip_OBJECTS) $(parse_recip_LDADD) $(LIBS)
+parse_ref$(EXEEXT): $(parse_ref_OBJECTS) $(parse_ref_DEPENDENCIES)
+ @rm -f parse_ref$(EXEEXT)
+ $(LINK) $(parse_ref_OBJECTS) $(parse_ref_LDADD) $(LIBS)
+parse_ref_nonexistent$(EXEEXT): $(parse_ref_nonexistent_OBJECTS) $(parse_ref_nonexistent_DEPENDENCIES)
+ @rm -f parse_ref_nonexistent$(EXEEXT)
+ $(LINK) $(parse_ref_nonexistent_OBJECTS) $(parse_ref_nonexistent_LDADD) $(LIBS)
+parse_sbit$(EXEEXT): $(parse_sbit_OBJECTS) $(parse_sbit_DEPENDENCIES)
+ @rm -f parse_sbit$(EXEEXT)
+ $(LINK) $(parse_sbit_OBJECTS) $(parse_sbit_LDADD) $(LIBS)
+parse_sort$(EXEEXT): $(parse_sort_OBJECTS) $(parse_sort_DEPENDENCIES)
+ @rm -f parse_sort$(EXEEXT)
+ $(LINK) $(parse_sort_OBJECTS) $(parse_sort_LDADD) $(LIBS)
+parse_string$(EXEEXT): $(parse_string_OBJECTS) $(parse_string_DEPENDENCIES)
+ @rm -f parse_string$(EXEEXT)
+ $(LINK) $(parse_string_OBJECTS) $(parse_string_LDADD) $(LIBS)
+parse_string_ncols$(EXEEXT): $(parse_string_ncols_OBJECTS) $(parse_string_ncols_DEPENDENCIES)
+ @rm -f parse_string_ncols$(EXEEXT)
+ $(LINK) $(parse_string_ncols_OBJECTS) $(parse_string_ncols_LDADD) $(LIBS)
+parse_string_null$(EXEEXT): $(parse_string_null_OBJECTS) $(parse_string_null_DEPENDENCIES)
+ @rm -f parse_string_null$(EXEEXT)
+ $(LINK) $(parse_string_null_OBJECTS) $(parse_string_null_LDADD) $(LIBS)
+parse_version$(EXEEXT): $(parse_version_OBJECTS) $(parse_version_DEPENDENCIES)
+ @rm -f parse_version$(EXEEXT)
+ $(LINK) $(parse_version_OBJECTS) $(parse_version_LDADD) $(LIBS)
+parse_version_include$(EXEEXT): $(parse_version_include_OBJECTS) $(parse_version_include_DEPENDENCIES)
+ @rm -f parse_version_include$(EXEEXT)
+ $(LINK) $(parse_version_include_OBJECTS) $(parse_version_include_LDADD) $(LIBS)
+parse_version_permissive$(EXEEXT): $(parse_version_permissive_OBJECTS) $(parse_version_permissive_DEPENDENCIES)
+ @rm -f parse_version_permissive$(EXEEXT)
+ $(LINK) $(parse_version_permissive_OBJECTS) $(parse_version_permissive_LDADD) $(LIBS)
+parse_version_slash$(EXEEXT): $(parse_version_slash_OBJECTS) $(parse_version_slash_DEPENDENCIES)
+ @rm -f parse_version_slash$(EXEEXT)
+ $(LINK) $(parse_version_slash_OBJECTS) $(parse_version_slash_LDADD) $(LIBS)
+parse_whitespace$(EXEEXT): $(parse_whitespace_OBJECTS) $(parse_whitespace_DEPENDENCIES)
+ @rm -f parse_whitespace$(EXEEXT)
+ $(LINK) $(parse_whitespace_OBJECTS) $(parse_whitespace_LDADD) $(LIBS)
+protect_alter$(EXEEXT): $(protect_alter_OBJECTS) $(protect_alter_DEPENDENCIES)
+ @rm -f protect_alter$(EXEEXT)
+ $(LINK) $(protect_alter_OBJECTS) $(protect_alter_LDADD) $(LIBS)
+protect_get$(EXEEXT): $(protect_get_OBJECTS) $(protect_get_DEPENDENCIES)
+ @rm -f protect_get$(EXEEXT)
+ $(LINK) $(protect_get_OBJECTS) $(protect_get_LDADD) $(LIBS)
+put64$(EXEEXT): $(put64_OBJECTS) $(put64_DEPENDENCIES)
+ @rm -f put64$(EXEEXT)
+ $(LINK) $(put64_OBJECTS) $(put64_LDADD) $(LIBS)
+put_bad_code$(EXEEXT): $(put_bad_code_OBJECTS) $(put_bad_code_DEPENDENCIES)
+ @rm -f put_bad_code$(EXEEXT)
+ $(LINK) $(put_bad_code_OBJECTS) $(put_bad_code_LDADD) $(LIBS)
+put_bit$(EXEEXT): $(put_bit_OBJECTS) $(put_bit_DEPENDENCIES)
+ @rm -f put_bit$(EXEEXT)
+ $(LINK) $(put_bit_OBJECTS) $(put_bit_LDADD) $(LIBS)
+put_bof$(EXEEXT): $(put_bof_OBJECTS) $(put_bof_DEPENDENCIES)
+ @rm -f put_bof$(EXEEXT)
+ $(LINK) $(put_bof_OBJECTS) $(put_bof_LDADD) $(LIBS)
+put_carray$(EXEEXT): $(put_carray_OBJECTS) $(put_carray_DEPENDENCIES)
+ @rm -f put_carray$(EXEEXT)
+ $(LINK) $(put_carray_OBJECTS) $(put_carray_LDADD) $(LIBS)
+put_carray_slice$(EXEEXT): $(put_carray_slice_OBJECTS) $(put_carray_slice_DEPENDENCIES)
+ @rm -f put_carray_slice$(EXEEXT)
+ $(LINK) $(put_carray_slice_OBJECTS) $(put_carray_slice_LDADD) $(LIBS)
+put_char$(EXEEXT): $(put_char_OBJECTS) $(put_char_DEPENDENCIES)
+ @rm -f put_char$(EXEEXT)
+ $(LINK) $(put_char_OBJECTS) $(put_char_LDADD) $(LIBS)
+put_complex128$(EXEEXT): $(put_complex128_OBJECTS) $(put_complex128_DEPENDENCIES)
+ @rm -f put_complex128$(EXEEXT)
+ $(LINK) $(put_complex128_OBJECTS) $(put_complex128_LDADD) $(LIBS)
+put_complex64$(EXEEXT): $(put_complex64_OBJECTS) $(put_complex64_DEPENDENCIES)
+ @rm -f put_complex64$(EXEEXT)
+ $(LINK) $(put_complex64_OBJECTS) $(put_complex64_LDADD) $(LIBS)
+put_const$(EXEEXT): $(put_const_OBJECTS) $(put_const_DEPENDENCIES)
+ @rm -f put_const$(EXEEXT)
+ $(LINK) $(put_const_OBJECTS) $(put_const_LDADD) $(LIBS)
+put_const_protect$(EXEEXT): $(put_const_protect_OBJECTS) $(put_const_protect_DEPENDENCIES)
+ @rm -f put_const_protect$(EXEEXT)
+ $(LINK) $(put_const_protect_OBJECTS) $(put_const_protect_LDADD) $(LIBS)
+put_divide$(EXEEXT): $(put_divide_OBJECTS) $(put_divide_DEPENDENCIES)
+ @rm -f put_divide$(EXEEXT)
+ $(LINK) $(put_divide_OBJECTS) $(put_divide_LDADD) $(LIBS)
+put_endian16$(EXEEXT): $(put_endian16_OBJECTS) $(put_endian16_DEPENDENCIES)
+ @rm -f put_endian16$(EXEEXT)
+ $(LINK) $(put_endian16_OBJECTS) $(put_endian16_LDADD) $(LIBS)
+put_endian32$(EXEEXT): $(put_endian32_OBJECTS) $(put_endian32_DEPENDENCIES)
+ @rm -f put_endian32$(EXEEXT)
+ $(LINK) $(put_endian32_OBJECTS) $(put_endian32_LDADD) $(LIBS)
+put_endian64$(EXEEXT): $(put_endian64_OBJECTS) $(put_endian64_DEPENDENCIES)
+ @rm -f put_endian64$(EXEEXT)
+ $(LINK) $(put_endian64_OBJECTS) $(put_endian64_LDADD) $(LIBS)
+put_endian8$(EXEEXT): $(put_endian8_OBJECTS) $(put_endian8_DEPENDENCIES)
+ @rm -f put_endian8$(EXEEXT)
+ $(LINK) $(put_endian8_OBJECTS) $(put_endian8_LDADD) $(LIBS)
+put_endian_complex128_arm$(EXEEXT): $(put_endian_complex128_arm_OBJECTS) $(put_endian_complex128_arm_DEPENDENCIES)
+ @rm -f put_endian_complex128_arm$(EXEEXT)
+ $(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)
+ @rm -f put_endian_complex128_big$(EXEEXT)
+ $(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)
+ @rm -f put_endian_complex128_little$(EXEEXT)
+ $(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)
+ @rm -f put_endian_complex64_arm$(EXEEXT)
+ $(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)
+ @rm -f put_endian_complex64_big$(EXEEXT)
+ $(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)
+ @rm -f put_endian_complex64_little$(EXEEXT)
+ $(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)
+ @rm -f put_endian_float32_arm$(EXEEXT)
+ $(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)
+ @rm -f put_endian_float32_big$(EXEEXT)
+ $(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)
+ @rm -f put_endian_float32_little$(EXEEXT)
+ $(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)
+ @rm -f put_endian_float64_arm$(EXEEXT)
+ $(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)
+ @rm -f put_endian_float64_big$(EXEEXT)
+ $(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)
+ @rm -f put_endian_float64_little$(EXEEXT)
+ $(LINK) $(put_endian_float64_little_OBJECTS) $(put_endian_float64_little_LDADD) $(LIBS)
+put_ff$(EXEEXT): $(put_ff_OBJECTS) $(put_ff_DEPENDENCIES)
+ @rm -f put_ff$(EXEEXT)
+ $(LINK) $(put_ff_OBJECTS) $(put_ff_LDADD) $(LIBS)
+put_float32$(EXEEXT): $(put_float32_OBJECTS) $(put_float32_DEPENDENCIES)
+ @rm -f put_float32$(EXEEXT)
+ $(LINK) $(put_float32_OBJECTS) $(put_float32_LDADD) $(LIBS)
+put_float64$(EXEEXT): $(put_float64_OBJECTS) $(put_float64_DEPENDENCIES)
+ @rm -f put_float64$(EXEEXT)
+ $(LINK) $(put_float64_OBJECTS) $(put_float64_LDADD) $(LIBS)
+put_foffs$(EXEEXT): $(put_foffs_OBJECTS) $(put_foffs_DEPENDENCIES)
+ @rm -f put_foffs$(EXEEXT)
+ $(LINK) $(put_foffs_OBJECTS) $(put_foffs_LDADD) $(LIBS)
+put_fs$(EXEEXT): $(put_fs_OBJECTS) $(put_fs_DEPENDENCIES)
+ @rm -f put_fs$(EXEEXT)
+ $(LINK) $(put_fs_OBJECTS) $(put_fs_LDADD) $(LIBS)
+put_int16$(EXEEXT): $(put_int16_OBJECTS) $(put_int16_DEPENDENCIES)
+ @rm -f put_int16$(EXEEXT)
+ $(LINK) $(put_int16_OBJECTS) $(put_int16_LDADD) $(LIBS)
+put_int32$(EXEEXT): $(put_int32_OBJECTS) $(put_int32_DEPENDENCIES)
+ @rm -f put_int32$(EXEEXT)
+ $(LINK) $(put_int32_OBJECTS) $(put_int32_LDADD) $(LIBS)
+put_int64$(EXEEXT): $(put_int64_OBJECTS) $(put_int64_DEPENDENCIES)
+ @rm -f put_int64$(EXEEXT)
+ $(LINK) $(put_int64_OBJECTS) $(put_int64_LDADD) $(LIBS)
+put_int8$(EXEEXT): $(put_int8_OBJECTS) $(put_int8_DEPENDENCIES)
+ @rm -f put_int8$(EXEEXT)
+ $(LINK) $(put_int8_OBJECTS) $(put_int8_LDADD) $(LIBS)
+put_invalid$(EXEEXT): $(put_invalid_OBJECTS) $(put_invalid_DEPENDENCIES)
+ @rm -f put_invalid$(EXEEXT)
+ $(LINK) $(put_invalid_OBJECTS) $(put_invalid_LDADD) $(LIBS)
+put_lincom1$(EXEEXT): $(put_lincom1_OBJECTS) $(put_lincom1_DEPENDENCIES)
+ @rm -f put_lincom1$(EXEEXT)
+ $(LINK) $(put_lincom1_OBJECTS) $(put_lincom1_LDADD) $(LIBS)
+put_lincom2$(EXEEXT): $(put_lincom2_OBJECTS) $(put_lincom2_DEPENDENCIES)
+ @rm -f put_lincom2$(EXEEXT)
+ $(LINK) $(put_lincom2_OBJECTS) $(put_lincom2_LDADD) $(LIBS)
+put_lincom_noin$(EXEEXT): $(put_lincom_noin_OBJECTS) $(put_lincom_noin_DEPENDENCIES)
+ @rm -f put_lincom_noin$(EXEEXT)
+ $(LINK) $(put_lincom_noin_OBJECTS) $(put_lincom_noin_LDADD) $(LIBS)
+put_linterp$(EXEEXT): $(put_linterp_OBJECTS) $(put_linterp_DEPENDENCIES)
+ @rm -f put_linterp$(EXEEXT)
+ $(LINK) $(put_linterp_OBJECTS) $(put_linterp_LDADD) $(LIBS)
+put_linterp_noin$(EXEEXT): $(put_linterp_noin_OBJECTS) $(put_linterp_noin_DEPENDENCIES)
+ @rm -f put_linterp_noin$(EXEEXT)
+ $(LINK) $(put_linterp_noin_OBJECTS) $(put_linterp_noin_LDADD) $(LIBS)
+put_linterp_nomono$(EXEEXT): $(put_linterp_nomono_OBJECTS) $(put_linterp_nomono_DEPENDENCIES)
+ @rm -f put_linterp_nomono$(EXEEXT)
+ $(LINK) $(put_linterp_nomono_OBJECTS) $(put_linterp_nomono_LDADD) $(LIBS)
+put_linterp_notab$(EXEEXT): $(put_linterp_notab_OBJECTS) $(put_linterp_notab_DEPENDENCIES)
+ @rm -f put_linterp_notab$(EXEEXT)
+ $(LINK) $(put_linterp_notab_OBJECTS) $(put_linterp_notab_LDADD) $(LIBS)
+put_linterp_reverse$(EXEEXT): $(put_linterp_reverse_OBJECTS) $(put_linterp_reverse_DEPENDENCIES)
+ @rm -f put_linterp_reverse$(EXEEXT)
+ $(LINK) $(put_linterp_reverse_OBJECTS) $(put_linterp_reverse_LDADD) $(LIBS)
+put_multiply$(EXEEXT): $(put_multiply_OBJECTS) $(put_multiply_DEPENDENCIES)
+ @rm -f put_multiply$(EXEEXT)
+ $(LINK) $(put_multiply_OBJECTS) $(put_multiply_LDADD) $(LIBS)
+put_null$(EXEEXT): $(put_null_OBJECTS) $(put_null_DEPENDENCIES)
+ @rm -f put_null$(EXEEXT)
+ $(LINK) $(put_null_OBJECTS) $(put_null_LDADD) $(LIBS)
+put_off64$(EXEEXT): $(put_off64_OBJECTS) $(put_off64_DEPENDENCIES)
+ @rm -f put_off64$(EXEEXT)
+ $(LINK) $(put_off64_OBJECTS) $(put_off64_LDADD) $(LIBS)
+put_phase$(EXEEXT): $(put_phase_OBJECTS) $(put_phase_DEPENDENCIES)
+ @rm -f put_phase$(EXEEXT)
+ $(LINK) $(put_phase_OBJECTS) $(put_phase_LDADD) $(LIBS)
+put_phase_noin$(EXEEXT): $(put_phase_noin_OBJECTS) $(put_phase_noin_DEPENDENCIES)
+ @rm -f put_phase_noin$(EXEEXT)
+ $(LINK) $(put_phase_noin_OBJECTS) $(put_phase_noin_LDADD) $(LIBS)
+put_polynom1$(EXEEXT): $(put_polynom1_OBJECTS) $(put_polynom1_DEPENDENCIES)
+ @rm -f put_polynom1$(EXEEXT)
+ $(LINK) $(put_polynom1_OBJECTS) $(put_polynom1_LDADD) $(LIBS)
+put_polynom2$(EXEEXT): $(put_polynom2_OBJECTS) $(put_polynom2_DEPENDENCIES)
+ @rm -f put_polynom2$(EXEEXT)
+ $(LINK) $(put_polynom2_OBJECTS) $(put_polynom2_LDADD) $(LIBS)
+put_polynom_noin$(EXEEXT): $(put_polynom_noin_OBJECTS) $(put_polynom_noin_DEPENDENCIES)
+ @rm -f put_polynom_noin$(EXEEXT)
+ $(LINK) $(put_polynom_noin_OBJECTS) $(put_polynom_noin_LDADD) $(LIBS)
+put_protect$(EXEEXT): $(put_protect_OBJECTS) $(put_protect_DEPENDENCIES)
+ @rm -f put_protect$(EXEEXT)
+ $(LINK) $(put_protect_OBJECTS) $(put_protect_LDADD) $(LIBS)
+put_rdonly$(EXEEXT): $(put_rdonly_OBJECTS) $(put_rdonly_DEPENDENCIES)
+ @rm -f put_rdonly$(EXEEXT)
+ $(LINK) $(put_rdonly_OBJECTS) $(put_rdonly_LDADD) $(LIBS)
+put_recip$(EXEEXT): $(put_recip_OBJECTS) $(put_recip_DEPENDENCIES)
+ @rm -f put_recip$(EXEEXT)
+ $(LINK) $(put_recip_OBJECTS) $(put_recip_LDADD) $(LIBS)
+put_recurse$(EXEEXT): $(put_recurse_OBJECTS) $(put_recurse_DEPENDENCIES)
+ @rm -f put_recurse$(EXEEXT)
+ $(LINK) $(put_recurse_OBJECTS) $(put_recurse_LDADD) $(LIBS)
+put_repr$(EXEEXT): $(put_repr_OBJECTS) $(put_repr_DEPENDENCIES)
+ @rm -f put_repr$(EXEEXT)
+ $(LINK) $(put_repr_OBJECTS) $(put_repr_LDADD) $(LIBS)
+put_rofs$(EXEEXT): $(put_rofs_OBJECTS) $(put_rofs_DEPENDENCIES)
+ @rm -f put_rofs$(EXEEXT)
+ $(LINK) $(put_rofs_OBJECTS) $(put_rofs_LDADD) $(LIBS)
+put_sbit$(EXEEXT): $(put_sbit_OBJECTS) $(put_sbit_DEPENDENCIES)
+ @rm -f put_sbit$(EXEEXT)
+ $(LINK) $(put_sbit_OBJECTS) $(put_sbit_LDADD) $(LIBS)
+put_sf$(EXEEXT): $(put_sf_OBJECTS) $(put_sf_DEPENDENCIES)
+ @rm -f put_sf$(EXEEXT)
+ $(LINK) $(put_sf_OBJECTS) $(put_sf_LDADD) $(LIBS)
+put_ss$(EXEEXT): $(put_ss_OBJECTS) $(put_ss_DEPENDENCIES)
+ @rm -f put_ss$(EXEEXT)
+ $(LINK) $(put_ss_OBJECTS) $(put_ss_LDADD) $(LIBS)
+put_string$(EXEEXT): $(put_string_OBJECTS) $(put_string_DEPENDENCIES)
+ @rm -f put_string$(EXEEXT)
+ $(LINK) $(put_string_OBJECTS) $(put_string_LDADD) $(LIBS)
+put_string_protect$(EXEEXT): $(put_string_protect_OBJECTS) $(put_string_protect_DEPENDENCIES)
+ @rm -f put_string_protect$(EXEEXT)
+ $(LINK) $(put_string_protect_OBJECTS) $(put_string_protect_LDADD) $(LIBS)
+put_type$(EXEEXT): $(put_type_OBJECTS) $(put_type_DEPENDENCIES)
+ @rm -f put_type$(EXEEXT)
+ $(LINK) $(put_type_OBJECTS) $(put_type_LDADD) $(LIBS)
+put_uint16$(EXEEXT): $(put_uint16_OBJECTS) $(put_uint16_DEPENDENCIES)
+ @rm -f put_uint16$(EXEEXT)
+ $(LINK) $(put_uint16_OBJECTS) $(put_uint16_LDADD) $(LIBS)
+put_uint32$(EXEEXT): $(put_uint32_OBJECTS) $(put_uint32_DEPENDENCIES)
+ @rm -f put_uint32$(EXEEXT)
+ $(LINK) $(put_uint32_OBJECTS) $(put_uint32_LDADD) $(LIBS)
+put_uint64$(EXEEXT): $(put_uint64_OBJECTS) $(put_uint64_DEPENDENCIES)
+ @rm -f put_uint64$(EXEEXT)
+ $(LINK) $(put_uint64_OBJECTS) $(put_uint64_LDADD) $(LIBS)
+ref$(EXEEXT): $(ref_OBJECTS) $(ref_DEPENDENCIES)
+ @rm -f ref$(EXEEXT)
+ $(LINK) $(ref_OBJECTS) $(ref_LDADD) $(LIBS)
+ref_none$(EXEEXT): $(ref_none_OBJECTS) $(ref_none_DEPENDENCIES)
+ @rm -f ref_none$(EXEEXT)
+ $(LINK) $(ref_none_OBJECTS) $(ref_none_LDADD) $(LIBS)
+ref_two$(EXEEXT): $(ref_two_OBJECTS) $(ref_two_DEPENDENCIES)
+ @rm -f ref_two$(EXEEXT)
+ $(LINK) $(ref_two_OBJECTS) $(ref_two_LDADD) $(LIBS)
+repr_a$(EXEEXT): $(repr_a_OBJECTS) $(repr_a_DEPENDENCIES)
+ @rm -f repr_a$(EXEEXT)
+ $(LINK) $(repr_a_OBJECTS) $(repr_a_LDADD) $(LIBS)
+repr_float32$(EXEEXT): $(repr_float32_OBJECTS) $(repr_float32_DEPENDENCIES)
+ @rm -f repr_float32$(EXEEXT)
+ $(LINK) $(repr_float32_OBJECTS) $(repr_float32_LDADD) $(LIBS)
+repr_float64$(EXEEXT): $(repr_float64_OBJECTS) $(repr_float64_DEPENDENCIES)
+ @rm -f repr_float64$(EXEEXT)
+ $(LINK) $(repr_float64_OBJECTS) $(repr_float64_LDADD) $(LIBS)
+repr_i$(EXEEXT): $(repr_i_OBJECTS) $(repr_i_DEPENDENCIES)
+ @rm -f repr_i$(EXEEXT)
+ $(LINK) $(repr_i_OBJECTS) $(repr_i_LDADD) $(LIBS)
+repr_int16$(EXEEXT): $(repr_int16_OBJECTS) $(repr_int16_DEPENDENCIES)
+ @rm -f repr_int16$(EXEEXT)
+ $(LINK) $(repr_int16_OBJECTS) $(repr_int16_LDADD) $(LIBS)
+repr_int32$(EXEEXT): $(repr_int32_OBJECTS) $(repr_int32_DEPENDENCIES)
+ @rm -f repr_int32$(EXEEXT)
+ $(LINK) $(repr_int32_OBJECTS) $(repr_int32_LDADD) $(LIBS)
+repr_int64$(EXEEXT): $(repr_int64_OBJECTS) $(repr_int64_DEPENDENCIES)
+ @rm -f repr_int64$(EXEEXT)
+ $(LINK) $(repr_int64_OBJECTS) $(repr_int64_LDADD) $(LIBS)
+repr_int8$(EXEEXT): $(repr_int8_OBJECTS) $(repr_int8_DEPENDENCIES)
+ @rm -f repr_int8$(EXEEXT)
+ $(LINK) $(repr_int8_OBJECTS) $(repr_int8_LDADD) $(LIBS)
+repr_m$(EXEEXT): $(repr_m_OBJECTS) $(repr_m_DEPENDENCIES)
+ @rm -f repr_m$(EXEEXT)
+ $(LINK) $(repr_m_OBJECTS) $(repr_m_LDADD) $(LIBS)
+repr_r$(EXEEXT): $(repr_r_OBJECTS) $(repr_r_DEPENDENCIES)
+ @rm -f repr_r$(EXEEXT)
+ $(LINK) $(repr_r_OBJECTS) $(repr_r_LDADD) $(LIBS)
+repr_real_a$(EXEEXT): $(repr_real_a_OBJECTS) $(repr_real_a_DEPENDENCIES)
+ @rm -f repr_real_a$(EXEEXT)
+ $(LINK) $(repr_real_a_OBJECTS) $(repr_real_a_LDADD) $(LIBS)
+repr_real_i$(EXEEXT): $(repr_real_i_OBJECTS) $(repr_real_i_DEPENDENCIES)
+ @rm -f repr_real_i$(EXEEXT)
+ $(LINK) $(repr_real_i_OBJECTS) $(repr_real_i_LDADD) $(LIBS)
+repr_real_m$(EXEEXT): $(repr_real_m_OBJECTS) $(repr_real_m_DEPENDENCIES)
+ @rm -f repr_real_m$(EXEEXT)
+ $(LINK) $(repr_real_m_OBJECTS) $(repr_real_m_LDADD) $(LIBS)
+repr_real_r$(EXEEXT): $(repr_real_r_OBJECTS) $(repr_real_r_DEPENDENCIES)
+ @rm -f repr_real_r$(EXEEXT)
+ $(LINK) $(repr_real_r_OBJECTS) $(repr_real_r_LDADD) $(LIBS)
+repr_uint16$(EXEEXT): $(repr_uint16_OBJECTS) $(repr_uint16_DEPENDENCIES)
+ @rm -f repr_uint16$(EXEEXT)
+ $(LINK) $(repr_uint16_OBJECTS) $(repr_uint16_LDADD) $(LIBS)
+repr_uint32$(EXEEXT): $(repr_uint32_OBJECTS) $(repr_uint32_DEPENDENCIES)
+ @rm -f repr_uint32$(EXEEXT)
+ $(LINK) $(repr_uint32_OBJECTS) $(repr_uint32_LDADD) $(LIBS)
+repr_uint64$(EXEEXT): $(repr_uint64_OBJECTS) $(repr_uint64_DEPENDENCIES)
+ @rm -f repr_uint64$(EXEEXT)
+ $(LINK) $(repr_uint64_OBJECTS) $(repr_uint64_LDADD) $(LIBS)
+repr_uint8$(EXEEXT): $(repr_uint8_OBJECTS) $(repr_uint8_DEPENDENCIES)
+ @rm -f repr_uint8$(EXEEXT)
+ $(LINK) $(repr_uint8_OBJECTS) $(repr_uint8_LDADD) $(LIBS)
+slim_get$(EXEEXT): $(slim_get_OBJECTS) $(slim_get_DEPENDENCIES)
+ @rm -f slim_get$(EXEEXT)
+ $(LINK) $(slim_get_OBJECTS) $(slim_get_LDADD) $(LIBS)
+slim_nframes$(EXEEXT): $(slim_nframes_OBJECTS) $(slim_nframes_DEPENDENCIES)
+ @rm -f slim_nframes$(EXEEXT)
+ $(LINK) $(slim_nframes_OBJECTS) $(slim_nframes_LDADD) $(LIBS)
+spf$(EXEEXT): $(spf_OBJECTS) $(spf_DEPENDENCIES)
+ @rm -f spf$(EXEEXT)
+ $(LINK) $(spf_OBJECTS) $(spf_LDADD) $(LIBS)
+spf_divide$(EXEEXT): $(spf_divide_OBJECTS) $(spf_divide_DEPENDENCIES)
+ @rm -f spf_divide$(EXEEXT)
+ $(LINK) $(spf_divide_OBJECTS) $(spf_divide_LDADD) $(LIBS)
+spf_lincom$(EXEEXT): $(spf_lincom_OBJECTS) $(spf_lincom_DEPENDENCIES)
+ @rm -f spf_lincom$(EXEEXT)
+ $(LINK) $(spf_lincom_OBJECTS) $(spf_lincom_LDADD) $(LIBS)
+spf_multiply$(EXEEXT): $(spf_multiply_OBJECTS) $(spf_multiply_DEPENDENCIES)
+ @rm -f spf_multiply$(EXEEXT)
+ $(LINK) $(spf_multiply_OBJECTS) $(spf_multiply_LDADD) $(LIBS)
+spf_polynom$(EXEEXT): $(spf_polynom_OBJECTS) $(spf_polynom_DEPENDENCIES)
+ @rm -f spf_polynom$(EXEEXT)
+ $(LINK) $(spf_polynom_OBJECTS) $(spf_polynom_LDADD) $(LIBS)
+spf_recip$(EXEEXT): $(spf_recip_OBJECTS) $(spf_recip_DEPENDENCIES)
+ @rm -f spf_recip$(EXEEXT)
+ $(LINK) $(spf_recip_OBJECTS) $(spf_recip_LDADD) $(LIBS)
+spf_recurse$(EXEEXT): $(spf_recurse_OBJECTS) $(spf_recurse_DEPENDENCIES)
+ @rm -f spf_recurse$(EXEEXT)
+ $(LINK) $(spf_recurse_OBJECTS) $(spf_recurse_LDADD) $(LIBS)
+svlist$(EXEEXT): $(svlist_OBJECTS) $(svlist_DEPENDENCIES)
+ @rm -f svlist$(EXEEXT)
+ $(LINK) $(svlist_OBJECTS) $(svlist_LDADD) $(LIBS)
+svlist_invalid$(EXEEXT): $(svlist_invalid_OBJECTS) $(svlist_invalid_DEPENDENCIES)
+ @rm -f svlist_invalid$(EXEEXT)
+ $(LINK) $(svlist_invalid_OBJECTS) $(svlist_invalid_LDADD) $(LIBS)
+svlist_meta$(EXEEXT): $(svlist_meta_OBJECTS) $(svlist_meta_DEPENDENCIES)
+ @rm -f svlist_meta$(EXEEXT)
+ $(LINK) $(svlist_meta_OBJECTS) $(svlist_meta_LDADD) $(LIBS)
+svlist_meta_invalid$(EXEEXT): $(svlist_meta_invalid_OBJECTS) $(svlist_meta_invalid_DEPENDENCIES)
+ @rm -f svlist_meta_invalid$(EXEEXT)
+ $(LINK) $(svlist_meta_invalid_OBJECTS) $(svlist_meta_invalid_LDADD) $(LIBS)
+trunc$(EXEEXT): $(trunc_OBJECTS) $(trunc_DEPENDENCIES)
+ @rm -f trunc$(EXEEXT)
+ $(LINK) $(trunc_OBJECTS) $(trunc_LDADD) $(LIBS)
+trunc_rdonly$(EXEEXT): $(trunc_rdonly_OBJECTS) $(trunc_rdonly_DEPENDENCIES)
+ @rm -f trunc_rdonly$(EXEEXT)
+ $(LINK) $(trunc_rdonly_OBJECTS) $(trunc_rdonly_LDADD) $(LIBS)
+trunc_rofs$(EXEEXT): $(trunc_rofs_OBJECTS) $(trunc_rofs_DEPENDENCIES)
+ @rm -f trunc_rofs$(EXEEXT)
+ $(LINK) $(trunc_rofs_OBJECTS) $(trunc_rofs_LDADD) $(LIBS)
+unclude$(EXEEXT): $(unclude_OBJECTS) $(unclude_DEPENDENCIES)
+ @rm -f unclude$(EXEEXT)
+ $(LINK) $(unclude_OBJECTS) $(unclude_LDADD) $(LIBS)
+unclude_del$(EXEEXT): $(unclude_del_OBJECTS) $(unclude_del_DEPENDENCIES)
+ @rm -f unclude_del$(EXEEXT)
+ $(LINK) $(unclude_del_OBJECTS) $(unclude_del_LDADD) $(LIBS)
+unclude_move$(EXEEXT): $(unclude_move_OBJECTS) $(unclude_move_DEPENDENCIES)
+ @rm -f unclude_move$(EXEEXT)
+ $(LINK) $(unclude_move_OBJECTS) $(unclude_move_LDADD) $(LIBS)
+version_0$(EXEEXT): $(version_0_OBJECTS) $(version_0_DEPENDENCIES)
+ @rm -f version_0$(EXEEXT)
+ $(LINK) $(version_0_OBJECTS) $(version_0_LDADD) $(LIBS)
+version_0_write$(EXEEXT): $(version_0_write_OBJECTS) $(version_0_write_DEPENDENCIES)
+ @rm -f version_0_write$(EXEEXT)
+ $(LINK) $(version_0_write_OBJECTS) $(version_0_write_LDADD) $(LIBS)
+version_1$(EXEEXT): $(version_1_OBJECTS) $(version_1_DEPENDENCIES)
+ @rm -f version_1$(EXEEXT)
+ $(LINK) $(version_1_OBJECTS) $(version_1_LDADD) $(LIBS)
+version_1_write$(EXEEXT): $(version_1_write_OBJECTS) $(version_1_write_DEPENDENCIES)
+ @rm -f version_1_write$(EXEEXT)
+ $(LINK) $(version_1_write_OBJECTS) $(version_1_write_LDADD) $(LIBS)
+version_2$(EXEEXT): $(version_2_OBJECTS) $(version_2_DEPENDENCIES)
+ @rm -f version_2$(EXEEXT)
+ $(LINK) $(version_2_OBJECTS) $(version_2_LDADD) $(LIBS)
+version_2_write$(EXEEXT): $(version_2_write_OBJECTS) $(version_2_write_DEPENDENCIES)
+ @rm -f version_2_write$(EXEEXT)
+ $(LINK) $(version_2_write_OBJECTS) $(version_2_write_LDADD) $(LIBS)
+version_3$(EXEEXT): $(version_3_OBJECTS) $(version_3_DEPENDENCIES)
+ @rm -f version_3$(EXEEXT)
+ $(LINK) $(version_3_OBJECTS) $(version_3_LDADD) $(LIBS)
+version_3_write$(EXEEXT): $(version_3_write_OBJECTS) $(version_3_write_DEPENDENCIES)
+ @rm -f version_3_write$(EXEEXT)
+ $(LINK) $(version_3_write_OBJECTS) $(version_3_write_LDADD) $(LIBS)
+version_4$(EXEEXT): $(version_4_OBJECTS) $(version_4_DEPENDENCIES)
+ @rm -f version_4$(EXEEXT)
+ $(LINK) $(version_4_OBJECTS) $(version_4_LDADD) $(LIBS)
+version_4_write$(EXEEXT): $(version_4_write_OBJECTS) $(version_4_write_DEPENDENCIES)
+ @rm -f version_4_write$(EXEEXT)
+ $(LINK) $(version_4_write_OBJECTS) $(version_4_write_LDADD) $(LIBS)
+version_5$(EXEEXT): $(version_5_OBJECTS) $(version_5_DEPENDENCIES)
+ @rm -f version_5$(EXEEXT)
+ $(LINK) $(version_5_OBJECTS) $(version_5_LDADD) $(LIBS)
+version_5_strict$(EXEEXT): $(version_5_strict_OBJECTS) $(version_5_strict_DEPENDENCIES)
+ @rm -f version_5_strict$(EXEEXT)
+ $(LINK) $(version_5_strict_OBJECTS) $(version_5_strict_LDADD) $(LIBS)
+version_5_write$(EXEEXT): $(version_5_write_OBJECTS) $(version_5_write_DEPENDENCIES)
+ @rm -f version_5_write$(EXEEXT)
+ $(LINK) $(version_5_write_OBJECTS) $(version_5_write_LDADD) $(LIBS)
+version_6$(EXEEXT): $(version_6_OBJECTS) $(version_6_DEPENDENCIES)
+ @rm -f version_6$(EXEEXT)
+ $(LINK) $(version_6_OBJECTS) $(version_6_LDADD) $(LIBS)
+version_6_strict$(EXEEXT): $(version_6_strict_OBJECTS) $(version_6_strict_DEPENDENCIES)
+ @rm -f version_6_strict$(EXEEXT)
+ $(LINK) $(version_6_strict_OBJECTS) $(version_6_strict_LDADD) $(LIBS)
+version_6_write$(EXEEXT): $(version_6_write_OBJECTS) $(version_6_write_DEPENDENCIES)
+ @rm -f version_6_write$(EXEEXT)
+ $(LINK) $(version_6_write_OBJECTS) $(version_6_write_LDADD) $(LIBS)
+version_7$(EXEEXT): $(version_7_OBJECTS) $(version_7_DEPENDENCIES)
+ @rm -f version_7$(EXEEXT)
+ $(LINK) $(version_7_OBJECTS) $(version_7_LDADD) $(LIBS)
+version_7_strict$(EXEEXT): $(version_7_strict_OBJECTS) $(version_7_strict_DEPENDENCIES)
+ @rm -f version_7_strict$(EXEEXT)
+ $(LINK) $(version_7_strict_OBJECTS) $(version_7_strict_LDADD) $(LIBS)
+version_7_write$(EXEEXT): $(version_7_write_OBJECTS) $(version_7_write_DEPENDENCIES)
+ @rm -f version_7_write$(EXEEXT)
+ $(LINK) $(version_7_write_OBJECTS) $(version_7_write_LDADD) $(LIBS)
+version_8$(EXEEXT): $(version_8_OBJECTS) $(version_8_DEPENDENCIES)
+ @rm -f version_8$(EXEEXT)
+ $(LINK) $(version_8_OBJECTS) $(version_8_LDADD) $(LIBS)
+version_8_strict$(EXEEXT): $(version_8_strict_OBJECTS) $(version_8_strict_DEPENDENCIES)
+ @rm -f version_8_strict$(EXEEXT)
+ $(LINK) $(version_8_strict_OBJECTS) $(version_8_strict_LDADD) $(LIBS)
+version_8_write$(EXEEXT): $(version_8_write_OBJECTS) $(version_8_write_DEPENDENCIES)
+ @rm -f version_8_write$(EXEEXT)
+ $(LINK) $(version_8_write_OBJECTS) $(version_8_write_LDADD) $(LIBS)
+vlist$(EXEEXT): $(vlist_OBJECTS) $(vlist_DEPENDENCIES)
+ @rm -f vlist$(EXEEXT)
+ $(LINK) $(vlist_OBJECTS) $(vlist_LDADD) $(LIBS)
+vlist_invalid$(EXEEXT): $(vlist_invalid_OBJECTS) $(vlist_invalid_DEPENDENCIES)
+ @rm -f vlist_invalid$(EXEEXT)
+ $(LINK) $(vlist_invalid_OBJECTS) $(vlist_invalid_LDADD) $(LIBS)
+vlist_meta$(EXEEXT): $(vlist_meta_OBJECTS) $(vlist_meta_DEPENDENCIES)
+ @rm -f vlist_meta$(EXEEXT)
+ $(LINK) $(vlist_meta_OBJECTS) $(vlist_meta_LDADD) $(LIBS)
+vlist_meta_invalid$(EXEEXT): $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_DEPENDENCIES)
+ @rm -f vlist_meta_invalid$(EXEEXT)
+ $(LINK) $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_LDADD) $(LIBS)
+xz_get$(EXEEXT): $(xz_get_OBJECTS) $(xz_get_DEPENDENCIES)
+ @rm -f xz_get$(EXEEXT)
+ $(LINK) $(xz_get_OBJECTS) $(xz_get_LDADD) $(LIBS)
+xz_nframes$(EXEEXT): $(xz_nframes_OBJECTS) $(xz_nframes_DEPENDENCIES)
+ @rm -f xz_nframes$(EXEEXT)
+ $(LINK) $(xz_nframes_OBJECTS) $(xz_nframes_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_bitnum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_bitsize.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_numbits.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_clincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_crecip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_crecip89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_divide_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_duplicate.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_format.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_lincom_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_lincom_nfields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_linterp_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_multiply_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_phase_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec_directive.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_bit_bitnum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_bit_numbits.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_carray_len.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_carray_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_recode.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar2a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar2n.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_23.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_input.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_offset.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_slope.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_linterp_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_mspec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_polynom_coeff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_polynom_input.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_polynom_ord.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_raw_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_raw_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_recip_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_move_from.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_discard.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat_excl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_carray_deref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const_deref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_data.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_meta_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_bit_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_lincom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_phase_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_polynom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw_scalar_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw_scalar_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_scalar_repr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_error.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_short.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_all.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_name_oor.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_carray_len.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_carray_slice.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_char.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_clincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const_repr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex128_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex128_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex128_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float32_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float32_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float32_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_ff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_fs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_non.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_notab.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_off64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_polynom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_recip_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_recurse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_sf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_ss.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref_empty.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref_set.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_move_from.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/header_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_accmode.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_auto.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_cb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_creat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_ignore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_pc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_syntax.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_domain.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_range.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_bit_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_clincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_crecip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_crecip89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_lincom_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_linterp_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_multiply_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_phase_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec_directive.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_enc_ar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_enc_ra.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_endian.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_nop.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_subdir.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfragments.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_empty.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_off64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_type_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_type_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_del.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nvectors.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nvectors_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_abort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_cont.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_ignore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_rescan.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_eaccess.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_notdirfile.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_badline.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_bitnum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_bitsize.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_numbits.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_carray_long.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_const_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_duplicate.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_duplicate_ignore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_eol.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_foffs_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_foffs_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_absolute.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_absrel.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_relabs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_relrel.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_ncols1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_ncols2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_nfields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_nofields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_non.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_non_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_linterp_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_implicit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_implicit2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_index2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_multiply_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_dot.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_ext.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_pedantic.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom_ncols1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom_ncols2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_all.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_data.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_format.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_none.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_quote.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_quote_mismatch.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_char.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ref_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_permissive.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_whitespace.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_carray_slice.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_char.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_const_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex128_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex128_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex128_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float32_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float32_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float32_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_ff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_fs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_lincom1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_lincom2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_lincom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_nomono.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_notab.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_reverse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_off64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_phase_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_polynom1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_polynom2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_polynom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_recurse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_repr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_sf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_ss.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_string_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref_none.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref_two.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_i.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_m.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_i.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_m.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_recurse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude_del.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_0_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_1_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_2_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_3_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_4_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_5.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_5_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_5_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_6.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_6_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_6_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_7.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_7_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_7_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_8_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_8_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xz_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xz_nframes.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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; 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 \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-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 all all-am check check-TESTS check-am check-local \
+ clean clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-local ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+# 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 "/' $$x | sh; \
+ echo $$x = $$? ); done &> $@;
+
+# clean up after the tests
+check-local: check-TESTS
+ $(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+ rm -rvf *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:
diff --git a/test/add.c b/test/add.c
new file mode 100644
index 0000000..7914886
--- /dev/null
+++ b/test/add.c
@@ -0,0 +1,62 @@
+/* Add a dirfile field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ int error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E, e;
+
+ // remove stuff of failed tests
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+#ifdef _WIN32
+ system("rmdir /q/s "__TEST__"dirfile");
+#endif
+ printf(format);
+ 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;
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_bit.c b/test/add_bit.c
new file mode 100644
index 0000000..f89e5eb
--- /dev/null
+++ b/test/add_bit.c
@@ -0,0 +1,44 @@
+/* Add a BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_bit_bitnum.c b/test/add_bit_bitnum.c
new file mode 100644
index 0000000..954dbbd
--- /dev/null
+++ b/test/add_bit_bitnum.c
@@ -0,0 +1,33 @@
+/* Add a BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, r = 0;
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(error, GD_E_BAD_ENTRY);
+
+ return r;
+}
diff --git a/test/add_bit_bitsize.c b/test/add_bit_bitsize.c
new file mode 100644
index 0000000..dc707f0
--- /dev/null
+++ b/test/add_bit_bitsize.c
@@ -0,0 +1,33 @@
+/* Add a BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, r = 0;
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(error, GD_E_BAD_ENTRY);
+
+ return r;
+}
diff --git a/test/add_bit_invalid.c b/test/add_bit_invalid.c
new file mode 100644
index 0000000..21b4a74
--- /dev/null
+++ b/test/add_bit_invalid.c
@@ -0,0 +1,23 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ int error, r = 0;
+
+ gd_add_bit(D, "new", "input", 1, 1, 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error,GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/add_bit_numbits.c b/test/add_bit_numbits.c
new file mode 100644
index 0000000..c4619e3
--- /dev/null
+++ b/test/add_bit_numbits.c
@@ -0,0 +1,33 @@
+/* Add a BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, r = 0;
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(error, GD_E_BAD_ENTRY);
+
+ return r;
+}
diff --git a/test/add_carray.c b/test/add_carray.c
new file mode 100644
index 0000000..1e59989
--- /dev/null
+++ b/test/add_carray.c
@@ -0,0 +1,49 @@
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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_carray_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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_clincom.c b/test/add_clincom.c
new file mode 100644
index 0000000..91b955b
--- /dev/null
+++ b/test/add_clincom.c
@@ -0,0 +1,66 @@
+/* Add a complex LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+ 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;
+
+ 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
+ CHECKI(e.comp_scal,1);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_code.c b/test/add_code.c
new file mode 100644
index 0000000..f4f0418
--- /dev/null
+++ b/test/add_code.c
@@ -0,0 +1,41 @@
+/* Add a dirfile field with invalid characters */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ D = gd_open(filedir, GD_RDWR | GD_CREAT);
+ gd_add(D, &E);
+ error = gd_error(D);
+
+ /* check */
+ n = gd_nfields(D);
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/add_const.c b/test/add_const.c
new file mode 100644
index 0000000..203f193
--- /dev/null
+++ b/test/add_const.c
@@ -0,0 +1,45 @@
+/* Add a CONST field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ uint8_t val = 3;
+ int error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_cpolynom.c b/test/add_cpolynom.c
new file mode 100644
index 0000000..4443697
--- /dev/null
+++ b/test/add_cpolynom.c
@@ -0,0 +1,58 @@
+/* Add a complex POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int r = 0;
+ int error, j;
+ gd_entry_t e;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+#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
+ 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);
+ CHECKI(e.comp_scal, 1);
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_crecip.c b/test/add_crecip.c
new file mode 100644
index 0000000..a68bd9c
--- /dev/null
+++ b/test/add_crecip.c
@@ -0,0 +1,48 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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");
+ CHECKI(e.comp_scal, 1);
+ CHECKC(e.EN(recip,cdividend), cdividend);
+ CHECKI(e.fragment_index, 0);
+
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_crecip89.c b/test/add_crecip89.c
new file mode 100644
index 0000000..10e4edd
--- /dev/null
+++ b/test/add_crecip89.c
@@ -0,0 +1,46 @@
+#define GD_C89_API
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+ double dividend[2] = {33.3, 44.4};
+
+ DIRFILE* 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");
+ CHECKI(e.comp_scal, 1);
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_divide.c b/test/add_divide.c
new file mode 100644
index 0000000..eb2ecd2
--- /dev/null
+++ b/test/add_divide.c
@@ -0,0 +1,42 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_divide_invalid.c b/test/add_divide_invalid.c
new file mode 100644
index 0000000..ae089f4
--- /dev/null
+++ b/test/add_divide_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_add_multiply(D, "new", "in1", "in2", 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/add_duplicate.c b/test/add_duplicate.c
new file mode 100644
index 0000000..a519060
--- /dev/null
+++ b/test/add_duplicate.c
@@ -0,0 +1,49 @@
+/* Add a dirfile field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,2);
+ CHECKI(error, GD_E_DUPLICATE);
+
+ return r;
+}
diff --git a/test/add_format.c b/test/add_format.c
new file mode 100644
index 0000000..9eff799
--- /dev/null
+++ b/test/add_format.c
@@ -0,0 +1,41 @@
+/* Add a dirfile field with to a bad fragment_index */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ D = gd_open(filedir, GD_RDWR | GD_CREAT);
+ gd_add(D, &E);
+ error = gd_error(D);
+
+ /* check */
+ n = gd_nfields(D);
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,1);
+ CHECKI(error, GD_E_BAD_INDEX);
+
+ return r;
+}
diff --git a/test/add_invalid.c b/test/add_invalid.c
new file mode 100644
index 0000000..853705f
--- /dev/null
+++ b/test/add_invalid.c
@@ -0,0 +1,31 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "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;
+
+ D = gd_open(filedir, GD_RDONLY);
+ gd_add(D, &E);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/add_lincom.c b/test/add_lincom.c
new file mode 100644
index 0000000..74573e6
--- /dev/null
+++ b/test/add_lincom.c
@@ -0,0 +1,54 @@
+/* Add a LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+ 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;
+
+ 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]);
+ CHECKI(e.comp_scal, 0);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_lincom_invalid.c b/test/add_lincom_invalid.c
new file mode 100644
index 0000000..8b915f4
--- /dev/null
+++ b/test/add_lincom_invalid.c
@@ -0,0 +1,26 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char* in_fields[2] = {"in1", "in2"};
+ const double m[2] = {1, 0.3};
+ const double b[2] = {0, 0.9};
+ gd_add_lincom(D, "new", 2, in_fields, m, b, 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/add_lincom_nfields.c b/test/add_lincom_nfields.c
new file mode 100644
index 0000000..5c83d86
--- /dev/null
+++ b/test/add_lincom_nfields.c
@@ -0,0 +1,36 @@
+/* Add a LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT);
+ const char* in_fields[2] = {"in1", "in2"};
+ const double m[2] = {1, 0.3};
+ const double b[2] = {0, 0.9};
+ gd_add_lincom(D, "new", 0, in_fields, m, b, 0);
+ error = gd_error(D);
+
+ /* check */
+ n = gd_nfields(D);
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(error, GD_E_BAD_ENTRY);
+
+ return r;
+}
diff --git a/test/add_linterp.c b/test/add_linterp.c
new file mode 100644
index 0000000..0a13609
--- /dev/null
+++ b/test/add_linterp.c
@@ -0,0 +1,43 @@
+/* Add a LINTERP field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_linterp_invalid.c b/test/add_linterp_invalid.c
new file mode 100644
index 0000000..ce8ff5b
--- /dev/null
+++ b/test/add_linterp_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_add_linterp(D, "new", "in", "table", 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/add_multiply.c b/test/add_multiply.c
new file mode 100644
index 0000000..c1900f6
--- /dev/null
+++ b/test/add_multiply.c
@@ -0,0 +1,43 @@
+/* Add a MULTIPLY field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_multiply_invalid.c b/test/add_multiply_invalid.c
new file mode 100644
index 0000000..ae089f4
--- /dev/null
+++ b/test/add_multiply_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_add_multiply(D, "new", "in1", "in2", 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/add_phase.c b/test/add_phase.c
new file mode 100644
index 0000000..e17a8b4
--- /dev/null
+++ b/test/add_phase.c
@@ -0,0 +1,43 @@
+/* Add a PHASE field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_phase_invalid.c b/test/add_phase_invalid.c
new file mode 100644
index 0000000..aae7e39
--- /dev/null
+++ b/test/add_phase_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_add_phase(D, "new", "in", 3, 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/add_polynom.c b/test/add_polynom.c
new file mode 100644
index 0000000..8dbd9b1
--- /dev/null
+++ b/test/add_polynom.c
@@ -0,0 +1,48 @@
+/* Add a POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int r = 0;
+ int j, error;
+ gd_entry_t e;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+ const double a[4] = {1, 0.3, 0.5, 1.8};
+ 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);
+ CHECKI(e.comp_scal, 0);
+ for (j = 0; j < 4; ++j)
+ CHECKFi(j,e.EN(polynom,a)[j], a[j]);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_protect.c b/test/add_protect.c
new file mode 100644
index 0000000..7cb7437
--- /dev/null
+++ b/test/add_protect.c
@@ -0,0 +1,48 @@
+/* Add a dirfile field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 2);
+ CHECKI(error, GD_E_PROTECTED);
+
+ return r;
+}
diff --git a/test/add_raw.c b/test/add_raw.c
new file mode 100644
index 0000000..351050c
--- /dev/null
+++ b/test/add_raw.c
@@ -0,0 +1,45 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ gd_entry_t e;
+ int error, r = 0;
+
+ DIRFILE* 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_close(D);
+
+ if (unlink(data))
+ r = 1;
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_raw_include.c b/test/add_raw_include.c
new file mode 100644
index 0000000..c263982
--- /dev/null
+++ b/test/add_raw_include.c
@@ -0,0 +1,49 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "dirfile/data";
+ gd_entry_t e;
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_UNENCODED | GD_VERBOSE);
+ int 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_close(D);
+
+ if (unlink(data))
+ r = 1;
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_raw_invalid.c b/test/add_raw_invalid.c
new file mode 100644
index 0000000..33fb3e2
--- /dev/null
+++ b/test/add_raw_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_add_raw(D, "data", GD_UINT8, 2, 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/add_raw_spf.c b/test/add_raw_spf.c
new file mode 100644
index 0000000..55befc6
--- /dev/null
+++ b/test/add_raw_spf.c
@@ -0,0 +1,33 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, r = 0;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,1);
+ CHECKI(error, GD_E_BAD_ENTRY);
+
+ return r;
+}
diff --git a/test/add_raw_type.c b/test/add_raw_type.c
new file mode 100644
index 0000000..2c18ded
--- /dev/null
+++ b/test/add_raw_type.c
@@ -0,0 +1,33 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, r = 0;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(error, GD_E_BAD_TYPE);
+
+ return r;
+}
diff --git a/test/add_rdonly.c b/test/add_rdonly.c
new file mode 100644
index 0000000..52626ae
--- /dev/null
+++ b/test/add_rdonly.c
@@ -0,0 +1,48 @@
+/* Add a dirfile field to a read-only dirfile*/
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 2);
+ CHECKI(error, GD_E_ACCMODE);
+
+ return r;
+}
diff --git a/test/add_recip.c b/test/add_recip.c
new file mode 100644
index 0000000..3ff76c7
--- /dev/null
+++ b/test/add_recip.c
@@ -0,0 +1,43 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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");
+ CHECKI(e.comp_scal, 0);
+ CHECKF(e.EN(recip,dividend), 33.3);
+ CHECKI(e.fragment_index, 0);
+
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_sbit.c b/test/add_sbit.c
new file mode 100644
index 0000000..1991bc8
--- /dev/null
+++ b/test/add_sbit.c
@@ -0,0 +1,44 @@
+/* Add a SBIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_scalar.c b/test/add_scalar.c
new file mode 100644
index 0000000..2f09f54
--- /dev/null
+++ b/test/add_scalar.c
@@ -0,0 +1,59 @@
+/* Add a dirfile field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ DIRFILE *D;
+
+ gd_entry_t E, e;
+ E.field = "data";
+ E.field_type = GD_LINCOM_ENTRY;
+ E.fragment_index = 0;
+ E.EN(lincom,n_fields) = 1;
+ E.comp_scal = 0;
+ E.in_fields[0] = "INDEX";
+ E.EN(lincom,m)[0] = 1.;
+ E.scalar[0] = NULL;
+ E.scalar[0 + GD_MAX_LINCOM] = "c";
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_sort.c b/test/add_sort.c
new file mode 100644
index 0000000..20f3175
--- /dev/null
+++ b/test/add_sort.c
@@ -0,0 +1,85 @@
+/* Field sort test for dirfile_add */
+#include "test.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int r = 0;
+
+void CheckSPF(DIRFILE *D, const char* f, 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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* a = __TEST__ "dirfile/a";
+ const char* b = __TEST__ "dirfile/b";
+ const char* c = __TEST__ "dirfile/c";
+ const char* d = __TEST__ "dirfile/d";
+ const char* e = __TEST__ "dirfile/e";
+ const char* f = __TEST__ "dirfile/f";
+ const char* g = __TEST__ "dirfile/g";
+ const char* h = __TEST__ "dirfile/h";
+ const char* i = __TEST__ "dirfile/i";
+ const char* j = __TEST__ "dirfile/j";
+ const char* k = __TEST__ "dirfile/k";
+
+ DIRFILE *D;
+
+ 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_close(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;
+}
diff --git a/test/add_spec.c b/test/add_spec.c
new file mode 100644
index 0000000..37d4118
--- /dev/null
+++ b/test/add_spec.c
@@ -0,0 +1,46 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ int error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ if (unlink(data))
+ r = 1;
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_spec_directive.c b/test/add_spec_directive.c
new file mode 100644
index 0000000..645a373
--- /dev/null
+++ b/test/add_spec_directive.c
@@ -0,0 +1,37 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/INCLUDE";
+ int error, n, r = 0;
+
+ DIRFILE* 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_close(D);
+
+ if (!unlink(data))
+ r = 1;
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(error, GD_E_FORMAT);
+
+ return r;
+}
diff --git a/test/add_spec_invalid.c b/test/add_spec_invalid.c
new file mode 100644
index 0000000..f71210c
--- /dev/null
+++ b/test/add_spec_invalid.c
@@ -0,0 +1,23 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_add_spec(D, "data RAW UINT8 2", 0);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/add_spec_meta.c b/test/add_spec_meta.c
new file mode 100644
index 0000000..48ca364
--- /dev/null
+++ b/test/add_spec_meta.c
@@ -0,0 +1,48 @@
+/* add a barth-style meta field with add_spec */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, r = 0;
+ gd_entry_t e;
+ unsigned char val;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/add_string.c b/test/add_string.c
new file mode 100644
index 0000000..7938ed5
--- /dev/null
+++ b/test/add_string.c
@@ -0,0 +1,45 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ gd_entry_t e;
+ char val[1000];
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/add_type.c b/test/add_type.c
new file mode 100644
index 0000000..2b9e5f6
--- /dev/null
+++ b/test/add_type.c
@@ -0,0 +1,40 @@
+/* Add a dirfile field with bad entry type */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ D = gd_open(filedir, GD_RDWR | GD_CREAT);
+ gd_add(D, &E);
+ error = gd_error(D);
+
+ /* check */
+ n = gd_nfields(D);
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,1);
+ CHECKI(error, GD_E_BAD_ENTRY);
+ return r;
+}
diff --git a/test/alter_bit_bitnum.c b/test/alter_bit_bitnum.c
new file mode 100644
index 0000000..dbf5b1f
--- /dev/null
+++ b/test/alter_bit_bitnum.c
@@ -0,0 +1,56 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_bit_numbits.c b/test/alter_bit_numbits.c
new file mode 100644
index 0000000..48739e6
--- /dev/null
+++ b/test/alter_bit_numbits.c
@@ -0,0 +1,56 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_carray_len.c b/test/alter_carray_len.c
new file mode 100644
index 0000000..81d6621
--- /dev/null
+++ b/test/alter_carray_len.c
@@ -0,0 +1,48 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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];
+
+ 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_carray_len(D, "carray");
+ n = gd_get_carray(D, "carray", GD_FLOAT64, &d);
+
+ gd_close(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;
+}
diff --git a/test/alter_carray_type.c b/test/alter_carray_type.c
new file mode 100644
index 0000000..bdd1f75
--- /dev/null
+++ b/test/alter_carray_type.c
@@ -0,0 +1,48 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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];
+
+ 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_carray_len(D, "carray");
+ n = gd_get_carray(D, "carray", GD_FLOAT64, &d);
+
+ gd_close(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;
+}
diff --git a/test/alter_const.c b/test/alter_const.c
new file mode 100644
index 0000000..4655e39
--- /dev/null
+++ b/test/alter_const.c
@@ -0,0 +1,44 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const CONST FLOAT32 8.3\n";
+ int fd, ret, error, n, r = 0;
+ DIRFILE *D;
+ double d;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 0);
+ CHECKI(ret, 0);
+ CHECKF(d, 8.);
+
+ return r;
+}
diff --git a/test/alter_cpolynom.c b/test/alter_cpolynom.c
new file mode 100644
index 0000000..ed6f3a3
--- /dev/null
+++ b/test/alter_cpolynom.c
@@ -0,0 +1,73 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_crecip.c b/test/alter_crecip.c
new file mode 100644
index 0000000..77fae1b
--- /dev/null
+++ b/test/alter_crecip.c
@@ -0,0 +1,62 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_crecip89.c b/test/alter_crecip89.c
new file mode 100644
index 0000000..3c05158
--- /dev/null
+++ b/test/alter_crecip89.c
@@ -0,0 +1,60 @@
+/* Test field modifying */
+#define GD_C89_API
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_crecip_zero.c b/test/alter_crecip_zero.c
new file mode 100644
index 0000000..52745f9
--- /dev/null
+++ b/test/alter_crecip_zero.c
@@ -0,0 +1,62 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_divide.c b/test/alter_divide.c
new file mode 100644
index 0000000..61dd0cb
--- /dev/null
+++ b/test/alter_divide.c
@@ -0,0 +1,57 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_entry.c b/test/alter_entry.c
new file mode 100644
index 0000000..bc02463
--- /dev/null
+++ b/test/alter_entry.c
@@ -0,0 +1,57 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 11);
+ CHECKI(ret, 0);
+ gd_free_entry_strings(&E);
+
+ return r;
+}
diff --git a/test/alter_entry_recode.c b/test/alter_entry_recode.c
new file mode 100644
index 0000000..5785b23
--- /dev/null
+++ b/test/alter_entry_recode.c
@@ -0,0 +1,73 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ fd = open(data, O_RDONLY | O_BINARY);
+ i = 0;
+
+ if (fd >= 0) {
+ while (read(fd, &d, sizeof(uint16_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);
+ gd_free_entry_strings(&E);
+
+ return r;
+}
diff --git a/test/alter_entry_scalar2a.c b/test/alter_entry_scalar2a.c
new file mode 100644
index 0000000..f474c69
--- /dev/null
+++ b/test/alter_entry_scalar2a.c
@@ -0,0 +1,51 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/alter_entry_scalar2n.c b/test/alter_entry_scalar2n.c
new file mode 100644
index 0000000..2645513
--- /dev/null
+++ b/test/alter_entry_scalar2n.c
@@ -0,0 +1,59 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_entry_scalar3.c b/test/alter_entry_scalar3.c
new file mode 100644
index 0000000..68f4b4f
--- /dev/null
+++ b/test/alter_entry_scalar3.c
@@ -0,0 +1,50 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/alter_entry_scalar4.c b/test/alter_entry_scalar4.c
new file mode 100644
index 0000000..fba5511
--- /dev/null
+++ b/test/alter_entry_scalar4.c
@@ -0,0 +1,51 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/alter_lincom_23.c b/test/alter_lincom_23.c
new file mode 100644
index 0000000..ebdc95b
--- /dev/null
+++ b/test/alter_lincom_23.c
@@ -0,0 +1,60 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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};
+
+ 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_close(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;
+}
diff --git a/test/alter_lincom_32.c b/test/alter_lincom_32.c
new file mode 100644
index 0000000..e1c8386
--- /dev/null
+++ b/test/alter_lincom_32.c
@@ -0,0 +1,60 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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};
+
+ 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_close(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;
+}
diff --git a/test/alter_lincom_input.c b/test/alter_lincom_input.c
new file mode 100644
index 0000000..aedca91
--- /dev/null
+++ b/test/alter_lincom_input.c
@@ -0,0 +1,58 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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};
+
+ 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_close(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;
+}
diff --git a/test/alter_lincom_offset.c b/test/alter_lincom_offset.c
new file mode 100644
index 0000000..5cf7951
--- /dev/null
+++ b/test/alter_lincom_offset.c
@@ -0,0 +1,59 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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};
+
+ 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_close(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;
+}
diff --git a/test/alter_lincom_slope.c b/test/alter_lincom_slope.c
new file mode 100644
index 0000000..a4f2fb2
--- /dev/null
+++ b/test/alter_lincom_slope.c
@@ -0,0 +1,59 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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};
+
+ 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_close(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;
+}
diff --git a/test/alter_linterp.c b/test/alter_linterp.c
new file mode 100644
index 0000000..2a114ff
--- /dev/null
+++ b/test/alter_linterp.c
@@ -0,0 +1,78 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* table = __TEST__ "dirfile/table";
+ const char* table1 = __TEST__ "dirfile/table1";
+ const char* data = __TEST__ "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, error, error2, n, unlink_table, r = 0;
+ DIRFILE *D;
+
+ 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", 0);
+ error = gd_error(D);
+ gd_entry(D, "lut", &e);
+ error2 = gd_error(D);
+ n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink_table = unlink(table);
+ unlink(table1);
+ unlink(format);
+ rmdir(filedir);
+
+ for (i = 0; i < 8; ++i)
+ CHECKIi(i,c[i], (i + 40) * 10);
+
+ CHECKI(error, 0);
+ CHECKI(n, 8);
+ CHECKI(ret, 0);
+ CHECKI(unlink_table, 0);
+ CHECKI(error2, 0);
+ CHECKS(e.in_fields[0], "data");
+ CHECKS(e.EN(linterp,table), "table1");
+ gd_free_entry_strings(&e);
+
+ return r;
+}
diff --git a/test/alter_linterp_move.c b/test/alter_linterp_move.c
new file mode 100644
index 0000000..4515032
--- /dev/null
+++ b/test/alter_linterp_move.c
@@ -0,0 +1,71 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* table = __TEST__ "dirfile/table";
+ const char* table1 = __TEST__ "dirfile/table1";
+ const char* data = __TEST__ "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, error, n, unlink_table, r = 0;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+ n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c);
+
+ gd_close(D);
+
+ 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(error,0);
+ CHECKI(n,8);
+ CHECKI(ret,0);
+ CHECKI(unlink_table,-1);
+
+ return r;
+}
diff --git a/test/alter_mspec.c b/test/alter_mspec.c
new file mode 100644
index 0000000..4b39ca8
--- /dev/null
+++ b/test/alter_mspec.c
@@ -0,0 +1,56 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_multiply.c b/test/alter_multiply.c
new file mode 100644
index 0000000..29da56e
--- /dev/null
+++ b/test/alter_multiply.c
@@ -0,0 +1,57 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_phase.c b/test/alter_phase.c
new file mode 100644
index 0000000..083dbca
--- /dev/null
+++ b/test/alter_phase.c
@@ -0,0 +1,56 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_polynom_coeff.c b/test/alter_polynom_coeff.c
new file mode 100644
index 0000000..96794b4
--- /dev/null
+++ b/test/alter_polynom_coeff.c
@@ -0,0 +1,70 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ CHECKS(E.field, "polynom");
+ CHECKI(E.field_type, GD_POLYNOM_ENTRY);
+ CHECKI(E.EN(polynom,poly_ord), 2);
+ CHECKI(E.comp_scal, 0);
+ 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;
+}
diff --git a/test/alter_polynom_input.c b/test/alter_polynom_input.c
new file mode 100644
index 0000000..b96680d
--- /dev/null
+++ b/test/alter_polynom_input.c
@@ -0,0 +1,59 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_polynom_ord.c b/test/alter_polynom_ord.c
new file mode 100644
index 0000000..0030b2e
--- /dev/null
+++ b/test/alter_polynom_ord.c
@@ -0,0 +1,59 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_raw_spf.c b/test/alter_raw_spf.c
new file mode 100644
index 0000000..043771f
--- /dev/null
+++ b/test/alter_raw_spf.c
@@ -0,0 +1,68 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_raw_type.c b/test/alter_raw_type.c
new file mode 100644
index 0000000..4b67d87
--- /dev/null
+++ b/test/alter_raw_type.c
@@ -0,0 +1,68 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_recip.c b/test/alter_recip.c
new file mode 100644
index 0000000..c8e9eaf
--- /dev/null
+++ b/test/alter_recip.c
@@ -0,0 +1,57 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_recip_zero.c b/test/alter_recip_zero.c
new file mode 100644
index 0000000..f4871a7
--- /dev/null
+++ b/test/alter_recip_zero.c
@@ -0,0 +1,57 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_spec.c b/test/alter_spec.c
new file mode 100644
index 0000000..7a77c9a
--- /dev/null
+++ b/test/alter_spec.c
@@ -0,0 +1,68 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/alter_spec_meta.c b/test/alter_spec_meta.c
new file mode 100644
index 0000000..8d2e2f1
--- /dev/null
+++ b/test/alter_spec_meta.c
@@ -0,0 +1,56 @@
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/ascii_get.c b/test/ascii_get.c
new file mode 100644
index 0000000..52a1006
--- /dev/null
+++ b/test/ascii_get.c
@@ -0,0 +1,51 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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" FOPEN_TEXT);
+ 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_close(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;
+}
diff --git a/test/ascii_get_get.c b/test/ascii_get_get.c
new file mode 100644
index 0000000..a905dbb
--- /dev/null
+++ b/test/ascii_get_get.c
@@ -0,0 +1,58 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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" FOPEN_TEXT);
+ 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_close(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;
+}
diff --git a/test/ascii_nframes.c b/test/ascii_nframes.c
new file mode 100644
index 0000000..bccd40a
--- /dev/null
+++ b/test/ascii_nframes.c
@@ -0,0 +1,46 @@
+/* Retreiving the number of frames should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data.txt";
+ const char* format_data = "data RAW UINT8 1\n";
+ int i, r = 0;
+ FILE* stream;
+ size_t n, m;
+ DIRFILE *D;
+
+ 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" FOPEN_TEXT);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 256);
+ CHECKI(m, 256);
+
+ return r;
+}
diff --git a/test/ascii_put.c b/test/ascii_put.c
new file mode 100644
index 0000000..44bca2d
--- /dev/null
+++ b/test/ascii_put.c
@@ -0,0 +1,67 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data.txt";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8];
+ int d, n, error;
+ int fd, i, r = 0;
+ struct stat buf;
+ FILE* stream;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf))
+ return 1;
+
+ stream = fopen(data, "r" FOPEN_TEXT);
+ 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);
+
+ CHECKI(error,0);
+ CHECKI(n,8);
+
+ return r;
+}
diff --git a/test/bof.c b/test/bof.c
new file mode 100644
index 0000000..81f12ce
--- /dev/null
+++ b/test/bof.c
@@ -0,0 +1,43 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT16 2\n/FRAMEOFFSET 35\n";
+ int fd, error, r = 0;
+ off_t n;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 70);
+
+ return r;
+}
diff --git a/test/bof_lincom.c b/test/bof_lincom.c
new file mode 100644
index 0000000..970e1a5
--- /dev/null
+++ b/test/bof_lincom.c
@@ -0,0 +1,61 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/bof_phase.c b/test/bof_phase.c
new file mode 100644
index 0000000..5cda96e
--- /dev/null
+++ b/test/bof_phase.c
@@ -0,0 +1,64 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/bzip_get.c b/test/bzip_get.c
new file mode 100644
index 0000000..05b9c9c
--- /dev/null
+++ b/test/bzip_get.c
@@ -0,0 +1,75 @@
+/* Attempt to read UINT8 */
+#include "../src/config.h"
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* bzip2data = __TEST__ "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, i, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_close(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
+}
diff --git a/test/bzip_get_get.c b/test/bzip_get_get.c
new file mode 100644
index 0000000..a97e69d
--- /dev/null
+++ b/test/bzip_get_get.c
@@ -0,0 +1,75 @@
+/* Attempt to read UINT8 */
+#include "../src/config.h"
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#if !defined USE_BZIP2 || !defined TEST_BZIP2
+ return 77; /* skip test */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* gzipdata = __TEST__ "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);
+ 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);
+ error1 = gd_error(D);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
+ error2 = gd_error(D);
+ gd_close(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) {
+ CHECKIi(i,c1[i], 40 + i)
+ CHECKIi(i,c2[i], 40 + i)
+ }
+
+ return r;
+#endif
+}
diff --git a/test/bzip_move_from.c b/test/bzip_move_from.c
new file mode 100644
index 0000000..a83aedf
--- /dev/null
+++ b/test/bzip_move_from.c
@@ -0,0 +1,108 @@
+/* Test move */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "dirfile/data";
+ const char* bz2data = __TEST__ "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, error, ge_ret, unlink_data, unlink_bz2data, r = 0, i = 0;
+ char command[4096];
+ gd_entry_t E;
+ DIRFILE *D;
+ uint16_t d;
+
+ 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);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(D);
+
+#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(error, GD_E_OK);
+ CHECKI(ge_ret, 0);
+ CHECKI(E.fragment_index, 1);
+ CHECKI(unlink_data, 0);
+ CHECKI(unlink_bz2data, -1);
+#else
+ CHECKI(ret, -1);
+ CHECKI(error, GD_E_UNSUPPORTED);
+ CHECKI(ge_ret, 0);
+ CHECKI(E.fragment_index, 0);
+ CHECKI(unlink_data, -1);
+ CHECKI(unlink_bz2data, 0);
+#endif
+ gd_free_entry_strings(&E);
+
+ return r;
+#endif
+}
diff --git a/test/bzip_nframes.c b/test/bzip_nframes.c
new file mode 100644
index 0000000..de841a7
--- /dev/null
+++ b/test/bzip_nframes.c
@@ -0,0 +1,72 @@
+/* Retreiving the number of frames should succeed cleanly */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* gzipdata = __TEST__ "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;
+
+ 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_close(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
+}
diff --git a/test/close.c b/test/close.c
new file mode 100644
index 0000000..e9c6acf
--- /dev/null
+++ b/test/close.c
@@ -0,0 +1,29 @@
+/* Closing a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ DIRFILE *D;
+
+ 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;
+}
diff --git a/test/close_bad.c b/test/close_bad.c
new file mode 100644
index 0000000..ec327eb
--- /dev/null
+++ b/test/close_bad.c
@@ -0,0 +1,13 @@
+/* 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;
+}
diff --git a/test/close_discard.c b/test/close_discard.c
new file mode 100644
index 0000000..eaa1eea
--- /dev/null
+++ b/test/close_discard.c
@@ -0,0 +1,37 @@
+/* Closing a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ int ret, n, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(ret, 0);
+ CHECKI(n, 1);
+
+ return r;
+}
diff --git a/test/close_null.c b/test/close_null.c
new file mode 100644
index 0000000..78dc639
--- /dev/null
+++ b/test/close_null.c
@@ -0,0 +1,12 @@
+/* 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;
+}
diff --git a/test/convert_complex128_complex64.c b/test/convert_complex128_complex64.c
new file mode 100644
index 0000000..7f16437
--- /dev/null
+++ b/test/convert_complex128_complex64.c
@@ -0,0 +1,71 @@
+/* Attempt to read COMPLEX128 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_complex128_float64.c b/test/convert_complex128_float64.c
new file mode 100644
index 0000000..884a249
--- /dev/null
+++ b/test/convert_complex128_float64.c
@@ -0,0 +1,53 @@
+/* Attempt to read COMPLEX128 as FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n1, 0);
+ CHECKI(n2, 0);
+ CHECKF(c, 8.);
+
+ return r;
+}
diff --git a/test/convert_complex128_int64.c b/test/convert_complex128_int64.c
new file mode 100644
index 0000000..71a4a1a
--- /dev/null
+++ b/test/convert_complex128_int64.c
@@ -0,0 +1,52 @@
+/* Attempt to read COMPLEX128 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n1, 0);
+ CHECKI(n2, 0);
+ CHECKI(c, 8);
+
+ return r;
+}
diff --git a/test/convert_complex128_uint64.c b/test/convert_complex128_uint64.c
new file mode 100644
index 0000000..b2a1403
--- /dev/null
+++ b/test/convert_complex128_uint64.c
@@ -0,0 +1,52 @@
+/* Attempt to read COMPLEX128 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n1, 0);
+ CHECKI(n2, 0);
+ CHECKU(c, 8);
+
+ return r;
+}
diff --git a/test/convert_complex64_complex128.c b/test/convert_complex64_complex128.c
new file mode 100644
index 0000000..300b459
--- /dev/null
+++ b/test/convert_complex64_complex128.c
@@ -0,0 +1,70 @@
+/* Attempt to read COMPLEX64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_complex64_float64.c b/test/convert_complex64_float64.c
new file mode 100644
index 0000000..293ff96
--- /dev/null
+++ b/test/convert_complex64_float64.c
@@ -0,0 +1,53 @@
+/* Attempt to read COMPLEX64 as FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n1, 0);
+ CHECKI(n2, 0);
+ CHECKF(c, 8.);
+
+ return r;
+}
diff --git a/test/convert_complex64_int64.c b/test/convert_complex64_int64.c
new file mode 100644
index 0000000..fd5712a
--- /dev/null
+++ b/test/convert_complex64_int64.c
@@ -0,0 +1,52 @@
+/* Attempt to read COMPLEX64 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n1, 0);
+ CHECKI(n2, 0);
+ CHECKI(c, 8);
+
+ return r;
+}
diff --git a/test/convert_complex64_uint64.c b/test/convert_complex64_uint64.c
new file mode 100644
index 0000000..cfeb79e
--- /dev/null
+++ b/test/convert_complex64_uint64.c
@@ -0,0 +1,52 @@
+/* Attempt to read COMPLEX64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n1, 0);
+ CHECKI(n2, 0);
+ CHECKU(c, 8);
+
+ return r;
+}
diff --git a/test/convert_float32_complex128.c b/test/convert_float32_complex128.c
new file mode 100644
index 0000000..089f4e9
--- /dev/null
+++ b/test/convert_float32_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read FLOAT32 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_float32_complex64.c b/test/convert_float32_complex64.c
new file mode 100644
index 0000000..c51baa8
--- /dev/null
+++ b/test/convert_float32_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read FLOAT32 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_float32_float64.c b/test/convert_float32_float64.c
new file mode 100644
index 0000000..8c7eab3
--- /dev/null
+++ b/test/convert_float32_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT32 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_int16.c b/test/convert_float32_int16.c
new file mode 100644
index 0000000..3f3eaf1
--- /dev/null
+++ b/test/convert_float32_int16.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_int32.c b/test/convert_float32_int32.c
new file mode 100644
index 0000000..d704072
--- /dev/null
+++ b/test/convert_float32_int32.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_int64.c b/test/convert_float32_int64.c
new file mode 100644
index 0000000..43c6f1e
--- /dev/null
+++ b/test/convert_float32_int64.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_int8.c b/test/convert_float32_int8.c
new file mode 100644
index 0000000..5e63941
--- /dev/null
+++ b/test/convert_float32_int8.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_uint16.c b/test/convert_float32_uint16.c
new file mode 100644
index 0000000..b378036
--- /dev/null
+++ b/test/convert_float32_uint16.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_uint32.c b/test/convert_float32_uint32.c
new file mode 100644
index 0000000..155a79f
--- /dev/null
+++ b/test/convert_float32_uint32.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_uint64.c b/test/convert_float32_uint64.c
new file mode 100644
index 0000000..580be7b
--- /dev/null
+++ b/test/convert_float32_uint64.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float32_uint8.c b/test/convert_float32_uint8.c
new file mode 100644
index 0000000..6e938c2
--- /dev/null
+++ b/test/convert_float32_uint8.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_complex128.c b/test/convert_float64_complex128.c
new file mode 100644
index 0000000..7713956
--- /dev/null
+++ b/test/convert_float64_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read FLOAT64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_float64_complex64.c b/test/convert_float64_complex64.c
new file mode 100644
index 0000000..b2a1c6c
--- /dev/null
+++ b/test/convert_float64_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read FLOAT64 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_float64_float32.c b/test/convert_float64_float32.c
new file mode 100644
index 0000000..ac1a86e
--- /dev/null
+++ b/test/convert_float64_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_int16.c b/test/convert_float64_int16.c
new file mode 100644
index 0000000..1f008a3
--- /dev/null
+++ b/test/convert_float64_int16.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_int32.c b/test/convert_float64_int32.c
new file mode 100644
index 0000000..1a3991e
--- /dev/null
+++ b/test/convert_float64_int32.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_int64.c b/test/convert_float64_int64.c
new file mode 100644
index 0000000..eecee06
--- /dev/null
+++ b/test/convert_float64_int64.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_int8.c b/test/convert_float64_int8.c
new file mode 100644
index 0000000..d074593
--- /dev/null
+++ b/test/convert_float64_int8.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_uint16.c b/test/convert_float64_uint16.c
new file mode 100644
index 0000000..c914429
--- /dev/null
+++ b/test/convert_float64_uint16.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_uint32.c b/test/convert_float64_uint32.c
new file mode 100644
index 0000000..6840e78
--- /dev/null
+++ b/test/convert_float64_uint32.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_uint64.c b/test/convert_float64_uint64.c
new file mode 100644
index 0000000..103d3ce
--- /dev/null
+++ b/test/convert_float64_uint64.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_float64_uint8.c b/test/convert_float64_uint8.c
new file mode 100644
index 0000000..5fd3a0b
--- /dev/null
+++ b/test/convert_float64_uint8.c
@@ -0,0 +1,54 @@
+/* Attempt to read FLOAT64 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_complex128.c b/test/convert_int16_complex128.c
new file mode 100644
index 0000000..f9d4887
--- /dev/null
+++ b/test/convert_int16_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT16 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int16_complex64.c b/test/convert_int16_complex64.c
new file mode 100644
index 0000000..6e85456
--- /dev/null
+++ b/test/convert_int16_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT16 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int16_float32.c b/test/convert_int16_float32.c
new file mode 100644
index 0000000..c9a6e83
--- /dev/null
+++ b/test/convert_int16_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT16 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_float64.c b/test/convert_int16_float64.c
new file mode 100644
index 0000000..99916b8
--- /dev/null
+++ b/test/convert_int16_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT16 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_int32.c b/test/convert_int16_int32.c
new file mode 100644
index 0000000..8811fac
--- /dev/null
+++ b/test/convert_int16_int32.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT16 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_int64.c b/test/convert_int16_int64.c
new file mode 100644
index 0000000..c2a6b08
--- /dev/null
+++ b/test/convert_int16_int64.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT16 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_int8.c b/test/convert_int16_int8.c
new file mode 100644
index 0000000..75b7ad3
--- /dev/null
+++ b/test/convert_int16_int8.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT16 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_uint16.c b/test/convert_int16_uint16.c
new file mode 100644
index 0000000..7614d97
--- /dev/null
+++ b/test/convert_int16_uint16.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT16 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_uint32.c b/test/convert_int16_uint32.c
new file mode 100644
index 0000000..4fd1124
--- /dev/null
+++ b/test/convert_int16_uint32.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT16 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_uint64.c b/test/convert_int16_uint64.c
new file mode 100644
index 0000000..e2746e8
--- /dev/null
+++ b/test/convert_int16_uint64.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT16 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int16_uint8.c b/test/convert_int16_uint8.c
new file mode 100644
index 0000000..1e8ae7f
--- /dev/null
+++ b/test/convert_int16_uint8.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT16 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_complex128.c b/test/convert_int32_complex128.c
new file mode 100644
index 0000000..891bfee
--- /dev/null
+++ b/test/convert_int32_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT32 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int32_complex64.c b/test/convert_int32_complex64.c
new file mode 100644
index 0000000..33ca68c
--- /dev/null
+++ b/test/convert_int32_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT32 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int32_float32.c b/test/convert_int32_float32.c
new file mode 100644
index 0000000..f2ba994
--- /dev/null
+++ b/test/convert_int32_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_float64.c b/test/convert_int32_float64.c
new file mode 100644
index 0000000..8c44e46
--- /dev/null
+++ b/test/convert_int32_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_int16.c b/test/convert_int32_int16.c
new file mode 100644
index 0000000..0b6401e
--- /dev/null
+++ b/test/convert_int32_int16.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_int64.c b/test/convert_int32_int64.c
new file mode 100644
index 0000000..2b698d8
--- /dev/null
+++ b/test/convert_int32_int64.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_int8.c b/test/convert_int32_int8.c
new file mode 100644
index 0000000..34a591a
--- /dev/null
+++ b/test/convert_int32_int8.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_uint16.c b/test/convert_int32_uint16.c
new file mode 100644
index 0000000..bcc3e19
--- /dev/null
+++ b/test/convert_int32_uint16.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_uint32.c b/test/convert_int32_uint32.c
new file mode 100644
index 0000000..ed27918
--- /dev/null
+++ b/test/convert_int32_uint32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_uint64.c b/test/convert_int32_uint64.c
new file mode 100644
index 0000000..59d8059
--- /dev/null
+++ b/test/convert_int32_uint64.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int32_uint8.c b/test/convert_int32_uint8.c
new file mode 100644
index 0000000..7b3f59a
--- /dev/null
+++ b/test/convert_int32_uint8.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_complex128.c b/test/convert_int64_complex128.c
new file mode 100644
index 0000000..2c2d916
--- /dev/null
+++ b/test/convert_int64_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int64_complex64.c b/test/convert_int64_complex64.c
new file mode 100644
index 0000000..4059c61
--- /dev/null
+++ b/test/convert_int64_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT64 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int64_float32.c b/test/convert_int64_float32.c
new file mode 100644
index 0000000..0d8b70e
--- /dev/null
+++ b/test/convert_int64_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_float64.c b/test/convert_int64_float64.c
new file mode 100644
index 0000000..cdee8ba
--- /dev/null
+++ b/test/convert_int64_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_int16.c b/test/convert_int64_int16.c
new file mode 100644
index 0000000..4af8eb4
--- /dev/null
+++ b/test/convert_int64_int16.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_int32.c b/test/convert_int64_int32.c
new file mode 100644
index 0000000..837ec6d
--- /dev/null
+++ b/test/convert_int64_int32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_int8.c b/test/convert_int64_int8.c
new file mode 100644
index 0000000..0dd16d6
--- /dev/null
+++ b/test/convert_int64_int8.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_uint16.c b/test/convert_int64_uint16.c
new file mode 100644
index 0000000..2002470
--- /dev/null
+++ b/test/convert_int64_uint16.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_uint32.c b/test/convert_int64_uint32.c
new file mode 100644
index 0000000..38d52fe
--- /dev/null
+++ b/test/convert_int64_uint32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_uint64.c b/test/convert_int64_uint64.c
new file mode 100644
index 0000000..59c6a87
--- /dev/null
+++ b/test/convert_int64_uint64.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int64_uint8.c b/test/convert_int64_uint8.c
new file mode 100644
index 0000000..736d9fb
--- /dev/null
+++ b/test/convert_int64_uint8.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT64 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_complex128.c b/test/convert_int8_complex128.c
new file mode 100644
index 0000000..ebf5ee1
--- /dev/null
+++ b/test/convert_int8_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT8 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int8_complex64.c b/test/convert_int8_complex64.c
new file mode 100644
index 0000000..9a231cd
--- /dev/null
+++ b/test/convert_int8_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read INT8 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_int8_float32.c b/test/convert_int8_float32.c
new file mode 100644
index 0000000..258b876
--- /dev/null
+++ b/test/convert_int8_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT8 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_float64.c b/test/convert_int8_float64.c
new file mode 100644
index 0000000..e55c805
--- /dev/null
+++ b/test/convert_int8_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT8 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_int16.c b/test/convert_int8_int16.c
new file mode 100644
index 0000000..ecd25e6
--- /dev/null
+++ b/test/convert_int8_int16.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT8 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_int32.c b/test/convert_int8_int32.c
new file mode 100644
index 0000000..b8c47cc
--- /dev/null
+++ b/test/convert_int8_int32.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT8 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_int64.c b/test/convert_int8_int64.c
new file mode 100644
index 0000000..0a01154
--- /dev/null
+++ b/test/convert_int8_int64.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT8 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_uint16.c b/test/convert_int8_uint16.c
new file mode 100644
index 0000000..67daa25
--- /dev/null
+++ b/test/convert_int8_uint16.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT8 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_uint32.c b/test/convert_int8_uint32.c
new file mode 100644
index 0000000..b75d6d8
--- /dev/null
+++ b/test/convert_int8_uint32.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT8 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_uint64.c b/test/convert_int8_uint64.c
new file mode 100644
index 0000000..7b7c79e
--- /dev/null
+++ b/test/convert_int8_uint64.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT8 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_int8_uint8.c b/test/convert_int8_uint8.c
new file mode 100644
index 0000000..a985646
--- /dev/null
+++ b/test/convert_int8_uint8.c
@@ -0,0 +1,53 @@
+/* Attempt to read INT8 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_complex128.c b/test/convert_uint16_complex128.c
new file mode 100644
index 0000000..802d312
--- /dev/null
+++ b/test/convert_uint16_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT16 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint16_complex64.c b/test/convert_uint16_complex64.c
new file mode 100644
index 0000000..ab2be2b
--- /dev/null
+++ b/test/convert_uint16_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT16 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint16_float32.c b/test/convert_uint16_float32.c
new file mode 100644
index 0000000..f0eedee
--- /dev/null
+++ b/test/convert_uint16_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT16 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_float64.c b/test/convert_uint16_float64.c
new file mode 100644
index 0000000..f706607
--- /dev/null
+++ b/test/convert_uint16_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT16 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_int16.c b/test/convert_uint16_int16.c
new file mode 100644
index 0000000..4f84679
--- /dev/null
+++ b/test/convert_uint16_int16.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_int32.c b/test/convert_uint16_int32.c
new file mode 100644
index 0000000..4463022
--- /dev/null
+++ b/test/convert_uint16_int32.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_int64.c b/test/convert_uint16_int64.c
new file mode 100644
index 0000000..7dbc943
--- /dev/null
+++ b/test/convert_uint16_int64.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_int8.c b/test/convert_uint16_int8.c
new file mode 100644
index 0000000..1f0bca4
--- /dev/null
+++ b/test/convert_uint16_int8.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_uint32.c b/test/convert_uint16_uint32.c
new file mode 100644
index 0000000..118c992
--- /dev/null
+++ b/test/convert_uint16_uint32.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_uint64.c b/test/convert_uint16_uint64.c
new file mode 100644
index 0000000..5a0ba72
--- /dev/null
+++ b/test/convert_uint16_uint64.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint16_uint8.c b/test/convert_uint16_uint8.c
new file mode 100644
index 0000000..7778100
--- /dev/null
+++ b/test/convert_uint16_uint8.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_complex128.c b/test/convert_uint32_complex128.c
new file mode 100644
index 0000000..96b61b2
--- /dev/null
+++ b/test/convert_uint32_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT32 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint32_complex64.c b/test/convert_uint32_complex64.c
new file mode 100644
index 0000000..3d9437e
--- /dev/null
+++ b/test/convert_uint32_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT32 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint32_float32.c b/test/convert_uint32_float32.c
new file mode 100644
index 0000000..68ff3b1
--- /dev/null
+++ b/test/convert_uint32_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_float64.c b/test/convert_uint32_float64.c
new file mode 100644
index 0000000..fe70280
--- /dev/null
+++ b/test/convert_uint32_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_int16.c b/test/convert_uint32_int16.c
new file mode 100644
index 0000000..5438102
--- /dev/null
+++ b/test/convert_uint32_int16.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_int32.c b/test/convert_uint32_int32.c
new file mode 100644
index 0000000..a57f5a0
--- /dev/null
+++ b/test/convert_uint32_int32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_int64.c b/test/convert_uint32_int64.c
new file mode 100644
index 0000000..fa585f9
--- /dev/null
+++ b/test/convert_uint32_int64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_int8.c b/test/convert_uint32_int8.c
new file mode 100644
index 0000000..1969e8c
--- /dev/null
+++ b/test/convert_uint32_int8.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_uint16.c b/test/convert_uint32_uint16.c
new file mode 100644
index 0000000..ab4daf5
--- /dev/null
+++ b/test/convert_uint32_uint16.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_uint64.c b/test/convert_uint32_uint64.c
new file mode 100644
index 0000000..48a5179
--- /dev/null
+++ b/test/convert_uint32_uint64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint32_uint8.c b/test/convert_uint32_uint8.c
new file mode 100644
index 0000000..5248c4d
--- /dev/null
+++ b/test/convert_uint32_uint8.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_complex128.c b/test/convert_uint64_complex128.c
new file mode 100644
index 0000000..d6123ab
--- /dev/null
+++ b/test/convert_uint64_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint64_complex64.c b/test/convert_uint64_complex64.c
new file mode 100644
index 0000000..3d8f88b
--- /dev/null
+++ b/test/convert_uint64_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT64 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint64_float32.c b/test/convert_uint64_float32.c
new file mode 100644
index 0000000..508b3c3
--- /dev/null
+++ b/test/convert_uint64_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_float64.c b/test/convert_uint64_float64.c
new file mode 100644
index 0000000..c5f46e1
--- /dev/null
+++ b/test/convert_uint64_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_int16.c b/test/convert_uint64_int16.c
new file mode 100644
index 0000000..a927872
--- /dev/null
+++ b/test/convert_uint64_int16.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_int32.c b/test/convert_uint64_int32.c
new file mode 100644
index 0000000..f6718cd
--- /dev/null
+++ b/test/convert_uint64_int32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_int64.c b/test/convert_uint64_int64.c
new file mode 100644
index 0000000..f903dc4
--- /dev/null
+++ b/test/convert_uint64_int64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_int8.c b/test/convert_uint64_int8.c
new file mode 100644
index 0000000..4dfffd2
--- /dev/null
+++ b/test/convert_uint64_int8.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_uint16.c b/test/convert_uint64_uint16.c
new file mode 100644
index 0000000..e89ea2e
--- /dev/null
+++ b/test/convert_uint64_uint16.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_uint32.c b/test/convert_uint64_uint32.c
new file mode 100644
index 0000000..9376292
--- /dev/null
+++ b/test/convert_uint64_uint32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint64_uint8.c b/test/convert_uint64_uint8.c
new file mode 100644
index 0000000..aa8430a
--- /dev/null
+++ b/test/convert_uint64_uint8.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT64 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_complex128.c b/test/convert_uint8_complex128.c
new file mode 100644
index 0000000..dccd703
--- /dev/null
+++ b/test/convert_uint8_complex128.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT8 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint8_complex64.c b/test/convert_uint8_complex64.c
new file mode 100644
index 0000000..c50807c
--- /dev/null
+++ b/test/convert_uint8_complex64.c
@@ -0,0 +1,64 @@
+/* Attempt to read UINT8 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+ CHECKCi(i,c[i], 40 + i);
+#endif
+ }
+
+ return r;
+}
diff --git a/test/convert_uint8_float32.c b/test/convert_uint8_float32.c
new file mode 100644
index 0000000..e8e9c49
--- /dev/null
+++ b/test/convert_uint8_float32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT8 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_float64.c b/test/convert_uint8_float64.c
new file mode 100644
index 0000000..1488146
--- /dev/null
+++ b/test/convert_uint8_float64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT8 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_int16.c b/test/convert_uint8_int16.c
new file mode 100644
index 0000000..6c4ff7d
--- /dev/null
+++ b/test/convert_uint8_int16.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT8 as INT16 */
+#include "test.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_int32.c b/test/convert_uint8_int32.c
new file mode 100644
index 0000000..4a13ee2
--- /dev/null
+++ b/test/convert_uint8_int32.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT8 as INT32 */
+#include "test.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_int64.c b/test/convert_uint8_int64.c
new file mode 100644
index 0000000..b735e0b
--- /dev/null
+++ b/test/convert_uint8_int64.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT8 as INT64 */
+#include "test.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_int8.c b/test/convert_uint8_int8.c
new file mode 100644
index 0000000..f0d1452
--- /dev/null
+++ b/test/convert_uint8_int8.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT8 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_uint16.c b/test/convert_uint8_uint16.c
new file mode 100644
index 0000000..5fb532b
--- /dev/null
+++ b/test/convert_uint8_uint16.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT8 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_uint32.c b/test/convert_uint8_uint32.c
new file mode 100644
index 0000000..00d7302
--- /dev/null
+++ b/test/convert_uint8_uint32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT8 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/convert_uint8_uint64.c b/test/convert_uint8_uint64.c
new file mode 100644
index 0000000..6687054
--- /dev/null
+++ b/test/convert_uint8_uint64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT8 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/creat.c b/test/creat.c
new file mode 100644
index 0000000..e15cf95
--- /dev/null
+++ b/test/creat.c
@@ -0,0 +1,29 @@
+/* Creating a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int unlink_ret, rmdir_ret, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+ int error = gd_error(D);
+ gd_close(D);
+
+ unlink_ret = unlink(format);
+ rmdir_ret = rmdir(filedir);
+
+ CHECKI(unlink_ret, 0);
+ CHECKI(rmdir_ret, 0);
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/creat_excl.c b/test/creat_excl.c
new file mode 100644
index 0000000..0f5608f
--- /dev/null
+++ b/test/creat_excl.c
@@ -0,0 +1,30 @@
+/* Exclusively creating an existing dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_CREAT);
+
+ return r;
+}
diff --git a/test/creat_rdonly.c b/test/creat_rdonly.c
new file mode 100644
index 0000000..c629f4a
--- /dev/null
+++ b/test/creat_rdonly.c
@@ -0,0 +1,29 @@
+/* Creating a read-only dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int unlink_ret, rmdir_ret, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY | GD_CREAT);
+ int error = gd_error(D);
+ gd_close(D);
+
+ unlink_ret = unlink(format);
+ rmdir_ret = rmdir(filedir);
+
+ CHECKI(unlink_ret, -1);
+ CHECKI(rmdir_ret, -1);
+ CHECKI(error, GD_E_ACCMODE);
+
+ return r;
+}
diff --git a/test/cvlist.c b/test/cvlist.c
new file mode 100644
index 0000000..8ac6676
--- /dev/null
+++ b/test/cvlist.c
@@ -0,0 +1,48 @@
+/* Retreiving the list of constant values should succeed cleanly */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/cvlist_array.c b/test/cvlist_array.c
new file mode 100644
index 0000000..9bf6f11
--- /dev/null
+++ b/test/cvlist_array.c
@@ -0,0 +1,54 @@
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/cvlist_array_meta.c b/test/cvlist_array_meta.c
new file mode 100644
index 0000000..a497d13
--- /dev/null
+++ b/test/cvlist_array_meta.c
@@ -0,0 +1,55 @@
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/cvlist_invalid.c b/test/cvlist_invalid.c
new file mode 100644
index 0000000..f39e432
--- /dev/null
+++ b/test/cvlist_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const void* fl = gd_constants(D, GD_UINT8);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/cvlist_meta.c b/test/cvlist_meta.c
new file mode 100644
index 0000000..3542667
--- /dev/null
+++ b/test/cvlist_meta.c
@@ -0,0 +1,47 @@
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/cvlist_meta_invalid.c b/test/cvlist_meta_invalid.c
new file mode 100644
index 0000000..c2175e5
--- /dev/null
+++ b/test/cvlist_meta_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const void* fl = gd_mconstants(D, "parent", GD_UINT8);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/del.c b/test/del.c
new file mode 100644
index 0000000..561f096
--- /dev/null
+++ b/test/del.c
@@ -0,0 +1,55 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ unsigned char c[8];
+ unsigned char data_data[256];
+ int fd, ret, error1, n, error2, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error1 = gd_error(D);
+ n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+ error2 = gd_error(D);
+ gd_close(D);
+
+ fd = unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(fd, 0);
+ CHECKI(error1, GD_E_OK);
+ CHECKI(n, 0);
+ CHECKI(ret, 0);
+ CHECKI(error2, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/del_carray.c b/test/del_carray.c
new file mode 100644
index 0000000..546f3ab
--- /dev/null
+++ b/test/del_carray.c
@@ -0,0 +1,39 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_DELETE);
+ CHECKI(ret, -1);
+
+ return r;
+}
diff --git a/test/del_carray_deref.c b/test/del_carray_deref.c
new file mode 100644
index 0000000..ff622b8
--- /dev/null
+++ b/test/del_carray_deref.c
@@ -0,0 +1,42 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+ gd_spf_t spf;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKU(spf, 15);
+ CHECKI(ret, 0);
+
+ return r;
+}
diff --git a/test/del_const.c b/test/del_const.c
new file mode 100644
index 0000000..d31001e
--- /dev/null
+++ b/test/del_const.c
@@ -0,0 +1,39 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data CONST UINT8 1\n"
+ "raw RAW UINT8 data\n";
+ int fd, ret, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_DELETE);
+ CHECKI(ret, -1);
+
+ return r;
+}
diff --git a/test/del_const_deref.c b/test/del_const_deref.c
new file mode 100644
index 0000000..a77bad8
--- /dev/null
+++ b/test/del_const_deref.c
@@ -0,0 +1,42 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data CONST UINT8 13\n"
+ "raw RAW UINT8 data\n";
+ int fd, ret, error, r = 0;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKU(spf, 13);
+ CHECKI(ret, 0);
+
+ return r;
+}
diff --git a/test/del_const_force.c b/test/del_const_force.c
new file mode 100644
index 0000000..e8d45ee
--- /dev/null
+++ b/test/del_const_force.c
@@ -0,0 +1,44 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+ gd_spf_t spf;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error1, GD_E_OK);
+ CHECKI(error2, GD_E_BAD_SCALAR);
+ CHECKU(spf, 0);
+ CHECKI(ret, 0);
+
+ return r;
+}
diff --git a/test/del_data.c b/test/del_data.c
new file mode 100644
index 0000000..e766b29
--- /dev/null
+++ b/test/del_data.c
@@ -0,0 +1,53 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ unsigned char data_data[256];
+ int fd, ret, error1, n, error2, unlink_data, r = 0;
+ DIRFILE *D;
+
+ 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);
+ error1 = gd_error(D);
+ n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data);
+ error2 = gd_error(D);
+ gd_close(D);
+
+ unlink_data = unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(unlink_data, -1);
+ CHECKI(error1, GD_E_OK);
+ CHECKI(n, 0);
+ CHECKI(ret, 0);
+ CHECKI(error2, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/del_derived.c b/test/del_derived.c
new file mode 100644
index 0000000..7936dfb
--- /dev/null
+++ b/test/del_derived.c
@@ -0,0 +1,38 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_DELETE);
+ CHECKI(ret, -1);
+
+ return r;
+}
diff --git a/test/del_derived_force.c b/test/del_derived_force.c
new file mode 100644
index 0000000..680c63c
--- /dev/null
+++ b/test/del_derived_force.c
@@ -0,0 +1,38 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKI(ret, 0);
+
+ return r;
+}
diff --git a/test/del_meta.c b/test/del_meta.c
new file mode 100644
index 0000000..f6b96a4
--- /dev/null
+++ b/test/del_meta.c
@@ -0,0 +1,44 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_DELETE);
+ CHECKI(ret, -1);
+
+ return r;
+}
diff --git a/test/del_meta_force.c b/test/del_meta_force.c
new file mode 100644
index 0000000..564713d
--- /dev/null
+++ b/test/del_meta_force.c
@@ -0,0 +1,47 @@
+/* Attempt to delete a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKI(nf, 2);
+ CHECKI(ret, 0);
+
+ return r;
+}
diff --git a/test/dfes_bit.c b/test/dfes_bit.c
new file mode 100644
index 0000000..dc6ce90
--- /dev/null
+++ b/test/dfes_bit.c
@@ -0,0 +1,36 @@
+/* Try to free the strings from a BIT entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in 3 2\n";
+ int fd, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/dfes_divide.c b/test/dfes_divide.c
new file mode 100644
index 0000000..8031007
--- /dev/null
+++ b/test/dfes_divide.c
@@ -0,0 +1,35 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data DIVIDE e b\n";
+ int fd;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return 0;
+}
diff --git a/test/dfes_lincom.c b/test/dfes_lincom.c
new file mode 100644
index 0000000..a100158
--- /dev/null
+++ b/test/dfes_lincom.c
@@ -0,0 +1,36 @@
+/* Try to free the strings from a LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data LINCOM 2 in1 2 1 in2 2 1\n";
+ int fd;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return 0;
+}
diff --git a/test/dfes_linterp.c b/test/dfes_linterp.c
new file mode 100644
index 0000000..63e85de
--- /dev/null
+++ b/test/dfes_linterp.c
@@ -0,0 +1,36 @@
+/* Try to free the strings from a LINTERP entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data LINTERP in table\n";
+ int fd;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return 0;
+}
diff --git a/test/dfes_multiply.c b/test/dfes_multiply.c
new file mode 100644
index 0000000..f467255
--- /dev/null
+++ b/test/dfes_multiply.c
@@ -0,0 +1,36 @@
+/* Try to free the strings from a MULTIPLY entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data MULTIPLY e b\n";
+ int fd;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return 0;
+}
diff --git a/test/dfes_null.c b/test/dfes_null.c
new file mode 100644
index 0000000..aa1d874
--- /dev/null
+++ b/test/dfes_null.c
@@ -0,0 +1,16 @@
+/* Try to free the strings from NULL */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ gd_free_entry_strings(NULL);
+
+ return 0;
+}
diff --git a/test/dfes_phase.c b/test/dfes_phase.c
new file mode 100644
index 0000000..eaffecb
--- /dev/null
+++ b/test/dfes_phase.c
@@ -0,0 +1,36 @@
+/* Try to free the strings from a PHASE entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data PHASE in 8\n";
+ int fd;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return 0;
+}
diff --git a/test/dfes_raw.c b/test/dfes_raw.c
new file mode 100644
index 0000000..fa1c5b4
--- /dev/null
+++ b/test/dfes_raw.c
@@ -0,0 +1,36 @@
+/* Try to free the strings from a RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 8\n";
+ int fd;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return 0;
+}
diff --git a/test/dfes_recip.c b/test/dfes_recip.c
new file mode 100644
index 0000000..add9530
--- /dev/null
+++ b/test/dfes_recip.c
@@ -0,0 +1,35 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RECIP b e\ne CONST UINT8 3";
+ int fd;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return 0;
+}
diff --git a/test/dfes_zero.c b/test/dfes_zero.c
new file mode 100644
index 0000000..6b07446
--- /dev/null
+++ b/test/dfes_zero.c
@@ -0,0 +1,18 @@
+/* Try to free the strings from a zeroed entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ gd_entry_t E;
+ memset(&E, 0, sizeof(E));
+ gd_free_entry_strings(&E);
+
+ return 0;
+}
diff --git a/test/encode_alter.c b/test/encode_alter.c
new file mode 100644
index 0000000..2416f68
--- /dev/null
+++ b/test/encode_alter.c
@@ -0,0 +1,63 @@
+/* Test encoding */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* txtdata = __TEST__ "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);
+ 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_close(D);
+
+ unlink(txtdata);
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(ret, 0);
+ CHECKI(n, 2);
+
+ return r;
+}
diff --git a/test/encode_get.c b/test/encode_get.c
new file mode 100644
index 0000000..554211a
--- /dev/null
+++ b/test/encode_get.c
@@ -0,0 +1,50 @@
+/* Test endianness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKX(n, GD_UNENCODED);
+
+ return r;
+}
diff --git a/test/encode_move.c b/test/encode_move.c
new file mode 100644
index 0000000..b954408
--- /dev/null
+++ b/test/encode_move.c
@@ -0,0 +1,61 @@
+/* Test endianness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* txtdata = __TEST__ "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, error, n, unlink_txtdata, unlink_data, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+ n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+ gd_close(D);
+
+ unlink_txtdata = unlink(txtdata);
+ unlink_data = unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ for (i = 0; i < 8; ++i)
+ CHECKXi(i,c[i], (40 + i) * 0x201);
+
+ CHECKI(error, 0);
+ CHECKI(ret, 0);
+ CHECKI(n, 8);
+ CHECKI(unlink_txtdata, 0);
+ CHECKI(unlink_data, -1);
+
+ return r;
+}
diff --git a/test/endian_alter.c b/test/endian_alter.c
new file mode 100644
index 0000000..28ab919
--- /dev/null
+++ b/test/endian_alter.c
@@ -0,0 +1,77 @@
+/* Test endianness */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/endian_get.c b/test/endian_get.c
new file mode 100644
index 0000000..f057e7e
--- /dev/null
+++ b/test/endian_get.c
@@ -0,0 +1,68 @@
+/* Test endianness */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format2 = __TEST__ "dirfile/format2";
+ const char* format3 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/endian_move.c b/test/endian_move.c
new file mode 100644
index 0000000..b65ffdf
--- /dev/null
+++ b/test/endian_move.c
@@ -0,0 +1,77 @@
+/* Test endianness */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/entry_bad_code.c b/test/entry_bad_code.c
new file mode 100644
index 0000000..382c18b
--- /dev/null
+++ b/test/entry_bad_code.c
@@ -0,0 +1,39 @@
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 8\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_CODE);
+ CHECKI(n, -1);
+
+ return r;
+}
diff --git a/test/entry_bit.c b/test/entry_bit.c
new file mode 100644
index 0000000..d71d697
--- /dev/null
+++ b/test/entry_bit.c
@@ -0,0 +1,48 @@
+/* Try to read BIT entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in1 3 4\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_bit_scalar.c b/test/entry_bit_scalar.c
new file mode 100644
index 0000000..221f134
--- /dev/null
+++ b/test/entry_bit_scalar.c
@@ -0,0 +1,49 @@
+/* Try to read BIT entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_invalid.c b/test/entry_invalid.c
new file mode 100644
index 0000000..5b17f58
--- /dev/null
+++ b/test/entry_invalid.c
@@ -0,0 +1,25 @@
+/* Try to read entry from an invalid DIRFILE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ DIRFILE* D = gd_open("not a dirfile", GD_RDONLY);
+ gd_entry_t E;
+ int r = 0;
+
+ int n = gd_entry(D, "data", &E);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ CHECKI(n, -1);
+
+ return r;
+}
diff --git a/test/entry_lincom.c b/test/entry_lincom.c
new file mode 100644
index 0000000..0de3246
--- /dev/null
+++ b/test/entry_lincom.c
@@ -0,0 +1,54 @@
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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.comp_scal, 0);
+ 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;
+}
diff --git a/test/entry_lincom_scalar.c b/test/entry_lincom_scalar.c
new file mode 100644
index 0000000..ae0999c
--- /dev/null
+++ b/test/entry_lincom_scalar.c
@@ -0,0 +1,67 @@
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_linterp.c b/test/entry_linterp.c
new file mode 100644
index 0000000..f7e521f
--- /dev/null
+++ b/test/entry_linterp.c
@@ -0,0 +1,44 @@
+/* Try to read LINTERP entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data LINTERP in1 ../tablefile\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_multiply.c b/test/entry_multiply.c
new file mode 100644
index 0000000..d46d707
--- /dev/null
+++ b/test/entry_multiply.c
@@ -0,0 +1,44 @@
+/* Try to read MULTIPLY entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data MULTIPLY in1 in2\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_phase.c b/test/entry_phase.c
new file mode 100644
index 0000000..ed1c952
--- /dev/null
+++ b/test/entry_phase.c
@@ -0,0 +1,44 @@
+/* Try to read PHASE entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data PHASE in1 3\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_phase_scalar.c b/test/entry_phase_scalar.c
new file mode 100644
index 0000000..fe90773
--- /dev/null
+++ b/test/entry_phase_scalar.c
@@ -0,0 +1,46 @@
+/* Try to read PHASE entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_polynom.c b/test/entry_polynom.c
new file mode 100644
index 0000000..8c837a0
--- /dev/null
+++ b/test/entry_polynom.c
@@ -0,0 +1,48 @@
+/* Try to read POLYNOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKI(n, 0);
+ CHECKS(E.field, "data");
+ CHECKX(E.field_type, GD_POLYNOM_ENTRY);
+ CHECKI(E.comp_scal, 0);
+ 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;
+}
diff --git a/test/entry_polynom_scalar.c b/test/entry_polynom_scalar.c
new file mode 100644
index 0000000..f806139
--- /dev/null
+++ b/test/entry_polynom_scalar.c
@@ -0,0 +1,60 @@
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKI(n, 0);
+ CHECKS(E.field, "data");
+ CHECKX(E.field_type, GD_POLYNOM_ENTRY);
+ CHECKI(E.comp_scal, 0);
+ 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;
+}
diff --git a/test/entry_raw.c b/test/entry_raw.c
new file mode 100644
index 0000000..859d7b8
--- /dev/null
+++ b/test/entry_raw.c
@@ -0,0 +1,44 @@
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 8\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_raw_scalar.c b/test/entry_raw_scalar.c
new file mode 100644
index 0000000..e33e4eb
--- /dev/null
+++ b/test/entry_raw_scalar.c
@@ -0,0 +1,46 @@
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_raw_scalar_code.c b/test/entry_raw_scalar_code.c
new file mode 100644
index 0000000..b7e0caf
--- /dev/null
+++ b/test/entry_raw_scalar_code.c
@@ -0,0 +1,39 @@
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 const\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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);
+
+ gd_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_SCALAR);
+ CHECKI(n, -1);
+
+ return r;
+}
diff --git a/test/entry_raw_scalar_type.c b/test/entry_raw_scalar_type.c
new file mode 100644
index 0000000..7ebcaf5
--- /dev/null
+++ b/test/entry_raw_scalar_type.c
@@ -0,0 +1,39 @@
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const RAW UINT32 8\ndata RAW UINT8 const\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+
+ mkdir(filedir, 0777);
+
+ fd = 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);
+
+ gd_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_SCALAR);
+ CHECKI(n, -1);
+
+ return r;
+}
diff --git a/test/entry_scalar_repr.c b/test/entry_scalar_repr.c
new file mode 100644
index 0000000..1edd355
--- /dev/null
+++ b/test/entry_scalar_repr.c
@@ -0,0 +1,53 @@
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/entry_type.c b/test/entry_type.c
new file mode 100644
index 0000000..bb09de9
--- /dev/null
+++ b/test/entry_type.c
@@ -0,0 +1,39 @@
+/* Try to read entry type */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 8\n";
+ int fd, error, r = 0;
+ gd_entype_t n;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKI(n, GD_RAW_ENTRY);
+
+ return r;
+}
diff --git a/test/eof.c b/test/eof.c
new file mode 100644
index 0000000..4c875e4
--- /dev/null
+++ b/test/eof.c
@@ -0,0 +1,44 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI((int)n, (int)len / 2);
+
+ return r;
+}
diff --git a/test/eof_index.c b/test/eof_index.c
new file mode 100644
index 0000000..e9182d3
--- /dev/null
+++ b/test/eof_index.c
@@ -0,0 +1,60 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/eof_lincom.c b/test/eof_lincom.c
new file mode 100644
index 0000000..31b67c0
--- /dev/null
+++ b/test/eof_lincom.c
@@ -0,0 +1,58 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* data2 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/eof_phase.c b/test/eof_phase.c
new file mode 100644
index 0000000..d60ade2
--- /dev/null
+++ b/test/eof_phase.c
@@ -0,0 +1,44 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, (int)len / 2 - 3);
+
+ return r;
+}
diff --git a/test/error.c b/test/error.c
new file mode 100644
index 0000000..421b976
--- /dev/null
+++ b/test/error.c
@@ -0,0 +1,33 @@
+/* attempt to obtain an error string */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ char string[1000] = "";
+ int error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKS(string, "Success");
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/error_error.c b/test/error_error.c
new file mode 100644
index 0000000..896bc97
--- /dev/null
+++ b/test/error_error.c
@@ -0,0 +1,21 @@
+/* Opening a non-existent dirfile should fail cleanly */
+#include "test.h"
+
+#include <string.h>
+
+int main(void)
+{
+ char string[1000];
+ int error, r = 0;
+
+ DIRFILE* D = gd_open("a non_existant dirfile", 0);
+
+ gd_error_string(D, string, 1000);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_OPEN);
+ CHECKS(string, "Dirfile does not exist: a non_existant dirfile");
+
+ return r;
+}
diff --git a/test/error_short.c b/test/error_short.c
new file mode 100644
index 0000000..a0c61ab
--- /dev/null
+++ b/test/error_short.c
@@ -0,0 +1,31 @@
+/* a short error string should still be NULL-terminated */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ char string[1000] = "abc";
+ int r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(string[1], 0);
+
+ return r;
+}
diff --git a/test/file.c b/test/file.c
new file mode 100644
index 0000000..d9691ce
--- /dev/null
+++ b/test/file.c
@@ -0,0 +1,50 @@
+/* Attempt to get RAW filename */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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 = strdup(gd_raw_filename(D, "data"));
+ error = gd_error(D);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKS(path, __TEST__ "dirfile/data");
+ free(path);
+
+ return r;
+}
diff --git a/test/file_code.c b/test/file_code.c
new file mode 100644
index 0000000..b46f818
--- /dev/null
+++ b/test/file_code.c
@@ -0,0 +1,49 @@
+/* Attempt to get RAW filename */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_CODE);
+ CHECKP(path);
+
+ return r;
+}
diff --git a/test/file_type.c b/test/file_type.c
new file mode 100644
index 0000000..09cf5d6
--- /dev/null
+++ b/test/file_type.c
@@ -0,0 +1,49 @@
+/* Attempt to get RAW filename */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_FIELD_TYPE);
+ CHECKP(path);
+
+ return r;
+}
diff --git a/test/flist.c b/test/flist.c
new file mode 100644
index 0000000..0442f19
--- /dev/null
+++ b/test/flist.c
@@ -0,0 +1,62 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/flist_invalid.c b/test/flist_invalid.c
new file mode 100644
index 0000000..ea12e6b
--- /dev/null
+++ b/test/flist_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_field_list(D);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/flist_meta.c b/test/flist_meta.c
new file mode 100644
index 0000000..57cc194
--- /dev/null
+++ b/test/flist_meta.c
@@ -0,0 +1,58 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/flist_meta_invalid.c b/test/flist_meta_invalid.c
new file mode 100644
index 0000000..c1b9337
--- /dev/null
+++ b/test/flist_meta_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_mfield_list(D, "parent");
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/flist_type.c b/test/flist_type.c
new file mode 100644
index 0000000..c547e61
--- /dev/null
+++ b/test/flist_type.c
@@ -0,0 +1,62 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/flist_type_invalid.c b/test/flist_type_invalid.c
new file mode 100644
index 0000000..68621ae
--- /dev/null
+++ b/test/flist_type_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_field_list_by_type(D, GD_STRING_ENTRY);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/flist_type_meta.c b/test/flist_type_meta.c
new file mode 100644
index 0000000..7d0eb18
--- /dev/null
+++ b/test/flist_type_meta.c
@@ -0,0 +1,61 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/flist_type_meta_invalid.c b/test/flist_type_meta_invalid.c
new file mode 100644
index 0000000..be314c0
--- /dev/null
+++ b/test/flist_type_meta_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/flush.c b/test/flush.c
new file mode 100644
index 0000000..24f112a
--- /dev/null
+++ b/test/flush.c
@@ -0,0 +1,67 @@
+/* Attempt to flush */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ int fd, i, n, error;
+ struct stat buf;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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");
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf))
+ return 1;
+ if (buf.st_size != 40 + 8 * sizeof(uint8_t))
+ return 1;
+
+ fd = open(data, O_RDONLY | O_BINARY);
+ i = 0;
+ while (read(fd, &d, sizeof(uint8_t))) {
+ if (i < 40 || i > 48) {
+ if (d != 0)
+ return 1;
+ } else if (d != i)
+ return 1;
+ i++;
+ }
+ close(fd);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ if (error)
+ return 1;
+ if (n != 8)
+ return 1;
+
+ return 0;
+}
diff --git a/test/flush_all.c b/test/flush_all.c
new file mode 100644
index 0000000..8c28129
--- /dev/null
+++ b/test/flush_all.c
@@ -0,0 +1,67 @@
+/* Attempt to flush */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ int fd, i, n, error;
+ struct stat buf;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf))
+ return 1;
+ if (buf.st_size != 40 + 8 * sizeof(uint8_t))
+ return 1;
+
+ fd = open(data, O_RDONLY | O_BINARY);
+ i = 0;
+ while (read(fd, &d, sizeof(uint8_t))) {
+ if (i < 40 || i > 48) {
+ if (d != 0)
+ return 1;
+ } else if (d != i)
+ return 1;
+ i++;
+ }
+ close(fd);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ if (error)
+ return 1;
+ if (n != 8)
+ return 1;
+
+ return 0;
+}
diff --git a/test/flush_bad_code.c b/test/flush_bad_code.c
new file mode 100644
index 0000000..fc57b46
--- /dev/null
+++ b/test/flush_bad_code.c
@@ -0,0 +1,37 @@
+/* Attempt to flush a non-existant field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "#\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/flush_invalid.c b/test/flush_invalid.c
new file mode 100644
index 0000000..309d47d
--- /dev/null
+++ b/test/flush_invalid.c
@@ -0,0 +1,23 @@
+/* Writing data to an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR);
+ gd_flush(D, NULL);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/flush_meta.c b/test/flush_meta.c
new file mode 100644
index 0000000..f882916
--- /dev/null
+++ b/test/flush_meta.c
@@ -0,0 +1,38 @@
+/* Attempt to flush meta data */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/new";
+ struct stat buf;
+ int error, stat_format, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC |
+ GD_VERBOSE);
+ gd_add_raw(D, "new", GD_UINT8, 2, 0);
+ gd_metaflush(D);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ stat_format = stat(format, &buf);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(stat_format, 0);
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/flush_spec.c b/test/flush_spec.c
new file mode 100644
index 0000000..522de64
--- /dev/null
+++ b/test/flush_spec.c
@@ -0,0 +1,73 @@
+/* Check the writing of field specs */
+#include "test.h"
+
+#include <stdio.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* apath = __TEST__ "dirfile/a";
+ const char* jpath = __TEST__ "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",
+ NULL
+ };
+
+ int error, i = 0, r = 0;
+ FILE *stream;
+
+ DIRFILE* 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_close(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;
+}
diff --git a/test/foffs_alter.c b/test/foffs_alter.c
new file mode 100644
index 0000000..fb07e59
--- /dev/null
+++ b/test/foffs_alter.c
@@ -0,0 +1,54 @@
+/* Test frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(ret, 0);
+ CHECKI(fo, 16);
+ CHECKI(nf, 48);
+
+ return r;
+}
diff --git a/test/foffs_get.c b/test/foffs_get.c
new file mode 100644
index 0000000..a6e1129
--- /dev/null
+++ b/test/foffs_get.c
@@ -0,0 +1,49 @@
+/* Test frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(n, 13);
+
+ return r;
+}
diff --git a/test/foffs_move.c b/test/foffs_move.c
new file mode 100644
index 0000000..2c03d6a
--- /dev/null
+++ b/test/foffs_move.c
@@ -0,0 +1,54 @@
+/* Test frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(ret, 0);
+ CHECKI(fo, 16);
+ CHECKI(nf, 45);
+
+ return r;
+}
diff --git a/test/fragment_index.c b/test/fragment_index.c
new file mode 100644
index 0000000..92a03fb
--- /dev/null
+++ b/test/fragment_index.c
@@ -0,0 +1,45 @@
+/* Try to read fragment index */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(D);
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKI(n, 1);
+
+ return r;
+}
diff --git a/test/fragment_name.c b/test/fragment_name.c
new file mode 100644
index 0000000..c52bbe6
--- /dev/null
+++ b/test/fragment_name.c
@@ -0,0 +1,50 @@
+/* Test gd_fragmentname */
+#define _SVID_SOURCE
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format_data = "INCLUDE format1\n";
+ const char* format1_data = "data RAW UINT8 11\n";
+ char* form0 = NULL;
+ char* form1 = NULL;
+ int fd, r = 0;
+ DIRFILE *D;
+
+ 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 = strdup(gd_fragmentname(D, 0));
+ form1 = strdup(gd_fragmentname(D, 1));
+ gd_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKS(form0, __TEST__ "dirfile/format");
+ CHECKS(form1, __TEST__ "dirfile/format1");
+ free(form0);
+ free(form1);
+
+ return r;
+}
diff --git a/test/fragment_name_oor.c b/test/fragment_name_oor.c
new file mode 100644
index 0000000..6429398
--- /dev/null
+++ b/test/fragment_name_oor.c
@@ -0,0 +1,49 @@
+/* Test gd_fragmentname out-of-range handling */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKP(form0);
+ CHECKP(form1);
+ CHECKI(error, GD_E_BAD_INDEX);
+
+ return r;
+}
diff --git a/test/get64.c b/test/get64.c
new file mode 100644
index 0000000..941fd9c
--- /dev/null
+++ b/test/get64.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT8 */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/get_bad_code.c b/test/get_bad_code.c
new file mode 100644
index 0000000..159459f
--- /dev/null
+++ b/test/get_bad_code.c
@@ -0,0 +1,39 @@
+/* Attempt to read a non-existant field */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "#\n";
+ unsigned char c = 0;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+ return r;
+}
diff --git a/test/get_bit.c b/test/get_bit.c
new file mode 100644
index 0000000..86e5160
--- /dev/null
+++ b/test/get_bit.c
@@ -0,0 +1,50 @@
+/* Attempt to read BIT */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 2);
+
+ return r;
+}
diff --git a/test/get_carray.c b/test/get_carray.c
new file mode 100644
index 0000000..2b9881c
--- /dev/null
+++ b/test/get_carray.c
@@ -0,0 +1,42 @@
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/get_carray_len.c b/test/get_carray_len.c
new file mode 100644
index 0000000..ffd61c0
--- /dev/null
+++ b/test/get_carray_len.c
@@ -0,0 +1,40 @@
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_carray_len(D, "carray");
+ error = gd_error(D);
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 7);
+
+ return r;
+}
diff --git a/test/get_carray_slice.c b/test/get_carray_slice.c
new file mode 100644
index 0000000..3f28ec3
--- /dev/null
+++ b/test/get_carray_slice.c
@@ -0,0 +1,42 @@
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(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;
+}
diff --git a/test/get_char.c b/test/get_char.c
new file mode 100644
index 0000000..f83d207
--- /dev/null
+++ b/test/get_char.c
@@ -0,0 +1,50 @@
+/* Attempt to use a old-style type character should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_TYPE);
+
+ return r;
+}
diff --git a/test/get_clincom.c b/test/get_clincom.c
new file mode 100644
index 0000000..79ae4c8
--- /dev/null
+++ b/test/get_clincom.c
@@ -0,0 +1,57 @@
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKC(c, v);
+
+ return r;
+}
diff --git a/test/get_complex128.c b/test/get_complex128.c
new file mode 100644
index 0000000..b149bbc
--- /dev/null
+++ b/test/get_complex128.c
@@ -0,0 +1,69 @@
+/* Attempt to read COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_complex64.c b/test/get_complex64.c
new file mode 100644
index 0000000..68222c2
--- /dev/null
+++ b/test/get_complex64.c
@@ -0,0 +1,69 @@
+/* Attempt to read COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_const.c b/test/get_const.c
new file mode 100644
index 0000000..6c8884e
--- /dev/null
+++ b/test/get_const.c
@@ -0,0 +1,41 @@
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const CONST FLOAT64 8.3\n";
+ double c;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 0);
+ CHECKF(c, 8.3);
+
+ return r;
+}
diff --git a/test/get_const_complex.c b/test/get_const_complex.c
new file mode 100644
index 0000000..8d1a61f
--- /dev/null
+++ b/test/get_const_complex.c
@@ -0,0 +1,51 @@
+/* Attempt to read complex constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 0);
+ CHECKC(c, v);
+
+ return r;
+}
diff --git a/test/get_const_repr.c b/test/get_const_repr.c
new file mode 100644
index 0000000..626dc40
--- /dev/null
+++ b/test/get_const_repr.c
@@ -0,0 +1,41 @@
+/* Attempt to read constant with repr */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const CONST COMPLEX128 8.3;9.2\n";
+ double c;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 0);
+ CHECKF(c, sqrt(8.3 * 8.3 + 9.2 * 9.2));
+
+ return r;
+}
diff --git a/test/get_cpolynom.c b/test/get_cpolynom.c
new file mode 100644
index 0000000..1654b14
--- /dev/null
+++ b/test/get_cpolynom.c
@@ -0,0 +1,57 @@
+/* Attempt to read POLYNOM */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKC(c, v);
+
+ return r;
+}
diff --git a/test/get_divide.c b/test/get_divide.c
new file mode 100644
index 0000000..cffb0a3
--- /dev/null
+++ b/test/get_divide.c
@@ -0,0 +1,52 @@
+/* Attempt to read DIVIDE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKF(c, 7. / 5);
+
+ return r;
+}
diff --git a/test/get_endian16.c b/test/get_endian16.c
new file mode 100644
index 0000000..403f34d
--- /dev/null
+++ b/test/get_endian16.c
@@ -0,0 +1,66 @@
+/* Attempt to read UINT16 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKX(c, 0x50a);
+
+ return r;
+}
diff --git a/test/get_endian32.c b/test/get_endian32.c
new file mode 100644
index 0000000..8748fc6
--- /dev/null
+++ b/test/get_endian32.c
@@ -0,0 +1,66 @@
+/* Attempt to read UINT32 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKX(c, 0x50a0a00);
+
+ return r;
+}
diff --git a/test/get_endian64.c b/test/get_endian64.c
new file mode 100644
index 0000000..2e8f9f3
--- /dev/null
+++ b/test/get_endian64.c
@@ -0,0 +1,66 @@
+/* Attempt to read UINT64 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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 * (0x020100000201LLU);
+
+ fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ write(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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKX(c, 0x50a0000050a0000LLU);
+
+ return r;
+}
diff --git a/test/get_endian8.c b/test/get_endian8.c
new file mode 100644
index 0000000..e796b16
--- /dev/null
+++ b/test/get_endian8.c
@@ -0,0 +1,66 @@
+/* Attempt to read UINT8 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKX(c, 0x5);
+
+ return r;
+}
diff --git a/test/get_endian_complex128_arm.c b/test/get_endian_complex128_arm.c
new file mode 100644
index 0000000..243b230
--- /dev/null
+++ b/test/get_endian_complex128_arm.c
@@ -0,0 +1,205 @@
+/* Attempt to read arm-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_complex128_big.c b/test/get_endian_complex128_big.c
new file mode 100644
index 0000000..11bb61a
--- /dev/null
+++ b/test/get_endian_complex128_big.c
@@ -0,0 +1,204 @@
+/* Attempt to read big-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_complex128_little.c b/test/get_endian_complex128_little.c
new file mode 100644
index 0000000..bbeae90
--- /dev/null
+++ b/test/get_endian_complex128_little.c
@@ -0,0 +1,204 @@
+/* Attempt to read little-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_complex64_arm.c b/test/get_endian_complex64_arm.c
new file mode 100644
index 0000000..e7eab7b
--- /dev/null
+++ b/test/get_endian_complex64_arm.c
@@ -0,0 +1,140 @@
+/* Attempt to read arm-endian COMPLEX64 (which is just little endian) */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_complex64_big.c b/test/get_endian_complex64_big.c
new file mode 100644
index 0000000..dd4294b
--- /dev/null
+++ b/test/get_endian_complex64_big.c
@@ -0,0 +1,140 @@
+/* Attempt to read big-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_complex64_little.c b/test/get_endian_complex64_little.c
new file mode 100644
index 0000000..5ee74b1
--- /dev/null
+++ b/test/get_endian_complex64_little.c
@@ -0,0 +1,140 @@
+/* Attempt to read little-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_float32_arm.c b/test/get_endian_float32_arm.c
new file mode 100644
index 0000000..91df1d0
--- /dev/null
+++ b/test/get_endian_float32_arm.c
@@ -0,0 +1,122 @@
+/* Attempt to read arm-endian FLOAT32 (which is just little endian) */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_float32_big.c b/test/get_endian_float32_big.c
new file mode 100644
index 0000000..25c1d29
--- /dev/null
+++ b/test/get_endian_float32_big.c
@@ -0,0 +1,122 @@
+/* Attempt to read big-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_float32_little.c b/test/get_endian_float32_little.c
new file mode 100644
index 0000000..4f5468a
--- /dev/null
+++ b/test/get_endian_float32_little.c
@@ -0,0 +1,122 @@
+/* Attempt to read little-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_float64_arm.c b/test/get_endian_float64_arm.c
new file mode 100644
index 0000000..302dd67
--- /dev/null
+++ b/test/get_endian_float64_arm.c
@@ -0,0 +1,186 @@
+/* Attempt to read arm-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_float64_big.c b/test/get_endian_float64_big.c
new file mode 100644
index 0000000..0aff9b4
--- /dev/null
+++ b/test/get_endian_float64_big.c
@@ -0,0 +1,186 @@
+/* Attempt to read big-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_endian_float64_little.c b/test/get_endian_float64_little.c
new file mode 100644
index 0000000..09d5d30
--- /dev/null
+++ b/test/get_endian_float64_little.c
@@ -0,0 +1,186 @@
+/* Attempt to read little-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_ff.c b/test/get_ff.c
new file mode 100644
index 0000000..31f3e1d
--- /dev/null
+++ b/test/get_ff.c
@@ -0,0 +1,52 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_float32.c b/test/get_float32.c
new file mode 100644
index 0000000..1e0e26c
--- /dev/null
+++ b/test/get_float32.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_float64.c b/test/get_float64.c
new file mode 100644
index 0000000..9d2045f
--- /dev/null
+++ b/test/get_float64.c
@@ -0,0 +1,53 @@
+/* Attempt to read FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_foffs.c b/test/get_foffs.c
new file mode 100644
index 0000000..a6af64b
--- /dev/null
+++ b/test/get_foffs.c
@@ -0,0 +1,50 @@
+/* Attempt to read UINT8 with a FRAMEOFFSET */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 4);
+
+ return r;
+}
diff --git a/test/get_fs.c b/test/get_fs.c
new file mode 100644
index 0000000..851157a
--- /dev/null
+++ b/test/get_fs.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_int16.c b/test/get_int16.c
new file mode 100644
index 0000000..146cc56
--- /dev/null
+++ b/test/get_int16.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_int32.c b/test/get_int32.c
new file mode 100644
index 0000000..ec7c77b
--- /dev/null
+++ b/test/get_int32.c
@@ -0,0 +1,54 @@
+/* Attempt to read INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/get_int64.c b/test/get_int64.c
new file mode 100644
index 0000000..8a8d430
--- /dev/null
+++ b/test/get_int64.c
@@ -0,0 +1,55 @@
+/* Attempt to read INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ mkdir(filedir, 0777);
+
+ for (fd = 0; fd < 64; ++fd)
+ data_data[fd] = fd * (0x0200000000000001LLU) * (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], (0x5000000000000028LL + i * 0x0200000000000001LL)
+ * (2 * (i % 2) - 1));
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/get_int8.c b/test/get_int8.c
new file mode 100644
index 0000000..a96a586
--- /dev/null
+++ b/test/get_int8.c
@@ -0,0 +1,52 @@
+/* Attempt to read INT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_invalid.c b/test/get_invalid.c
new file mode 100644
index 0000000..2cd39c0
--- /dev/null
+++ b/test/get_invalid.c
@@ -0,0 +1,25 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ char c[8];
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ size_t n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/get_lincom1.c b/test/get_lincom1.c
new file mode 100644
index 0000000..bf363b6
--- /dev/null
+++ b/test/get_lincom1.c
@@ -0,0 +1,50 @@
+/* Attempt to read LINCOM1 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 13);
+
+ return r;
+}
diff --git a/test/get_lincom2.c b/test/get_lincom2.c
new file mode 100644
index 0000000..0501670
--- /dev/null
+++ b/test/get_lincom2.c
@@ -0,0 +1,50 @@
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 18);
+
+ return r;
+}
diff --git a/test/get_lincom3.c b/test/get_lincom3.c
new file mode 100644
index 0000000..5bb3545
--- /dev/null
+++ b/test/get_lincom3.c
@@ -0,0 +1,50 @@
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 72);
+
+ return r;
+}
diff --git a/test/get_lincom_noin.c b/test/get_lincom_noin.c
new file mode 100644
index 0000000..0738bd7
--- /dev/null
+++ b/test/get_lincom_noin.c
@@ -0,0 +1,40 @@
+/* Attempt to read LINCOM1 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/get_lincom_non.c b/test/get_lincom_non.c
new file mode 100644
index 0000000..a5c8e00
--- /dev/null
+++ b/test/get_lincom_non.c
@@ -0,0 +1,50 @@
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 18);
+
+ return r;
+}
diff --git a/test/get_linterp.c b/test/get_linterp.c
new file mode 100644
index 0000000..b16d58f
--- /dev/null
+++ b/test/get_linterp.c
@@ -0,0 +1,59 @@
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* table = __TEST__ "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;
+
+ 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\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_close(D);
+
+ unlink(table);
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 10);
+
+ return r;
+}
diff --git a/test/get_linterp_noin.c b/test/get_linterp_noin.c
new file mode 100644
index 0000000..f8f0ba8
--- /dev/null
+++ b/test/get_linterp_noin.c
@@ -0,0 +1,48 @@
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* table = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(table);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/get_linterp_notab.c b/test/get_linterp_notab.c
new file mode 100644
index 0000000..18067d0
--- /dev/null
+++ b/test/get_linterp_notab.c
@@ -0,0 +1,54 @@
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n1, 0);
+ CHECKI(error1, GD_E_OPEN_LINFILE);
+ CHECKI(n2, 0);
+ CHECKI(error2, GD_E_OPEN_LINFILE);
+
+ return r;
+}
diff --git a/test/get_linterp_sort.c b/test/get_linterp_sort.c
new file mode 100644
index 0000000..2e1a26e
--- /dev/null
+++ b/test/get_linterp_sort.c
@@ -0,0 +1,58 @@
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* table = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(table);
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 10);
+
+ return r;
+}
diff --git a/test/get_multiply.c b/test/get_multiply.c
new file mode 100644
index 0000000..2cc73e8
--- /dev/null
+++ b/test/get_multiply.c
@@ -0,0 +1,50 @@
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 25);
+
+ return r;
+}
diff --git a/test/get_multiply_noin.c b/test/get_multiply_noin.c
new file mode 100644
index 0000000..552e6b6
--- /dev/null
+++ b/test/get_multiply_noin.c
@@ -0,0 +1,50 @@
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/get_nonexistent.c b/test/get_nonexistent.c
new file mode 100644
index 0000000..9c9470a
--- /dev/null
+++ b/test/get_nonexistent.c
@@ -0,0 +1,40 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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);
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_UNKNOWN_ENCODING);
+
+ return r;
+}
diff --git a/test/get_null.c b/test/get_null.c
new file mode 100644
index 0000000..0e81128
--- /dev/null
+++ b/test/get_null.c
@@ -0,0 +1,48 @@
+/* Attempt to read returning GD_NULL */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ unsigned char data_data[256];
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 8);
+
+ return r;
+}
diff --git a/test/get_off64.c b/test/get_off64.c
new file mode 100644
index 0000000..0dcb5d9
--- /dev/null
+++ b/test/get_off64.c
@@ -0,0 +1,62 @@
+/* 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 <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifdef SKIP_TEST
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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
+}
diff --git a/test/get_phase.c b/test/get_phase.c
new file mode 100644
index 0000000..9a6406a
--- /dev/null
+++ b/test/get_phase.c
@@ -0,0 +1,63 @@
+/* Attempt to read PHASE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ if (error) {
+ fprintf(stderr, "error=%i\n", error);
+ r = 1;
+ }
+ if (n != 1) {
+ fprintf(stderr, "n=%i\n", n);
+ r = 1;
+ }
+ if (c != 3) {
+ fprintf(stderr, "c=%i\n", c);
+ r = 1;
+ }
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKI(c, 3);
+
+ return r;
+}
diff --git a/test/get_polynom.c b/test/get_polynom.c
new file mode 100644
index 0000000..48c265c
--- /dev/null
+++ b/test/get_polynom.c
@@ -0,0 +1,51 @@
+/* Attempt to read POLYNOM */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKU(c, 3 + 2 * 5 + 1 * 5 * 5);
+
+ return r;
+}
diff --git a/test/get_polynom_noin.c b/test/get_polynom_noin.c
new file mode 100644
index 0000000..ee9c729
--- /dev/null
+++ b/test/get_polynom_noin.c
@@ -0,0 +1,40 @@
+/* Attempt to read POLYNOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "polynom POLYNOM data 2 3\n";
+ unsigned char c = 0;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/get_recip.c b/test/get_recip.c
new file mode 100644
index 0000000..0db7e06
--- /dev/null
+++ b/test/get_recip.c
@@ -0,0 +1,52 @@
+/* Attempt to read DIVIDE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKF(c, 2. / 7.);
+
+ return r;
+}
diff --git a/test/get_recip_const.c b/test/get_recip_const.c
new file mode 100644
index 0000000..b9b4b38
--- /dev/null
+++ b/test/get_recip_const.c
@@ -0,0 +1,53 @@
+/* Attempt to read DIVIDE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, 1);
+ CHECKF(c, 2. / 7.);
+
+ return r;
+}
diff --git a/test/get_recurse.c b/test/get_recurse.c
new file mode 100644
index 0000000..cdaa5af
--- /dev/null
+++ b/test/get_recurse.c
@@ -0,0 +1,40 @@
+/* Attempting to resove a recursively defined field should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error,GD_E_RECURSE_LEVEL);
+
+ return r;
+}
diff --git a/test/get_sbit.c b/test/get_sbit.c
new file mode 100644
index 0000000..cf2d41e
--- /dev/null
+++ b/test/get_sbit.c
@@ -0,0 +1,54 @@
+/* Attempt to read SBIT */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/get_sf.c b/test/get_sf.c
new file mode 100644
index 0000000..892f3d2
--- /dev/null
+++ b/test/get_sf.c
@@ -0,0 +1,52 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_ss.c b/test/get_ss.c
new file mode 100644
index 0000000..a51863e
--- /dev/null
+++ b/test/get_ss.c
@@ -0,0 +1,52 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_type.c b/test/get_type.c
new file mode 100644
index 0000000..7d59814
--- /dev/null
+++ b/test/get_type.c
@@ -0,0 +1,51 @@
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_TYPE);
+
+ return r;
+}
diff --git a/test/get_uint16.c b/test/get_uint16.c
new file mode 100644
index 0000000..1e0c8b5
--- /dev/null
+++ b/test/get_uint16.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/get_uint32.c b/test/get_uint32.c
new file mode 100644
index 0000000..6078890
--- /dev/null
+++ b/test/get_uint32.c
@@ -0,0 +1,54 @@
+/* Attempt to read UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ mkdir(filedir, 0777);
+
+ for (fd = 0; fd < 128; ++fd)
+ data_data[fd] = fd * (0x02000001);
+
+ fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ write(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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/get_uint64.c b/test/get_uint64.c
new file mode 100644
index 0000000..14b9c3b
--- /dev/null
+++ b/test/get_uint64.c
@@ -0,0 +1,53 @@
+/* Attempt to read UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ mkdir(filedir, 0777);
+
+ for (fd = 0; fd < 128; ++fd)
+ data_data[fd] = fd * (0x0200000000000001LLU);
+
+ fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ write(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],0x5000000000000028LLU + i * 0x0200000000000001LLU);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/get_zero.c b/test/get_zero.c
new file mode 100644
index 0000000..571f56b
--- /dev/null
+++ b/test/get_zero.c
@@ -0,0 +1,53 @@
+/* Attempt to read from before the BOF */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/global_name.c b/test/global_name.c
new file mode 100644
index 0000000..91f4250
--- /dev/null
+++ b/test/global_name.c
@@ -0,0 +1,41 @@
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data1 CONST UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+ char *name;
+
+ mkdir(filedir, 0777);
+
+ fd = 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 = strdup(gd_dirfilename(D));
+ error = gd_error(D);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKS(name, filedir);
+ free(name);
+
+ return r;
+}
diff --git a/test/global_ref.c b/test/global_ref.c
new file mode 100644
index 0000000..6cf8817
--- /dev/null
+++ b/test/global_ref.c
@@ -0,0 +1,41 @@
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 1\n";
+ int fd, error, r = 0;
+ char *ref;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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 = strdup(gd_reference(D, NULL));
+ error = gd_error(D);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKS(ref, "data");
+ free(ref);
+
+ return r;
+}
diff --git a/test/global_ref_empty.c b/test/global_ref_empty.c
new file mode 100644
index 0000000..954b66d
--- /dev/null
+++ b/test/global_ref_empty.c
@@ -0,0 +1,40 @@
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data CONST UINT8 1\n";
+ int fd, error, r = 0;
+ const char *ref;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKP(ref);
+
+ return r;
+}
diff --git a/test/global_ref_set.c b/test/global_ref_set.c
new file mode 100644
index 0000000..85175eb
--- /dev/null
+++ b/test/global_ref_set.c
@@ -0,0 +1,42 @@
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data1 RAW UINT8 1\n"
+ "data2 RAW UINT8 1\n";
+ int fd, error, r = 0;
+ char *ref;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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 = strdup(gd_reference(D, "data2"));
+ error = gd_error(D);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKS(ref, "data2");
+ free(ref);
+
+ return r;
+}
diff --git a/test/gzip_get.c b/test/gzip_get.c
new file mode 100644
index 0000000..cce454f
--- /dev/null
+++ b/test/gzip_get.c
@@ -0,0 +1,78 @@
+/* Attempt to read UINT8 */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_GZIP
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* gzipdata = __TEST__ "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, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_close(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
+}
diff --git a/test/gzip_get_get.c b/test/gzip_get_get.c
new file mode 100644
index 0000000..38d4af5
--- /dev/null
+++ b/test/gzip_get_get.c
@@ -0,0 +1,75 @@
+/* Attempt to read UINT8 */
+#include "../src/config.h"
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#if !defined USE_GZIP || !defined TEST_GZIP
+ return 77; /* skip test */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* gzipdata = __TEST__ "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);
+ 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);
+ error1 = gd_error(D);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
+ error2 = gd_error(D);
+ gd_close(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], 40 + i);
+ CHECKUi(i,c2[i], 40 + i);
+ }
+
+ return r;
+#endif
+}
diff --git a/test/gzip_move_from.c b/test/gzip_move_from.c
new file mode 100644
index 0000000..9f3c08d
--- /dev/null
+++ b/test/gzip_move_from.c
@@ -0,0 +1,108 @@
+/* Test move */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_GZIP
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "dirfile/data";
+ const char* gzdata = __TEST__ "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, error, i = 0, r = 0;
+ DIRFILE *D;
+ gd_entry_t E;
+ uint16_t d;
+
+ 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);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(D);
+
+#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(error, 0);
+ CHECKI(ge_ret, 0);
+ CHECKI(E.fragment_index, 1);
+ CHECKI(unlink_data, 0);
+ CHECKI(unlink_gzdata, -1);
+#else
+ CHECKI(ret, -1);
+ CHECKI(error, GD_E_UNSUPPORTED);
+ CHECKI(ge_ret, 0);
+ CHECKI(E.fragment_index, 0);
+ CHECKI(unlink_data, -1);
+ CHECKI(unlink_gzdata, 0);
+#endif
+ gd_free_entry_strings(&E);
+
+ return r;
+#endif
+}
diff --git a/test/gzip_nframes.c b/test/gzip_nframes.c
new file mode 100644
index 0000000..81a3f19
--- /dev/null
+++ b/test/gzip_nframes.c
@@ -0,0 +1,70 @@
+/* Retreiving the number of frames should succeed cleanly */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_GZIP
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* gzipdata = __TEST__ "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;
+
+ 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_close(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
+}
diff --git a/test/header_complex.c b/test/header_complex.c
new file mode 100644
index 0000000..dcfd769
--- /dev/null
+++ b/test/header_complex.c
@@ -0,0 +1,72 @@
+/* Check if GD_C89_API produces a useable API */
+#define GD_C89_API
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ CHECKIi(0,E.comp_scal, 1);
+ 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);
+ CHECKIi(1,E.comp_scal,1);
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/include.c b/test/include.c
new file mode 100644
index 0000000..51927b2
--- /dev/null
+++ b/test/include.c
@@ -0,0 +1,46 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format_data = "#\n";
+ const char* format1_data = "data RAW UINT8 11\n";
+ int fd, error, r = 0;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKU(spf, 11);
+
+ return r;
+}
diff --git a/test/include_accmode.c b/test/include_accmode.c
new file mode 100644
index 0000000..fdf79c5
--- /dev/null
+++ b/test/include_accmode.c
@@ -0,0 +1,34 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_ACCMODE);
+
+ return r;
+}
diff --git a/test/include_auto.c b/test/include_auto.c
new file mode 100644
index 0000000..06646d8
--- /dev/null
+++ b/test/include_auto.c
@@ -0,0 +1,56 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format_data = "#\n";
+ const char* format1_data = "data RAW UINT8 11\n";
+ int fd, error1, error2, r = 0;
+ const char *ptr;
+ char *reference;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ 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);
+ ptr = gd_reference(D, NULL);
+ reference = strdup(ptr);
+ error2 = gd_error(D);
+ spf = gd_spf(D, "data");
+ gd_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error1, 0);
+ CHECKI(error2, 0);
+ CHECKPN(ptr);
+ CHECKS(reference, "data");
+ CHECKU(spf, 11);
+ free(reference);
+
+ return r;
+}
diff --git a/test/include_cb.c b/test/include_cb.c
new file mode 100644
index 0000000..02d214c
--- /dev/null
+++ b/test/include_cb.c
@@ -0,0 +1,54 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int saw_callback = 0;
+int callback(gd_parser_data_t *pdata __attribute__ (( unused )),
+ void *extra __attribute__ (( unused )))
+{
+ saw_callback++;
+
+ return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format_data = "#\n";
+ const char* format1_data = "data ROW UINT8 11\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(saw_callback, 1);
+
+ return r;
+}
diff --git a/test/include_creat.c b/test/include_creat.c
new file mode 100644
index 0000000..912e7a1
--- /dev/null
+++ b/test/include_creat.c
@@ -0,0 +1,37 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ int fd, error, unlink_format1, r = 0;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+ gd_close(D);
+
+ unlink_format1 = unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(unlink_format1, 0);
+
+ return r;
+}
diff --git a/test/include_ignore.c b/test/include_ignore.c
new file mode 100644
index 0000000..f927bd7
--- /dev/null
+++ b/test/include_ignore.c
@@ -0,0 +1,53 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+ char *reference;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ 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 = strdup(gd_reference(D, NULL));
+ error2 = gd_error(D);
+ spf = gd_spf(D, "data");
+ gd_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error1, 0);
+ CHECKI(error2, 0);
+ CHECKS(reference, "data1");
+ CHECKU(spf, 11);
+ free(reference);
+
+ return r;
+}
diff --git a/test/include_index.c b/test/include_index.c
new file mode 100644
index 0000000..5e27ea9
--- /dev/null
+++ b/test/include_index.c
@@ -0,0 +1,36 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "#\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_INDEX);
+
+ return r;
+}
diff --git a/test/include_invalid.c b/test/include_invalid.c
new file mode 100644
index 0000000..f99834b
--- /dev/null
+++ b/test/include_invalid.c
@@ -0,0 +1,36 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format1_data = "data RAW UINT8 11\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format1);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/include_nonexistent.c b/test/include_nonexistent.c
new file mode 100644
index 0000000..115f597
--- /dev/null
+++ b/test/include_nonexistent.c
@@ -0,0 +1,36 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "#\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OPEN_INCLUDE);
+
+ return r;
+}
diff --git a/test/include_pc.c b/test/include_pc.c
new file mode 100644
index 0000000..e38f5b9
--- /dev/null
+++ b/test/include_pc.c
@@ -0,0 +1,55 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int saw_callback = 0;
+int callback(gd_parser_data_t *pdata __attribute__ (( unused )),
+ void *extra __attribute__ (( unused )))
+{
+ saw_callback++;
+
+ return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_FORMAT);
+ CHECKI(saw_callback, 1);
+
+ return r;
+}
diff --git a/test/include_ref.c b/test/include_ref.c
new file mode 100644
index 0000000..ec8e826
--- /dev/null
+++ b/test/include_ref.c
@@ -0,0 +1,53 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+ char *reference;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ 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);
+ reference = strdup(gd_reference(D, NULL));
+ error2 = gd_error(D);
+ spf = gd_spf(D, "data");
+ gd_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error1, 0);
+ CHECKI(error2, 0);
+ CHECKS(reference, "data");
+ CHECKU(spf, 11);
+ free(reference);
+
+ return r;
+}
diff --git a/test/include_syntax.c b/test/include_syntax.c
new file mode 100644
index 0000000..1e119fc
--- /dev/null
+++ b/test/include_syntax.c
@@ -0,0 +1,44 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format_data = "#\n";
+ const char* format1_data = "data ROW UINT8 11\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_FORMAT);
+
+ return r;
+}
diff --git a/test/index.c b/test/index.c
new file mode 100644
index 0000000..dc41b51
--- /dev/null
+++ b/test/index.c
@@ -0,0 +1,54 @@
+/* Frameindex look-up */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW FLOAT64 1\n";
+ double d[1000], f1, f2, f3;
+ int i, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ for (i = 0; i < 1000; ++i)
+ d[i] = sqrt((i+600) / 500.);
+
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKF(f1, -5.96730894763915);
+ CHECKF(f2, 510.050010695549);
+ CHECKF(f3, 1002.04807025292);
+
+ return r;
+}
diff --git a/test/index_domain.c b/test/index_domain.c
new file mode 100644
index 0000000..c3479e0
--- /dev/null
+++ b/test/index_domain.c
@@ -0,0 +1,50 @@
+/* Frameindex look-up */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW FLOAT64 1\n";
+ double d[1000], f1;
+ int i, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_DOMAIN);
+ CHECK(!isnan(f1),f1,"%.15g","%s",f1,"not a number");
+
+ return r;
+}
diff --git a/test/index_range.c b/test/index_range.c
new file mode 100644
index 0000000..8c1b9ec
--- /dev/null
+++ b/test/index_range.c
@@ -0,0 +1,50 @@
+/* Frameindex look-up */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW FLOAT64 1\n";
+ double d[1000], f1;
+ int i, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_RANGE);
+ CHECK(!isnan(f1),f1,"%.15g","%s",f1,"not a number");
+
+ return r;
+}
diff --git a/test/legacy_get.c b/test/legacy_get.c
new file mode 100644
index 0000000..7463526
--- /dev/null
+++ b/test/legacy_get.c
@@ -0,0 +1,51 @@
+/* Attempt to read UINT8 via the legacy interface */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+ return 77; /* skipped */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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
+}
diff --git a/test/legacy_get_put.c b/test/legacy_get_put.c
new file mode 100644
index 0000000..9b30c43
--- /dev/null
+++ b/test/legacy_get_put.c
@@ -0,0 +1,56 @@
+/* Attempt a write following a read via the legacy API -- this requires
+ * closing and then re-opening the legacy dirfile */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+ return 77; /* skipped */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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
+}
diff --git a/test/legacy_get_rofs.c b/test/legacy_get_rofs.c
new file mode 100644
index 0000000..87f9f51
--- /dev/null
+++ b/test/legacy_get_rofs.c
@@ -0,0 +1,52 @@
+/* Attempt to read UINT8 from a read-only filesystem via the legacy interface */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+ return 77; /* skipped */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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
+}
diff --git a/test/legacy_nframes.c b/test/legacy_nframes.c
new file mode 100644
index 0000000..2481800
--- /dev/null
+++ b/test/legacy_nframes.c
@@ -0,0 +1,44 @@
+/* Retreiving the number of frames via the legacy API should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+ return 77; /* skipped */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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
+}
diff --git a/test/legacy_nonexistent.c b/test/legacy_nonexistent.c
new file mode 100644
index 0000000..7726c9f
--- /dev/null
+++ b/test/legacy_nonexistent.c
@@ -0,0 +1,25 @@
+/* Reference to a non-existent dirfile from the legacy API should fail cleanly
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+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_OPEN);
+
+ return r;
+#endif
+}
diff --git a/test/legacy_put.c b/test/legacy_put.c
new file mode 100644
index 0000000..1e362a7
--- /dev/null
+++ b/test/legacy_put.c
@@ -0,0 +1,56 @@
+/* Attempt to write UINT8 via the legacy interface*/
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+ return 77; /* skipped */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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;
+ 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);
+
+ CHECKI(error,0);
+ CHECKI(n,8);
+
+ return r;
+#endif
+}
diff --git a/test/legacy_spf.c b/test/legacy_spf.c
new file mode 100644
index 0000000..62ffc77
--- /dev/null
+++ b/test/legacy_spf.c
@@ -0,0 +1,37 @@
+/* Retreiving the samples-per-frame of a field via the legacy API should
+ * succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+ return 77; /* skip */
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 11\n";
+ int fd, error, r = 0;
+ unsigned int spf;
+
+ 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
+}
diff --git a/test/lzma_get.c b/test/lzma_get.c
new file mode 100644
index 0000000..ff8a088
--- /dev/null
+++ b/test/lzma_get.c
@@ -0,0 +1,75 @@
+/* Attempt to read UINT8 */
+#include "../src/config.h"
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_LZMA
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* lzmadata = __TEST__ "dirfile/data.lzma";
+ const char* format_data = "data RAW UINT16 8\n";
+ uint16_t c[8];
+ char command[4096];
+ uint16_t data_data[256];
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_close(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
+}
diff --git a/test/lzma_nframes.c b/test/lzma_nframes.c
new file mode 100644
index 0000000..3806c53
--- /dev/null
+++ b/test/lzma_nframes.c
@@ -0,0 +1,70 @@
+/* Retreiving the number of frames should succeed cleanly */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_LZMA
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* xzdata = __TEST__ "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;
+
+ 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_close(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
+}
diff --git a/test/madd.c b/test/madd.c
new file mode 100644
index 0000000..e3d2c3d
--- /dev/null
+++ b/test/madd.c
@@ -0,0 +1,58 @@
+/* Add a dirfile field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ CHECKI(n, 2);
+
+ return r;
+}
diff --git a/test/madd_bit.c b/test/madd_bit.c
new file mode 100644
index 0000000..d921ed4
--- /dev/null
+++ b/test/madd_bit.c
@@ -0,0 +1,45 @@
+/* Add a BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int ge_error, error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/madd_bit_invalid.c b/test/madd_bit_invalid.c
new file mode 100644
index 0000000..373209e
--- /dev/null
+++ b/test/madd_bit_invalid.c
@@ -0,0 +1,23 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_madd_bit(D, "new", "meta", "input", 1, 1);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/madd_carray.c b/test/madd_carray.c
new file mode 100644
index 0000000..3e2f7b6
--- /dev/null
+++ b/test/madd_carray.c
@@ -0,0 +1,49 @@
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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_carray_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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_clincom.c b/test/madd_clincom.c
new file mode 100644
index 0000000..7187997
--- /dev/null
+++ b/test/madd_clincom.c
@@ -0,0 +1,60 @@
+/* Add a LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_const.c b/test/madd_const.c
new file mode 100644
index 0000000..6691706
--- /dev/null
+++ b/test/madd_const.c
@@ -0,0 +1,46 @@
+/* Add a CONST field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ uint8_t val = 3;
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_cpolynom.c b/test/madd_cpolynom.c
new file mode 100644
index 0000000..f610dce
--- /dev/null
+++ b/test/madd_cpolynom.c
@@ -0,0 +1,57 @@
+/* Add a complex POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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);
+ CHECKI(e.comp_scal, 1);
+ for (j = 0; j < 4; ++j)
+ CHECKCi(j,e.EN(polynom,ca)[j], a[j]);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_crecip.c b/test/madd_crecip.c
new file mode 100644
index 0000000..76a16c6
--- /dev/null
+++ b/test/madd_crecip.c
@@ -0,0 +1,48 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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);
+ CHECKI(e.comp_scal, 1);
+ CHECKI(e.fragment_index, 0);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_crecip89.c b/test/madd_crecip89.c
new file mode 100644
index 0000000..38fb65c
--- /dev/null
+++ b/test/madd_crecip89.c
@@ -0,0 +1,46 @@
+#define GD_C89_API
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+ double div[2] = {3.2, 3.1};
+
+ DIRFILE* 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]);
+ CHECKI(e.comp_scal, 1);
+ CHECKI(e.fragment_index, 0);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_divide.c b/test/madd_divide.c
new file mode 100644
index 0000000..b7fe3f0
--- /dev/null
+++ b/test/madd_divide.c
@@ -0,0 +1,42 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_lincom.c b/test/madd_lincom.c
new file mode 100644
index 0000000..88dcf41
--- /dev/null
+++ b/test/madd_lincom.c
@@ -0,0 +1,53 @@
+/* Add a LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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]);
+ CHECKI(e.comp_scal, 0);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ return r;
+}
diff --git a/test/madd_lincom_invalid.c b/test/madd_lincom_invalid.c
new file mode 100644
index 0000000..02940e8
--- /dev/null
+++ b/test/madd_lincom_invalid.c
@@ -0,0 +1,25 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char* in_fields[2] = {"in1", "in2"};
+ const double m[2] = {1, 0.3};
+ const double b[2] = {0, 0.9};
+ gd_madd_lincom(D, "new", "meta", 2, in_fields, m, b);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/madd_linterp.c b/test/madd_linterp.c
new file mode 100644
index 0000000..5abf216
--- /dev/null
+++ b/test/madd_linterp.c
@@ -0,0 +1,43 @@
+/* Add a LINTERP field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_linterp_invalid.c b/test/madd_linterp_invalid.c
new file mode 100644
index 0000000..8cf4f3c
--- /dev/null
+++ b/test/madd_linterp_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_madd_linterp(D, "new", "meta", "in", "table");
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/madd_multiply.c b/test/madd_multiply.c
new file mode 100644
index 0000000..a09669d
--- /dev/null
+++ b/test/madd_multiply.c
@@ -0,0 +1,43 @@
+/* Add a MULTIPLY field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_multiply_invalid.c b/test/madd_multiply_invalid.c
new file mode 100644
index 0000000..f9ee9e7
--- /dev/null
+++ b/test/madd_multiply_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_madd_multiply(D, "new", "meta", "in1", "in2");
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/madd_phase.c b/test/madd_phase.c
new file mode 100644
index 0000000..f0d65e5
--- /dev/null
+++ b/test/madd_phase.c
@@ -0,0 +1,43 @@
+/* Add a PHASE field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE *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", &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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_phase_invalid.c b/test/madd_phase_invalid.c
new file mode 100644
index 0000000..e759cc6
--- /dev/null
+++ b/test/madd_phase_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_madd_phase(D, "new", "meta", "in", 3);
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/madd_polynom.c b/test/madd_polynom.c
new file mode 100644
index 0000000..5392c2c
--- /dev/null
+++ b/test/madd_polynom.c
@@ -0,0 +1,49 @@
+/* Add a POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = 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);
+ CHECKI(e.comp_scal, 0);
+ for (j = 0; j < 4; ++j)
+ CHECKFi(j, e.EN(polynom,a)[j], a[j]);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_recip.c b/test/madd_recip.c
new file mode 100644
index 0000000..2cba2d7
--- /dev/null
+++ b/test/madd_recip.c
@@ -0,0 +1,43 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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);
+ CHECKI(e.comp_scal, 0);
+ CHECKI(e.fragment_index, 0);
+ gd_free_entry_strings(&e);
+ }
+
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_sbit.c b/test/madd_sbit.c
new file mode 100644
index 0000000..96f6006
--- /dev/null
+++ b/test/madd_sbit.c
@@ -0,0 +1,44 @@
+/* Add a BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_spec.c b/test/madd_spec.c
new file mode 100644
index 0000000..dd213af
--- /dev/null
+++ b/test/madd_spec.c
@@ -0,0 +1,48 @@
+/* gd_madd_spec() */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, n, r = 0;
+ unsigned char val;
+ gd_entry_t e;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/madd_spec_directive.c b/test/madd_spec_directive.c
new file mode 100644
index 0000000..0ee076c
--- /dev/null
+++ b/test/madd_spec_directive.c
@@ -0,0 +1,35 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, n, m, r = 0;
+
+ DIRFILE* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 1);
+ CHECKI(m, 0);
+ CHECKI(error, GD_E_FORMAT);
+
+ return r;
+}
diff --git a/test/madd_spec_invalid.c b/test/madd_spec_invalid.c
new file mode 100644
index 0000000..7b07996
--- /dev/null
+++ b/test/madd_spec_invalid.c
@@ -0,0 +1,22 @@
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ gd_madd_spec(D, "data RAW UINT8 2", "INDEX");
+ error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(error, GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/madd_string.c b/test/madd_string.c
new file mode 100644
index 0000000..67a29f7
--- /dev/null
+++ b/test/madd_string.c
@@ -0,0 +1,45 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, ge_error, r = 0;
+ gd_entry_t e;
+ char val[1000];
+
+ DIRFILE* 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);
+
+ /* 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/move.c b/test/move.c
new file mode 100644
index 0000000..0a453e5
--- /dev/null
+++ b/test/move.c
@@ -0,0 +1,50 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/move_data_enc_ar.c b/test/move_data_enc_ar.c
new file mode 100644
index 0000000..3e4fee4
--- /dev/null
+++ b/test/move_data_enc_ar.c
@@ -0,0 +1,80 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <inttypes.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "dirfile/data";
+ const char* txtdata = __TEST__ "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, error, ge_ret, unlink_data, unlink_txtdata;
+ FILE* stream;
+ gd_entry_t E;
+ DIRFILE *D;
+
+ 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, 1);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(D);
+
+ 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(ret, 0);
+ CHECKI(error, GD_E_OK);
+ CHECKI(ge_ret, 0);
+ CHECKI(E.fragment_index, 1);
+ CHECKI(unlink_data, 0);
+ CHECKI(unlink_txtdata, -1);
+ gd_free_entry_strings(&E);
+
+ return r;
+}
diff --git a/test/move_data_enc_ra.c b/test/move_data_enc_ra.c
new file mode 100644
index 0000000..4973822
--- /dev/null
+++ b/test/move_data_enc_ra.c
@@ -0,0 +1,85 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <inttypes.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "dirfile/data";
+ const char* txtdata = __TEST__ "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, error, ge_ret, unlink_data, unlink_txtdata;
+ FILE* stream;
+ gd_entry_t E;
+ DIRFILE *D;
+
+ 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, 1);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(D);
+
+ 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(ret, 0);
+ CHECKI(error, GD_E_OK);
+ CHECKI(ge_ret, 0);
+ CHECKI(E.fragment_index, 1);
+ CHECKI(unlink_data, -1);
+ CHECKI(unlink_txtdata, 0);
+ gd_free_entry_strings(&E);
+
+ return r;
+}
diff --git a/test/move_data_endian.c b/test/move_data_endian.c
new file mode 100644
index 0000000..f3453ca
--- /dev/null
+++ b/test/move_data_endian.c
@@ -0,0 +1,80 @@
+/* Test move */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <inttypes.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "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;
+
+ 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, 1);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(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;
+}
diff --git a/test/move_data_foffs.c b/test/move_data_foffs.c
new file mode 100644
index 0000000..6f46d9f
--- /dev/null
+++ b/test/move_data_foffs.c
@@ -0,0 +1,69 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <inttypes.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "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;
+
+ 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, 1);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(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;
+}
diff --git a/test/move_data_nop.c b/test/move_data_nop.c
new file mode 100644
index 0000000..6eb10e6
--- /dev/null
+++ b/test/move_data_nop.c
@@ -0,0 +1,60 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* data = __TEST__ "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;
+
+ 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, 1);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(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;
+}
diff --git a/test/move_index.c b/test/move_index.c
new file mode 100644
index 0000000..d34df1c
--- /dev/null
+++ b/test/move_index.c
@@ -0,0 +1,50 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/move_meta.c b/test/move_meta.c
new file mode 100644
index 0000000..134839d
--- /dev/null
+++ b/test/move_meta.c
@@ -0,0 +1,51 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/move_protect.c b/test/move_protect.c
new file mode 100644
index 0000000..5e6ae1f
--- /dev/null
+++ b/test/move_protect.c
@@ -0,0 +1,50 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/move_subdir.c b/test/move_subdir.c
new file mode 100644
index 0000000..e8ba6a3
--- /dev/null
+++ b/test/move_subdir.c
@@ -0,0 +1,63 @@
+/* Test move */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* subdir = __TEST__ "dirfile/subdir";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/subdir/format1";
+ const char* data = __TEST__ "dirfile/data";
+ const char* new_data = __TEST__ "dirfile/subdir/data";
+ const char* format_data = "INCLUDE subdir/format1\ndata RAW UINT8 11\n";
+ const char* format1_data = "#\n";
+ int fd, ret, error, ge_ret, unlink_data, unlink_new_data, r = 0;
+ gd_entry_t E;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+ mkdirsub(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, 1);
+ error = gd_error(D);
+ ge_ret = gd_entry(D, "data", &E);
+ gd_close(D);
+
+ unlink_data = unlink(data);
+ unlink_new_data = unlink(new_data);
+ unlink(format1);
+ unlink(format);
+ rmdir(subdir);
+ rmdir(filedir);
+
+ CHECKI(ret, 0);
+ CHECKI(error, GD_E_OK);
+ CHECKI(ge_ret, 0);
+ CHECKI(E.fragment_index, 1);
+ CHECKI(unlink_data, -1);
+ CHECKI(unlink_new_data, 0);
+ gd_free_entry_strings(&E);
+
+ return r;
+}
diff --git a/test/name.c b/test/name.c
new file mode 100644
index 0000000..07ab0a1
--- /dev/null
+++ b/test/name.c
@@ -0,0 +1,70 @@
+/* Attempt to rename a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* zata = __TEST__ "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, error, unlink_data, unlink_zata, r = 0;
+ const char **fl;
+ char *field_list[4];
+ DIRFILE *D;
+
+ 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", 0);
+ error = gd_error(D);
+ fl = gd_field_list(D);
+
+ field_list[0] = strdup(fl[0]);
+ field_list[1] = strdup(fl[1]);
+ field_list[2] = strdup(fl[2]);
+ field_list[3] = strdup(fl[3]);
+
+ gd_close(D);
+
+ unlink_data = unlink(data);
+ unlink_zata = unlink(zata);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(ret,0);
+ CHECKS(field_list[0], "INDEX");
+ CHECKS(field_list[1], "cata");
+ CHECKS(field_list[2], "eata");
+ CHECKS(field_list[3], "zata");
+ CHECKI(unlink_data, 0);
+ CHECKI(unlink_zata, -1);
+ free(field_list[0]);
+ free(field_list[1]);
+ free(field_list[2]);
+ free(field_list[3]);
+
+ return r;
+}
diff --git a/test/name_move.c b/test/name_move.c
new file mode 100644
index 0000000..5b0a4c3
--- /dev/null
+++ b/test/name_move.c
@@ -0,0 +1,70 @@
+/* Attempt to rename a field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* zata = __TEST__ "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, error, unlink_data, unlink_zata, r = 0;
+ const char **fl;
+ char *field_list[4];
+ DIRFILE *D;
+
+ 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", 1);
+ error = gd_error(D);
+ fl = gd_field_list(D);
+
+ field_list[0] = strdup(fl[0]);
+ field_list[1] = strdup(fl[1]);
+ field_list[2] = strdup(fl[2]);
+ field_list[3] = strdup(fl[3]);
+
+ gd_close(D);
+
+ unlink_data = unlink(data);
+ unlink_zata = unlink(zata);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(ret, 0);
+ CHECKS(field_list[0], "INDEX");
+ CHECKS(field_list[1], "cata");
+ CHECKS(field_list[2], "eata");
+ CHECKS(field_list[3], "zata");
+ CHECKI(unlink_data, -1);
+ CHECKI(unlink_zata, 0);
+ free(field_list[0]);
+ free(field_list[1]);
+ free(field_list[2]);
+ free(field_list[3]);
+
+ return r;
+}
diff --git a/test/nfields.c b/test/nfields.c
new file mode 100644
index 0000000..db02a27
--- /dev/null
+++ b/test/nfields.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(nfields, 8);
+
+ return r;
+}
diff --git a/test/nfields_invalid.c b/test/nfields_invalid.c
new file mode 100644
index 0000000..fdad67a
--- /dev/null
+++ b/test/nfields_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ unsigned int n = gd_nfields(D);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/nfields_type.c b/test/nfields_type.c
new file mode 100644
index 0000000..a220fec
--- /dev/null
+++ b/test/nfields_type.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(nfields, 2);
+
+ return r;
+}
diff --git a/test/nfields_type_invalid.c b/test/nfields_type_invalid.c
new file mode 100644
index 0000000..081ec9d
--- /dev/null
+++ b/test/nfields_type_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ unsigned int n = gd_nfields_by_type(D, GD_RAW_ENTRY);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/nfragments.c b/test/nfragments.c
new file mode 100644
index 0000000..1998d6e
--- /dev/null
+++ b/test/nfragments.c
@@ -0,0 +1,42 @@
+/* Test gd_nfragments */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(nfragments, 2);
+
+ return r;
+}
diff --git a/test/nframes.c b/test/nframes.c
new file mode 100644
index 0000000..e58950e
--- /dev/null
+++ b/test/nframes.c
@@ -0,0 +1,45 @@
+/* Retreiving the number of frames should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(n, (off_t)len / 2);
+
+ return r;
+}
diff --git a/test/nframes64.c b/test/nframes64.c
new file mode 100644
index 0000000..37567e1
--- /dev/null
+++ b/test/nframes64.c
@@ -0,0 +1,45 @@
+/* Retreiving the number of frames should succeed cleanly */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(n, len);
+
+ return r;
+}
diff --git a/test/nframes_empty.c b/test/nframes_empty.c
new file mode 100644
index 0000000..516d8bb
--- /dev/null
+++ b/test/nframes_empty.c
@@ -0,0 +1,33 @@
+/* Requesting the number of frames from an empty dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ DIRFILE *D;
+ size_t n;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(n, 0);
+ CHECKI(error, GD_E_OK);
+
+ return r;
+}
diff --git a/test/nframes_invalid.c b/test/nframes_invalid.c
new file mode 100644
index 0000000..7cd4ce8
--- /dev/null
+++ b/test/nframes_invalid.c
@@ -0,0 +1,23 @@
+/* Requesting the number of frames from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ size_t n = gd_nframes(D);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKU(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/nframes_off64.c b/test/nframes_off64.c
new file mode 100644
index 0000000..336ad72
--- /dev/null
+++ b/test/nframes_off64.c
@@ -0,0 +1,53 @@
+/* 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 <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifdef SKIP_TEST
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(n, len);
+
+ return r;
+#endif
+}
diff --git a/test/nframes_spf.c b/test/nframes_spf.c
new file mode 100644
index 0000000..3ed769d
--- /dev/null
+++ b/test/nframes_spf.c
@@ -0,0 +1,55 @@
+/* The number of frames should track the samples per frame */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ int fd, i, r = 0;
+ const size_t len = strlen(data);
+
+ 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;
+ gd_spf_t 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_close(D);
+ }
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/nmeta.c b/test/nmeta.c
new file mode 100644
index 0000000..0969bb0
--- /dev/null
+++ b/test/nmeta.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKU(nfields, 6);
+
+ return r;
+}
diff --git a/test/nmeta_invalid.c b/test/nmeta_invalid.c
new file mode 100644
index 0000000..e4f1f9a
--- /dev/null
+++ b/test/nmeta_invalid.c
@@ -0,0 +1,23 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ unsigned int n = gd_nmfields(D, "raw1");
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKU(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/nmeta_parent.c b/test/nmeta_parent.c
new file mode 100644
index 0000000..3db381f
--- /dev/null
+++ b/test/nmeta_parent.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(nfields, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/nmeta_type.c b/test/nmeta_type.c
new file mode 100644
index 0000000..fe44a69
--- /dev/null
+++ b/test/nmeta_type.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKU(nfields, 2);
+
+ return r;
+}
diff --git a/test/nmeta_type_invalid.c b/test/nmeta_type_invalid.c
new file mode 100644
index 0000000..819960f
--- /dev/null
+++ b/test/nmeta_type_invalid.c
@@ -0,0 +1,23 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ unsigned int n = gd_nmfields_by_type(D, "raw1", GD_STRING_ENTRY);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKU(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/nmeta_type_parent.c b/test/nmeta_type_parent.c
new file mode 100644
index 0000000..6046048
--- /dev/null
+++ b/test/nmeta_type_parent.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(nfields, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/nmeta_vectors.c b/test/nmeta_vectors.c
new file mode 100644
index 0000000..88d6577
--- /dev/null
+++ b/test/nmeta_vectors.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKU(nfields, 3);
+
+ return r;
+}
diff --git a/test/nmeta_vectors_del.c b/test/nmeta_vectors_del.c
new file mode 100644
index 0000000..2288fd9
--- /dev/null
+++ b/test/nmeta_vectors_del.c
@@ -0,0 +1,60 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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;
+}
diff --git a/test/nmeta_vectors_invalid.c b/test/nmeta_vectors_invalid.c
new file mode 100644
index 0000000..4440b29
--- /dev/null
+++ b/test/nmeta_vectors_invalid.c
@@ -0,0 +1,23 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ unsigned int n = gd_nmvectors(D, "raw1");
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKU(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/nmeta_vectors_parent.c b/test/nmeta_vectors_parent.c
new file mode 100644
index 0000000..1c2ff90
--- /dev/null
+++ b/test/nmeta_vectors_parent.c
@@ -0,0 +1,51 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(nfields, 0);
+ CHECKI(error, GD_E_BAD_CODE);
+
+ return r;
+}
diff --git a/test/nvectors.c b/test/nvectors.c
new file mode 100644
index 0000000..701757b
--- /dev/null
+++ b/test/nvectors.c
@@ -0,0 +1,52 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(nfields, 5);
+
+ return r;
+}
diff --git a/test/nvectors_invalid.c b/test/nvectors_invalid.c
new file mode 100644
index 0000000..6e9cab6
--- /dev/null
+++ b/test/nvectors_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ unsigned int n = gd_nvectors(D);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(n, 0);
+ CHECKI(error, GD_E_BAD_DIRFILE);
+
+ return r;
+}
diff --git a/test/open.c b/test/open.c
new file mode 100644
index 0000000..2c77a99
--- /dev/null
+++ b/test/open.c
@@ -0,0 +1,29 @@
+/* Opening an empty dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ return r;
+}
diff --git a/test/open_cb_abort.c b/test/open_cb_abort.c
new file mode 100644
index 0000000..53514df
--- /dev/null
+++ b/test/open_cb_abort.c
@@ -0,0 +1,50 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata __attribute__ (( unused )),
+ void* extra __attribute__ (( unused )))
+{
+ saw_callback++;
+
+ return GD_SYNTAX_ABORT;
+}
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "BADDIRECTIVE BADTYPE\n"
+ "BADDIRECTIVE BADTYPE\n"
+ "BADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(saw_callback, 1);
+ CHECKI(error, GD_E_FORMAT);
+
+ return r;
+}
diff --git a/test/open_cb_cont.c b/test/open_cb_cont.c
new file mode 100644
index 0000000..af31978
--- /dev/null
+++ b/test/open_cb_cont.c
@@ -0,0 +1,49 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata __attribute__ (( unused )),
+ void* extra __attribute__ (( unused )))
+{
+ saw_callback++;
+
+ return GD_SYNTAX_CONTINUE;
+}
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "BADDIRECTIVE BADTYPE\n"
+ "BADDIRECTIVE BADTYPE\n"
+ "BADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(saw_callback, 3);
+ CHECKI(error, GD_E_FORMAT);
+
+ return r;
+}
diff --git a/test/open_cb_ignore.c b/test/open_cb_ignore.c
new file mode 100644
index 0000000..afbe47f
--- /dev/null
+++ b/test/open_cb_ignore.c
@@ -0,0 +1,46 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata __attribute__ (( unused )),
+ void* extra __attribute__ (( unused )))
+{
+ saw_callback = 1;
+
+ return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "BADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(saw_callback, 1);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/open_cb_invalid.c b/test/open_cb_invalid.c
new file mode 100644
index 0000000..3d89374
--- /dev/null
+++ b/test/open_cb_invalid.c
@@ -0,0 +1,50 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata __attribute__ (( unused )),
+ void* extra __attribute__ (( unused )))
+{
+ saw_callback++;
+
+ return -1;
+}
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "BADDIRECTIVE BADTYPE\n"
+ "BADDIRECTIVE BADTYPE\n"
+ "BADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(saw_callback, 1);
+ CHECKI(error, GD_E_CALLBACK);
+
+ return r;
+}
diff --git a/test/open_cb_rescan.c b/test/open_cb_rescan.c
new file mode 100644
index 0000000..f79b7f8
--- /dev/null
+++ b/test/open_cb_rescan.c
@@ -0,0 +1,51 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata, void *extra __attribute__ (( 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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "BADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(saw_callback, 1);
+ CHECKI(error, GD_E_BAD_REFERENCE);
+
+ return r;
+}
diff --git a/test/open_eaccess.c b/test/open_eaccess.c
new file mode 100644
index 0000000..2903bfe
--- /dev/null
+++ b/test/open_eaccess.c
@@ -0,0 +1,39 @@
+/* Opening an dirfile with no read permission should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OPEN);
+ return r;
+}
diff --git a/test/open_nonexistent.c b/test/open_nonexistent.c
new file mode 100644
index 0000000..b2ceb1a
--- /dev/null
+++ b/test/open_nonexistent.c
@@ -0,0 +1,14 @@
+/* Opening a non-existent dirfile should fail cleanly */
+#include "test.h"
+
+int main(void)
+{
+ DIRFILE* D = gd_open("a non_existant dirfile", 0);
+ int r = 0;
+
+ int error = gd_error(D);
+ CHECKI(error, GD_E_OPEN);
+ gd_discard(D);
+
+ return r;
+}
diff --git a/test/open_notdirfile.c b/test/open_notdirfile.c
new file mode 100644
index 0000000..601131e
--- /dev/null
+++ b/test/open_notdirfile.c
@@ -0,0 +1,26 @@
+/* Opening an non-dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ D = gd_open(filedir, GD_RDONLY);
+
+ rmdir(filedir);
+ error = gd_error(D);
+ CHECKI(error, GD_E_OPEN);
+ gd_discard(D);
+
+ return r;
+}
diff --git a/test/parent.c b/test/parent.c
new file mode 100644
index 0000000..d2474ce
--- /dev/null
+++ b/test/parent.c
@@ -0,0 +1,52 @@
+/* Test gd_parent_fragment */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format2 = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format2);
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(parent, 1);
+
+ return r;
+}
diff --git a/test/parse_badline.c b/test/parse_badline.c
new file mode 100644
index 0000000..aec63a0
--- /dev/null
+++ b/test/parse_badline.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "BADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_bit.c b/test/parse_bit.c
new file mode 100644
index 0000000..175dda9
--- /dev/null
+++ b/test/parse_bit.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in1 3\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_bit4.c b/test/parse_bit4.c
new file mode 100644
index 0000000..18819aa
--- /dev/null
+++ b/test/parse_bit4.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in1 3 4\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_bit_bitnum.c b/test/parse_bit_bitnum.c
new file mode 100644
index 0000000..9b695d6
--- /dev/null
+++ b/test/parse_bit_bitnum.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in1 -1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_bit_bitsize.c b/test/parse_bit_bitsize.c
new file mode 100644
index 0000000..7264b47
--- /dev/null
+++ b/test/parse_bit_bitsize.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in1 63 2\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_bit_ncols.c b/test/parse_bit_ncols.c
new file mode 100644
index 0000000..bdd0559
--- /dev/null
+++ b/test/parse_bit_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_bit_numbits.c b/test/parse_bit_numbits.c
new file mode 100644
index 0000000..9a8ed33
--- /dev/null
+++ b/test/parse_bit_numbits.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data BIT in1 1 0\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_bit_scalar.c b/test/parse_bit_scalar.c
new file mode 100644
index 0000000..0dce204
--- /dev/null
+++ b/test/parse_bit_scalar.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const CONST INT32 3\ndata BIT in1 const\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_carray.c b/test/parse_carray.c
new file mode 100644
index 0000000..6e935fb
--- /dev/null
+++ b/test/parse_carray.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "c CARRAY UINT8 1 2 3 4\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_carray_long.c b/test/parse_carray_long.c
new file mode 100644
index 0000000..1d5b4d4
--- /dev/null
+++ b/test/parse_carray_long.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_const.c b/test/parse_const.c
new file mode 100644
index 0000000..98ca38d
--- /dev/null
+++ b/test/parse_const.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const CONST UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_const_ncols.c b/test/parse_const_ncols.c
new file mode 100644
index 0000000..4d8fc53
--- /dev/null
+++ b/test/parse_const_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const RAW UINT8\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_divide.c b/test/parse_divide.c
new file mode 100644
index 0000000..d28c94b
--- /dev/null
+++ b/test/parse_divide.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data DIVIDE in1 in2\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_duplicate.c b/test/parse_duplicate.c
new file mode 100644
index 0000000..287272c
--- /dev/null
+++ b/test/parse_duplicate.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 1\ndata RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_duplicate_ignore.c b/test/parse_duplicate_ignore.c
new file mode 100644
index 0000000..3f63a8a
--- /dev/null
+++ b/test/parse_duplicate_ignore.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 1\ndata RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_endian_bad.c b/test/parse_endian_bad.c
new file mode 100644
index 0000000..b524b89
--- /dev/null
+++ b/test/parse_endian_bad.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "ENDIAN badendianness\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_endian_big.c b/test/parse_endian_big.c
new file mode 100644
index 0000000..6b74a0e
--- /dev/null
+++ b/test/parse_endian_big.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "ENDIAN big\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_endian_force.c b/test/parse_endian_force.c
new file mode 100644
index 0000000..68fae20
--- /dev/null
+++ b/test/parse_endian_force.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "ENDIAN badendianness\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_endian_little.c b/test/parse_endian_little.c
new file mode 100644
index 0000000..54cfd57
--- /dev/null
+++ b/test/parse_endian_little.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "ENDIAN little\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_endian_slash.c b/test/parse_endian_slash.c
new file mode 100644
index 0000000..ff9ae40
--- /dev/null
+++ b/test/parse_endian_slash.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "/ENDIAN big\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_eol.c b/test/parse_eol.c
new file mode 100644
index 0000000..df1dabe
--- /dev/null
+++ b/test/parse_eol.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 1\\\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_foffs.c b/test/parse_foffs.c
new file mode 100644
index 0000000..f235b9b
--- /dev/null
+++ b/test/parse_foffs.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "FRAMEOFFSET 73\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_foffs_include.c b/test/parse_foffs_include.c
new file mode 100644
index 0000000..fadd6b3
--- /dev/null
+++ b/test/parse_foffs_include.c
@@ -0,0 +1,80 @@
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "FRAMEOFFSET 1\nINCLUDE format1\nINCLUDE format2";
+
+ const char* data1 = __TEST__ "dirfile/data1";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format1_data = "data1 RAW UINT8 1\n";
+
+ const char* data2 = __TEST__ "dirfile/data2";
+ const char* format2 = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format);
+ unlink(format1);
+ unlink(format2);
+ unlink(data1);
+ unlink(data2);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/parse_foffs_slash.c b/test/parse_foffs_slash.c
new file mode 100644
index 0000000..9568a83
--- /dev/null
+++ b/test/parse_foffs_slash.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "/FRAMEOFFSET 73\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_include.c b/test/parse_include.c
new file mode 100644
index 0000000..e77f040
--- /dev/null
+++ b/test/parse_include.c
@@ -0,0 +1,42 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format_data = "INCLUDE format1\n";
+ const char* format1_data = "data RAW UINT8 11\n";
+ int fd, r = 0;
+ DIRFILE *D;
+ gd_spf_t spf;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(spf, 11);
+ return r;
+}
diff --git a/test/parse_include_absolute.c b/test/parse_include_absolute.c
new file mode 100644
index 0000000..dec8097
--- /dev/null
+++ b/test/parse_include_absolute.c
@@ -0,0 +1,64 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#if defined HAVE_GETCWD || defined HAVE__GETCWD
+#ifdef HAVE__GETCWD
+#define getcwd _getcwd
+#endif
+ const char *filedir = __TEST__ "dirfile";
+ const char *format = __TEST__ "dirfile/format";
+ const char *format1 = __TEST__ "dirfile/format1";
+ const char *format_data1 = "INCLUDE ";
+ const char *format_data2 = "/" __TEST__ "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;
+ gd_spf_t spf;
+
+ mkdir(filedir, 0777);
+
+ 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));
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(spf, 11);
+ free(cwd);
+ return r;
+#else
+ return 77;
+#endif
+}
diff --git a/test/parse_include_absrel.c b/test/parse_include_absrel.c
new file mode 100644
index 0000000..6fd4e7f
--- /dev/null
+++ b/test/parse_include_absrel.c
@@ -0,0 +1,71 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#if defined HAVE_GETCWD || defined HAVE__GETCWD
+#ifdef HAVE__GETCWD
+#define getcwd _getcwd
+#endif
+ const char *filedir = __TEST__ "dirfile";
+ const char *format = __TEST__ "dirfile/format";
+ const char *format1 = __TEST__ "dirfile/format1";
+ const char *format2 = __TEST__ "dirfile/format2";
+ const char *format_data1 = "INCLUDE ";
+ const char *format_data2 = "/" __TEST__ "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;
+ gd_spf_t spf;
+
+ mkdir(filedir, 0777);
+
+ 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));
+
+ 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_close(D);
+
+ unlink(format2);
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(spf, 11);
+ free(cwd);
+ return r;
+#else
+ return 77;
+#endif
+}
diff --git a/test/parse_include_nonexistent.c b/test/parse_include_nonexistent.c
new file mode 100644
index 0000000..dfb86db
--- /dev/null
+++ b/test/parse_include_nonexistent.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "INCLUDE non_existent_file\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OPEN_INCLUDE);
+ return r;
+}
diff --git a/test/parse_include_relabs.c b/test/parse_include_relabs.c
new file mode 100644
index 0000000..a562863
--- /dev/null
+++ b/test/parse_include_relabs.c
@@ -0,0 +1,74 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#if defined HAVE_GETCWD || defined HAVE__GETCWD
+#ifdef HAVE__GETCWD
+#define getcwd _getcwd
+#endif
+ const char *filedir = __TEST__ "dirfile";
+ const char *subdir = __TEST__ "dirfile/sub";
+ const char *format = __TEST__ "dirfile/format";
+ const char *format1 = __TEST__ "dirfile/sub/format1";
+ const char *format2 = __TEST__ "dirfile/sub/format2";
+ const char *format_data = "INCLUDE sub/format1\n";
+ const char *format1_data1 = "INCLUDE ";
+ const char *format1_data2 = "/" __TEST__ "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;
+ gd_spf_t spf;
+
+ mkdir(filedir, 0777);
+ mkdirsub(subdir, 0777);
+
+ 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));
+
+ 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_close(D);
+
+ unlink(format2);
+ unlink(format1);
+ unlink(format);
+ rmdir(subdir);
+ rmdir(filedir);
+
+ CHECKU(spf, 11);
+ free(cwd);
+ return r;
+#else
+ return 77;
+#endif
+}
diff --git a/test/parse_include_relrel.c b/test/parse_include_relrel.c
new file mode 100644
index 0000000..08e3eec
--- /dev/null
+++ b/test/parse_include_relrel.c
@@ -0,0 +1,53 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char *filedir = __TEST__ "dirfile";
+ const char *subdir = __TEST__ "dirfile/sub";
+ const char *format = __TEST__ "dirfile/format";
+ const char *format1 = __TEST__ "dirfile/sub/format1";
+ const char *format2 = __TEST__ "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;
+ gd_spf_t spf;
+
+ mkdir(filedir, 0777);
+ mkdirsub(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_close(D);
+
+ unlink(format2);
+ unlink(format1);
+ unlink(format);
+ rmdir(subdir);
+ rmdir(filedir);
+
+ CHECKU(spf, 11);
+ return r;
+}
diff --git a/test/parse_include_slash.c b/test/parse_include_slash.c
new file mode 100644
index 0000000..7baf7ee
--- /dev/null
+++ b/test/parse_include_slash.c
@@ -0,0 +1,42 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format_data = "/INCLUDE format1\n";
+ const char* format1_data = "data RAW UINT8 11\n";
+ int fd, r = 0;
+ DIRFILE *D;
+ gd_spf_t spf;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(spf,11);
+ return r;
+}
diff --git a/test/parse_index.c b/test/parse_index.c
new file mode 100644
index 0000000..6fb9401
--- /dev/null
+++ b/test/parse_index.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "INDEX RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_lincom.c b/test/parse_lincom.c
new file mode 100644
index 0000000..1cf8f2d
--- /dev/null
+++ b/test/parse_lincom.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "lincom LINCOM 2 in1 1 0 in2 1 0\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_lincom_ncols1.c b/test/parse_lincom_ncols1.c
new file mode 100644
index 0000000..ff3029e
--- /dev/null
+++ b/test/parse_lincom_ncols1.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "lincom LINCOM\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_lincom_ncols2.c b/test/parse_lincom_ncols2.c
new file mode 100644
index 0000000..78b2c1b
--- /dev/null
+++ b/test/parse_lincom_ncols2.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "lincom LINCOM 2 in1 1 0\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_lincom_nfields.c b/test/parse_lincom_nfields.c
new file mode 100644
index 0000000..0157915
--- /dev/null
+++ b/test/parse_lincom_nfields.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_lincom_nofields.c b/test/parse_lincom_nofields.c
new file mode 100644
index 0000000..9453494
--- /dev/null
+++ b/test/parse_lincom_nofields.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "lincom LINCOM 0\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_lincom_non.c b/test/parse_lincom_non.c
new file mode 100644
index 0000000..43996dd
--- /dev/null
+++ b/test/parse_lincom_non.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "lincom LINCOM in1 1 0 in2 1 0\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_lincom_non_ncols.c b/test/parse_lincom_non_ncols.c
new file mode 100644
index 0000000..1c60ed0
--- /dev/null
+++ b/test/parse_lincom_non_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "lincom LINCOM in1 1 0 in2\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_lincom_scalar.c b/test/parse_lincom_scalar.c
new file mode 100644
index 0000000..d5cee85
--- /dev/null
+++ b/test/parse_lincom_scalar.c
@@ -0,0 +1,36 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_linterp.c b/test/parse_linterp.c
new file mode 100644
index 0000000..0a3df3f
--- /dev/null
+++ b/test/parse_linterp.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data LINTERP in1 lut\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_linterp_ncols.c b/test/parse_linterp_ncols.c
new file mode 100644
index 0000000..e4da8e7
--- /dev/null
+++ b/test/parse_linterp_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data LINTERP in1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_meta.c b/test/parse_meta.c
new file mode 100644
index 0000000..90f80be
--- /dev/null
+++ b/test/parse_meta.c
@@ -0,0 +1,36 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_meta_implicit.c b/test/parse_meta_implicit.c
new file mode 100644
index 0000000..588d4ee
--- /dev/null
+++ b/test/parse_meta_implicit.c
@@ -0,0 +1,43 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/parse_meta_implicit2.c b/test/parse_meta_implicit2.c
new file mode 100644
index 0000000..2fc1948
--- /dev/null
+++ b/test/parse_meta_implicit2.c
@@ -0,0 +1,36 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_meta_index.c b/test/parse_meta_index.c
new file mode 100644
index 0000000..08808cd
--- /dev/null
+++ b/test/parse_meta_index.c
@@ -0,0 +1,35 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "META INDEX child CONST UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_meta_index2.c b/test/parse_meta_index2.c
new file mode 100644
index 0000000..d9d4b5e
--- /dev/null
+++ b/test/parse_meta_index2.c
@@ -0,0 +1,36 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_meta_parent.c b/test/parse_meta_parent.c
new file mode 100644
index 0000000..16961b8
--- /dev/null
+++ b/test/parse_meta_parent.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "META parent child CONST UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_meta_raw.c b/test/parse_meta_raw.c
new file mode 100644
index 0000000..415d8f3
--- /dev/null
+++ b/test/parse_meta_raw.c
@@ -0,0 +1,36 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_multiply.c b/test/parse_multiply.c
new file mode 100644
index 0000000..0a3f2be
--- /dev/null
+++ b/test/parse_multiply.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data MULTIPLY in1 in2\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_multiply_ncols.c b/test/parse_multiply_ncols.c
new file mode 100644
index 0000000..14568ae
--- /dev/null
+++ b/test/parse_multiply_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data MULTIPLY in1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_name.c b/test/parse_name.c
new file mode 100644
index 0000000..b71aad2
--- /dev/null
+++ b/test/parse_name.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "d/ta RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_name_dot.c b/test/parse_name_dot.c
new file mode 100644
index 0000000..360ee03
--- /dev/null
+++ b/test/parse_name_dot.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "d.ta RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_name_ext.c b/test/parse_name_ext.c
new file mode 100644
index 0000000..25885ac
--- /dev/null
+++ b/test/parse_name_ext.c
@@ -0,0 +1,36 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data.txt RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+
+ return r;
+}
diff --git a/test/parse_name_pedantic.c b/test/parse_name_pedantic.c
new file mode 100644
index 0000000..3638f8a
--- /dev/null
+++ b/test/parse_name_pedantic.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "d.ta RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_ncols.c b/test/parse_ncols.c
new file mode 100644
index 0000000..c2af494
--- /dev/null
+++ b/test/parse_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "ENDIAN\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_phase.c b/test/parse_phase.c
new file mode 100644
index 0000000..7574ec7
--- /dev/null
+++ b/test/parse_phase.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data PHASE in1 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_phase_ncols.c b/test/parse_phase_ncols.c
new file mode 100644
index 0000000..a8ae96f
--- /dev/null
+++ b/test/parse_phase_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data PHASE in1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_phase_scalar.c b/test/parse_phase_scalar.c
new file mode 100644
index 0000000..60d81dc
--- /dev/null
+++ b/test/parse_phase_scalar.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const CONST INT32 1\ndata PHASE in1 const\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_polynom.c b/test/parse_polynom.c
new file mode 100644
index 0000000..a437f81
--- /dev/null
+++ b/test/parse_polynom.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "polynom POLYNOM in 1 2 3 4\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_polynom_ncols1.c b/test/parse_polynom_ncols1.c
new file mode 100644
index 0000000..b1c8590
--- /dev/null
+++ b/test/parse_polynom_ncols1.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "polynom POLYNOM in 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_polynom_ncols2.c b/test/parse_polynom_ncols2.c
new file mode 100644
index 0000000..117e21d
--- /dev/null
+++ b/test/parse_polynom_ncols2.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_polynom_scalar.c b/test/parse_polynom_scalar.c
new file mode 100644
index 0000000..67f82d3
--- /dev/null
+++ b/test/parse_polynom_scalar.c
@@ -0,0 +1,36 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_protect_all.c b/test/parse_protect_all.c
new file mode 100644
index 0000000..55e34a3
--- /dev/null
+++ b/test/parse_protect_all.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "PROTECT all\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_protect_bad.c b/test/parse_protect_bad.c
new file mode 100644
index 0000000..44278d9
--- /dev/null
+++ b/test/parse_protect_bad.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "PROTECT badprotection\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_protect_data.c b/test/parse_protect_data.c
new file mode 100644
index 0000000..77201a5
--- /dev/null
+++ b/test/parse_protect_data.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "PROTECT data\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_protect_format.c b/test/parse_protect_format.c
new file mode 100644
index 0000000..029db5e
--- /dev/null
+++ b/test/parse_protect_format.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "PROTECT format\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_protect_none.c b/test/parse_protect_none.c
new file mode 100644
index 0000000..0c648d0
--- /dev/null
+++ b/test/parse_protect_none.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "PROTECT none\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_quote.c b/test/parse_quote.c
new file mode 100644
index 0000000..c7bd022
--- /dev/null
+++ b/test/parse_quote.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "\"da ta\" RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_quote_mismatch.c b/test/parse_quote_mismatch.c
new file mode 100644
index 0000000..dfe7bed
--- /dev/null
+++ b/test/parse_quote_mismatch.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 \"1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_raw.c b/test/parse_raw.c
new file mode 100644
index 0000000..1e3b4dd
--- /dev/null
+++ b/test/parse_raw.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_raw_char.c b/test/parse_raw_char.c
new file mode 100644
index 0000000..c8c94be
--- /dev/null
+++ b/test/parse_raw_char.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW c 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_raw_ncols.c b/test/parse_raw_ncols.c
new file mode 100644
index 0000000..a3f61ce
--- /dev/null
+++ b/test/parse_raw_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_raw_scalar.c b/test/parse_raw_scalar.c
new file mode 100644
index 0000000..3b1d5e3
--- /dev/null
+++ b/test/parse_raw_scalar.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "const CONST INT8 1\ndata RAW UINT8 const\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_raw_spf.c b/test/parse_raw_spf.c
new file mode 100644
index 0000000..97e0e0c
--- /dev/null
+++ b/test/parse_raw_spf.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 0\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_raw_type.c b/test/parse_raw_type.c
new file mode 100644
index 0000000..ac1547d
--- /dev/null
+++ b/test/parse_raw_type.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW BADTYPE 11\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_recip.c b/test/parse_recip.c
new file mode 100644
index 0000000..054109d
--- /dev/null
+++ b/test/parse_recip.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RECIP in2 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_ref.c b/test/parse_ref.c
new file mode 100644
index 0000000..263ba93
--- /dev/null
+++ b/test/parse_ref.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "REFERENCE data\ndata RAW UINT8 1";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_ref_nonexistent.c b/test/parse_ref_nonexistent.c
new file mode 100644
index 0000000..c88f0d6
--- /dev/null
+++ b/test/parse_ref_nonexistent.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "REFERENCE data\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_BAD_REFERENCE);
+ return r;
+}
diff --git a/test/parse_sbit.c b/test/parse_sbit.c
new file mode 100644
index 0000000..bccbd5e
--- /dev/null
+++ b/test/parse_sbit.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data SBIT in1 3\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_sort.c b/test/parse_sort.c
new file mode 100644
index 0000000..55150eb
--- /dev/null
+++ b/test/parse_sort.c
@@ -0,0 +1,75 @@
+/* Field sort check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/parse_string.c b/test/parse_string.c
new file mode 100644
index 0000000..2c6862b
--- /dev/null
+++ b/test/parse_string.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "string STRING value\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_string_ncols.c b/test/parse_string_ncols.c
new file mode 100644
index 0000000..e9f0146
--- /dev/null
+++ b/test/parse_string_ncols.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "string STRING\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_string_null.c b/test/parse_string_null.c
new file mode 100644
index 0000000..101a110
--- /dev/null
+++ b/test/parse_string_null.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "string STRING \"\"\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_version.c b/test/parse_version.c
new file mode 100644
index 0000000..6ee8b6e
--- /dev/null
+++ b/test/parse_version.c
@@ -0,0 +1,35 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "VERSION 999999\nBADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_version_include.c b/test/parse_version_include.c
new file mode 100644
index 0000000..be77717
--- /dev/null
+++ b/test/parse_version_include.c
@@ -0,0 +1,41 @@
+/* VERSION should cross INCLUDEs */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/parse_version_permissive.c b/test/parse_version_permissive.c
new file mode 100644
index 0000000..0976b33
--- /dev/null
+++ b/test/parse_version_permissive.c
@@ -0,0 +1,35 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "VERSION 999999\nBADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_OK);
+ return r;
+}
diff --git a/test/parse_version_slash.c b/test/parse_version_slash.c
new file mode 100644
index 0000000..b7bb0d6
--- /dev/null
+++ b/test/parse_version_slash.c
@@ -0,0 +1,35 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "/VERSION 999999\nBADDIRECTIVE BADTYPE\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_FORMAT);
+ return r;
+}
diff --git a/test/parse_whitespace.c b/test/parse_whitespace.c
new file mode 100644
index 0000000..5be589d
--- /dev/null
+++ b/test/parse_whitespace.c
@@ -0,0 +1,34 @@
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "da\\ ta RAW UINT8 1\n";
+ int fd, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/protect_alter.c b/test/protect_alter.c
new file mode 100644
index 0000000..03e0a7b
--- /dev/null
+++ b/test/protect_alter.c
@@ -0,0 +1,51 @@
+/* Test frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, 0);
+ CHECKI(ret, 0);
+ CHECKI(p, GD_PROTECT_DATA);
+
+ return r;
+}
diff --git a/test/protect_get.c b/test/protect_get.c
new file mode 100644
index 0000000..ca47057
--- /dev/null
+++ b/test/protect_get.c
@@ -0,0 +1,48 @@
+/* Test protection */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(p, GD_PROTECT_FORMAT);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put64.c b/test/put64.c
new file mode 100644
index 0000000..d05afbe
--- /dev/null
+++ b/test/put64.c
@@ -0,0 +1,68 @@
+/* Attempt to write UINT8 */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ int fd, n, error, i;
+ struct stat buf;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf))
+ return 1;
+ if (buf.st_size != 40 + 8 * sizeof(uint8_t))
+ return 1;
+
+ fd = open(data, O_RDONLY | O_BINARY);
+ i = 0;
+ while (read(fd, &d, sizeof(uint8_t))) {
+ if (i < 40 || i > 48) {
+ if (d != 0)
+ return 1;
+ } else if (d != i)
+ return 1;
+ i++;
+ }
+ close(fd);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ if (error)
+ return 1;
+ if (n != 8)
+ return 1;
+
+ return 0;
+}
diff --git a/test/put_bad_code.c b/test/put_bad_code.c
new file mode 100644
index 0000000..ebdf1fd
--- /dev/null
+++ b/test/put_bad_code.c
@@ -0,0 +1,38 @@
+/* Attempt to write a non-existant field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "#\n";
+ unsigned char c = 0;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n, 0);
+ CHECKI(error,GD_E_BAD_CODE);
+ return r;
+}
diff --git a/test/put_bit.c b/test/put_bit.c
new file mode 100644
index 0000000..f5741d1
--- /dev/null
+++ b/test/put_bit.c
@@ -0,0 +1,63 @@
+/* Attempt to write BIT */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/put_bof.c b/test/put_bof.c
new file mode 100644
index 0000000..1f3a7b5
--- /dev/null
+++ b/test/put_bof.c
@@ -0,0 +1,39 @@
+/* Attempt to write UINT8 past the beginning-of-field*/
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 8\nFRAMEOFFSET 10000";
+ uint8_t c[8];
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_RANGE);
+ return r;
+}
diff --git a/test/put_carray.c b/test/put_carray.c
new file mode 100644
index 0000000..dc0abc6
--- /dev/null
+++ b/test/put_carray.c
@@ -0,0 +1,42 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0};
+ int error, r = 0, i;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+ gd_close(D);
+
+ /* check */
+ memset(val, 0, 8);
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ gd_get_carray(D, "data", GD_UINT8, &val);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ for (i = 0; i < 8; ++i)
+ CHECKIi(i, val[i], i * (i + 1));
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/put_carray_slice.c b/test/put_carray_slice.c
new file mode 100644
index 0000000..d0b2f36
--- /dev/null
+++ b/test/put_carray_slice.c
@@ -0,0 +1,44 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0};
+ int r = 0, error, i;
+
+ DIRFILE* 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);
+ error = gd_error(D);
+ gd_close(D);
+
+ /* check */
+ memset(val, 0, 8);
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ gd_get_carray(D, "data", GD_UINT8, &val);
+ gd_close(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);
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/put_char.c b/test/put_char.c
new file mode 100644
index 0000000..16f37e8
--- /dev/null
+++ b/test/put_char.c
@@ -0,0 +1,42 @@
+/* Attempt to write UINT8 c/ an old-style type character should fail cleanly */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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);
+ 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_TYPE);
+ return r;
+}
diff --git a/test/put_complex128.c b/test/put_complex128.c
new file mode 100644
index 0000000..ab5d516
--- /dev/null
+++ b/test/put_complex128.c
@@ -0,0 +1,89 @@
+/* Attempt to write COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ struct stat buf;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ CHECKI(buf.st_size, 48 * 2 * sizeof(double));
+
+ fd = open(data, O_RDONLY | O_BINARY);
+ 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);
+
+ CHECKI(error, 0);
+ CHECKI(n,8);
+
+ return r;
+}
diff --git a/test/put_complex64.c b/test/put_complex64.c
new file mode 100644
index 0000000..a7e37ba
--- /dev/null
+++ b/test/put_complex64.c
@@ -0,0 +1,89 @@
+/* Attempt to write COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(error,0);
+ CHECKI(n,8);
+
+ return r;
+}
diff --git a/test/put_const.c b/test/put_const.c
new file mode 100644
index 0000000..dd51079
--- /dev/null
+++ b/test/put_const.c
@@ -0,0 +1,39 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ uint8_t val = 0;
+ int error, r = 0;
+
+ DIRFILE* 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);
+ error = gd_error(D);
+ gd_close(D);
+
+ /* check */
+ val = 0;
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ gd_get_constant(D, "data", GD_UINT8, &val);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKU(val, 23);
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/put_const_protect.c b/test/put_const_protect.c
new file mode 100644
index 0000000..cce0f71
--- /dev/null
+++ b/test/put_const_protect.c
@@ -0,0 +1,40 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_PROTECTED);
+ CHECKI(n, -1);
+ return r;
+}
diff --git a/test/put_divide.c b/test/put_divide.c
new file mode 100644
index 0000000..defdece
--- /dev/null
+++ b/test/put_divide.c
@@ -0,0 +1,50 @@
+/* Attempt to write DIVIDE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (!stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_FIELD_TYPE);
+ return r;
+}
diff --git a/test/put_endian16.c b/test/put_endian16.c
new file mode 100644
index 0000000..4811e6b
--- /dev/null
+++ b/test/put_endian16.c
@@ -0,0 +1,63 @@
+/* Attempt to write UINT16 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/put_endian32.c b/test/put_endian32.c
new file mode 100644
index 0000000..2c78ba9
--- /dev/null
+++ b/test/put_endian32.c
@@ -0,0 +1,63 @@
+/* Attempt to write UINT32 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/put_endian64.c b/test/put_endian64.c
new file mode 100644
index 0000000..f83639e
--- /dev/null
+++ b/test/put_endian64.c
@@ -0,0 +1,63 @@
+/* Attempt to write UINT64 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ char format_data[1000];
+ uint64_t c = 0x0203000000040001LLU, d = 0;
+ const int big_endian = BigEndian();
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ 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_close(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,0x0100040000000302LLU);
+ CHECKI(n,1);
+ CHECKI(error,0);
+
+ return r;
+}
diff --git a/test/put_endian8.c b/test/put_endian8.c
new file mode 100644
index 0000000..cc6adff
--- /dev/null
+++ b/test/put_endian8.c
@@ -0,0 +1,62 @@
+/* Attempt to write UINT8 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/put_endian_complex128_arm.c b/test/put_endian_complex128_arm.c
new file mode 100644
index 0000000..c4c376b
--- /dev/null
+++ b/test/put_endian_complex128_arm.c
@@ -0,0 +1,65 @@
+/* Attempt to write arm-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_complex128_big.c b/test/put_endian_complex128_big.c
new file mode 100644
index 0000000..801bfad
--- /dev/null
+++ b/test/put_endian_complex128_big.c
@@ -0,0 +1,65 @@
+/* Attempt to write big-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_complex128_little.c b/test/put_endian_complex128_little.c
new file mode 100644
index 0000000..10127ac
--- /dev/null
+++ b/test/put_endian_complex128_little.c
@@ -0,0 +1,65 @@
+/* Attempt to write little-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_complex64_arm.c b/test/put_endian_complex64_arm.c
new file mode 100644
index 0000000..1124730
--- /dev/null
+++ b/test/put_endian_complex64_arm.c
@@ -0,0 +1,64 @@
+/* Attempt to write arm-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_complex64_big.c b/test/put_endian_complex64_big.c
new file mode 100644
index 0000000..62ed613
--- /dev/null
+++ b/test/put_endian_complex64_big.c
@@ -0,0 +1,64 @@
+/* Attempt to write big-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_complex64_little.c b/test/put_endian_complex64_little.c
new file mode 100644
index 0000000..e5b4cc1
--- /dev/null
+++ b/test/put_endian_complex64_little.c
@@ -0,0 +1,64 @@
+/* Attempt to write little-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_float32_arm.c b/test/put_endian_float32_arm.c
new file mode 100644
index 0000000..38274f5
--- /dev/null
+++ b/test/put_endian_float32_arm.c
@@ -0,0 +1,54 @@
+/* Attempt to write arm-endian FLOAT32 (which is just little endian) */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_float32_big.c b/test/put_endian_float32_big.c
new file mode 100644
index 0000000..3dcbad8
--- /dev/null
+++ b/test/put_endian_float32_big.c
@@ -0,0 +1,54 @@
+/* Attempt to write big-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_float32_little.c b/test/put_endian_float32_little.c
new file mode 100644
index 0000000..27f3110
--- /dev/null
+++ b/test/put_endian_float32_little.c
@@ -0,0 +1,54 @@
+/* Attempt to write little-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_float64_arm.c b/test/put_endian_float64_arm.c
new file mode 100644
index 0000000..e5efc61
--- /dev/null
+++ b/test/put_endian_float64_arm.c
@@ -0,0 +1,56 @@
+/* Attempt to write arm-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_float64_big.c b/test/put_endian_float64_big.c
new file mode 100644
index 0000000..6b88b9c
--- /dev/null
+++ b/test/put_endian_float64_big.c
@@ -0,0 +1,56 @@
+/* Attempt to write big-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_endian_float64_little.c b/test/put_endian_float64_little.c
new file mode 100644
index 0000000..11ea8bb
--- /dev/null
+++ b/test/put_endian_float64_little.c
@@ -0,0 +1,56 @@
+/* Attempt to write little-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(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;
+}
diff --git a/test/put_ff.c b/test/put_ff.c
new file mode 100644
index 0000000..bf33c28
--- /dev/null
+++ b/test/put_ff.c
@@ -0,0 +1,64 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+ struct stat buf;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_float32.c b/test/put_float32.c
new file mode 100644
index 0000000..9d10437
--- /dev/null
+++ b/test/put_float32.c
@@ -0,0 +1,65 @@
+/* Attempt to write FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW FLOAT32 8\n";
+ float c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_float64.c b/test/put_float64.c
new file mode 100644
index 0000000..92dd752
--- /dev/null
+++ b/test/put_float64.c
@@ -0,0 +1,65 @@
+/* Attempt to write FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW FLOAT64 8\n";
+ double c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_foffs.c b/test/put_foffs.c
new file mode 100644
index 0000000..253d472
--- /dev/null
+++ b/test/put_foffs.c
@@ -0,0 +1,64 @@
+/* Attempt to write UINT8 with FRAMEOFFSET */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_fs.c b/test/put_fs.c
new file mode 100644
index 0000000..4c92520
--- /dev/null
+++ b/test/put_fs.c
@@ -0,0 +1,64 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_int16.c b/test/put_int16.c
new file mode 100644
index 0000000..38b1238
--- /dev/null
+++ b/test/put_int16.c
@@ -0,0 +1,64 @@
+/* Attempt to write INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW INT16 8\n";
+ int16_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_int32.c b/test/put_int32.c
new file mode 100644
index 0000000..de23887
--- /dev/null
+++ b/test/put_int32.c
@@ -0,0 +1,64 @@
+/* Attempt to write INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW INT32 8\n";
+ int32_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_int64.c b/test/put_int64.c
new file mode 100644
index 0000000..803c592
--- /dev/null
+++ b/test/put_int64.c
@@ -0,0 +1,64 @@
+/* Attempt to write INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW INT64 8\n";
+ int64_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_int8.c b/test/put_int8.c
new file mode 100644
index 0000000..0596537
--- /dev/null
+++ b/test/put_int8.c
@@ -0,0 +1,64 @@
+/* Attempt to write INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW INT8 8\n";
+ int8_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_invalid.c b/test/put_invalid.c
new file mode 100644
index 0000000..c0bd989
--- /dev/null
+++ b/test/put_invalid.c
@@ -0,0 +1,25 @@
+/* Writing data to an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ char c[8];
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+ size_t n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKI(n,0);
+
+ CHECKI(error,GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/put_lincom1.c b/test/put_lincom1.c
new file mode 100644
index 0000000..e15c000
--- /dev/null
+++ b/test/put_lincom1.c
@@ -0,0 +1,64 @@
+/* Attempt to write LINCOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_lincom2.c b/test/put_lincom2.c
new file mode 100644
index 0000000..aac3a36
--- /dev/null
+++ b/test/put_lincom2.c
@@ -0,0 +1,50 @@
+/* Attempt to write LINCOM 2 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_close(D);
+
+ if (!stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_FIELD_TYPE);
+ return r;
+}
diff --git a/test/put_lincom_noin.c b/test/put_lincom_noin.c
new file mode 100644
index 0000000..31f383d
--- /dev/null
+++ b/test/put_lincom_noin.c
@@ -0,0 +1,43 @@
+/* Attempt to write LINCOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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);
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_CODE);
+ return r;
+}
diff --git a/test/put_linterp.c b/test/put_linterp.c
new file mode 100644
index 0000000..0f8939a
--- /dev/null
+++ b/test/put_linterp.c
@@ -0,0 +1,73 @@
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* table = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+ FILE *t;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_linterp_noin.c b/test/put_linterp_noin.c
new file mode 100644
index 0000000..c24e4af
--- /dev/null
+++ b/test/put_linterp_noin.c
@@ -0,0 +1,52 @@
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* table = __TEST__ "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);
+ 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_close(D);
+
+ unlink(table);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_CODE);
+ return r;
+}
diff --git a/test/put_linterp_nomono.c b/test/put_linterp_nomono.c
new file mode 100644
index 0000000..8b7e225
--- /dev/null
+++ b/test/put_linterp_nomono.c
@@ -0,0 +1,55 @@
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* table = __TEST__ "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);
+ 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_close(D);
+
+ unlink(table);
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error, GD_E_DOMAIN);
+
+ return r;
+}
diff --git a/test/put_linterp_notab.c b/test/put_linterp_notab.c
new file mode 100644
index 0000000..8a8979b
--- /dev/null
+++ b/test/put_linterp_notab.c
@@ -0,0 +1,45 @@
+/* Attempt to write LINCOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_OPEN_LINFILE);
+ return r;
+}
diff --git a/test/put_linterp_reverse.c b/test/put_linterp_reverse.c
new file mode 100644
index 0000000..a47524f
--- /dev/null
+++ b/test/put_linterp_reverse.c
@@ -0,0 +1,73 @@
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* table = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+ FILE *t;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_multiply.c b/test/put_multiply.c
new file mode 100644
index 0000000..bd9d0b8
--- /dev/null
+++ b/test/put_multiply.c
@@ -0,0 +1,50 @@
+/* Attempt to write MULTIPLY */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (!stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_FIELD_TYPE);
+ return r;
+}
diff --git a/test/put_null.c b/test/put_null.c
new file mode 100644
index 0000000..a5b93dd
--- /dev/null
+++ b/test/put_null.c
@@ -0,0 +1,38 @@
+/* Attempt to write NULL */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 8\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_TYPE);
+ return r;
+}
diff --git a/test/put_off64.c b/test/put_off64.c
new file mode 100644
index 0000000..da4aa08
--- /dev/null
+++ b/test/put_off64.c
@@ -0,0 +1,74 @@
+/* Attempt to write 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 <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifdef SKIP_TEST
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+#endif
+}
diff --git a/test/put_phase.c b/test/put_phase.c
new file mode 100644
index 0000000..017a18e
--- /dev/null
+++ b/test/put_phase.c
@@ -0,0 +1,64 @@
+/* Attempt to write PHASE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_phase_noin.c b/test/put_phase_noin.c
new file mode 100644
index 0000000..abafb28
--- /dev/null
+++ b/test/put_phase_noin.c
@@ -0,0 +1,43 @@
+/* Attempt to write PHASE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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);
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_CODE);
+ return r;
+}
diff --git a/test/put_polynom1.c b/test/put_polynom1.c
new file mode 100644
index 0000000..e7739a2
--- /dev/null
+++ b/test/put_polynom1.c
@@ -0,0 +1,64 @@
+/* Attempt to write POLYNOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_polynom2.c b/test/put_polynom2.c
new file mode 100644
index 0000000..ad40e6b
--- /dev/null
+++ b/test/put_polynom2.c
@@ -0,0 +1,50 @@
+/* Attempt to write POLYNOM */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_close(D);
+
+ if (!stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_FIELD_TYPE);
+ return r;
+}
diff --git a/test/put_polynom_noin.c b/test/put_polynom_noin.c
new file mode 100644
index 0000000..93af75a
--- /dev/null
+++ b/test/put_polynom_noin.c
@@ -0,0 +1,43 @@
+/* Attempt to write POLYNOM */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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);
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_CODE);
+ return r;
+}
diff --git a/test/put_protect.c b/test/put_protect.c
new file mode 100644
index 0000000..a91b411
--- /dev/null
+++ b/test/put_protect.c
@@ -0,0 +1,44 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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);
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error, GD_E_PROTECTED);
+
+ return r;
+}
diff --git a/test/put_rdonly.c b/test/put_rdonly.c
new file mode 100644
index 0000000..28e64e3
--- /dev/null
+++ b/test/put_rdonly.c
@@ -0,0 +1,42 @@
+/* Attempt to write to a read only dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ unsigned char c[8];
+ int fd, n, error, unlink_data, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ mkdir(filedir, 0777);
+
+ fd = 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ unlink_data = unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(unlink_data, -1);
+ CHECKI(n,0);
+ CHECKI(error,GD_E_ACCMODE);
+ return r;
+}
diff --git a/test/put_recip.c b/test/put_recip.c
new file mode 100644
index 0000000..7b9c907
--- /dev/null
+++ b/test/put_recip.c
@@ -0,0 +1,64 @@
+/* Attempt to write DIVIDE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_recurse.c b/test/put_recurse.c
new file mode 100644
index 0000000..aae6391
--- /dev/null
+++ b/test/put_recurse.c
@@ -0,0 +1,39 @@
+/* Attempting to resove a recursively defined field should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_RECURSE_LEVEL);
+ return r;
+}
diff --git a/test/put_repr.c b/test/put_repr.c
new file mode 100644
index 0000000..d0c7599
--- /dev/null
+++ b/test/put_repr.c
@@ -0,0 +1,48 @@
+/* Attempt to write COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_BAD_REPR);
+ CHECKI(n,0);
+
+ return r;
+}
diff --git a/test/put_rofs.c b/test/put_rofs.c
new file mode 100644
index 0000000..ad661ce
--- /dev/null
+++ b/test/put_rofs.c
@@ -0,0 +1,42 @@
+/* Attempt to write a non-existant field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 1\n";
+ unsigned char c = 0;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ 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, 0444));
+
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_RAW_IO);
+ return r;
+}
diff --git a/test/put_sbit.c b/test/put_sbit.c
new file mode 100644
index 0000000..9b5d86c
--- /dev/null
+++ b/test/put_sbit.c
@@ -0,0 +1,63 @@
+/* Attempt to write BIT */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/put_sf.c b/test/put_sf.c
new file mode 100644
index 0000000..754d32f
--- /dev/null
+++ b/test/put_sf.c
@@ -0,0 +1,64 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ 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))) {
+ if (i < 40 || i > 48) {
+ CHECKIi(i,d,0);
+ } else
+ CHECKIi(i,d,i);
+ i++;
+ }
+ close(fd);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_ss.c b/test/put_ss.c
new file mode 100644
index 0000000..eb6528e
--- /dev/null
+++ b/test/put_ss.c
@@ -0,0 +1,64 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT8 8\n";
+ uint8_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ 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))) {
+ if (i < 40 || i > 48) {
+ CHECKIi(i,d,0);
+ } else
+ CHECKIi(i,d,i);
+ i++;
+ }
+ close(fd);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_string.c b/test/put_string.c
new file mode 100644
index 0000000..554e157
--- /dev/null
+++ b/test/put_string.c
@@ -0,0 +1,37 @@
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ char string[1024] = "";
+ int error, r = 0;
+
+ DIRFILE* 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");
+ error = gd_error(D);
+ gd_close(D);
+
+ /* check */
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ gd_get_string(D, "data", 1023, string);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKS(string,"some other string");
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/put_string_protect.c b/test/put_string_protect.c
new file mode 100644
index 0000000..5465534
--- /dev/null
+++ b/test/put_string_protect.c
@@ -0,0 +1,39 @@
+/* Attempt to write UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data STRING UINT8\nPROTECT all\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error, GD_E_PROTECTED);
+
+ return r;
+}
diff --git a/test/put_type.c b/test/put_type.c
new file mode 100644
index 0000000..b2fe788
--- /dev/null
+++ b/test/put_type.c
@@ -0,0 +1,38 @@
+/* Attempt to write an invalid type */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 8\n";
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(n,0);
+ CHECKI(error,GD_E_BAD_TYPE);
+ return r;
+}
diff --git a/test/put_uint16.c b/test/put_uint16.c
new file mode 100644
index 0000000..ef2a13c
--- /dev/null
+++ b/test/put_uint16.c
@@ -0,0 +1,65 @@
+/* Attempt to write UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT16 8\n";
+ uint16_t c[8], d;
+ struct stat buf;
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_uint32.c b/test/put_uint32.c
new file mode 100644
index 0000000..7d7841a
--- /dev/null
+++ b/test/put_uint32.c
@@ -0,0 +1,64 @@
+/* Attempt to write UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT32 8\n";
+ uint32_t c[8], d, i;
+ struct stat buf;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/put_uint64.c b/test/put_uint64.c
new file mode 100644
index 0000000..2189050
--- /dev/null
+++ b/test/put_uint64.c
@@ -0,0 +1,64 @@
+/* Attempt to write UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* format_data = "data RAW UINT64 8\n";
+ uint64_t c[8], d, i;
+ struct stat buf;
+ int fd, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ if (stat(data, &buf)) {
+ perror("stat");
+ r = 1;
+ }
+ 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);
+
+ CHECKI(n,8);
+ CHECKI(error, 0);
+
+ return r;
+}
diff --git a/test/ref.c b/test/ref.c
new file mode 100644
index 0000000..52549ff
--- /dev/null
+++ b/test/ref.c
@@ -0,0 +1,64 @@
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "data1 RAW UINT8 1\n"
+ "data2 RAW UINT8 1\n"
+ "REFERENCE data2\n"
+ ;
+
+ const char* data1 = __TEST__ "dirfile/data1";
+ const char* data2 = __TEST__ "dirfile/data2";
+
+ uint8_t data_data[4] = { 0, 1, 2, 3 };
+ int fd, error, error2, r = 0;
+ DIRFILE *D;
+ off_t nf;
+
+ 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_close(D);
+
+ unlink(format);
+ unlink(data1);
+ unlink(data2);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/ref_none.c b/test/ref_none.c
new file mode 100644
index 0000000..0087c16
--- /dev/null
+++ b/test/ref_none.c
@@ -0,0 +1,63 @@
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "data1 RAW UINT8 1\n"
+ "data2 RAW UINT8 1\n"
+ ;
+
+ const char* data1 = __TEST__ "dirfile/data1";
+ const char* data2 = __TEST__ "dirfile/data2";
+
+ uint8_t data_data[4] = { 0, 1, 2, 3 };
+ int fd, error, error2, r = 0;
+ DIRFILE *D;
+ off_t nf;
+
+ 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_close(D);
+
+ unlink(format);
+ unlink(data1);
+ unlink(data2);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/ref_two.c b/test/ref_two.c
new file mode 100644
index 0000000..42e352e
--- /dev/null
+++ b/test/ref_two.c
@@ -0,0 +1,65 @@
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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 = __TEST__ "dirfile/data1";
+ const char* data2 = __TEST__ "dirfile/data2";
+
+ uint8_t data_data[4] = { 0, 1, 2, 3 };
+ int fd, error, error2, r = 0;
+ DIRFILE *D;
+ off_t nf;
+
+ 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_close(D);
+
+ unlink(format);
+ unlink(data1);
+ unlink(data2);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_a.c b/test/repr_a.c
new file mode 100644
index 0000000..3f5b10c
--- /dev/null
+++ b/test/repr_a.c
@@ -0,0 +1,64 @@
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_float32.c b/test/repr_float32.c
new file mode 100644
index 0000000..cf41892
--- /dev/null
+++ b/test/repr_float32.c
@@ -0,0 +1,63 @@
+/* Attempt to read COMPLEX128 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/repr_float64.c b/test/repr_float64.c
new file mode 100644
index 0000000..dd85b4d
--- /dev/null
+++ b/test/repr_float64.c
@@ -0,0 +1,63 @@
+/* Attempt to read COMPLEX128 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/repr_i.c b/test/repr_i.c
new file mode 100644
index 0000000..9d3f5d9
--- /dev/null
+++ b/test/repr_i.c
@@ -0,0 +1,64 @@
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_int16.c b/test/repr_int16.c
new file mode 100644
index 0000000..3787809
--- /dev/null
+++ b/test/repr_int16.c
@@ -0,0 +1,63 @@
+/* Attempt to read COMPLEX128 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_int32.c b/test/repr_int32.c
new file mode 100644
index 0000000..d141f55
--- /dev/null
+++ b/test/repr_int32.c
@@ -0,0 +1,62 @@
+/* Attempt to read COMPLEX128 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_int64.c b/test/repr_int64.c
new file mode 100644
index 0000000..93c82e0
--- /dev/null
+++ b/test/repr_int64.c
@@ -0,0 +1,62 @@
+/* Attempt to read COMPLEX128 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_int8.c b/test/repr_int8.c
new file mode 100644
index 0000000..8607cc8
--- /dev/null
+++ b/test/repr_int8.c
@@ -0,0 +1,62 @@
+/* Attempt to read COMPLEX128 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_m.c b/test/repr_m.c
new file mode 100644
index 0000000..36946ae
--- /dev/null
+++ b/test/repr_m.c
@@ -0,0 +1,64 @@
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_r.c b/test/repr_r.c
new file mode 100644
index 0000000..92a31c6
--- /dev/null
+++ b/test/repr_r.c
@@ -0,0 +1,64 @@
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_real_a.c b/test/repr_real_a.c
new file mode 100644
index 0000000..9bc5087
--- /dev/null
+++ b/test/repr_real_a.c
@@ -0,0 +1,53 @@
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_real_i.c b/test/repr_real_i.c
new file mode 100644
index 0000000..a150ed0
--- /dev/null
+++ b/test/repr_real_i.c
@@ -0,0 +1,53 @@
+/* Attempt to read imaginary representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_real_m.c b/test/repr_real_m.c
new file mode 100644
index 0000000..e441088
--- /dev/null
+++ b/test/repr_real_m.c
@@ -0,0 +1,53 @@
+/* Attempt to read modulus representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_real_r.c b/test/repr_real_r.c
new file mode 100644
index 0000000..38761d5
--- /dev/null
+++ b/test/repr_real_r.c
@@ -0,0 +1,53 @@
+/* Attempt to read real representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/repr_uint16.c b/test/repr_uint16.c
new file mode 100644
index 0000000..d8da637
--- /dev/null
+++ b/test/repr_uint16.c
@@ -0,0 +1,62 @@
+/* Attempt to read COMPLEX128 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_uint32.c b/test/repr_uint32.c
new file mode 100644
index 0000000..8c82cfa
--- /dev/null
+++ b/test/repr_uint32.c
@@ -0,0 +1,62 @@
+/* Attempt to read COMPLEX128 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_uint64.c b/test/repr_uint64.c
new file mode 100644
index 0000000..f5cf421
--- /dev/null
+++ b/test/repr_uint64.c
@@ -0,0 +1,62 @@
+/* Attempt to read COMPLEX128 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/repr_uint8.c b/test/repr_uint8.c
new file mode 100644
index 0000000..8b17a85
--- /dev/null
+++ b/test/repr_uint8.c
@@ -0,0 +1,62 @@
+/* Attempt to read COMPLEX128 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/slim_get.c b/test/slim_get.c
new file mode 100644
index 0000000..89b5c8d
--- /dev/null
+++ b/test/slim_get.c
@@ -0,0 +1,77 @@
+/* Attempt to read UINT8 */
+#include "../src/config.h"
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_SLIM
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* slimdata = __TEST__ "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, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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", SLIM, 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_close(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
+}
diff --git a/test/slim_nframes.c b/test/slim_nframes.c
new file mode 100644
index 0000000..ff71644
--- /dev/null
+++ b/test/slim_nframes.c
@@ -0,0 +1,72 @@
+/* Retreiving the number of frames should succeed cleanly */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_SLIM
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* slimdata = __TEST__ "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;
+
+ 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", SLIM, 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_close(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
+}
diff --git a/test/spf.c b/test/spf.c
new file mode 100644
index 0000000..d141ecd
--- /dev/null
+++ b/test/spf.c
@@ -0,0 +1,37 @@
+/* Retreiving the samples-per-frame of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "data RAW UINT8 11\n";
+ int fd, error, r = 0;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(spf,11);
+ return r;
+}
diff --git a/test/spf_divide.c b/test/spf_divide.c
new file mode 100644
index 0000000..be43475
--- /dev/null
+++ b/test/spf_divide.c
@@ -0,0 +1,37 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+ gd_spf_t spf;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(spf,11);
+ return r;
+}
diff --git a/test/spf_lincom.c b/test/spf_lincom.c
new file mode 100644
index 0000000..4840671
--- /dev/null
+++ b/test/spf_lincom.c
@@ -0,0 +1,38 @@
+/* The SPF of a lincom should equal the SPF of the first field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(spf,11);
+ return r;
+}
diff --git a/test/spf_multiply.c b/test/spf_multiply.c
new file mode 100644
index 0000000..9579a81
--- /dev/null
+++ b/test/spf_multiply.c
@@ -0,0 +1,38 @@
+/* The SPF of a MULTIPLY should equal the SPF of the first field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(spf,11);
+ return r;
+}
diff --git a/test/spf_polynom.c b/test/spf_polynom.c
new file mode 100644
index 0000000..dc38bea
--- /dev/null
+++ b/test/spf_polynom.c
@@ -0,0 +1,37 @@
+/* The SPF of a polynom should equal the SPF of its input field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "in RAW UINT8 11\n"
+ "polynom POLYNOM in 1 2 1 3\n";
+ int fd, r = 0;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(spf,11);
+ return r;
+}
diff --git a/test/spf_recip.c b/test/spf_recip.c
new file mode 100644
index 0000000..412aadb
--- /dev/null
+++ b/test/spf_recip.c
@@ -0,0 +1,36 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data =
+ "in2 RAW UINT8 13\n"
+ "div RECIP in2 3.\n";
+ int fd, r = 0;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(spf,13);
+ return r;
+}
diff --git a/test/spf_recurse.c b/test/spf_recurse.c
new file mode 100644
index 0000000..4d37f2f
--- /dev/null
+++ b/test/spf_recurse.c
@@ -0,0 +1,40 @@
+/* Attempting to resove a recursively defined field should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+ gd_spf_t spf;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(spf,0);
+
+ CHECKI(error,GD_E_RECURSE_LEVEL);
+ return r;
+}
diff --git a/test/svlist.c b/test/svlist.c
new file mode 100644
index 0000000..c5566d7
--- /dev/null
+++ b/test/svlist.c
@@ -0,0 +1,60 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/svlist_invalid.c b/test/svlist_invalid.c
new file mode 100644
index 0000000..b51bcbe
--- /dev/null
+++ b/test/svlist_invalid.c
@@ -0,0 +1,23 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_strings(D);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error,GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/svlist_meta.c b/test/svlist_meta.c
new file mode 100644
index 0000000..bf9f375
--- /dev/null
+++ b/test/svlist_meta.c
@@ -0,0 +1,64 @@
+/* Retrieve a list of string metafields */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/svlist_meta_invalid.c b/test/svlist_meta_invalid.c
new file mode 100644
index 0000000..0ee4c9f
--- /dev/null
+++ b/test/svlist_meta_invalid.c
@@ -0,0 +1,23 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_mstrings(D, "parent");
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error,GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/test.h b/test/test.h
new file mode 100644
index 0000000..3dc4e18
--- /dev/null
+++ b/test/test.h
@@ -0,0 +1,101 @@
+#define GD_TEST
+#include "../src/internal.h"
+#include <inttypes.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* for MSVCRT _getcwd */
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
+
+/* System call kludge for Win32 */
+#if defined __MSVCRT__ && defined MSYS_SHELL
+#include <process.h>
+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
+
+/* mkdir for MSVC */
+#ifdef _MSC_VER
+#define mkdir(x,y) \
+ system("rmdir /q/s "__TEST__"dirfile"); \
+ _mkdir(x)
+// when using msvc the macro mkdir removes dirfile
+#define mkdirsub(x,y) _mkdir(x)
+#else
+#define mkdirsub(x,y) mkdir(x,y)
+#endif
+
+/* path munging for WIN32/64 */
+#if defined _WIN32 || defined _WIN64
+#define gd_pathwrite(x,y) do { \
+ char *ptr; \
+ for (ptr = y; *ptr != '\0'; ++ptr) { \
+ if (*ptr == '\\') write(x,ptr,1); \
+ write(x,ptr,1); \
+ } \
+} while (0)
+#else
+#define gd_pathwrite(x,y) write(x,y,strlen(y))
+#endif
+
+#define CHECK(e,n,nf,vf,...) \
+ if (e) { r = 1; \
+ fprintf(stderr, #n " = " nf " (expected " vf ")\n", __VA_ARGS__); }
+
+#define CHECKi(i,e,n,nf,vf,...) \
+ if (e) { r = 1; \
+ fprintf(stderr, #i ":%i " #n " = " nf " (expected " vf ")\n", (int)(i), \
+ __VA_ARGS__); }
+
+#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 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(strcmp((n),(v)),n,"\"%s\"","\"%s\"",(n),(v));
+#define CHECKSi(n,v) CHECKi(i,strcmp((n),(v)),n,"\"%s\"","\"%s\"",(n),(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))
diff --git a/test/trunc.c b/test/trunc.c
new file mode 100644
index 0000000..aa99928
--- /dev/null
+++ b/test/trunc.c
@@ -0,0 +1,44 @@
+/* Truncating a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ int fd, error, unlink_data, stat_format, r = 0;
+ struct stat buf;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+ gd_close(D);
+
+ 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);
+
+ CHECKI(error,GD_E_OK);
+ return r;
+}
diff --git a/test/trunc_rdonly.c b/test/trunc_rdonly.c
new file mode 100644
index 0000000..fb86749
--- /dev/null
+++ b/test/trunc_rdonly.c
@@ -0,0 +1,39 @@
+/* Truncating a read-only dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ int fd, error, unlink_data, r = 0;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+ gd_close(D);
+
+ unlink_data = unlink(data);
+ CHECKI(unlink_data, 0);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,GD_E_ACCMODE);
+ return r;
+}
diff --git a/test/trunc_rofs.c b/test/trunc_rofs.c
new file mode 100644
index 0000000..a15aacb
--- /dev/null
+++ b/test/trunc_rofs.c
@@ -0,0 +1,38 @@
+/* Truncating a read-only dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ int error, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+ close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+ chmod(filedir, 0555);
+
+ /* ensure filesystem honours read-onlyness */
+ if (!unlink(format) || errno != EACCES) {
+ rmdir(filedir);
+ return 77;
+ }
+
+ D = gd_open(filedir, GD_RDWR | GD_TRUNC);
+ error = gd_error(D);
+ gd_discard(D);
+
+ chmod(filedir, 0777);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error, GD_E_TRUNC);
+ return r;
+}
diff --git a/test/unclude.c b/test/unclude.c
new file mode 100644
index 0000000..c582deb
--- /dev/null
+++ b/test/unclude.c
@@ -0,0 +1,59 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format2 = __TEST__ "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, error, unlink_format1, unlink_format2, r = 0;
+ unsigned int nfields, nfragments;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+ nfields = gd_nfields(D);
+ nfragments = gd_nfragments(D);
+ gd_close(D);
+
+ unlink_format2 = unlink(format2);
+ unlink_format1 = unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(ret,0);
+ CHECKI(nfields,2);
+ CHECKI(nfragments,1);
+ CHECKI(unlink_format2,0);
+ CHECKI(unlink_format1,0);
+
+ return r;
+}
diff --git a/test/unclude_del.c b/test/unclude_del.c
new file mode 100644
index 0000000..f93a1c7
--- /dev/null
+++ b/test/unclude_del.c
@@ -0,0 +1,59 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format2 = __TEST__ "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, error, unlink_format1, unlink_format2, r = 0;
+ unsigned int nfields, nfragments;
+ DIRFILE *D;
+
+ 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);
+ error = gd_error(D);
+ nfields = gd_nfields(D);
+ nfragments = gd_nfragments(D);
+ gd_close(D);
+
+ unlink_format2 = unlink(format2);
+ unlink_format1 = unlink(format1);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(ret,0);
+ CHECKI(nfields,3);
+ CHECKI(nfragments,2);
+ CHECKI(unlink_format2,-1);
+ CHECKI(unlink_format1,0);
+
+ return r;
+}
diff --git a/test/unclude_move.c b/test/unclude_move.c
new file mode 100644
index 0000000..56c70e9
--- /dev/null
+++ b/test/unclude_move.c
@@ -0,0 +1,61 @@
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/format1";
+ const char* format2 = __TEST__ "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;
+
+ 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_close(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;
+}
diff --git a/test/version_0.c b/test/version_0.c
new file mode 100644
index 0000000..140b827
--- /dev/null
+++ b/test/version_0.c
@@ -0,0 +1,62 @@
+/* Open a Standards Version 0 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/version_0_write.c b/test/version_0_write.c
new file mode 100644
index 0000000..b1615c7
--- /dev/null
+++ b/test/version_0_write.c
@@ -0,0 +1,42 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "FRAMEOFFSET RAW c 8\na&b RAW c 8";
+ int fd, e, q, c, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(e,0);
+ CHECKI(q,0);
+ CHECKI(c,0);
+
+ return r;
+}
diff --git a/test/version_1.c b/test/version_1.c
new file mode 100644
index 0000000..791b323
--- /dev/null
+++ b/test/version_1.c
@@ -0,0 +1,63 @@
+/* Open a Standards Version 1 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/version_1_write.c b/test/version_1_write.c
new file mode 100644
index 0000000..069e4ae
--- /dev/null
+++ b/test/version_1_write.c
@@ -0,0 +1,42 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "INCLUDE RAW c 8\nFRAMEOFFSET 1\na&b RAW c 8\n";
+ int fd, e, q, c, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(e,1);
+ CHECKI(q,0);
+ CHECKI(c,1);
+
+ return r;
+}
diff --git a/test/version_2.c b/test/version_2.c
new file mode 100644
index 0000000..551ab3f
--- /dev/null
+++ b/test/version_2.c
@@ -0,0 +1,65 @@
+/* Open a Standards Version 2 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/version_2_write.c b/test/version_2_write.c
new file mode 100644
index 0000000..7b55088
--- /dev/null
+++ b/test/version_2_write.c
@@ -0,0 +1,45 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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, q, c, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(e,2);
+ CHECKI(q,0);
+ CHECKI(c,2);
+
+ return r;
+}
diff --git a/test/version_3.c b/test/version_3.c
new file mode 100644
index 0000000..66d8f83
--- /dev/null
+++ b/test/version_3.c
@@ -0,0 +1,70 @@
+/* Open a Standards Version 3 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/RAW";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/version_3_write.c b/test/version_3_write.c
new file mode 100644
index 0000000..f72caef
--- /dev/null
+++ b/test/version_3_write.c
@@ -0,0 +1,49 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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, q, c, r = 0;
+ DIRFILE *D;
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+ gd_close(D);
+
+ unlink(format);
+ unlink(format1);
+ rmdir(filedir);
+
+ CHECKI(e,3);
+ CHECKI(q,0);
+ CHECKI(c,3);
+
+ return r;
+}
diff --git a/test/version_4.c b/test/version_4.c
new file mode 100644
index 0000000..edd9302
--- /dev/null
+++ b/test/version_4.c
@@ -0,0 +1,69 @@
+/* Open a Standards Version 4 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "dirfile/RAW";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/version_4_write.c b/test/version_4_write.c
new file mode 100644
index 0000000..5d7a26f
--- /dev/null
+++ b/test/version_4_write.c
@@ -0,0 +1,49 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format1 = __TEST__ "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, q, c, r = 0;
+ DIRFILE *D;
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+ gd_close(D);
+
+ unlink(format);
+ unlink(format1);
+ rmdir(filedir);
+
+ CHECKI(e,4);
+ CHECKI(q,0);
+ CHECKI(c,4);
+
+ return r;
+}
diff --git a/test/version_5.c b/test/version_5.c
new file mode 100644
index 0000000..659eba3
--- /dev/null
+++ b/test/version_5.c
@@ -0,0 +1,70 @@
+/* Open a Standards Version 5 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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;
+}
diff --git a/test/version_5_strict.c b/test/version_5_strict.c
new file mode 100644
index 0000000..dc210bb
--- /dev/null
+++ b/test/version_5_strict.c
@@ -0,0 +1,84 @@
+/* CheckStandards Version 5 strictness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/ar";
+ const char* format_data =
+ "/VERSION 5\n"
+ "ENDIAN little\n"
+ "X<r RAW UINT8 8\n"
+ "/ENCODING raw\n"
+ "/REFERENCE ar\n"
+ "/PROTECT none\n"
+ "ar RAW UINT8 8\n";
+ uint16_t c[8];
+ int ll[7] = {0, 0, 0, 0, 0, 0, 0};
+ uint16_t d[8];
+ unsigned char data_data[256];
+ int fd, n, error, m, error2, i, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+ n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+ error = gd_error(D);
+
+ m = gd_getdata(D, "FILEFRAM", 5, 0, 8, 0, GD_UINT16, d);
+ error2 = gd_error(D);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(error2,0);
+ CHECKI(n,8);
+
+ for (i = 0; i < 7; ++i)
+ if ((i == 2 || i == 3 || i == 4 || i == 5)) {
+ CHECKIi(i,!ll[i],0);
+ } else
+ CHECKIi(i,ll[i],0);
+
+ for (i = 0; i < 8; ++i)
+ CHECKIi(i,c[i], 40 + i);
+
+ CHECKI(m,8);
+
+ for (i = 0; i < 8; ++i)
+ CHECKIi(i,d[i], 5 + i);
+
+ return r;
+}
diff --git a/test/version_5_write.c b/test/version_5_write.c
new file mode 100644
index 0000000..5b0cb66
--- /dev/null
+++ b/test/version_5_write.c
@@ -0,0 +1,46 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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, q, c, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(e,5);
+ CHECKI(q,0);
+ CHECKI(c,5);
+
+ return r;
+}
diff --git a/test/version_6.c b/test/version_6.c
new file mode 100644
index 0000000..de77557
--- /dev/null
+++ b/test/version_6.c
@@ -0,0 +1,63 @@
+/* Open a Standards Version 6 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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,8);
+ CHECKI(e,6);
+
+ return r;
+}
diff --git a/test/version_6_strict.c b/test/version_6_strict.c
new file mode 100644
index 0000000..044590e
--- /dev/null
+++ b/test/version_6_strict.c
@@ -0,0 +1,87 @@
+/* Check Standards Version 6 strictness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/ar";
+ const char* format_data =
+ "/VERSION 6\n"
+ "X<r RAW UINT8 8\n"
+ "X#r RAW COMPLEX128 8\n"
+ "X.r RAW UINT8 8\n"
+ "Xr POLYNOM INDEX 8 3 1 2\n"
+ "/ENCODING none\n"
+ "/REFERENCE ar\n"
+ "/PROTECT none\n"
+ "c CONST UINT8 3\n"
+ "ar RAW UINT8 8\n";
+ uint16_t c[8];
+ int ll[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ uint16_t d[8];
+ unsigned char data_data[256];
+ int fd, n, error, m, error2, i, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+ n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+ error = gd_error(D);
+
+ m = gd_getdata(D, "FILEFRAM", 5, 0, 8, 0, GD_UINT16, d);
+ error2 = gd_error(D);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+ CHECKI(error2, GD_E_BAD_CODE);
+
+ for (i = 0; i < 10; ++i) {
+ if (i == 1 || i == 2 || i == 3 || i == 4) {
+ CHECKIi(i,!ll[i],0);
+ } else if (i < 1 || i > 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;
+}
diff --git a/test/version_6_write.c b/test/version_6_write.c
new file mode 100644
index 0000000..42dcc1a
--- /dev/null
+++ b/test/version_6_write.c
@@ -0,0 +1,42 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "/VERSION 6\na\\#r RAW UINT8 8\n";
+ int fd, e, q, c, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(e,6);
+ CHECKI(q,0);
+ CHECKI(c,6);
+
+ return r;
+}
diff --git a/test/version_7.c b/test/version_7.c
new file mode 100644
index 0000000..109b127
--- /dev/null
+++ b/test/version_7.c
@@ -0,0 +1,63 @@
+/* Open a Standards Version 7 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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,8);
+ CHECKI(e,7);
+
+ return r;
+}
diff --git a/test/version_7_strict.c b/test/version_7_strict.c
new file mode 100644
index 0000000..e7c12d6
--- /dev/null
+++ b/test/version_7_strict.c
@@ -0,0 +1,77 @@
+/* Check Standards Version 6 strictness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/ar";
+ const char* format_data =
+ "/VERSION 7\n"
+ "X<r RAW UINT8 8\n"
+ "X.r RAW UINT8 8\n"
+ "X\\#r RAW COMPLEX128 8\n"
+ "Xr POLYNOM INDEX 8 3 1 2\n"
+ "ar RAW UINT8 8\n"
+ "ar/c CONST COMPLEX128 3;3\n";
+ uint16_t c[8];
+ int ll[7] = {0, 0, 0, 0, 0, 0, 0};
+ unsigned char data_data[256];
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+ n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+
+ for (i = 0; i < 7; ++i) {
+ if (i == 1 || i == 2) {
+ CHECKIi(i,!ll[i], 0);
+ } else if (i < 1 || i > 2) {
+ CHECKIi(i,ll[i],0);
+ }
+ }
+
+ CHECKI(n,8);
+
+ for (i = 0; i < 8; ++i)
+ CHECKUi(i,c[i],40 +i);
+
+ return r;
+}
diff --git a/test/version_7_write.c b/test/version_7_write.c
new file mode 100644
index 0000000..e39e833
--- /dev/null
+++ b/test/version_7_write.c
@@ -0,0 +1,42 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* format_data = "/VERSION 7\nar RAW UINT8 8\nar/q SBIT ar 0 10\n";
+ int fd, e, q, c, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ q = gd_rewrite_fragment(D, 0);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(e,7);
+ CHECKI(q,0);
+ CHECKI(c,7);
+
+ return r;
+}
diff --git a/test/version_8.c b/test/version_8.c
new file mode 100644
index 0000000..2528391
--- /dev/null
+++ b/test/version_8.c
@@ -0,0 +1,66 @@
+/* Open a Standards Version 8 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "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);
+ 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_close(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,8);
+ CHECKI(e,8);
+
+ return r;
+}
diff --git a/test/version_8_strict.c b/test/version_8_strict.c
new file mode 100644
index 0000000..be549a3
--- /dev/null
+++ b/test/version_8_strict.c
@@ -0,0 +1,85 @@
+/* Check Standards Version 6 strictness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.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 = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/ar";
+ const char* format_data =
+ "/VERSION 8\n"
+ "X<r RAW UINT8 8\n"
+ "X.r RAW UINT8 8\n"
+ "X\\#r RAW COMPLEX128 8\n"
+ "Xr POLYNOM INDEX 8 3 1 2\n"
+ "ar RAW UINT8 8\n"
+ "e RECIP 3. Xr\n"
+ "FRAMEOFFSET 3\n"
+ "FRAMEOFFSET RAW UINT8 3\n"
+ "/FRAMEOFFSET 3\n"
+ "e RECIP ar/c Xr\n"
+ "e DIVIDE ar Xr\n"
+ "ar/c CONST COMPLEX128 3;3\n";
+ uint16_t c[8];
+ int ll[NLINES];
+ unsigned char data_data[256];
+ int fd, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ memset(ll, 0, NLINES * sizeof(int));
+ 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_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+ n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+ error = gd_error(D);
+
+ gd_close(D);
+
+ unlink(data);
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(error,0);
+
+ for (i = 0; i < NLINES; ++i) {
+ if (i == 1 || i == 2 || i == 7 || i == 10 || i == 11) {
+ CHECKIi(i,ll[i], 1);
+ } else {
+ CHECKIi(i,ll[i],0);
+ }
+ }
+
+ CHECKI(n,8);
+
+ for (i = 0; i < n; ++i)
+ CHECKUi(i,c[i],16 +i);
+
+ return r;
+}
diff --git a/test/version_8_write.c b/test/version_8_write.c
new file mode 100644
index 0000000..e8b008a
--- /dev/null
+++ b/test/version_8_write.c
@@ -0,0 +1,46 @@
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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, q, c, r = 0;
+ DIRFILE *D;
+
+ mkdir(filedir, 0777);
+
+ 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);
+ gd_close(D);
+
+ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+ c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+ gd_close(D);
+
+ unlink(format);
+ rmdir(filedir);
+
+ CHECKI(e,8);
+ CHECKI(q,0);
+ CHECKI(c,8);
+
+ return r;
+}
diff --git a/test/vlist.c b/test/vlist.c
new file mode 100644
index 0000000..ceed10d
--- /dev/null
+++ b/test/vlist.c
@@ -0,0 +1,58 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/vlist_invalid.c b/test/vlist_invalid.c
new file mode 100644
index 0000000..34f96d8
--- /dev/null
+++ b/test/vlist_invalid.c
@@ -0,0 +1,23 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_vector_list(D);
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+ CHECKI(error,GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/vlist_meta.c b/test/vlist_meta.c
new file mode 100644
index 0000000..38974f8
--- /dev/null
+++ b/test/vlist_meta.c
@@ -0,0 +1,61 @@
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "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;
+
+ mkdir(filedir, 0777);
+
+ fd = 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_close(D);
+ unlink(format);
+ rmdir(filedir);
+
+ return r;
+}
diff --git a/test/vlist_meta_invalid.c b/test/vlist_meta_invalid.c
new file mode 100644
index 0000000..c6d9d94
--- /dev/null
+++ b/test/vlist_meta_invalid.c
@@ -0,0 +1,24 @@
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+ const char* filedir = __TEST__ "dirfile";
+ int r = 0;
+
+ DIRFILE* D = gd_open(filedir, GD_RDONLY);
+ const char** fl = gd_mvector_list(D, "parent");
+ int error = gd_error(D);
+ gd_close(D);
+
+ CHECKP(fl);
+
+ CHECKI(error,GD_E_BAD_DIRFILE);
+ return r;
+}
diff --git a/test/xz_get.c b/test/xz_get.c
new file mode 100644
index 0000000..220ab0b
--- /dev/null
+++ b/test/xz_get.c
@@ -0,0 +1,75 @@
+/* Attempt to read UINT8 */
+#include "../src/config.h"
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_LZMA
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* xzdata = __TEST__ "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, i, n, error, r = 0;
+ DIRFILE *D;
+
+ memset(c, 0, 8);
+ 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_close(D);
+
+ unlink(xzdata);
+ 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
+}
diff --git a/test/xz_nframes.c b/test/xz_nframes.c
new file mode 100644
index 0000000..f7f117c
--- /dev/null
+++ b/test/xz_nframes.c
@@ -0,0 +1,70 @@
+/* Retrieving the number of frames should succeed cleanly */
+#include "../src/config.h"
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_LZMA
+ return 77;
+#else
+ const char* filedir = __TEST__ "dirfile";
+ const char* format = __TEST__ "dirfile/format";
+ const char* data = __TEST__ "dirfile/data";
+ const char* xzdata = __TEST__ "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;
+
+ 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_close(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
+}
diff --git a/util/Makefile.am b/util/Makefile.am
new file mode 100644
index 0000000..4db8985
--- /dev/null
+++ b/util/Makefile.am
@@ -0,0 +1,39 @@
+# Copyright (C) 2008, 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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CC_WALL
+WALL=-Wall
+endif
+
+if CC_WEXTRA
+WEXTRA=-Wextra
+endif
+
+LDADD=../src/libgetdata.la
+INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src
+
+bin_PROGRAMS=checkdirfile dirfile2ascii
+checkdirfile_SOURCES=checkdirfile.c
+dirfile2ascii_SOURCES=dirfile2ascii.c
+
+clean-local:
+ rm -rf *~
diff --git a/util/Makefile.in b/util/Makefile.in
new file mode 100644
index 0000000..bccf27f
--- /dev/null
+++ b/util/Makefile.in
@@ -0,0 +1,611 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = checkdirfile$(EXEEXT) dirfile2ascii$(EXEEXT)
+subdir = util
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.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/idl.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/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/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_dirfile2ascii_OBJECTS = dirfile2ascii.$(OBJEXT)
+dirfile2ascii_OBJECTS = $(am_dirfile2ascii_OBJECTS)
+dirfile2ascii_LDADD = $(LDADD)
+dirfile2ascii_DEPENDENCIES = ../src/libgetdata.la
+DEFAULT_INCLUDES = -I. at 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(checkdirfile_SOURCES) $(dirfile2ascii_SOURCES)
+DIST_SOURCES = $(checkdirfile_SOURCES) $(dirfile2ascii_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BUILD_DATE = @BUILD_DATE@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+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@
+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@
+FLIBS = @FLIBS@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+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@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+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@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_xz = @path_xz@
+pdfdir = @pdfdir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General 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
+ at CC_WALL_TRUE@WALL = -Wall
+ at CC_WEXTRA_TRUE@WEXTRA = -Wextra
+LDADD = ../src/libgetdata.la
+INCLUDES = ${WALL} $(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)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ 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)
+ @rm -f checkdirfile$(EXEEXT)
+ $(LINK) $(checkdirfile_OBJECTS) $(checkdirfile_LDADD) $(LIBS)
+dirfile2ascii$(EXEEXT): $(dirfile2ascii_OBJECTS) $(dirfile2ascii_DEPENDENCIES)
+ @rm -f dirfile2ascii$(EXEEXT)
+ $(LINK) $(dirfile2ascii_OBJECTS) $(dirfile2ascii_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/checkdirfile.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dirfile2ascii.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-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 all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool clean-local ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS
+
+
+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:
diff --git a/util/checkdirfile.c b/util/checkdirfile.c
new file mode 100644
index 0000000..10b449a
--- /dev/null
+++ b/util/checkdirfile.c
@@ -0,0 +1,199 @@
+/* Copyright (C) 2007-2010 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 "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "getdata.h"
+
+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;
+ 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. Copyright (C) 2008-2010 D. V. Wiebe\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);
+ return 1;
+ }
+
+ /* open the dirfile */
+ 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");
+
+ 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");
+
+ 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 field defined */
+ ne = 0;
+ puts("\nChecking fields...");
+ flist = gd_field_list(dirfile);
+ 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++;
+ }
+ mflist = gd_mfield_list(dirfile, flist[i]);
+ 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 = gd_nfields(dirfile);
+
+ if (ne > 0)
+ printf(" Found %i problems in %u %s.\n", ne, nfields,
+ nfields > 1 ? "fields" : "field");
+ else
+ printf(" No problems found in %u %s.\n", nfields,
+ nfields > 1 ? "fields" : "field");
+
+ /* 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 frames.\n", (unsigned long long)n);
+
+ gd_close(dirfile);
+ return 0;
+}
diff --git a/util/dirfile2ascii.c b/util/dirfile2ascii.c
new file mode 100644
index 0000000..9dc892e
--- /dev/null
+++ b/util/dirfile2ascii.c
@@ -0,0 +1,537 @@
+/* Copyright (C) 2010, 2011 Matthew Truch
+ * Copyright (C) 2010 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 "config.h"
+#endif
+
+#define _XOPEN_SOURCE 1000
+#define __STDC_FORMAT_MACROS
+#define __STDC_LIMIT_MACROS
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <getopt.h>
+#include <math.h>
+#include "nan.h"
+#include "getdata.h"
+
+#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;
+ gd_spf_t 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 Matthew Truch\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;
+ gd_spf_t j;
+ gd_spf_t max_spf = 0;
+ gd_spf_t min_spf = UINT16_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). */
+ gd_spf_t prev_samp, next_samp, offset;
+ double slope, diff, val;
+
+ prev_samp = (gd_spf_t)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;
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libgetdata.git
More information about the debian-science-commits
mailing list