[libgetdata] 01/05: Upstream 0.9.0

Alastair McKinstry mckinstry at moszumanska.debian.org
Wed May 3 10:35:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to tag debian/0.9.0-2.2
in repository libgetdata.

commit a96d84708d0a715071ae423198b41b2cdf15f165
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Thu Oct 29 04:56:45 2015 +0000

    Upstream 0.9.0
---
 ChangeLog                                       | 1365 +++-
 Makefile.am                                     |   50 +-
 Makefile.in                                     |   90 +-
 NEWS                                            | 1522 ++--
 TODO                                            |    1 +
 aclocal.m4                                      | 9035 ++++++++++++++++++++++-
 bindings/Makefile.am                            |   10 +-
 bindings/Makefile.in                            |   43 +-
 bindings/cxx/Makefile.am                        |   19 +-
 bindings/cxx/Makefile.in                        |   55 +-
 bindings/cxx/bitentry.cpp                       |   18 +-
 bindings/cxx/constentry.cpp                     |    2 +-
 bindings/cxx/dirfile.cpp                        |   28 +-
 bindings/cxx/entry.cpp                          |   28 +-
 bindings/cxx/fragment.cpp                       |    2 +-
 bindings/cxx/getdata/bitentry.h                 |   14 +-
 bindings/cxx/getdata/carrayentry.h              |    2 +-
 bindings/cxx/getdata/constentry.h               |    2 +-
 bindings/cxx/getdata/dirfile.h                  |   14 +-
 bindings/cxx/getdata/divideentry.h              |    6 +-
 bindings/cxx/getdata/entry.h                    |   34 +-
 bindings/cxx/getdata/fragment.h                 |   18 +-
 bindings/cxx/getdata/indexentry.h               |    2 +-
 bindings/cxx/getdata/lincomentry.h              |   34 +-
 bindings/cxx/getdata/linterpentry.h             |    6 +-
 bindings/cxx/getdata/mplexentry.h               |   14 +-
 bindings/cxx/getdata/multiplyentry.h            |    6 +-
 bindings/cxx/getdata/phaseentry.h               |   14 +-
 bindings/cxx/getdata/polynomentry.h             |   31 +-
 bindings/cxx/getdata/rawentry.h                 |   10 +-
 bindings/cxx/getdata/recipentry.h               |   18 +-
 bindings/cxx/getdata/sbitentry.h                |   14 +-
 bindings/cxx/getdata/stringentry.h              |    2 +-
 bindings/cxx/getdata/windowentry.h              |   14 +-
 bindings/cxx/indexentry.cpp                     |   21 -
 bindings/cxx/internal.h                         |   10 +-
 bindings/cxx/lincomentry.cpp                    |   10 +-
 bindings/cxx/linterpentry.cpp                   |    2 +-
 bindings/cxx/mplexentry.cpp                     |    2 +-
 bindings/cxx/multiplyentry.cpp                  |    2 +-
 bindings/cxx/polynomentry.cpp                   |    8 +-
 bindings/cxx/rawentry.cpp                       |    2 +-
 bindings/cxx/recipentry.cpp                     |    8 +-
 bindings/cxx/sbitentry.cpp                      |   18 +-
 bindings/cxx/stringentry.cpp                    |    2 +-
 bindings/cxx/test/Makefile.am                   |   12 +-
 bindings/cxx/test/Makefile.in                   |   40 +-
 bindings/cxx/test/big_test.cpp                  | 1072 ++-
 bindings/cxx/windowentry.cpp                    |    2 +-
 bindings/f77/Makefile.am                        |   22 +-
 bindings/f77/Makefile.in                        |   44 +-
 bindings/f77/fgetdata.c                         | 1449 +++-
 bindings/f77/fgetdata.h                         |  230 +-
 bindings/f77/getdata.f.in                       |   72 +-
 bindings/f77/getdata.f90.in                     |  393 +-
 bindings/f77/test/Makefile.am                   |   26 +-
 bindings/f77/test/Makefile.in                   |   46 +-
 bindings/f77/test/big_test.f                    | 2446 ++++--
 bindings/f77/test/big_test95.f90                | 2208 +++---
 bindings/f77/test/gdcopn.f                      |   53 +-
 bindings/idl/Makefile.am                        |    8 +-
 bindings/idl/Makefile.in                        |   39 +-
 bindings/idl/getdata.c                          | 1216 +--
 bindings/idl/makedlm.sh.in                      |    2 +-
 bindings/idl/test/Makefile.am                   |    2 +-
 bindings/idl/test/Makefile.in                   |   36 +-
 bindings/idl/test/big_test.pro                  | 1440 ++--
 bindings/idl/test/getdata_idl_test_routines.pro |   22 +
 bindings/make_parameters.c                      |  510 +-
 bindings/matlab/Contents.m.head                 |    3 +-
 bindings/matlab/Makefile.am                     |   44 +-
 bindings/matlab/Makefile.in                     |   76 +-
 bindings/matlab/gd_add_carray.c                 |    4 +-
 bindings/matlab/gd_add_const.c                  |    4 +-
 bindings/matlab/gd_array_len.c                  |   56 +
 bindings/matlab/gd_carray_len.c                 |   56 -
 bindings/matlab/gd_delete_alias.c               |   57 -
 bindings/matlab/gd_encoding_support.c           |   53 +
 bindings/matlab/gd_get_carray.c                 |    4 +-
 bindings/matlab/gd_getdata.c                    |    6 +-
 bindings/matlab/gd_madd_carray.c                |    4 +-
 bindings/matlab/gd_madd_const.c                 |    4 +-
 bindings/matlab/gd_matlab.h                     |   18 +-
 bindings/matlab/gd_move.c                       |    7 +-
 bindings/matlab/gd_move_alias.c                 |   55 -
 bindings/matlab/gd_put_carray.m                 |    4 +-
 bindings/matlab/gd_put_carray_slice.c           |    4 +-
 bindings/matlab/gd_putdata.c                    |    4 +-
 bindings/matlab/getdata_constants.m             |   26 +-
 bindings/matlab/matlab.c                        |   90 +-
 bindings/matlab/test/Makefile.am                |    2 +-
 bindings/matlab/test/Makefile.in                |   36 +-
 bindings/matlab/test/big_test.m                 | 1080 ++-
 bindings/perl/GetData.pm.in                     |   41 +-
 bindings/perl/GetData.xs                        |  699 +-
 bindings/perl/Makefile.am                       |    2 +-
 bindings/perl/Makefile.in                       |   36 +-
 bindings/perl/funclist.pl                       |   21 +
 bindings/perl/simple_funcs.pl                   |   24 +-
 bindings/perl/simple_funcs.xsin                 |   64 +-
 bindings/perl/t/big_test.t                      | 1821 +++--
 bindings/perl/t/callback.t                      |   20 +
 bindings/perl/typemap                           |   50 +-
 bindings/php/Makefile.am                        |   40 +
 bindings/php/Makefile.in                        |  903 +++
 bindings/php/getdata.c                          | 4895 ++++++++++++
 bindings/php/php_getdata.h                      |   64 +
 bindings/php/test/Makefile.am                   |   50 +
 bindings/php/test/Makefile.in                   |  700 ++
 bindings/php/test/big_test.php                  | 1694 +++++
 bindings/python/Makefile.am                     |   35 +-
 bindings/python/Makefile.in                     |  261 +-
 bindings/python/pydirfile.c                     |  272 +-
 bindings/python/pyentry.c                       |   85 +-
 bindings/python/pyfragment.c                    |   11 +-
 bindings/python/pygetdata.c                     |  128 +-
 bindings/python/pygetdata.h                     |    7 +-
 bindings/python/setup.py.in                     |  101 +
 bindings/python/test/Makefile.am                |    4 +-
 bindings/python/test/Makefile.in                |   38 +-
 bindings/python/test/big_test.py                | 1042 ++-
 bindings/python/test/callback.py                |   20 +
 configure                                       | 2674 ++++---
 configure.ac                                    |  328 +-
 doc/Makefile.am                                 |    2 +-
 doc/Makefile.in                                 |   36 +-
 doc/README.cxx                                  |  149 +-
 doc/README.f77                                  |  623 +-
 doc/README.f95                                  |   27 +-
 doc/README.idl                                  |   45 +-
 doc/README.python                               |    8 +-
 m4/compiler.m4                                  |  102 +-
 m4/encoding.m4                                  |    2 +-
 m4/idl.m4                                       |    4 +-
 m4/libtool.m4                                   | 8369 ---------------------
 m4/ltoptions.m4                                 |  437 --
 m4/ltsugar.m4                                   |  124 -
 m4/ltversion.m4                                 |   23 -
 m4/lt~obsolete.m4                               |   99 -
 m4/matlab.m4                                    |   41 +-
 m4/perl.m4                                      |    6 +-
 m4/php.m4                                       |  112 +
 m4/python.m4                                    |   60 +-
 m4/version.m4                                   |   22 +-
 m4/win32.m4                                     |    2 +-
 man/Makefile.am                                 |   34 +-
 man/Makefile.in                                 |   68 +-
 man/dirfile-encoding.5                          |   86 +-
 man/dirfile-format.5                            |    2 +-
 man/gd_add.3                                    |   45 +-
 man/gd_add_bit.3                                |   50 +-
 man/gd_add_spec.3                               |   16 +-
 man/gd_alter_bit.3                              |   31 +-
 man/gd_alter_encoding.3.in                      |    8 +-
 man/gd_alter_endianness.3.in                    |   16 +-
 man/gd_alter_entry.3                            |   37 +-
 man/gd_alter_frameoffset.3.in                   |   17 +-
 man/gd_alter_spec.3                             |   29 +-
 man/gd_array_len.3                              |   86 +
 man/gd_bof.3                                    |    5 -
 man/gd_bof64.3                                  |    2 +-
 man/gd_carray_len.3                             |   88 -
 man/gd_cbopen.3                                 |   42 +-
 man/gd_close.3                                  |   18 +-
 man/gd_delete.3                                 |   41 +-
 man/gd_desync.3                                 |    6 +-
 man/gd_dirfile_standards.3                      |    2 +-
 man/gd_encoding_support.3                       |   81 +
 man/gd_entry.3                                  |   94 +-
 man/gd_entry_type.3                             |    5 -
 man/gd_eof.3                                    |   11 +-
 man/gd_eof64.3                                  |    2 +-
 man/gd_error_count.3                            |   15 +-
 man/gd_error_string.3                           |   12 +-
 man/gd_flush.3                                  |   30 +-
 man/gd_framenum_subset.3                        |   21 +-
 man/gd_framenum_subset64.3                      |    2 +-
 man/gd_frameoffset64.3                          |    2 +-
 man/gd_free_entry_strings.3                     |   10 +-
 man/gd_get_carray_slice.3                       |   16 +-
 man/gd_getdata.3                                |  163 +-
 man/gd_getdata64.3                              |    2 +-
 man/gd_hidden.3                                 |    8 +-
 man/gd_hide.3                                   |   10 +-
 man/gd_include_affix.3                          |    8 +-
 man/gd_linterp_tablename.3                      |    7 +-
 man/gd_madd_bit.3                               |    3 +-
 man/gd_metaflush.3                              |   15 +-
 man/gd_move.3                                   |   81 +-
 man/gd_naliases.3                               |    2 +-
 man/gd_native_type.3                            |   28 +-
 man/gd_nframes.3                                |    6 +-
 man/gd_nframes64.3                              |    2 +-
 man/gd_put_carray_slice.3                       |    9 +-
 man/gd_put_string.3                             |    5 -
 man/gd_putdata.3                                |   32 +-
 man/gd_putdata64.3                              |    2 +-
 man/gd_raw_filename.3                           |    9 +-
 man/gd_rename.3                                 |   55 +-
 man/gd_rewrite_fragment.3                       |   15 +-
 man/gd_seek.3                                   |   40 +-
 man/gd_seek64.3                                 |    2 +-
 man/gd_spf.3                                    |    5 -
 man/gd_tell.3                                   |   18 +-
 man/gd_tell64.3                                 |    2 +-
 man/gd_uninclude.3                              |   15 +-
 man/gd_validate.3                               |    5 -
 src/Makefile.am                                 |   56 +-
 src/Makefile.in                                 |  155 +-
 src/add.c                                       |  650 +-
 src/ascii.c                                     |   30 +-
 src/bzip.c                                      |  309 +-
 src/close.c                                     |    9 +-
 src/common.c                                    |  168 +-
 src/compat.c                                    |   38 +-
 src/constant.c                                  |  166 +-
 src/debug.c                                     |    4 +-
 src/del.c                                       |  144 +-
 src/encoding.c                                  |  420 +-
 src/endian.c                                    |  172 +-
 src/entry.c                                     |  233 +-
 src/errors.c                                    |  132 +-
 src/field_list.c                                |   25 +-
 src/flac.c                                      |  574 ++
 src/flimits.c                                   |   74 +-
 src/flush.c                                     |  856 ++-
 src/fpos.c                                      |  176 +-
 src/fragment.c                                  |   43 +-
 src/gd_config.h.in                              |   71 +-
 src/getdata.c                                   |  284 +-
 src/getdata.h.in                                |  130 +-
 src/globals.c                                   |    4 +-
 src/gzip.c                                      |   72 +-
 src/include.c                                   |  201 +-
 src/index.c                                     |   50 +-
 src/internal.h                                  |  559 +-
 src/legacy.c                                    |   47 +-
 src/lzma.c                                      |  571 +-
 src/mod.c                                       |  370 +-
 src/move.c                                      |  247 +-
 src/name.c                                      | 1041 ++-
 src/nan.h                                       |   34 -
 src/native.c                                    |   30 +-
 src/nfields.c                                   |    2 +-
 src/nframes.c                                   |   26 +-
 src/open.c                                      |  152 +-
 src/parse.c                                     | 1470 ++--
 src/protect.c                                   |    2 +-
 src/putdata.c                                   |  193 +-
 src/raw.c                                       |   33 +-
 src/sie.c                                       |   22 +-
 src/slim.c                                      |  181 +-
 src/spf.c                                       |   18 +-
 src/string.c                                    |  174 +-
 src/types.c                                     |    2 +-
 src/zzip.c                                      |  248 +-
 src/zzslim.c                                    |  127 +-
 test/Makefile.am                                |  362 +-
 test/Makefile.in                                | 3966 +++++++---
 test/add.c                                      |   75 -
 test/add_add.c                                  |   75 +
 test/add_alias.c                                |    7 +-
 test/add_alias_affix.c                          |    7 +-
 test/add_alias_meta.c                           |    7 +-
 test/add_amb_code7.c                            |   54 +
 test/add_bit.c                                  |    4 +-
 test/add_bit_bitnum.c                           |    4 +-
 test/add_bit_bitsize.c                          |    4 +-
 test/add_bit_invalid.c                          |    4 +-
 test/add_bit_numbits.c                          |    4 +-
 test/add_carray.c                               |    6 +-
 test/add_clincom.c                              |    6 +-
 test/add_code.c                                 |    4 +-
 test/add_const.c                                |    4 +-
 test/add_cpolynom.c                             |    6 +-
 test/add_crecip.c                               |    6 +-
 test/add_crecip89.c                             |    6 +-
 test/add_divide.c                               |    4 +-
 test/add_divide_invalid.c                       |    4 +-
 test/add_dot5.c                                 |   76 +
 test/add_dot6.c                                 |   60 +
 test/add_duplicate.c                            |    4 +-
 test/add_format.c                               |    4 +-
 test/add_invalid.c                              |    4 +-
 test/add_lincom.c                               |    6 +-
 test/add_lincom_affix.c                         |    6 +-
 test/add_lincom_invalid.c                       |    4 +-
 test/add_lincom_nfields.c                       |    4 +-
 test/add_linterp.c                              |    4 +-
 test/add_linterp_invalid.c                      |    4 +-
 test/add_meta.c                                 |    4 +-
 test/add_meta_alias.c                           |    4 +-
 test/add_mplex.c                                |    6 +-
 test/add_multiply.c                             |    4 +-
 test/add_multiply_invalid.c                     |    4 +-
 test/add_phase.c                                |    4 +-
 test/add_phase_invalid.c                        |    4 +-
 test/add_polynom.c                              |    6 +-
 test/add_polynom_scalar.c                       |    3 +-
 test/add_protect.c                              |    4 +-
 test/add_raw.c                                  |    4 +-
 test/add_raw_include.c                          |    4 +-
 test/add_raw_invalid.c                          |    4 +-
 test/add_raw_spf.c                              |    4 +-
 test/add_raw_spf_scalar.c                       |    2 +-
 test/add_raw_sub.c                              |   85 +
 test/add_raw_type.c                             |    4 +-
 test/add_rdonly.c                               |    4 +-
 test/add_recip.c                                |    6 +-
 test/add_resolv.c                               |    7 +-
 test/add_sbit.c                                 |    4 +-
 test/add_scalar.c                               |    5 +-
 test/add_scalar_carray.c                        |    5 +-
 test/add_scalar_carray_bad.c                    |    3 +-
 test/add_sort.c                                 |    4 +-
 test/add_spec.c                                 |    4 +-
 test/add_spec_directive.c                       |    4 +-
 test/add_spec_invalid.c                         |    4 +-
 test/add_spec_meta.c                            |    4 +-
 test/add_spec_resolv.c                          |    7 +-
 test/add_string.c                               |    4 +-
 test/add_string_affix.c                         |    4 +-
 test/add_type.c                                 |    4 +-
 test/add_window.c                               |    4 +-
 test/add_window_op.c                            |    4 +-
 test/alias_list.c                               |    4 +-
 test/alias_list_alias.c                         |    4 +-
 test/alias_list_missing.c                       |    4 +-
 test/alias_num.c                                |    9 +-
 test/alias_num_alias.c                          |    9 +-
 test/alias_num_missing.c                        |    9 +-
 test/alias_target.c                             |    4 +-
 test/alias_target_alias.c                       |    4 +-
 test/alias_target_missing.c                     |    4 +-
 test/alter_bit_bitnum.c                         |    4 +-
 test/alter_bit_numbits.c                        |    4 +-
 test/alter_carray_len.c                         |    6 +-
 test/alter_carray_type.c                        |    6 +-
 test/alter_clincom.c                            |   95 +
 test/alter_const.c                              |    4 +-
 test/alter_const_c2r.c                          |    4 +-
 test/alter_const_r2c.c                          |   64 +
 test/alter_const_r2r.c                          |   64 +
 test/alter_cpolynom.c                           |    4 +-
 test/alter_cpolynom_null.c                      |   87 +
 test/alter_crecip.c                             |    4 +-
 test/alter_crecip89.c                           |    4 +-
 test/alter_crecip89_null.c                      |   79 +
 test/alter_crecip_zero.c                        |    4 +-
 test/alter_divide.c                             |    4 +-
 test/alter_entry.c                              |    4 +-
 test/alter_entry_affix.c                        |    4 +-
 test/alter_entry_hidden.c                       |    9 +-
 test/alter_entry_lincom.c                       |   82 +
 test/alter_entry_recode.c                       |    4 +-
 test/alter_entry_recode_recalc.c                |   98 +
 test/alter_entry_scalar1.c                      |   74 +
 test/alter_entry_scalar2a.c                     |    4 +-
 test/alter_entry_scalar2n.c                     |    4 +-
 test/alter_entry_scalar3.c                      |    4 +-
 test/alter_entry_scalar3c.c                     |   73 +
 test/alter_entry_scalar4.c                      |    4 +-
 test/alter_entry_scalar_amb.c                   |   65 +
 test/alter_index.c                              |   59 +
 test/alter_lincom_23.c                          |    4 +-
 test/alter_lincom_32.c                          |    4 +-
 test/alter_lincom_input.c                       |    4 +-
 test/alter_lincom_offset.c                      |    4 +-
 test/alter_lincom_slope.c                       |    4 +-
 test/alter_linterp.c                            |   34 +-
 test/alter_linterp_move.c                       |   17 +-
 test/alter_mplex.c                              |    4 +-
 test/alter_mspec.c                              |    4 +-
 test/alter_mspec_affix.c                        |    4 +-
 test/alter_multiply.c                           |    4 +-
 test/alter_phase.c                              |    4 +-
 test/alter_polynom_coeff.c                      |    6 +-
 test/alter_polynom_input.c                      |    4 +-
 test/alter_polynom_ord.c                        |    4 +-
 test/alter_raw_spf.c                            |    4 +-
 test/alter_raw_type.c                           |    4 +-
 test/alter_recip.c                              |    4 +-
 test/alter_recip_zero.c                         |    4 +-
 test/alter_spec.c                               |    4 +-
 test/alter_spec_affix.c                         |    4 +-
 test/alter_spec_meta.c                          |    4 +-
 test/alter_spec_polynom.c                       |   70 +
 test/alter_window.c                             |    4 +-
 test/ascii_add.c                                |    4 +-
 test/ascii_get.c                                |    4 +-
 test/ascii_get_complex.c                        |   71 +
 test/ascii_get_get.c                            |    4 +-
 test/ascii_get_here.c                           |   70 +
 test/ascii_get_sub.c                            |   82 +
 test/ascii_nframes.c                            |    4 +-
 test/ascii_put.c                                |   15 +-
 test/ascii_put_here.c                           |   92 +
 test/ascii_seek.c                               |   59 +
 test/ascii_seek_far.c                           |   59 +
 test/ascii_sync.c                               |   88 +
 test/bof.c                                      |    4 +-
 test/bof_bit.c                                  |   67 +
 test/bof_index.c                                |   64 +
 test/bof_lincom.c                               |    4 +-
 test/bof_phase.c                                |    4 +-
 test/bof_phase_neg.c                            |   85 +
 test/bzip_add.c                                 |   77 +
 test/bzip_get.c                                 |    9 +-
 test/bzip_get_far.c                             |   82 +
 test/bzip_get_get.c                             |   30 +-
 test/bzip_get_get2.c                            |   82 +
 test/bzip_get_put.c                             |  173 +
 test/bzip_move_from.c                           |   21 +-
 test/bzip_move_to.c                             |  111 +
 test/bzip_nframes.c                             |    4 +-
 test/bzip_put.c                                 |  115 +
 test/bzip_put_back.c                            |  101 +
 test/bzip_put_endian.c                          |  117 +
 test/bzip_put_get.c                             |   83 +
 test/bzip_put_pad.c                             |  103 +
 test/bzip_put_sub.c                             |  111 +
 test/bzip_seek.c                                |   72 +
 test/bzip_seek_far.c                            |   72 +
 test/bzip_sync.c                                |   93 +
 test/{close.c => close_close.c}                 |    0
 test/close_discard.c                            |    4 +-
 test/convert_complex128_complex64.c             |    4 +-
 test/convert_complex128_float64.c               |    4 +-
 test/convert_complex128_int64.c                 |    4 +-
 test/convert_complex128_uint64.c                |    4 +-
 test/convert_complex64_complex128.c             |    4 +-
 test/convert_complex64_float64.c                |    4 +-
 test/convert_complex64_int64.c                  |    4 +-
 test/convert_complex64_uint64.c                 |    4 +-
 test/convert_float32_complex128.c               |    7 +-
 test/convert_float32_complex64.c                |    7 +-
 test/convert_float32_float64.c                  |    4 +-
 test/convert_float32_int16.c                    |    4 +-
 test/convert_float32_int32.c                    |    4 +-
 test/convert_float32_int64.c                    |    4 +-
 test/convert_float32_int8.c                     |    4 +-
 test/convert_float32_uint16.c                   |    4 +-
 test/convert_float32_uint32.c                   |    4 +-
 test/convert_float32_uint64.c                   |    4 +-
 test/convert_float32_uint8.c                    |    4 +-
 test/convert_float64_complex128.c               |    7 +-
 test/convert_float64_complex64.c                |    7 +-
 test/convert_float64_float32.c                  |    4 +-
 test/convert_float64_int16.c                    |    4 +-
 test/convert_float64_int32.c                    |    4 +-
 test/convert_float64_int64.c                    |    4 +-
 test/convert_float64_int8.c                     |    4 +-
 test/convert_float64_uint16.c                   |    4 +-
 test/convert_float64_uint32.c                   |    4 +-
 test/convert_float64_uint64.c                   |    4 +-
 test/convert_float64_uint8.c                    |    4 +-
 test/convert_int16_complex128.c                 |    7 +-
 test/convert_int16_complex64.c                  |    7 +-
 test/convert_int16_float32.c                    |    4 +-
 test/convert_int16_float64.c                    |    4 +-
 test/convert_int16_int32.c                      |    4 +-
 test/convert_int16_int64.c                      |    4 +-
 test/convert_int16_int8.c                       |    4 +-
 test/convert_int16_uint16.c                     |    4 +-
 test/convert_int16_uint32.c                     |    4 +-
 test/convert_int16_uint64.c                     |    4 +-
 test/convert_int16_uint8.c                      |    4 +-
 test/convert_int32_complex128.c                 |    7 +-
 test/convert_int32_complex64.c                  |    7 +-
 test/convert_int32_float32.c                    |    4 +-
 test/convert_int32_float64.c                    |    4 +-
 test/convert_int32_int16.c                      |    4 +-
 test/convert_int32_int64.c                      |    4 +-
 test/convert_int32_int8.c                       |    4 +-
 test/convert_int32_uint16.c                     |    4 +-
 test/convert_int32_uint32.c                     |    4 +-
 test/convert_int32_uint64.c                     |    4 +-
 test/convert_int32_uint8.c                      |    4 +-
 test/convert_int64_complex128.c                 |    7 +-
 test/convert_int64_complex64.c                  |    7 +-
 test/convert_int64_float32.c                    |    4 +-
 test/convert_int64_float64.c                    |    4 +-
 test/convert_int64_int16.c                      |    4 +-
 test/convert_int64_int32.c                      |    4 +-
 test/convert_int64_int8.c                       |    4 +-
 test/convert_int64_uint16.c                     |    4 +-
 test/convert_int64_uint32.c                     |    4 +-
 test/convert_int64_uint64.c                     |    4 +-
 test/convert_int64_uint8.c                      |    4 +-
 test/convert_int8_complex128.c                  |    7 +-
 test/convert_int8_complex64.c                   |    7 +-
 test/convert_int8_float32.c                     |    4 +-
 test/convert_int8_float64.c                     |    4 +-
 test/convert_int8_int16.c                       |    4 +-
 test/convert_int8_int32.c                       |    4 +-
 test/convert_int8_int64.c                       |    4 +-
 test/convert_int8_uint16.c                      |    4 +-
 test/convert_int8_uint32.c                      |    4 +-
 test/convert_int8_uint64.c                      |    4 +-
 test/convert_int8_uint8.c                       |    4 +-
 test/convert_uint16_complex128.c                |    7 +-
 test/convert_uint16_complex64.c                 |    7 +-
 test/convert_uint16_float32.c                   |    4 +-
 test/convert_uint16_float64.c                   |    4 +-
 test/convert_uint16_int16.c                     |    4 +-
 test/convert_uint16_int32.c                     |    4 +-
 test/convert_uint16_int64.c                     |    4 +-
 test/convert_uint16_int8.c                      |    4 +-
 test/convert_uint16_uint32.c                    |    4 +-
 test/convert_uint16_uint64.c                    |    4 +-
 test/convert_uint16_uint8.c                     |    4 +-
 test/convert_uint32_complex128.c                |    7 +-
 test/convert_uint32_complex64.c                 |    7 +-
 test/convert_uint32_float32.c                   |    4 +-
 test/convert_uint32_float64.c                   |    4 +-
 test/convert_uint32_int16.c                     |    4 +-
 test/convert_uint32_int32.c                     |    4 +-
 test/convert_uint32_int64.c                     |    4 +-
 test/convert_uint32_int8.c                      |    4 +-
 test/convert_uint32_uint16.c                    |    4 +-
 test/convert_uint32_uint64.c                    |    4 +-
 test/convert_uint32_uint8.c                     |    4 +-
 test/convert_uint64_complex128.c                |    7 +-
 test/convert_uint64_complex64.c                 |    7 +-
 test/convert_uint64_float32.c                   |    4 +-
 test/convert_uint64_float64.c                   |    4 +-
 test/convert_uint64_int16.c                     |    4 +-
 test/convert_uint64_int32.c                     |    4 +-
 test/convert_uint64_int64.c                     |    4 +-
 test/convert_uint64_int8.c                      |    4 +-
 test/convert_uint64_uint16.c                    |    4 +-
 test/convert_uint64_uint32.c                    |    4 +-
 test/convert_uint64_uint8.c                     |    4 +-
 test/convert_uint8_complex128.c                 |    7 +-
 test/convert_uint8_complex64.c                  |    7 +-
 test/convert_uint8_float32.c                    |    4 +-
 test/convert_uint8_float64.c                    |    4 +-
 test/convert_uint8_int16.c                      |    4 +-
 test/convert_uint8_int32.c                      |    4 +-
 test/convert_uint8_int64.c                      |    4 +-
 test/convert_uint8_int8.c                       |    4 +-
 test/convert_uint8_uint16.c                     |    4 +-
 test/convert_uint8_uint32.c                     |    4 +-
 test/convert_uint8_uint64.c                     |    4 +-
 test/creat.c                                    |   13 +-
 test/creat_excl.c                               |    4 +-
 test/creat_rdonly.c                             |   21 +-
 test/creat_rdonly_exists.c                      |   55 +
 test/cvlist.c                                   |    4 +-
 test/cvlist_array.c                             |    4 +-
 test/cvlist_array0.c                            |   61 +
 test/cvlist_array_free.c                        |   87 +
 test/cvlist_array_hidden.c                      |    4 +-
 test/cvlist_array_meta.c                        |    4 +-
 test/cvlist_array_meta0.c                       |   64 +
 test/cvlist_array_meta_free.c                   |   88 +
 test/cvlist_array_meta_hidden.c                 |    4 +-
 test/cvlist_hidden.c                            |    4 +-
 test/cvlist_invalid.c                           |    4 +-
 test/cvlist_meta.c                              |    4 +-
 test/cvlist_meta0.c                             |   62 +
 test/cvlist_meta_hidden.c                       |    4 +-
 test/cvlist_meta_invalid.c                      |    4 +-
 test/del.c                                      |   76 -
 test/del_alias.c                                |   71 +
 test/del_carray.c                               |    4 +-
 test/del_carray_deref.c                         |    4 +-
 test/del_const.c                                |    4 +-
 test/del_const_deref.c                          |   56 +-
 test/del_const_force.c                          |    4 +-
 test/del_data.c                                 |   22 +-
 test/del_data_enoent.c                          |   58 +
 test/del_data_open.c                            |   80 +
 test/del_del.c                                  |   77 +
 test/del_derived.c                              |    4 +-
 test/del_derived_after.c                        |    4 +-
 test/del_derived_force.c                        |    4 +-
 test/del_meta.c                                 |    4 +-
 test/del_meta_force.c                           |    4 +-
 test/del_ref.c                                  |   82 +
 test/desync.c                                   |    4 +-
 test/desync_flush.c                             |    4 +-
 test/desync_path.c                              |   85 +
 test/desync_reopen.c                            |    4 +-
 test/desync_reopen_inv.c                        |    4 +-
 test/dfes_bit.c                                 |    4 +-
 test/dfes_divide.c                              |    4 +-
 test/dfes_lincom.c                              |    4 +-
 test/dfes_linterp.c                             |    4 +-
 test/dfes_multiply.c                            |    4 +-
 test/dfes_phase.c                               |    4 +-
 test/dfes_raw.c                                 |    4 +-
 test/dfes_recip.c                               |    4 +-
 test/elist_alias.c                              |    4 +-
 test/elist_hidden.c                             |    4 +-
 test/elist_noalias.c                            |    4 +-
 test/elist_scalar.c                             |    4 +-
 test/encode_alter.c                             |    4 +-
 test/encode_alter_all.c                         |   78 +
 test/encode_alter_open.c                        |   86 +
 test/encode_get.c                               |    4 +-
 test/encode_move.c                              |   82 -
 test/encode_recode.c                            |   84 +
 test/encode_recode_open.c                       |   85 +
 test/encode_support.c                           |   89 +
 test/endian_alter.c                             |    4 +-
 test/endian_alter_all.c                         |   79 +
 test/endian_alter_sie.c                         |    4 +-
 test/endian_get.c                               |    4 +-
 test/endian_move.c                              |    4 +-
 test/entry_bad_code.c                           |    4 +-
 test/entry_bit.c                                |    4 +-
 test/entry_bit_scalar.c                         |    4 +-
 test/entry_divide.c                             |    4 +-
 test/entry_invalid.c                            |    4 +-
 test/entry_lincom.c                             |    6 +-
 test/entry_lincom_scalar.c                      |    4 +-
 test/entry_linterp.c                            |    4 +-
 test/entry_mplex.c                              |    4 +-
 test/entry_mplex_scalar.c                       |    4 +-
 test/entry_multiply.c                           |    4 +-
 test/entry_phase.c                              |    4 +-
 test/entry_phase_scalar.c                       |    4 +-
 test/entry_polynom.c                            |    6 +-
 test/entry_polynom_scalar.c                     |    6 +-
 test/entry_raw.c                                |    4 +-
 test/entry_raw_scalar.c                         |    4 +-
 test/entry_raw_scalar_code.c                    |   12 +-
 test/entry_raw_scalar_type.c                    |   14 +-
 test/entry_recip.c                              |    6 +-
 test/entry_scalar_repr.c                        |    4 +-
 test/entry_type.c                               |    4 +-
 test/entry_type_alias.c                         |    4 +-
 test/entry_window.c                             |    4 +-
 test/entry_window_scalar.c                      |    4 +-
 test/eof.c                                      |    4 +-
 test/eof_bit.c                                  |   65 +
 test/eof_index.c                                |    4 +-
 test/eof_lincom.c                               |    4 +-
 test/eof_phase.c                                |    4 +-
 test/eof_phase_neg.c                            |   65 +
 test/error.c                                    |    4 +-
 test/error_error.c                              |   17 +-
 test/error_num.c                                |    4 +-
 test/error_short.c                              |    4 +-
 test/error_verbose.c                            |   16 +-
 test/error_verbose_prefix.c                     |    4 +-
 test/file.c                                     |    4 +-
 test/file_code.c                                |    4 +-
 test/file_type.c                                |    4 +-
 test/flac_add.c                                 |   77 +
 test/flac_get_big.c                             |   91 +
 test/flac_get_far.c                             |   79 +
 test/flac_get_get.c                             |   88 +
 test/flac_get_get2.c                            |   84 +
 test/flac_get_little.c                          |   91 +
 test/flac_nframes.c                             |   90 +
 test/flac_put_big.c                             |  117 +
 test/flac_put_complex128.c                      |   81 +
 test/flac_put_float64.c                         |   80 +
 test/flac_put_int32.c                           |   81 +
 test/flac_put_little.c                          |  118 +
 test/flac_seek.c                                |   84 +
 test/flac_seek_far.c                            |   80 +
 test/flac_sync.c                                |   95 +
 test/flist.c                                    |    4 +-
 test/flist0.c                                   |   58 +
 test/flist2.c                                   |   84 +
 test/flist_hidden.c                             |    4 +-
 test/flist_invalid.c                            |    4 +-
 test/flist_meta.c                               |    4 +-
 test/flist_meta2.c                              |   80 +
 test/flist_meta_hidden.c                        |    4 +-
 test/flist_meta_invalid.c                       |    4 +-
 test/flist_type.c                               |    4 +-
 test/flist_type_hidden.c                        |    4 +-
 test/flist_type_invalid.c                       |    4 +-
 test/flist_type_meta.c                          |    4 +-
 test/flist_type_meta_hidden.c                   |    4 +-
 test/flist_type_meta_invalid.c                  |    4 +-
 test/flush.c                                    |   88 -
 test/flush_all.c                                |   34 +-
 test/flush_amb_code.c                           |   78 +
 test/flush_bad_code.c                           |    4 +-
 test/flush_flush.c                              |   82 +
 test/flush_invalid.c                            |    4 +-
 test/flush_lincom.c                             |  109 +
 test/flush_lincom1.c                            |   83 +
 test/flush_meta.c                               |   15 +-
 test/flush_mult.c                               |   90 +
 test/flush_raw_close.c                          |   82 +
 test/flush_ref.c                                |    7 +-
 test/flush_spec.c                               |    4 +-
 test/flush_string.c                             |   61 +
 test/flush_sync.c                               |   82 +
 test/foffs_alter.c                              |    4 +-
 test/foffs_alter_all.c                          |   77 +
 test/foffs_get.c                                |    4 +-
 test/foffs_move.c                               |    4 +-
 test/fragment_affix.c                           |    4 +-
 test/fragment_affix_alter.c                     |    4 +-
 test/fragment_affix_alter2.c                    |    4 +-
 test/fragment_affix_alter_code.c                |   57 +
 test/fragment_affix_alter_nop.c                 |   69 +
 test/fragment_affix_dup.c                       |    4 +-
 test/fragment_index.c                           |    4 +-
 test/fragment_index_alias.c                     |    4 +-
 test/fragment_name.c                            |   24 +-
 test/fragment_name_oor.c                        |    4 +-
 test/fragment_num.c                             |    4 +-
 test/fragment_parent.c                          |    4 +-
 test/get64.c                                    |    4 +-
 test/get_affix.c                                |    4 +-
 test/get_bad_code.c                             |    4 +-
 test/get_bit.c                                  |    4 +-
 test/get_carray.c                               |    4 +-
 test/get_carray_c2r.c                           |    2 +-
 test/get_carray_len.c                           |    6 +-
 test/get_carray_slice.c                         |    4 +-
 test/get_char.c                                 |    4 +-
 test/get_clincom.c                              |    4 +-
 test/get_complex128.c                           |    4 +-
 test/get_complex64.c                            |    4 +-
 test/get_const.c                                |    4 +-
 test/get_const_carray.c                         |   58 +
 test/get_const_complex.c                        |    4 +-
 test/get_const_repr.c                           |    4 +-
 test/get_cpolynom.c                             |    4 +-
 test/get_dim.c                                  |   58 +
 test/get_divide.c                               |    4 +-
 test/get_endian16.c                             |    4 +-
 test/get_endian32.c                             |    4 +-
 test/get_endian64.c                             |    4 +-
 test/get_endian8.c                              |    4 +-
 test/get_endian_complex128_arm.c                |    4 +-
 test/get_endian_complex128_big.c                |    4 +-
 test/get_endian_complex128_little.c             |    4 +-
 test/get_endian_complex64_arm.c                 |    4 +-
 test/get_endian_complex64_big.c                 |    4 +-
 test/get_endian_complex64_little.c              |    4 +-
 test/get_endian_float32_arm.c                   |    4 +-
 test/get_endian_float32_big.c                   |    4 +-
 test/get_endian_float32_little.c                |    4 +-
 test/get_endian_float64_arm.c                   |    4 +-
 test/get_endian_float64_big.c                   |    4 +-
 test/get_endian_float64_little.c                |    4 +-
 test/get_ff.c                                   |    4 +-
 test/get_float32.c                              |    4 +-
 test/get_float64.c                              |    4 +-
 test/get_foffs.c                                |    4 +-
 test/get_fs.c                                   |    4 +-
 test/get_here.c                                 |    4 +-
 test/get_here_foffs.c                           |    4 +-
 test/get_heres.c                                |    4 +-
 test/get_index_complex.c                        |   61 +
 test/get_int16.c                                |    4 +-
 test/get_int32.c                                |    4 +-
 test/get_int64.c                                |    4 +-
 test/get_int8.c                                 |    4 +-
 test/get_invalid.c                              |    4 +-
 test/get_lincom1.c                              |    4 +-
 test/get_lincom2.c                              |    4 +-
 test/get_lincom2s.c                             |   71 +
 test/get_lincom3.c                              |    4 +-
 test/get_lincom3s.c                             |   71 +
 test/get_lincom_mdt.c                           |   70 +
 test/get_lincom_noin.c                          |    4 +-
 test/get_lincom_non.c                           |    4 +-
 test/get_lincom_null.c                          |    4 +-
 test/get_lincom_spf.c                           |    4 +-
 test/get_linterp.c                              |    6 +-
 test/get_linterp1.c                             |   77 +
 test/get_linterp_abs.c                          |   98 +
 test/get_linterp_complex.c                      |   80 +
 test/get_linterp_empty.c                        |   79 +
 test/get_linterp_noin.c                         |    4 +-
 test/get_linterp_notab.c                        |    8 +-
 test/get_linterp_sort.c                         |    4 +-
 test/get_mplex.c                                |    4 +-
 test/get_mplex_bof.c                            |    4 +-
 test/get_mplex_complex.c                        |   79 +
 test/get_mplex_lb.c                             |    4 +-
 test/get_mplex_lball.c                          |    4 +-
 test/get_mplex_nolb.c                           |    4 +-
 test/get_mplex_s.c                              |   69 +
 test/get_mplex_saved.c                          |   82 +
 test/get_multiply.c                             |    4 +-
 test/get_neg.c                                  |   59 +
 test/get_none.c                                 |   68 +
 test/get_nonexistent.c                          |    4 +-
 test/get_null.c                                 |    4 +-
 test/get_off64.c                                |    4 +-
 test/get_phase.c                                |    4 +-
 test/get_phase_affix.c                          |    4 +-
 test/get_polynom.c                              |    4 +-
 test/get_polynom_noin.c                         |    4 +-
 test/get_recip.c                                |    4 +-
 test/get_recip_const.c                          |    4 +-
 test/get_recurse.c                              |    4 +-
 test/get_rofs.c                                 |    4 +-
 test/get_sbit.c                                 |    4 +-
 test/get_sf.c                                   |    4 +-
 test/get_ss.c                                   |    4 +-
 test/get_string.c                               |   61 +
 test/get_type.c                                 |    4 +-
 test/get_uint16.c                               |    4 +-
 test/get_uint32.c                               |    6 +-
 test/get_uint64.c                               |    6 +-
 test/get_window.c                               |    4 +-
 test/get_window_clr.c                           |    4 +-
 test/get_window_complex.c                       |   78 +
 test/get_window_ge.c                            |    4 +-
 test/get_window_gt.c                            |    4 +-
 test/get_window_le.c                            |    4 +-
 test/get_window_lt.c                            |    4 +-
 test/get_window_ne.c                            |    4 +-
 test/get_window_s.c                             |   71 +
 test/get_window_set.c                           |    4 +-
 test/get_zero.c                                 |    4 +-
 test/get_zero_complex.c                         |   73 +
 test/get_zero_float.c                           |   73 +
 test/global_flags.c                             |    4 +-
 test/global_name.c                              |   16 +-
 test/global_ref.c                               |   16 +-
 test/global_ref_empty.c                         |    4 +-
 test/global_ref_set.c                           |   17 +-
 test/gzip_add.c                                 |    9 +-
 test/gzip_del.c                                 |   86 +
 test/gzip_get.c                                 |    9 +-
 test/gzip_get_far.c                             |   82 +
 test/gzip_get_get.c                             |   31 +-
 test/gzip_get_get2.c                            |    4 +-
 test/gzip_get_put.c                             |   12 +-
 test/gzip_move_from.c                           |   22 +-
 test/gzip_move_to.c                             |   14 +-
 test/gzip_nframes.c                             |    4 +-
 test/gzip_put.c                                 |   14 +-
 test/gzip_put_back.c                            |  110 +
 test/gzip_put_endian.c                          |  126 +
 test/gzip_put_get.c                             |   14 +-
 test/gzip_put_nframes.c                         |   78 +
 test/gzip_put_off.c                             |   79 +
 test/gzip_put_pad.c                             |  103 +
 test/gzip_put_sub.c                             |  120 +
 test/gzip_seek.c                                |   82 +
 test/gzip_seek_far.c                            |   85 +
 test/gzip_seek_put.c                            |   85 +
 test/gzip_sync.c                                |  102 +
 test/header_complex.c                           |    8 +-
 test/header_off64t.c                            |   55 +
 test/hide.c                                     |    4 +-
 test/hide_hidden.c                              |    4 +-
 test/hide_unhide.c                              |    4 +-
 test/include.c                                  |   67 -
 test/include_accmode.c                          |    4 +-
 test/include_affix.c                            |    4 +-
 test/include_auto.c                             |   25 +-
 test/include_cb.c                               |    4 +-
 test/include_creat.c                            |   13 +-
 test/include_ignore.c                           |   21 +-
 test/include_include.c                          |   67 +
 test/include_index.c                            |    4 +-
 test/include_invalid.c                          |    4 +-
 test/include_nonexistent.c                      |    7 +-
 test/include_pc.c                               |    4 +-
 test/include_ref.c                              |   21 +-
 test/include_sub.c                              |    4 +-
 test/include_syntax.c                           |    4 +-
 test/index.c                                    |   75 -
 test/index_domain.c                             |    4 +-
 test/index_index.c                              |   80 +
 test/index_range.c                              |    4 +-
 test/index_s.c                                  |   77 +
 test/index_subset.c                             |   77 +
 test/legacy_error.c                             |   44 +
 test/legacy_estring.c                           |   71 +
 test/legacy_format.c                            |  156 +
 test/legacy_nonexistent.c                       |    4 +-
 test/lzma_get.c                                 |    4 +-
 test/lzma_nframes.c                             |    4 +-
 test/lzma_put.c                                 |   73 +
 test/lzma_xz_add.c                              |   77 +
 test/lzma_xz_get.c                              |   88 +
 test/lzma_xz_get_far.c                          |   82 +
 test/lzma_xz_get_get.c                          |   87 +
 test/lzma_xz_get_get2.c                         |   82 +
 test/lzma_xz_get_put.c                          |  157 +
 test/lzma_xz_move_to.c                          |  111 +
 test/lzma_xz_nframes.c                          |   90 +
 test/lzma_xz_put.c                              |  115 +
 test/lzma_xz_put_back.c                         |  101 +
 test/lzma_xz_put_endian.c                       |  117 +
 test/lzma_xz_put_get.c                          |   83 +
 test/lzma_xz_put_pad.c                          |  103 +
 test/lzma_xz_seek.c                             |   71 +
 test/lzma_xz_seek_far.c                         |   71 +
 test/lzma_xz_sync.c                             |   93 +
 test/madd.c                                     |    4 +-
 test/madd_affix.c                               |    4 +-
 test/madd_alias.c                               |    7 +-
 test/madd_alias_affix.c                         |    7 +-
 test/madd_bit.c                                 |    4 +-
 test/madd_bit_invalid.c                         |    4 +-
 test/madd_carray.c                              |    6 +-
 test/madd_clincom.c                             |    4 +-
 test/madd_const.c                               |    4 +-
 test/madd_cpolynom.c                            |    6 +-
 test/madd_crecip.c                              |    6 +-
 test/madd_crecip89.c                            |    6 +-
 test/madd_divide.c                              |    4 +-
 test/madd_index.c                               |    4 +-
 test/madd_lincom.c                              |    6 +-
 test/madd_lincom_invalid.c                      |    4 +-
 test/madd_linterp.c                             |    4 +-
 test/madd_linterp_invalid.c                     |    4 +-
 test/madd_mplex.c                               |    6 +-
 test/madd_multiply.c                            |    4 +-
 test/madd_multiply_invalid.c                    |    4 +-
 test/madd_phase.c                               |    4 +-
 test/madd_phase_invalid.c                       |    4 +-
 test/madd_polynom.c                             |    6 +-
 test/madd_recip.c                               |    6 +-
 test/madd_sbit.c                                |    4 +-
 test/madd_spec.c                                |    4 +-
 test/madd_spec_directive.c                      |    4 +-
 test/madd_spec_invalid.c                        |    4 +-
 test/madd_spec_resolv.c                         |    7 +-
 test/madd_string.c                              |   12 +-
 test/madd_window.c                              |    4 +-
 test/move.c                                     |   71 -
 test/move_affix.c                               |    4 +-
 test/move_affix_dup.c                           |    4 +-
 test/move_affix_meta.c                          |   98 +
 test/move_affix_updb.c                          |   91 +
 test/move_alias.c                               |    6 +-
 test/move_data_enc_ar.c                         |   23 +-
 test/move_data_enc_ra.c                         |   24 +-
 test/move_data_endian.c                         |    7 +-
 test/move_data_foffs.c                          |    6 +-
 test/move_data_foffs_neg.c                      |   92 +
 test/move_data_nop.c                            |    7 +-
 test/move_index.c                               |    4 +-
 test/move_meta.c                                |    4 +-
 test/move_move.c                                |   71 +
 test/move_protect.c                             |    4 +-
 test/move_subdir.c                              |   26 +-
 test/name.c                                     |  133 -
 test/name_affix.c                               |   26 +-
 test/name_affix_bad.c                           |    4 +-
 test/name_alias.c                               |  104 +-
 test/name_dangle.c                              |  135 +
 test/name_dot5.c                                |   68 +
 test/name_dot5r.c                               |   73 +
 test/name_dot9.c                                |   61 +
 test/name_dup.c                                 |    4 +-
 test/name_meta.c                                |   88 +
 test/name_move.c                                |   40 +-
 test/name_move_alias.c                          |   40 +-
 test/name_name.c                                |  139 +
 test/name_updb.c                                |   56 +-
 test/name_updb_affix.c                          |   91 +
 test/name_updb_alias.c                          |   50 +-
 test/name_updb_carray.c                         |   70 +
 test/name_updb_const.c                          |   35 +-
 test/name_updb_const_alias.c                    |   29 +-
 test/native_bit.c                               |   54 +
 test/native_const.c                             |   52 +
 test/native_index.c                             |   46 +
 test/native_lincom.c                            |   54 +
 test/native_lincom_cmpin.c                      |   54 +
 test/native_lincom_cmpscal.c                    |   54 +
 test/native_linterp.c                           |   61 +
 test/native_linterp_cmp.c                       |   61 +
 test/native_mult.c                              |   54 +
 test/native_mult1.c                             |   55 +
 test/native_mult2.c                             |   55 +
 test/native_phase.c                             |   54 +
 test/native_polynom.c                           |   54 +
 test/native_polynom_cmpin.c                     |   54 +
 test/native_polynom_cmpscal.c                   |   54 +
 test/native_raw.c                               |   52 +
 test/native_recip.c                             |   54 +
 test/native_recip_cmpin.c                       |   54 +
 test/native_recip_cmpscal.c                     |   54 +
 test/native_sbit.c                              |   54 +
 test/native_string.c                            |   52 +
 test/nentries_alias.c                           |    4 +-
 test/nentries_hidden.c                          |    4 +-
 test/nentries_noalias.c                         |    4 +-
 test/nentries_scalar.c                          |    4 +-
 test/nfields.c                                  |   72 -
 test/nfields_hidden.c                           |    4 +-
 test/nfields_invalid.c                          |    4 +-
 test/nfields_nfields.c                          |   72 +
 test/nfields_type.c                             |    4 +-
 test/nfields_type_hidden.c                      |    4 +-
 test/nfields_type_invalid.c                     |    4 +-
 test/nfields_vector.c                           |    4 +-
 test/nfields_vector_hidden.c                    |    4 +-
 test/nfields_vector_invalid.c                   |    4 +-
 test/nframes.c                                  |   66 -
 test/nframes64.c                                |    4 +-
 test/nframes_empty.c                            |    4 +-
 test/nframes_invalid.c                          |    4 +-
 test/nframes_nframes.c                          |   66 +
 test/nframes_off64.c                            |    4 +-
 test/nframes_spf.c                              |    4 +-
 test/nmeta.c                                    |    4 +-
 test/nmeta_hidden.c                             |    4 +-
 test/nmeta_invalid.c                            |    4 +-
 test/nmeta_parent.c                             |    4 +-
 test/nmeta_type.c                               |    4 +-
 test/nmeta_type_hidden.c                        |    4 +-
 test/nmeta_type_invalid.c                       |    4 +-
 test/nmeta_type_parent.c                        |    4 +-
 test/nmeta_vectors.c                            |    4 +-
 test/nmeta_vectors_hidden.c                     |    4 +-
 test/nmeta_vectors_invalid.c                    |    4 +-
 test/nmeta_vectors_parent.c                     |    4 +-
 test/open.c                                     |   50 -
 test/open_abs.c                                 |    4 +-
 test/open_cb_abort.c                            |    4 +-
 test/open_cb_cont.c                             |    4 +-
 test/open_cb_ignore.c                           |    4 +-
 test/open_cb_invalid.c                          |    4 +-
 test/open_cb_rescan.c                           |    4 +-
 test/open_cb_rescan_alloc.c                     |   71 +
 test/open_eaccess.c                             |    7 +-
 test/open_invalid.c                             |   45 +
 test/open_nonexistent.c                         |    2 +-
 test/open_notdirfile.c                          |    2 +-
 test/open_open.c                                |   50 +
 test/open_sym_a.c                               |   66 -
 test/open_sym_al.c                              |    4 +-
 test/open_sym_at.c                              |    4 +-
 test/open_sym_c.c                               |    4 +-
 test/open_sym_cl.c                              |    4 +-
 test/open_sym_ct.c                              |    4 +-
 test/open_sym_d.c                               |   66 +
 test/open_sym_l.c                               |   62 +
 test/open_sym_p.c                               |    4 +-
 test/open_sym_pl.c                              |    4 +-
 test/open_sym_pt.c                              |    4 +-
 test/parse_badline.c                            |    4 +-
 test/parse_bit.c                                |    4 +-
 test/parse_bit4.c                               |    4 +-
 test/parse_bit_bitnum.c                         |    4 +-
 test/parse_bit_bitsize.c                        |    4 +-
 test/parse_bit_ncols.c                          |    4 +-
 test/parse_bit_numbits.c                        |    4 +-
 test/parse_bit_scalar.c                         |    4 +-
 test/parse_carray.c                             |    4 +-
 test/parse_carray_long.c                        |    4 +-
 test/parse_const.c                              |    4 +-
 test/parse_const_complex.c                      |    4 +-
 test/parse_const_ncols.c                        |    4 +-
 test/parse_divide.c                             |    4 +-
 test/parse_double.c                             |    4 +-
 test/parse_duplicate.c                          |    4 +-
 test/parse_duplicate_ignore.c                   |    4 +-
 test/parse_endian_bad.c                         |    4 +-
 test/parse_endian_big.c                         |    4 +-
 test/parse_endian_force.c                       |    4 +-
 test/parse_endian_little.c                      |    4 +-
 test/parse_endian_slash.c                       |    4 +-
 test/parse_eol.c                                |    4 +-
 test/parse_foffs.c                              |    4 +-
 test/parse_foffs_include.c                      |    4 +-
 test/parse_foffs_slash.c                        |    4 +-
 test/parse_hidden.c                             |    4 +-
 test/parse_hidden_field.c                       |    4 +-
 test/parse_hidden_meta.c                        |    4 +-
 test/parse_include.c                            |    4 +-
 test/parse_include_absolute.c                   |    4 +-
 test/parse_include_absrel.c                     |    4 +-
 test/parse_include_affix_bad.c                  |   64 +
 test/parse_include_affix_ref.c                  |    2 +-
 test/parse_include_dir.c                        |    6 +-
 test/parse_include_loop.c                       |    4 +-
 test/parse_include_nonexistent.c                |    6 +-
 test/parse_include_prefix.c                     |    4 +-
 test/parse_include_prefix_dup.c                 |    4 +-
 test/parse_include_preprefix.c                  |    4 +-
 test/parse_include_ref.c                        |    4 +-
 test/parse_include_relabs.c                     |    4 +-
 test/parse_include_relrel.c                     |    4 +-
 test/parse_include_slash.c                      |    4 +-
 test/parse_include_suffix.c                     |    4 +-
 test/parse_include_sufsuffix.c                  |    4 +-
 test/parse_index.c                              |    4 +-
 test/parse_lincom.c                             |    4 +-
 test/parse_lincom_ncols1.c                      |    4 +-
 test/parse_lincom_ncols2.c                      |    4 +-
 test/parse_lincom_nfields.c                     |    4 +-
 test/parse_lincom_nofields.c                    |    4 +-
 test/parse_lincom_non.c                         |    4 +-
 test/parse_lincom_non_ncols.c                   |    4 +-
 test/parse_lincom_scalar.c                      |    4 +-
 test/parse_linterp.c                            |    4 +-
 test/parse_linterp_ncols.c                      |    4 +-
 test/parse_literal_cmpbad.c                     |   56 +
 test/parse_literal_fltcmp.c                     |   56 +
 test/parse_literal_fltcmp0.c                    |   56 +
 test/parse_literal_intcmp.c                     |   55 +
 test/parse_literal_intcmp0.c                    |   55 +
 test/parse_literal_uintcmp.c                    |   54 +
 test/parse_literal_uintcmp0.c                   |   54 +
 test/parse_meta.c                               |    4 +-
 test/parse_meta_affix.c                         |    4 +-
 test/parse_meta_alias.c                         |    4 +-
 test/parse_meta_frag.c                          |   62 +
 test/parse_meta_implicit.c                      |    4 +-
 test/parse_meta_implicit2.c                     |    4 +-
 test/parse_meta_implicit_affix.c                |    4 +-
 test/parse_meta_index.c                         |    4 +-
 test/parse_meta_index2.c                        |    4 +-
 test/parse_meta_jump.c                          |    4 +-
 test/parse_meta_malias.c                        |    4 +-
 test/parse_meta_meta.c                          |    4 +-
 test/parse_meta_parent.c                        |    4 +-
 test/parse_meta_raw.c                           |    4 +-
 test/parse_mplex.c                              |    4 +-
 test/parse_mplex_ncols.c                        |    4 +-
 test/parse_mplex_nomax.c                        |    4 +-
 test/parse_mplex_scalar.c                       |    4 +-
 test/parse_multiply.c                           |    4 +-
 test/parse_multiply_ncols.c                     |    4 +-
 test/parse_name.c                               |    4 +-
 test/parse_name_dot.c                           |    4 +-
 test/parse_name_ext.c                           |    4 +-
 test/parse_name_pedantic.c                      |    4 +-
 test/parse_ncols.c                              |    4 +-
 test/parse_octal_zero.c                         |   55 +
 test/parse_phase.c                              |    4 +-
 test/parse_phase_ncols.c                        |    4 +-
 test/parse_phase_scalar.c                       |    4 +-
 test/parse_polynom.c                            |    4 +-
 test/parse_polynom_ncols1.c                     |    4 +-
 test/parse_polynom_ncols2.c                     |    4 +-
 test/parse_polynom_scalar.c                     |    4 +-
 test/parse_protect_all.c                        |    4 +-
 test/parse_protect_bad.c                        |    4 +-
 test/parse_protect_data.c                       |    4 +-
 test/parse_protect_format.c                     |    4 +-
 test/parse_protect_none.c                       |    4 +-
 test/parse_quote.c                              |    4 +-
 test/parse_quote_mismatch.c                     |    4 +-
 test/parse_raw.c                                |    4 +-
 test/parse_raw_char.c                           |    4 +-
 test/parse_raw_char_bad.c                       |   54 +
 test/parse_raw_ncols.c                          |    4 +-
 test/parse_raw_scalar.c                         |    4 +-
 test/parse_raw_spf.c                            |    4 +-
 test/parse_raw_type.c                           |    4 +-
 test/parse_recip.c                              |    4 +-
 test/parse_ref.c                                |    4 +-
 test/parse_ref_nonexistent.c                    |    4 +-
 test/parse_sbit.c                               |    4 +-
 test/parse_scalar1.c                            |   55 +
 test/parse_scalar2.c                            |   59 +
 test/parse_scalar_repr.c                        |   55 +
 test/parse_sort.c                               |    4 +-
 test/parse_string.c                             |    4 +-
 test/parse_string_ncols.c                       |    4 +-
 test/parse_string_null.c                        |    4 +-
 test/parse_version.c                            |    4 +-
 test/parse_version_89.c                         |    4 +-
 test/parse_version_98.c                         |    4 +-
 test/parse_version_include.c                    |    4 +-
 test/parse_version_p8.c                         |    4 +-
 test/parse_version_p9.c                         |    4 +-
 test/parse_version_permissive.c                 |    4 +-
 test/parse_version_slash.c                      |    4 +-
 test/parse_whitespace.c                         |    4 +-
 test/parse_window.c                             |    4 +-
 test/parse_window_ncols.c                       |    4 +-
 test/parse_window_op.c                          |    4 +-
 test/parse_window_scalar.c                      |    4 +-
 test/protect_alter.c                            |    4 +-
 test/protect_alter_all.c                        |   74 +
 test/protect_get.c                              |    4 +-
 test/put64.c                                    |   34 +-
 test/put_bad_code.c                             |    4 +-
 test/put_bit.c                                  |    4 +-
 test/put_bof.c                                  |    4 +-
 test/put_carray.c                               |   14 +-
 test/put_carray_client.c                        |   49 +
 test/put_carray_slice.c                         |   14 +-
 test/put_char.c                                 |    4 +-
 test/put_clincom1.c                             |   99 +
 test/put_complex128.c                           |   15 +-
 test/put_complex64.c                            |   15 +-
 test/put_const.c                                |   14 +-
 test/put_const_protect.c                        |    4 +-
 test/put_cpolynom.c                             |   89 +
 test/put_crecip.c                               |   88 +
 test/put_divide.c                               |   14 +-
 test/put_endian16.c                             |    4 +-
 test/put_endian32.c                             |    4 +-
 test/put_endian64.c                             |    4 +-
 test/put_endian8.c                              |    4 +-
 test/put_endian_complex128_arm.c                |    4 +-
 test/put_endian_complex128_big.c                |    4 +-
 test/put_endian_complex128_little.c             |    4 +-
 test/put_endian_complex64_arm.c                 |    4 +-
 test/put_endian_complex64_big.c                 |    4 +-
 test/put_endian_complex64_little.c              |    4 +-
 test/put_endian_float32_arm.c                   |    4 +-
 test/put_endian_float32_big.c                   |    4 +-
 test/put_endian_float32_little.c                |    4 +-
 test/put_endian_float64_arm.c                   |    4 +-
 test/put_endian_float64_big.c                   |    4 +-
 test/put_endian_float64_little.c                |    4 +-
 test/put_ff.c                                   |   15 +-
 test/put_float32.c                              |   15 +-
 test/put_float64.c                              |   15 +-
 test/put_foffs.c                                |   15 +-
 test/put_fs.c                                   |   15 +-
 test/put_here.c                                 |   18 +-
 test/put_heres.c                                |   18 +-
 test/put_int16.c                                |   15 +-
 test/put_int32.c                                |   15 +-
 test/put_int64.c                                |   15 +-
 test/put_int8.c                                 |   15 +-
 test/put_invalid.c                              |    4 +-
 test/put_lincom1.c                              |   15 +-
 test/put_lincom2.c                              |   14 +-
 test/put_lincom_noin.c                          |    4 +-
 test/put_linterp.c                              |   15 +-
 test/put_linterp_noin.c                         |    4 +-
 test/put_linterp_nomono.c                       |    4 +-
 test/put_linterp_notab.c                        |    6 +-
 test/put_linterp_reverse.c                      |   15 +-
 test/put_mplex.c                                |    4 +-
 test/put_mplex_complex.c                        |   88 +
 test/put_multiply.c                             |   14 +-
 test/put_nofile.c                               |   92 +
 test/put_null.c                                 |    4 +-
 test/put_off64.c                                |   15 +-
 test/put_phase.c                                |   14 +-
 test/put_phase_noin.c                           |    4 +-
 test/put_polynom1.c                             |   15 +-
 test/put_polynom2.c                             |   15 +-
 test/put_polynom_noin.c                         |    4 +-
 test/put_protect.c                              |    4 +-
 test/put_rdonly.c                               |   14 +-
 test/put_recip.c                                |   15 +-
 test/put_recurse.c                              |    4 +-
 test/put_repr.c                                 |    6 +-
 test/put_rofs.c                                 |    4 +-
 test/put_sbit.c                                 |    4 +-
 test/put_sf.c                                   |   15 +-
 test/put_ss.c                                   |   15 +-
 test/put_string.c                               |   14 +-
 test/put_string_protect.c                       |    4 +-
 test/put_sub.c                                  |   98 +
 test/put_type.c                                 |    4 +-
 test/put_uint16.c                               |   15 +-
 test/put_uint32.c                               |   15 +-
 test/put_uint64.c                               |   14 +-
 test/put_window.c                               |   14 +-
 test/put_zero.c                                 |    4 +-
 test/ref.c                                      |    4 +-
 test/ref_none.c                                 |    4 +-
 test/ref_two.c                                  |    4 +-
 test/repr_a.c                                   |    4 +-
 test/repr_bad.c                                 |   71 +
 test/repr_float32.c                             |    4 +-
 test/repr_float64.c                             |    4 +-
 test/repr_i.c                                   |    4 +-
 test/repr_int16.c                               |    4 +-
 test/repr_int32.c                               |    4 +-
 test/repr_int64.c                               |    4 +-
 test/repr_int8.c                                |    4 +-
 test/repr_m.c                                   |    4 +-
 test/repr_r.c                                   |    4 +-
 test/repr_real_a.c                              |    4 +-
 test/repr_real_i.c                              |    4 +-
 test/repr_real_m.c                              |    4 +-
 test/repr_real_r.c                              |    4 +-
 test/repr_uint16.c                              |    4 +-
 test/repr_uint32.c                              |    4 +-
 test/repr_uint64.c                              |    4 +-
 test/repr_uint8.c                               |    4 +-
 test/seek64.c                                   |    4 +-
 test/seek_cur.c                                 |    4 +-
 test/seek_end.c                                 |    4 +-
 test/seek_far.c                                 |   76 +
 test/seek_foffs.c                               |    4 +-
 test/seek_foffs2.c                              |    1 -
 test/seek_index.c                               |   57 +
 test/seek_lincom.c                              |   75 +
 test/seek_mult.c                                |   75 +
 test/seek_neg.c                                 |    4 +-
 test/seek_phase.c                               |   70 +
 test/seek_set.c                                 |    4 +-
 test/seek_sub.c                                 |   83 +
 test/sie_get_big.c                              |    6 +-
 test/sie_get_little.c                           |    4 +-
 test/sie_move_from.c                            |   26 +-
 test/sie_move_to.c                              |   17 +-
 test/sie_nframes_big.c                          |    4 +-
 test/sie_nframes_little.c                       |    4 +-
 test/sie_put_big.c                              |   22 +-
 test/sie_put_little.c                           |    4 +-
 test/sie_put_trunc_nf.c                         |    2 +-
 test/sie_seek.c                                 |   66 +
 test/sie_seek_far.c                             |   66 +
 test/slim_get.c                                 |    6 +-
 test/slim_nframes.c                             |    6 +-
 test/slim_seek.c                                |   73 +
 test/slim_seek_far.c                            |   73 +
 test/spf.c                                      |   58 -
 test/spf_alias.c                                |    4 +-
 test/spf_alias_meta.c                           |    4 +-
 test/spf_alias_missing.c                        |    4 +-
 test/spf_divide.c                               |    4 +-
 test/spf_lincom.c                               |    4 +-
 test/spf_multiply.c                             |    4 +-
 test/spf_polynom.c                              |    4 +-
 test/spf_raw.c                                  |   58 +
 test/spf_recip.c                                |    4 +-
 test/spf_recurse.c                              |    4 +-
 test/svlist.c                                   |    4 +-
 test/svlist0.c                                  |   60 +
 test/svlist2.c                                  |   82 +
 test/svlist_hidden.c                            |    4 +-
 test/svlist_invalid.c                           |    4 +-
 test/svlist_meta.c                              |    4 +-
 test/svlist_meta0.c                             |   65 +
 test/svlist_meta_hidden.c                       |    4 +-
 test/svlist_meta_invalid.c                      |    4 +-
 test/table.c                                    |    4 +-
 test/table_code.c                               |    4 +-
 test/table_type.c                               |    4 +-
 test/tell.c                                     |    4 +-
 test/tell64.c                                   |    4 +-
 test/tell_multidiv.c                            |    4 +-
 test/tell_sub.c                                 |   78 +
 test/test.h                                     |   22 +-
 test/tok_arg.c                                  |    2 +-
 test/tok_escape.c                               |   30 +-
 test/tok_quote.c                                |   30 +-
 test/trunc.c                                    |   13 +-
 test/trunc_dir.c                                |   13 +-
 test/trunc_rdonly.c                             |   13 +-
 test/trunc_truncsub.c                           |   13 +-
 test/unclude.c                                  |   21 +-
 test/unclude_del.c                              |   21 +-
 test/unclude_move.c                             |    4 +-
 test/unclude_open.c                             |   95 +
 test/version_0.c                                |    4 +-
 test/version_0_write.c                          |   18 +-
 test/version_1.c                                |    4 +-
 test/version_1_write.c                          |   17 +-
 test/version_2.c                                |    4 +-
 test/version_2_write.c                          |   18 +-
 test/version_3.c                                |    4 +-
 test/version_3_write.c                          |   18 +-
 test/version_4.c                                |    4 +-
 test/version_4_write.c                          |   18 +-
 test/version_5.c                                |    4 +-
 test/version_5_strict.c                         |    4 +-
 test/version_5_write.c                          |   18 +-
 test/version_6.c                                |    4 +-
 test/version_6_strict.c                         |    4 +-
 test/version_6_write.c                          |   20 +-
 test/version_7.c                                |    4 +-
 test/version_7_strict.c                         |    4 +-
 test/version_7_write.c                          |   19 +-
 test/version_8.c                                |    4 +-
 test/version_8_strict.c                         |    4 +-
 test/version_8_write.c                          |   16 +-
 test/version_9.c                                |    4 +-
 test/version_9_strict.c                         |    6 +-
 test/version_9_write.c                          |   30 +-
 test/vlist.c                                    |    4 +-
 test/vlist_alias.c                              |    4 +-
 test/vlist_hidden.c                             |    4 +-
 test/vlist_invalid.c                            |    4 +-
 test/vlist_meta.c                               |    4 +-
 test/vlist_meta_hidden.c                        |    4 +-
 test/vlist_meta_invalid.c                       |    4 +-
 test/xz_get.c                                   |   88 -
 test/xz_nframes.c                               |   90 -
 test/zzip_data.c                                |    4 +-
 test/zzip_get.c                                 |    4 +-
 test/zzip_get_get.c                             |   31 +-
 test/zzip_nframes.c                             |    4 +-
 test/zzip_seek.c                                |   75 +
 test/zzip_seek_far.c                            |   75 +
 test/zzslim_get.c                               |    6 +-
 test/zzslim_nframes.c                           |    6 +-
 test/zzslim_seek.c                              |   82 +
 test/zzslim_seek_far.c                          |   82 +
 util/Makefile.am                                |   12 +-
 util/Makefile.in                                |   40 +-
 util/checkdirfile.c                             |   17 +-
 util/dirfile2ascii.c                            |   21 +-
 1399 files changed, 64769 insertions(+), 28514 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 16fb79d..a5077f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,168 +1,466 @@
-2015-07-24   D. V. Wiebe <getdata at ketiltrout.net> svn:980
-	* src/sie.c (_GD_SampIndSize): Fix return value.
+2015-10-05   D. V. Wiebe <getdata at ketiltrout.net> svn:1009
+	GetData-0.9.0rc3:
 
-	* src/sie.c (_GD_SampIndWrite): Flush stdio buffer before truncating to
-	avoid having a partially written file on disk.
-	* test/sie_put_trunc_nf.c: Added.
-
-	* test/flush_hex.c: Call gd_discard() before exit.
+	* bindings/cxx/dirfile.cpp (GetData::EncodingSupport): Use
+	GetData::EncodingScheme for the encoding parameter.
 
-	* test/seek_foffs2.c: Fix memset call.
-
-2015-05-25   D. V. Wiebe <getdata at ketiltrout.net> svn:979
-	* bindings/f77/fgetdata.c (GDFLSH GDSYNC GDRCLO): Fix zero-length string
-	checks.
+	* bindings/cxx/dirfile.cpp (Dirfile::Delete): Use unsigned for the flags
+	parameter.
 
-	* bindings/python/pyfragment.c (gdpy_fragment_getprefix
-	gdpy_fragment_getsuffix): Fix memory leaks.
+	* bindings/cxx/getdata/fragment.h: Add FlacEncoding.
 
-	* src/add.c (_GD_Add) src/legacy.c (_GD_GetDirfile) src/mod.c
-	(gd_alter_spec) src/name.c (_GD_Rename) src/parse.c (_GD_ParseCarray): Fix
-	on-error memory leaks.
+	* bindings/idl/getdata.c (gdidl_delete): Add missing /META flag.
 
-	* src/common.c (_GD_GetRepr): Only set field_code to field_code_in if
-	necessary.
+	* bindings/php/getdata.c (gdphp_callback): Don't accept floating point
+	response from callback.
 
-	* src/entry.c (gd_linterp_tablename): Fix error reporting.
+	* bindings/matlab/Contents.m.head bindings/matlab/gd_move.c
+	bindings/perl/GetData.pm.in doc/README.cxx doc/README.f77 doc/README.f95
+	doc/README.idl doc/README.php doc/README.python: Update bindings docs.
 
-	* src/flush.c (_GD_StringEscapeise): Fix upper nibble of hex encoding.
-	* test/flush_hex.c: Added.
+	* test/put_nofile.c: Fix !defined HAVE_SETRLIMIT case.
 
-	* src/getdata.c (_GD_DoBit): Fix sign mask.
+	* test/test.h (gd_pathwrite): Also escape hash and space and use in all
+	cases.
+	* test/get_linterp_abs.c: Use gd_pathwrite.  Don't double buffer
+	format_data.
+
+2015-10-05   D. V. Wiebe <getdata at ketiltrout.net> svn:1008
+	* configure.ac: Fix handling of --with-ltdl.
+	* src/encoding.c src/internal.h: Move inclusion of <ltdl.h> out of header.
+
+	* src/compat.c (gd_StatAt64): Don't define if GD_NO_64BIT_STAT is defined.
+
+	* test/gzip_put_nframes.c test/gzip_put_off.c test/gzip_seek.c
+	test/gzip_seek_far.c test/gzip_seek_put.c: Fix for !defined(USE_GZIP).
+
+	* bindings/f77/getdata.f.in: Delete GDDELA and GDDSTP.
+
+	* configure.ac: remove check for -fno-backslash
+	* m4/compiler.m4 (GD_PROG_F77_FNO_BACKSLASH): Deleted.
+	* bidnings/f77/test/big_test.f: Define backslash parameter.
+
+2015-09-30   D. V. Wiebe <getdata at ketiltrout.net> svn:1007
+	GetData-0.9.0rc2.
+
+2015-09-27   D. V. Wiebe <getdata at ketiltrout.net> svn:1006
+	* test/gzip_seek_far.c: Allow both 256 and 4000 which can be returned by
+	different builds of zlib.
+
+	* src/getdata.c (_GD_ExtractRepr): Remove unused 4th parameter from
+	EXTRACT_REPR.
+
+2015-09-26   D. V. Wiebe <getdata at ketiltrout.net> svn:1005
+	* bindings/cxx/bitentry.cpp (BitEntry::Scalar BitEntry::ScalarIndex)
+	bindings/cxx/sbitentry.cpp (SBitEntry::Scalar SBitEntry::ScalarIndex): Moved
+	to header.
+
+	* bindings/cxx/getdata/bitentry.h (Input Scalar ScalarIndex)
+	bindings/cxx/getdata/divideentry.h (Input) bindings/cxx/getdata/entry.h
+	(Input Scalar ScalarIndex Scale CScale Offset COffset Coefficient CCoefficient
+	SetInput SetScale SetOffset SetCoefficient) bindings/cxx/getdata/lincomentry.h
+	(Input Scalar ScalarIndex Scale CScale Offset COffset SetInput SetScale
+	SetOffset) bindings/cxx/getdata/linterpentry.h (Input)
+	bindings/cxx/getdata/mplexentry.h (Input Scalar ScalarIndex)
+	bindings/cxx/getdata/multiplyentry.h (Input) bindings/cxx/getdata/phaseentry.h
+	(Input Scalar ScalarIndex) bindings/cxx/getdata/polynomentry.h (Input Scalar
+	ScalarIndex Coefficient CCoefficient SetCoefficient)
+	bindings/cxx/getdata/rawentry.h (Scalar ScalarIndex)
+	bindings/cxx/getdata/recipentry.h (Index Scalar ScalarIndex)
+	bindings/cxx/getdata/sbitentry.h (Index Scalar ScalarIndex)
+	bindings/cxx/getdata/windowentry.h (Index Scalar ScalarIndex): Remove default
+	from index.
 
-	* src/mod.c (_GD_AlterScalar): Remove duplicate case.
+	* bindings/python/pydirfile.c (gdpy_dirfile_getfieldlist
+	gdpy_dirfile_getmfieldlist gdpy_dirfile_getnmfields): Fix type cast.
 
-2015-05-25   D. V. Wiebe <getdata at ketiltrout.net> svn:977
-	* src/getdata.c (_GD_DoRaw): Rewind RAW file if necessary after
-	zero-padding.
-	* test/get_foffs2.c test/seek_foffs2.c: Added.
+	* configure.ac: Remove GD_C_CAST_COMPLEX
+	* src/getdata.c (_GD_ExtractRepr): Avoid calling complex functions
+	unnecessarily.
+	* src/internal.h: Remove GD_RTOC.
 
-	* src/raw.c (_GD_RawSeek): Handle landing in the middle of a sample.
+	* configure.ac: Check for gzseek64 and gztell64
+	* src/gzip.c (_GD_GzipSeek): Abstractify gzseek and gztell.
 
-	* src/raw.c (_GD_RawSeek): Remember the actual position, not the
-	requested position.
+	* src/internal.h: Redirect gd_StatAt64 if GD_NO_64BIT_STAT.
 
-	* bindings/idl/test/Makefile.am bindings/matlab/test/Makefile.am
-	bindings/perl/Makefile.am bindings/python/test/Makefile.am: Fix
-	DL_LIBRARY_PATH ordering.
+2015-09-25   D. V. Wiebe <getdata at ketiltrout.net> svn:1004
+	GetData-0.9.0rc1:
 
-	* bindings/perl/GetData.pm.in: Fix perldoc markup.
+	* src/internal.h (gd_ef_strerr_t): Mark first argument const.
 
-2015-05-20   D. V. Wiebe <getdata at ketiltrout.net> svn:976
-	* cmake/test/CMakeLists.txt: blacklist gzip tests.
+	* src/include.c (_GD_SetFieldAffixes): Remove unused ns and nsl arguments.
 
-	* src/getdata.h.in: Don't attempt to use __nonnull.
+	* src/legacy.c (GetFormat): Remove DSV 10 stuff.
 
-	* configure.ac: Fix cygwin check.
+	* test/ascii_get_here.c: Fix e1 check.
+	* test/flac_put_int32.c: Fix signedness.
 
-2015-05-19   D. V. Wiebe <getdata at ketiltrout.net> svn:973
-	* src/add.c (_GD_Add _GD_AddAlias) src/fragment.c (_GD_CheckAffixes):
-	Don't dealias during the duplicate field name check.
-	* test/add_dangle_dup.c: Added.
+	* bindings/matlab/gd_add_indir.m bindings/matlab/gd_add_sindir.m
+	bindings/matlab/gd_alter_indir.m bindings/matlab/gd_alter_sindir.m
+	bindings/matlab/gd_madd_indir.m bindings/matlab/gd_madd_sindir.m
+	bindings/matlab/gd_msarrays.c: Deleted.
+	
+	* src/nan.h: Deleted.
+	* src/internal.h: Merged in nan.h content.
 
-2015-05-13   D. V. Wiebe <getdata at ketiltrout.net> svn:969
-	GetData-0.8.8 released:
+	* test/gzip_put_off.c test/gzip_seek_put.c: Halve the amount of data used.
 
-	* src/getdata.h.in: Delete all the __REDIRECTs.
+	Merge in build system fixes from GetData-0.8 branch, revision 969:
 
-	* test/get_uint32.c test/get_uint64.c: Fix signed integer overflow.
+	* Makefile.am: Don't run matlabdistcheck and idldistcheck against an
+	installed GetData.
 
 	* bindings/idl/Makefile.am bindings/python/Makefile.am: Fix VPATH builds
 	again.
 
-	* bindings/matlab/package/Makefile.am bindings/idl/package/Makefile.am: Deal
-	with non-standard GETDATA_CFLAGS.
+2015-09-25   D. V. Wiebe <getdata at ketiltrout.net> svn:1003
+	* src/flac.c (_GD_FlacWrite): Fix data marshalling for little-ended data.
+	* test/flac_put_complex128.c: Added.
 
-	* Makefile.am: Don't run matlabdistcheck and idldistcheck against an
-	installed GetData.
+2015-09-24   D. V. Wiebe <getdata at ketiltrout.net> svn:1001
+	* src/flac.c: Added.
+	* configure.ac src/Makefile.am src/encoding.c (_GD_EncodingUnderstood)
+	src/flush.c (_GD_FlushFragment): Deal with FLAC.
+	* bindings/make_parameters.c src/getdata.h.in: Add GD_FLAC_ENCODED.
+	* man/dirfile-encoding.5: Updated.
 
-2015-05-11   D. V. Wiebe <getdata at ketiltrout.net> svn:966
-	GetData-0.8.7 released.
+	* src/internal.h: data_type added to gd_ef_open_t.
 
-2015-05-08   D. V. Wiebe <getdata at ketiltrout.net> svn:965
-	GetData-0.8.7rc3:
+	* src/bzip2.c (_GD_Bzip2DoOpen): Clean up after errors.
 
-	* bindings/python/test/Makefile.am: Don't clobber an existing PYTHONPATH.
-	* m4/python.m4: python-config lies.  Don't use it.  Always use
-	distutils.sysconfig instead.  Don't hardcode -lpython
+	* src/internal.h: Abstractify strerror stuff.
+	* src/compat.c (gd_sterror): Added.
+	* src/errors.c (gd_error_string): Call gd_sterrror.
 
-	* m4/python.m4: dnl the simple module check.
+	* src/fpos.c (_GD_DoSeek): Renamed from _GD_WriteSeek.  Handle short writes.
 
-2015-05-07   D. V. Wiebe <getdata at ketiltrout.net> svn:964
-	GetData-0.8.7rc2.
+	* src/slim.c: Handle ZZSLIM.
 
-2015-05-07   D. V. Wiebe <getdata at ketiltrout.net> svn:963
-	* m4/python.m4: Set PYTHON_CFLAGS from distutils/python-config.
-	* bindings/python/Makefile.am: Use PYTHON_CFLAGS.
+	* src/slim.c (Seek) src/zzip.c (_GD_ZzipSeek): Deal with seeks past the EOF.
+	Properly update and report file->pos.
 
-2015-05-06   D. V. Wiebe <getdata at ketiltrout.net> svn:962
-	GetData-0.8.7rc1:
+	* src/slim.c (DoOpen): Record full path name along with SLIMFILE in
+	file->edata.  Renamed from _GD_SlimOpen.
+	* src/slim.c (Open): Added.
 
-	Backport build system fixes from trunk, rev 947:
+	* src/zzip.c (_GD_ZzipName): Put both .zip name and field name in
+	file->name.
+	* src/zzip.c (_GD_ZzipDoOpen): Renamed from _GD_ZzipOpen.  Open containing
+	archive (ZZIP_DIR) separately from the data file (ZZIP_FILE).
+	* src/zzip.c (_GD_ZzipOpen): Added.
+	* src/zzip.c (_GD_ZzipDoOpen): Call _GD_DoOpen.
 
-	* configure.ac bindings/idl/package/configure.ac
-	bindings/matlab/package/configure.ac: Use AC_USE_SYSTEM_EXTENSIONS and
-	AC_SYS_LARGEFILE instead of definining feature macros explicitly.
-	* m4/compiler.m4 (GD_CHECK_LFS_TYPE): Deleted.
+	* src/zzslim.c (_GD_ZzslimOpen _GD_ZzslimSeek _GD_ZzslimRead _GD_ZzslimClose
+	_GD_ZzslimSize): Removed.  Instead, define ZZSLIM and include slim.c.
 
-2015-05-04   D. V. Wiebe <getdata at ketiltrout.net> svn:961
-	* test/sie.put_many.c test/sie_put_newo.c test/sie_put_newo0.c: Added.
-	* test/sie_put_steve.c: Deleted.
+	* src/internal.h: Added error to gd_raw_file_.  Added strerr to encoding_t.
+	Added GD_EF_STRERR.
+	* src/bzip2.c src/gzip.c src/lzma.c src/zzip.c: Record errors in file->error.
+	* src/errors.c (_GD_SetEncIOError) src/bzip2.c (_GD_Bzip2Strerr) src/gzip.c
+	(_GD_GzipStrerr) src/lzma.c (_GD_LzmaStrerr) src/slim.c (Strerr) src/zzip.c
+	(_GD_ZzipStrerr): Added.
+	* src/del.c (_GD_Delete) src/encoding.c (_GD_FiniRawIO _GD_InitRawIO)
+	src/flimits.c (_GD_GetEOF) src/fpos.c (_GD_DoSeek gd_tell) src/getdata.c
+	(_GD_DoRaw) src/mod.c (_GD_Change) src/move.c (_GD_MogrifyFile) src/name.c
+	(_GD_Rename) src/nframes.c (gd_nframes64) src/putdata.c (_GD_DoRawOut): Set error via _GD_SetEncIOError.
+	* src/encoding.c (_GD_MissingFramework): Deal with GD_EF_STRERR
+	* src/fpos.c (_GD_Seek): _GD_DoSeek has already set the error.
+	* src/errors.c: Added GD_E_IO_ENC_*.
+	* src/errors.c (_GD_SetEncIOError): Added.
 
-2015-05-01   D. V. Wiebe <getdata at ketiltrout.net> svn:960
-	Steve's SIE fixes:
+	* src/getdata.h.in: Fix GD_DIRFILE_STANDARDS_VERSION.
 
-	* src/sie.c (_GD_SampIndSeek): Behave when seeking on an empty file.
+	* test/name_dot10.c: Deleted.
 
-	* src/sie.c (_GD_SampIndWrite): Update cur_end when reallocing p.
+	* test/ascii_get_here.c test/ascii_put_here.c test/ascii_seek.c
+	test/ascii_seek_far.c test/bzip_seek.c test/bzip_seek_far.c test/flac_add.c
+	test/flac_get_big.c test/flac_get_far.c test/flac_get_get.c
+	test/flac_get_get2.c test/flac_get_little.c test/flac_nframes.c
+	test/flac_put_big.c test/flac_put_float64.c test/flac_put_int32.c
+	test/flac_put_little.c test/flac_seek.c test/flac_seek_far.c
+	test/flac_sync.c test/gzip_seek.c test/gzip_seek_far.c test/lzma_xz_seek.c
+	test/lzma_xz_seek_far.c test/seek_far.c test/sie_seek.c test/sie_seek_far.c
+	test/slim_seek.c test/slim_seek_far.c test/zzip_seek.c test/zzip_seek_far.c
+	test/zzslim_seek.c test/zzslim_seek_far.c: Added.
 
-	* src/sie.c (_GD_SampIndWrite): Fix fence-post error in memcpy.
 
-	* test/sie_put_steve.c: Added.
+2015-09-22   D. V. Wiebe <getdata at ketiltrout.net> svn:1000
+	* bindings/python/pydirfile.c bindings/python/pygetdata.c configure.ac: Make
+	NumPy support mandatory.
 
-	Also:
+	* src/common.c (_GD_GetRepr): Remove DSV 10 features.
 
-	* src/sie.c (_GD_SampIndDoOpen): Initialise fd from fdin.
+2015-09-22   D. V. Wiebe <getdata at ketiltrout.net> svn:999
+	* src/fragment.c (_GD_SubFragmentList): Removed (part of DSV 10).
 
-2015-04-30   D. V. Wiebe <getdata at ketiltrout.net> svn:959
-	Backport SIE fixes from trunk:
+	* bindings/f77/test/gdcopn.f: remove GD_VB
 
-	* test/sie_put_append.c test/sie_put_append2.c test/sie_put_back.c
-	test/sie_put_pad.c test/sie_put_pad0.c test/sie_put_trunc.c
-	test/sie_put_trunc2.c test/sie_sync.c: Added. (r867)
+2015-09-22   D. V. Wiebe <getdata at ketiltrout.net> svn:998
+	* bindings/idl/getdata.c bindings/python/pydirfile.c bindings/perl/typemap
+	bindings/perl/simple_funcs.pl bindings/perl/GetData.xs: Use gd_off64_t in
+	place of off64_t or off_t.
 
-	* src/sie.c (_GD_SampIndWrite): Deallocate buffers on error. (r877)
+	* bindings/perl/GetData.xs bindings/perl/simple_funcs.pl (gdp64): Deleted;
+	use the 64-bit API always.
 
-	* src/sie.c: Added l, have_l and bof to struct gd_siedata.  Also, f->d[0]
-	is no longer endianness corrected (ie. f->d is now simply the raw record),
-	which means we use f->s in most places where we used f->d[0] previously.
-	(r867)
+	* bindings/python/pydirfile.c (gdpy_dirfile_getdata gdpy_dirfile_getnframes
+	gdpy_dirfile_getbof gdpy_dirfile_getbof gdpy_dirfile_geteof
+	gdpy_dirfile_putdata gdpy_dirfile_getframenum gdpy_dirfile_seek
+	gdpy_dirfile_tell) bindings/python/pyfragment.c (gdpy_fragment_getoffset
+	gdpy_fragment_setoffset): Call the 64-bit API.
 
-	* src/sie.c (_GD_Advance): remember the previous record in f->l.  Also set
-	f->bof. (r867)
+	* configure.ac: Remove AC_SYS_LARGEFILE
+	* src/internal.h: Define _LARGEFILE64_SOURCE.
 
-	* src/sie.c (_GD_SampIndSeek): check stdio calls for failure.  Correctly
-	format a padding record when write seeking past the EOF. (r867)
+	* test/header_off64t: Added.
 
-	* src/sie.c (_GD_SampIndWrite): Correctly deal with appending data,
-	including backing up a record when necessary to check whether we need to
-	combine the start of the new data with that record.  Compose p with the
-	output endianness. (r867)
+	* m4/php.m4: Handle NONE for php-binary.
+
+	* src/getdata.h.in: Do 64-bit API redirection if _FILE_OFFSET_BITS == 64.
+
+	* src/zzslim.c (_GD_ZzslimSeek) src/zzip.c (_GD_ZzipSeek) src/slim.c
+	(_GD_SlimSeek): Cast count to the correct type.
+
+	* src/gzip.c (_GD_GzipSeek): Use the 64-bit zlib API.
+
+2015-09-21   D. V. Wiebe <getdata at ketiltrout.net> svn:997
+	* src/add.c (_GD_InvalidEntype _GD_Add) src/close.c (_GD_FreeD)
+	src/constant.c (gd_array_len) src/del.c (_GD_ClearDerived _GD_DeReference)
+	src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate)
+	src/field_list.c (_GD_EntryIndex) src/flimits.c (_GD_GetEOF _GD_GetBOF)
+	src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion) src/fpos.c
+	(_GD_GetFilePos _GD_Seek) src/getdata.c (_GD_DoField gd_getdata64)
+	src/getdata.h.in src/internal.h src/mod.c (_GD_Change) src/name.c
+	(_GD_UpdateInputs) src/native.c (_GD_NativeType) src/parse.c
+	(_GD_ParseArray _GD_ParseFieldSpec _GD_ParseDirective) src/putdata.c
+	(_GD_DoFieldOut) src/spf.c (_GD_GetSPF) src/include.c (_GD_SetFieldAffixes):
+	Remove DSV 10 features.
+
+	* src/add.c (gd_add_indir gd_add_sindir gd_add_sarray gd_madd_indir
+	gd_madd_sindir gd_madd_sarray) src/field_list.c (gd_sarrays gd_msarrays)
+	src/getdata.c (_GD_IndirData _GD_DoIndir _GD_DoSindir) src/mod.c
+	(gd_alter_indir gd_alter_sindir gd_alter_sarray) src/parse.c
+	(_GD_ParseNamespace) src/string.c (gd_get_sarray gd_put_sarray_slice
+	gd_put_sarray) src/fragment.c (_GD_CheckChangeNamespace
+	gd_fragment_namespace): Removed.
+	* src/string.c (gd_get_sarray_slice): Made static.
+
+	* test/add_dot10.c test/add_indir.c test/add_sarray.c test/add_sarray_nil.c
+	test/add_sindir.c test/alter_entry_sarray.c test/alter_indir.c
+	test/alter_sarray.c test/alter_sindir.c test/get_indir.c test/get_sarray.c
+	test/get_sarray_len.c test/get_sarray_slice.c test/get_sindir.c
+	test/get_sindir_none.c test/get_sindir_null.c test/get_sindir_type.c
+	test/get_type_string.c test/madd_indir.c test/madd_sarray.c
+	test/madd_sindir.c test/name_updb_sarray.c test/parse_include_ns2.c
+	test/parse_include_nsabs.c test/parse_include_nsinh.c
+	test/parse_include_nspop.c test/parse_include_nsrabs.c
+	test/parse_include_nsrainh.c test/parse_include_nsrinh.c
+	test/parse_include_nsroot.c test/parse_indir.c test/parse_ns.c
+	test/parse_ns_abs.c test/parse_ns_dot.c test/parse_ns_dotdot.c
+	test/parse_ns_dotdotns.c test/parse_ns_dotns.c test/parse_ns_ndotdots.c
+	test/parse_ns_ndots.c test/parse_ns_nsdot.c test/parse_ns_nsdotdot.c
+	test/parse_ns_par.c test/parse_ns_sub.c test/parse_nsf.c
+	test/parse_nsf_abs.c test/parse_nsf_alias.c test/parse_nsf_dot.c
+	test/parse_nsf_hide.c test/parse_nsf_index.c test/parse_nsf_meta.c
+	test/parse_nsf_meta2.c test/parse_nsf_par.c test/parse_nsf_ref.c
+	test/parse_nsf_refabs.c test/parse_nsf_refrel.c test/parse_nsf_root.c
+	test/parse_nsf_rpar.c test/parse_nsf_sub.c test/parse_sarray.c
+	test/parse_sarray_long.c test/parse_sindir.c put_indir.c test/put_sarray.c
+	test/put_sarray_slice.c test/put_sindir.c test/svlist_array.c
+	test/svlist_array_meta.c test/add_ns.c test/add_ns_frag.c
+	test/add_ns_frag2.c test/include_ns.c test/name_ns.c test/name_ns2.c
+	test/name_nsdot.c test/parse_include_ns.c: Deleted.
+	* test/name_updb.c test/name_updb_carray.c test/native_string.c: Remove DSV 10
+	tests.
+
+	* bindings/make_parameters.c bindings/cxx/dirfile.cpp (Dirfile::Entry
+	Dirfile::GetData) bindings/cxx/entry.cpp (Entry::CheckIndex scalar_ok)
+	bindings/cxx/getdata/entry.h bindings/f77/fgetdata.c (GDGSCA GDASCA)
+	bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd fgd_alter_entry)
+	bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_convert_entry_num
+	gdidl_read_idl_entry gdidl_getdata) bindings/matlab/gd_getdata.c
+	bindings/matlab/matlab.c (gdmx_from_entry gdmx_to_entry)
+	bindings/perl/GetData.xs (gdp_to_entry entry getdata)
+	bindings/perl/simple_funcs.xsin bindings/php/getdata.c (gdphp_from_entry
+	gdphp_to_entry gd_getdata) bindings/python/pydirfile.c
+	(gdpy_dirfile_getdata) bindings/python/pyentry.c (gdpy_set_entry_from_tuple
+	gdpy_entry_getinfields gdpy_entry_setinfields gdpy_entry_getarraylen
+	gdpy_entry_setarraylen gdpy_entry_getparms) bindings/python/pygetdata.c
+	(gdpy_convert_to_pylist gdpy_convert_to_pyobj): Remove DSV 10 features.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::GetSarray Dirfile::Sarrays
+	Dirfile::MSarrays Dirfile::PutSarray) bindings/f77/fgetdata.c (GDGEID GDGESD
+	GDGESA GDADID GDADSD GDMDID GDMDSD GDADSA GDMDSA GDALID GDALSD GDSARX GDMSAX
+	GDGTSA GDPTSA GDALSA GDGSTD GDGSTP GDXSTP) bindings/f77/getdata.f90.in
+	(fgd_sarray_value_max fgd_msarray_value_max fgd_get_sarray
+	fgd_get_sarray_slice fgd_put_sarray fgd_put_sarray_slice fgd_add_sarray
+	fgd_madd_sarray fgd_alter_sarray fgd_add_indir fgd_add_sindir fgd_madd_indir
+	fgd_madd_sindir fgd_alter_indir fgd_alter_sindir fgd_getstrdata)
+	bindings/idl/getdata.c (gdidl_add_sarray gdidl_get_sarray gdidl_get_sarray
+	gdidl_alter_sarray gdidl_add_indir gdidl_alter_indir gdidl_add_sindir
+	gdidl_alter_sindir) bindings/matlab/matlab.c (gdmx_from_sarrays)
+	bindings/perl/GetData.xs (get_sarray get_sarray_slice sarrays put_sarray
+	put_sarray_slice add_sarray madd_sarray msarrays) bindings/php/getdata.c
+	(gdphp_convert_sarray gd_add_sarray gd_add_indir gd_add_sindir
+	gd_alter_sarray gd_alter_indir gd_alter_sindir gd_sarrays gd_get_sarray
+	gd_madd_sarray gd_madd_indir gd_madd_sindir gd_msarrays gd_put_sarray)
+	bindings/python/pydirfile.c (gdpy_dirfile_getsarray gdpy_dirfile_sarrays
+	gdpy_dirfile_msarrays gdpy_dirfile_putsarray): Removed.
+
+	* bindings/cxx/getdata/indirentry.h bindings/cxx/getdata/sarrayentry.h
+	bindings/cxx/getdata/sindirentry.h bindings/cxx/indirentry.cpp
+	bindings/cxx/sarrayentry.cpp bindings/cxx/sindirentry.cpp
+	bindings/matlab/gd_add_sarray.c bindings/matlab/gd_alter_sarray.m
+	bindings/matlab/gd_get_sarray.c bindings/matlab/gd_get_sarray_slice.c
+	bindings/matlab/gd_madd_sarray.c bindings/matlab/gd_put_sarray.m
+	bindings/matlab/gd_put_sarray_slice.c bindings/matlab/gd_sarrays.c: Deleted.
+
+	* bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+	bindings/matlab/test/big_test.m bindings/perl/t/big_test.t
+	bindings/php/test/big_test.php bindings/python/test/big_test.py
+	doc/list.tests: Deleted tests 272-298.  Renumbered test 299 to 272.
+
+2015-09-20   D. V. Wiebe <getdata at ketiltrout.net> svn:995
+	* src/encoding.c (_GD_FiniRawIO) src/fpos.c (_GD_WriteSeek): Place large
+	buffers on the heap.
+
+2015-09-20   D. V. Wiebe <getdata at ketiltrout.net> svn:993
+	Merge in bugfixes from GetData-0.8:
+
+	* src/add.c (_GD_Add _GD_AddAlias) src/fragment.c (_GD_CheckAffixes):
+	Don't dealias during the duplicate field name check. (r973)
+	* test/add_dangle_dup.c: Added. (r973)
+
+	* cmake/test/CMakeLists.txt: blacklist gzip tests. (r976)
+
+	* src/getdata.h.in: Don't attempt to use __nonnull. (r976)
+
+	* configure.ac: Fix cygwin check. (r976)
+
+	* src/getdata.c (_GD_DoRaw): Rewind RAW file if necessary after
+	zero-padding. (r977)
+	* test/get_foffs2.c test/seek_foffs2.c: Added. (r977)
+
+	* src/raw.c (_GD_RawSeek): Handle landing in the middle of a sample. (r977)
+
+	* src/raw.c (_GD_RawSeek): Remember the actual position, not the
+	requested position. (r977)
+
+	* bindings/idl/test/Makefile.am bindings/matlab/test/Makefile.am
+	bindings/perl/Makefile.am bindings/python/test/Makefile.am: Fix
+	DL_LIBRARY_PATH ordering. (r977)
+
+	* bindings/perl/GetData.pm.in: Fix perldoc markup. (r977)
+
+	* bindings/f77/fgetdata.c (GDFLSH GDSYNC GDRCLO): Fix zero-length string
+	checks. (r979)
+
+	* bindings/python/pyfragment.c (gdpy_fragment_getprefix
+	gdpy_fragment_getsuffix): Fix memory leaks. (r979)
+
+	* src/add.c (_GD_Add) src/legacy.c (_GD_GetDirfile) src/mod.c
+	(gd_alter_spec): Fix on-error memory leaks. (r979)
+
+	* src/common.c (_GD_GetRepr): Only set field_code to field_code_in if
+	necessary. (r979)
+
+	* src/flush.c (_GD_StringEscapeise): Fix upper nibble of hex encoding.
+	* test/flush_hex.c: Added. (r979)
+
+	* src/getdata.c (_GD_DoBit): Fix sign mask. (r979)
+
+	* src/sie.c (_GD_SampIndSize): Fix return value. (r980)
+
+	* src/sie.c (_GD_SampIndWrite): Flush stdio buffer before truncating to
+	avoid having a partially written file on disk. (r980)
+	* test/sie_put_trunc_nf.c: Added. (r980)
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getrawfilename)
+	bindings/python/pyfragment.c (gdpy_fragment_getprefix
+	gdpy_fragment_getsuffix): Free C strings after calling PyString_FromString.
+	Patch from Matthew Petroff.  (r985)
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_delete)
+	bindings/python/pyentry.c (gdpy_entry_delete) bindings/python/pyfragment.c
+	(gdpy_fragment_delete): Free the object. (r985)
+
+	* src/raw.c (_GD_RawOpen): Don't set the mode if open fails. (r988)
+	* test/put_nofile.c: Added. (r988)
+
+	* src/fpos.c (_GD_WriteSeek): Don't overrun the buffer when doing OOP
+	seeks. (r989, r990, r992)
+	* test/gzip_put_off.c * test/gzip_seek_put.c: Added. (r989, r990)
+
+	* src/nframes.c (gd_nframes64): Close the reference field if it's open for
+	writing to ensure everything is on disk before we check its size. (r989)
+	* test/gzip_put_nframes.c: Added. (r989)
+
+	Also:
+
+	* src/internal.h: Merge BUFFER_SIZE and GD_BUFFER_SIZE.
+
+2015-05-15   D. V. Wiebe <getdata at ketiltrout.net> svn:974
+	* m4/compiler.m4 (GD_C_CAST_COMPLEX): Added.
+	* configure.ac: Call GD_C_CAST_COMPLEX in C99 mode.
+
+	* src/internal.h: Define GD_RTOC to handle GD_COMPLEX_CONV_OK.
+	* src/getdata.c (EXTRACT_REPRS EXTRACT_REPR2 EXTRACT_REPRR2 EXTRACT_REPR):
+	Use GD_RTOC when appropriate.
+
+2015-05-15   D. V. Wiebe <getdata at ketiltrout.net> svn:972
+	
+	* src/name.c (_GD_MungeCode): Fix buffer overrun.  Don't write spurious
+	slash.  Patch from Seth Hillbrand.
+
+	Merge in bugfixes from 0.8 branch:
+
+	* src/include.c )_GD_Include): Only open the file read-write if it's being
+	  truncated or created. (r949)
+	* test/open_rofs.c: Added. (r949)
 
-2015-04-30   D. V. Wiebe <getdata at ketiltrout.net> svn:956
 	* bindings/f77/fgetdata.c (GDREFE): Convert a passed empty string to NULL.
+	(r956)
 
 	* bindings/f77/getdata.f90.in (fgd_reference): Handle empty string from
-	GDREFE.
+	GDREFE. (r956)
 
 	* bindings/python/pydirfile.c (gdpy_dirfile_getreference): Handle NULL from
-	gd_reference.
+	gd_reference. (r956)
 
 	* bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
 	bindings/f77/test/big_test95.f90 bindings/matlab/test/big_test.m
-	bindings/perl/t/big_test.t bindings/python/test/big_test.py: Add test 243.
+	bindings/perl/t/big_test.t bindings/python/test/big_test.py: Add test 299.
+	(r956, where it is test 243).
+
+	* src/sie.c (_GD_SampIndSeek): Behave when seeking on an empty file. (r960)
+	* src/sie.c (_GD_SampIndWrite): Update cur_end when reallocing p. (r960)
+	* src/sie.c (_GD_SampIndWrite): Fix fence-post error in memcpy. (r960)
+
+	* test/sie.put_many.c test/sie_put_newo.c test/sie_put_newo0.c: Added.
+	(r961)
+
+	* src/getdata.h.in: Delete all the __REDIRECTs. (r969)
+
+	* test/get_uint32.c test/get_uint64.c: Fix signed integer overflow.
+
+	Also:
+
+	* bindings/php/getdata.c (gd_reference): Handle NULL from gd_reference.
+	* bindings/php/test/big_test/php: Add test 299.
+	* bindings/python/pydirfile.c (gdpy_dirfile_getstrings): Fix error call.
+
+
+2014-04-29   D. V. Wiebe <getdata at ketiltrout.net> svn:955
+	* bindings/idl/getdata.c (gdidl_reference): Converted from procedure to
+	function returning the string returned by gd_reference(), or the empty
+	string if gd_reference returns NULL.
+
+2014-04-24   D. V. Wiebe <getdata at ketiltrout.net> svn:954
+
+	Merge in bugfixes from 0.8 branch, rev.953:
 
-2015-04-24   D. V. Wiebe <getdata at ketiltrout.net> svn:953
 	* bindings/python/pygetdata.c (gdpylist_append gdpy_to_pystringlist): Added.
 	* bindings/python/pydirfile.c (gdpy_dirfile_getvectorlist
 	gdpy_dirfile_getfieldlist gdpy_dirfile_getmfieldlist
@@ -176,135 +474,832 @@
 	error.
 
 	* test/add_raw_spf_scalar.c: Initialise E.
-	* test/open_sym_a.c test/open_sym_al.c test/open_sym_at.c test/tok_escape.c
-	test/tok_quote.c: Free strings.
+	* test/open_sym_a.c: Free string.
 
-2015-04-05   D. V. Wiebe <getdata at ketiltrout.net> svn:949
-	* src/include.c (_GD_Include): Only open the file read-write if it's being
-	truncated or created.
+2015-04-15     D. V. Wiebe <getdata at ketiltrout.net> svn:952
+	* configure.ac: Call AC_TYPE_MODE_T and AC_TYPE_SSIZE_T.
+	* src/internal.h [_MSC_VER]: Don't typedef mode_t.
+	* cmake/CMakeLists.txt: Define mode_t.
+	* src/bzip.c (_GD_Bzip2Read) src/flimits.c (_GD_GetBOF gd_bof64)
+	src/parse.c (_GD_TokToNum): Use stdint types instead of "long long" directly.
 
-2014-12-07   D. V. Wiebe <getdata at ketiltrout.net> svn:935
-	GetData-0.8.6 released.
+2015-04-03     D. V. Wiebe <getdata at ketiltrout.net> svn:947
+	* configure.ac bindings/idl/package/configure.ac
+	bindings/matlab/package/configure.ac: Use AC_USE_SYSTEM_EXTENSIONS and
+	AC_SYS_LARGEFILE instead of definining feature macros explicitly.
+	* m4/compiler.m4 (GD_CHECK_LFS_TYPE): Deleted.
 
-2014-12-06   D. V. Wiebe <getdata at ketiltrout.net> svn:932
-	Backport more bugfixes from trunk:
+2014-12-31     D. V. Wiebe <getdata at ketiltrout.net> svn:940
+	* src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut): Fix recursion
+	counting on error.
+
+	* src/getdata.h.in src/errors.c: Merge GD_E_BAD_REPR into GD_E_BAD_CODE.
+
+	* src/common.c (_GD_FindEntry): Added.
+	* src/entry.c (gd_raw_filename gd_entry, gd_entry_type gd_linterp_tablename)
+	src/flush.c (_GD_SyncOrClose) src/spf.c (_GD_GetSPF) src/constant.c
+	(gd_put_carray_slice gd_put_carray) src/putdata.c (gd_putdata64)
+	src/flimits.c (gd_eof64 gd_bof64) src/fpos.c (gd_tell64 gd_seek64):
+	Use _GD_FindEntry instead of _GD_FindFieldAndRepr.
+	* src/constant.c (_GD_PutCarraySlice) src/putdata.c (_GD_DoFieldOut):
+	Remove repr parameter.
+	* src/putdata.c (_GD_DoLinterpOut _GD_DoLincomOut _GD_DoBitOut
+	_GD_DoPhaseOut _GD_DoRecipOut _GD_DoPolynomOut _GD_DoMplexOut
+	_GD_DoConstOut): Return error if input field has a repr.
+
+	* src/parse.c: Use struct parser_state to pass around parser data rather
+	than passing bits and pieces individually.
+	* src/internal.h: Define struct parser_state.
+	* src/parse.c (_GD_SimpleParserInit): Added.
+	* src/open.c (_GD_Open): Initialise the parser proto-state; set or clear
+	GD_PEDANTIC in the dirfile flags after parsing completes.
+
+	* src/mod.c (gd_alter_spec gd_malter_spec) src/parse.c (gd_strtok) src/add.c
+	(_GD_FixName gd_madd_spec gd_add_spec): Call _GD_SimpleParserInit().
+
+	* src/parse.c (_GD_ParseFieldSpec): Speed up strcmps.
+
+	* src/common.c (_GD_GrabDir): Let callers (i.e. _GD_Include) skip
+	canonicalisation, if they've already done it.
+
+	* src/internal.h: Add ns and nsl to gd_fragment_t.
+	* src/name.c (_GD_MungeCode): Remove subfield munging (the P parameter).
+	Replace err_ok with flags parameter.  Don't malloc the buffer it the caller
+	doesn't want it.
+	* src/name.c (_GD_ValidateField): Replaced affix parameter with flags.
+	* src/parse.c (_GD_SubfieldCode _GD_CodeFromFrag _GD_InputCode _GD_SetField):
+	Added.
 
-	* src/native.c (_GD_NativeType): Don't always return GD_FLOAT64 for LINCOMs.
-	(r867)
+	* src/name.c (_GD_MungeCode _GD_CheckCodeAffixes _GD_ValidateField)
+	src/include.c (_GD_SetFieldAffixes _GD_Include): Handle
+	namespaces.
+	* src/parse.c (_GD_ParseNamespace): Added.
+	* src/parse.c (_GD_ParseDirective): Handle "/NAMESPACE"
+
+	* src/name,c (_GD_MakeNewCode): Handle errors better.
+
+	* src/getdata.h.in: Declare GD_EN_DOTTED.
+	* src/name.c (_GD_PerformRename) src/add.c (_GD_Add): Set or clear
+	GD_EN_DOTTED.
+
+	* src/fragment.c (_GD_SubFragmentList _GD_CheckChangeNamespace
+	gd_fragment_namespace): Added.
+
+2014-10-16     D. V. Wiebe <getdata at ketiltrout.net> svn:929
+	* src/open.c (_GD_CreateDirfile): Force GD_RDWR when creating a dirfile.
+	* test/creat_rdonly.c: Updated.
+	* test/creat_rdonly_exists.c: Added.
+
+2014-10-16     D. V. Wiebe <getdata at ketiltrout.net> svn:928
+	* bindings/make_parameters.c: Replace numeric type literals with CPP macros
+	for legibility.
+
+	* man/gd_getdata.3: Explain I/O pointers more.
+
+	* src/getdata.h.in: Merge GD_E_OPEN, GD_E_TRUNC, GD_E_RAW_IO,
+	GD_E_OPEN_FRAGMENT, most of GD_E_FLUSH and half of GD_E_OPEN_LINFILE into
+	the new GD_E_IO and deprecate.  The remainder of GD_E_OPEN_LINFILE (syntax
+	errors) is now the new GD_E_LUT.
+	* src/common.c (_GD_ReadLinterpFile): Consolidate error handling code.
+	Handle syntax errors better.
+	* src/flush.c (_GD_FieldSpec): Raise GD_E_LINE_TOO_LONG for line overflows.
+	* src/errors.c (_GD_SetError2 _GD_SetError gd_error_string): Track stdlib
+	errno separately and implicitly.
+
+	* bindings/python/pygetdata.c: Define deprecated Exceptions as aliases for
+	current ones.
+
+2014-07-30     D. V. Wiebe <getdata at ketiltrout.net> svn:921
+	* src/del.c (gd_delete_alias): Deleted.
+	* src/del.c (gd_delete): Don't dereference the field code.
+
+	* bindings/f77/fgetdata.c (GDDELA) bindings/f77/getdata.f90.in
+	(fgd_delete_alias) bindings/cxx/dirfile.cpp (Dirfile::DeleteAlias)
+	bindings/php/getdata.c (gd_delete_alias) bindings/python/pydirfile.c
+	(gdpy_dirfile_deletealias): Deleted.
+	* bindings/matlab/gd_delete_alias.c: Deleted.
+	* bindings/perl/simple_funcs.xsin: Deleted delete_alias.
+	* bindings/idl/getdata.c (gdidl_delete): Removed the /ALIAS keyword.
 
-	* src/putdata.c (_GD_MplexOutData): Fix computation of complex data. (r867)
+	* bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+	bindings/matlab/test/big_test.m bindings/perl/t/big_test.t
+	bindings/php/test/big_test.php bindings/python/test/big_test.py: Deleted
+	test 225.
 
-	* src/open.c (_GD_CreateDirfile _GD_Open): Close descriptors on error.
-	(r877)
 
-	* src/types.c (_GD_ConvertType): Add missing break. (r877)
+2014-07-25     D. V. Wiebe <getdata at ketiltrout.net> svn:915
+	* Makefile.am: Auotmake version bumped to 1.13.
+	* configure.ac: Autoconf version bumped to 2.65.
+
+2014-07-25     D. V. Wiebe <getdata at ketiltrout.net> svn:914
+	* src/parse.c (_GD_TokToNum): Added.
+	* src/parse.c (_GD_SetScalar): Call _GD_TokToNum to parse numbers.
+
+	* src/errors.c: Add GD_E_CODE_AMBIGUOUS suberror.
+	* src/flush.c (_GD_WriteFieldCode): Append "<0>" when necessary to avoid
+	otherwise ambiguous scalar field codes.  Replaced "space" with "flags"
+	parameter.  Add "index" parameter.
+	* src/add.c (_GD_CopyScalars) src/mod.c (_GD_AlterScalar): Reject ambiguous
+	field codes when the format file writer won't be able to deal with them.
+
+	* src/internal.h: Alias GD_PERMISSIVE to GD_NOSTANDARD for legibility.
+	
+	* src/common.c (_GD_GetRepr): Add .z (we'll want that later).
+
+	* src/parse.c (_GD_ConstType): Handle GD_STRING.
+
+	* src/parse.c (_GD_ParseRaw): Don't set GD_E_FORMAT more than once.
+
+	* src/parse.c (_GD_SetScalar): Check for the closing > with CARRAY indices.
+
+	* test/add_amb_code7.c test/alter_entry_scalar_amb.c test/flush_amb_code.c
+	test/parse_scalar1.c test/parse_scalar2.c test/parse_scalar_repr.c: Added.
+
+2014-07-17     D. V. Wiebe <getdata at ketiltrout.net> svn:912
+	* bindings/f77/fgetdata.c (_GDF_SetDirfile): Don't abort on error, just
+	return -1 (optionally discarding the dirfile first).
+
+	* bindings/f77/fgetdata.c (_GDF_Callback GDCOPN): Handle running out of
+		DUNs.
+
+2014-07-17     D. V. Wiebe <getdata at ketiltrout.net> svn:911
+	* src/getdata.c (_GD_DoSindir): Renamed from gd_getstrdata64 and
+	internalised.  Do return_type checks, and handle num_samp = 0.
+	* src/getdata.c (gd_getstrdata): Deleted.
+	* src/getdata.h.in: Add GD_STRING.
+
+	* src/native.c (_GD_NativeType): Return GD_STRING for string types.
+
+	* bindings/make_parameters.c: Add GD_STRING.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::GetData) bindings/f77/fgetdata.c
+	(GDGSTD GDGSTP) bindings/idl/getdata.c (gdidl_getdata)
+	bindings/perl/GetData.xs (getdata) bindings/python/pydirfile.c
+	(gdpy_dirfile_getdata): Convert gd_getstrdata call to gd_getdata.
+	* bindings/matlab/gd_getdata.c: Handle SINDIR.
+	* bindings/matlab/gd_getstrdata.c: Deleted.
+	* bindings/php/getdata.c (gd_getdata): Handle SINDIR; made return_type
+	optional.
+	* bindings/php/getdata.c (gd_getstrdata): Deleted.
+
+	* test/get_none.c: Added.
+	* test/get_sindir.c: Replaced by renaming getstr_sindir.c.
+	* test/get_sindir_none.c test/get_sindir_null.c: Added.
+	* test/get_sindir_type.c: Replaced.
+	* test/getstr_here.c test: Deleted.
+
+	* configure.ac: Renamed the intermediate getdata.h file from getdata.ah to
+	getdata.in2.
+
+2014-07-16     D. V. Wiebe <getdata at ketiltrout.net> svn:908
+	* bindings/cxx/dirfile.cpp (GetData::EncodingSupport Dirfile::ArrayLen
+	Dirfile::GetData(..., const char** data_out) Dirfile::GetSarray
+	Dirfile::Sarrays Dirfile::MSarrays Dirfile::PutSarray): Added.
+	* bindings/cxx/getdata/sindirentry.h bindings/cxx/getdata/indirentry.h
+	bindings/cxx/getdata/sarrayentry.h bindings/cxx/indirentry.cpp
+	bindings/cxx/sarrayentry.cpp bindings/cxx/sindirentry.cpp
+
+	* bindings/cxx/indexentry.cpp: Deleted.
+
+	* bindings/f77/fgetdata.c (_GDF_GetEntryYoke GDGEID GDGESD GDGESA GDADID
+	GDADSD GDMDID GDMDSD GDADSA GDMDSA GDALID GDALSD GDENCS GDSARX GDMSAX GDARLN
+	GDGTSA GDPTSA GDALSA GDGSTD GDGSTP GDXSTP GDDSTP): Added.
+	* bindings/f77/getdata.f90.in (fgd_array_len fgd_encoding_support
+	fgd_sarray_value_max fgd_msarray_value_max fgd_get_sarray
+	fgd_get_sarray_slice fgd_put_sarray fgd_put_sarray_slice fgd_add_sarray
+	fgd_madd_sarray fgd_alter_sarray fgd_add_indir fgd_add_sindir fgd_madd_indir
+	fgd_madd_sindir fgd_alter_indir fgd_alter_sindir fgd_getstrdata): Added.
+
+	* bindings/idl/getdata.c (gdidl_add_yoke_ gdidl_alter_yoke_
+	gdidl_encoding_support gdidl_add_sarray gdidl_get_sarray gdidl_alter_sarray
+	gdidl_put_sarray gdidl_add_indir gdidl_alter_indir gdidl_add_sindir
+	gdidl_alter_sindir): Added.
+	* bindings/idl/getdata.c (gdidl_array_len): Renamed from gdidl_carray_len.
+	* bindings/idl/getdata.c (gdidl_getdata): Support gd_getstrdata, too.
+
+	* bindings/matlab/gd_add_indir.m bindings/matlab/gd_add_sarray.c
+	bindings/matlab/gd_add_sindir.m bindings/matlab/gd_alter_indir.m
+	bindings/matlab/gd_alter_sarray.m bindings/matlab/gd_alter_sindir.m
+	bindings/matlab/gd_carray_len.m bindings/matlab/gd_encoding_support.c
+	bindings/matlab/gd_get_sarray.c bindings/matlab/gd_get_sarray_slice.c
+	bindings/matlab/gd_getstrdata.c bindings/matlab/gd_madd_indir.m
+	bindings/matlab/gd_madd_sarray.c bindings/matlab/gd_madd_sindir.m
+	bindings/matlab/gd_msarrays.c bindings/matlab/gd_put_sarray.m
+	bindings/matlab/gd_put_sarray_slice.c bindings/matlab/gd_sarrays.c: Added.
+	* bindings/matlab/gd_array_len.c: Renamed from gd_carray_len.c.
+	* bindings/matlab/matlab.c (gdmx_from_sarrays gdmx_to_sdata
+	gdmx_free_sdata): Added.
+
+	* bindings/perl/GetData.xs (gdp_convert_const_avpv gdp_convert_strarr
+	gdp_newRVavpv0 array_len get_sarray get_sarray_slice sarrays put_sarray
+	put_sarray_slice add_sarray madd_sarray msarrays): Added.
+	* bindings/perl/simple_funcs.xsin (array_len alter_sarray add_indir
+	add_sindir alter_indir alter_sindir madd_indir madd_sindir): Added.
+
+	* bindings/php/getdata.c (gdphp_convert_sarray gdphp_convert_nsarray
+	gd_add_sarray gd_add_indir gd_add_sindir gd_alter_sarray gd_alter_indir
+	gd_alter_sindir gd_array_len gd_sarrays gd_get_sarray gd_getstrdata
+	gd_madd_sarray gd_madd_indir gd_madd_sindir gd_msarrays gd_put_sarray
+	gd_encoding_support): Added.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getsarray gdpy_dirfile_arraylen
+	gdpy_dirfile_sarrays gdpy_dirfile_msarrays gdpy_dirfile_putsarray): Added.
+	* bindings/python/pyentry.c: Handle SARRAY, INDIR, SINDIR
+	* bindings/python/pygetdata.c (gdpy_encoding_support): Added.
+
+	* bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+	bindings/matlab/test/big_test.m bindings/perl/t/big_test.t
+	bindings/php/test/big_test.php bindings/python/test/big_test.py: Added tests
+	271 through 298.
+
+	* src/field_list.c (_GD_EntryIndex): Handle SARRAY, INDIR, SINDIR
+
+	* gd_get_sarray_slice (gd_get_sarray_slice): Fix return for GD_INVALID.
+
+2014-05-27     D. V. Wiebe <getdata at ketiltrout.net> svn:907
+	* src/constant.c (gd_array_len): Added.
+	* src/constant.c (gd_carray_len): Replaced with a gd_array_len() call and
+	marked deprecated.
+	* src/string.c (gd_sarray_len): Deleted.
+	* man/gd_array_len.3: Renamed from man/gd_carray_len.3
+
+2014-05-23     D. V. Wiebe <getdata at ketiltrout.net> svn:906
+	* src/field_list.c (gd_sarrays gd_msarrays): Added.
+	* src/close.c (_GD_FreeD) src/entry.c (_GD_FreeE): Free sarray_value_list.
+	* test/svlist_array.c test/svlist_array_meta.c: Added.
+
+	* src/field_list.c (gd_mstrings): Don't use realloc to skip the unnecessary 
+	potential memcpy.
+
+	* src/include.c (_GD_SetFieldAffixes) src/open.c (_GD_CreateDirfile)
+	src/zzslim.c (_GD_ZzslimName): Use sprintf instead of convolutions of strcpy
+	and strcat for efficiency's sake.
 
+2014-05-22     D. V. Wiebe <getdata at ketiltrout.net> svn:905
+	* src/slim.c (_GD_SlimOpen _GD_SlimSize): Disable the slimdopen and
+	slimdrawsize stuff to avoid a slimlib bug.
+
+	* src/bzip.c src/lzma.c: Re-order some functions to get modules working
+	again.
+	
+	* src/encoding.c (_GD_InitialiseFramework): Don't try to lock the mutex if
+	it's not needed.
+
+2014-05-19     D. V. Wiebe <getdata at ketiltrout.net> svn:904
+	* src/lzma.c: Rewritten with better understanding of liblzma.  Includes
+	write support.
+	* src/encoding.c: LZMA write support.
+	* test/lzma_xz_get_get.c test/lzma_xz_get_get2.c test/lzma_xz_put.c
+	test/lzma_xz_get_put.c test/lzma_xz_add.c test/lzma_xz_sync.c
+	test/lzma_xz_move_to.c test/lzma_put.c test/lzma_xz_get_far.c
+	test/lzma_xz_put_pad.c test/lzma_xz_put_endian.c test/lzma_xz_put_back.c
+	test/lzma_xz_put_get.c: Added.
+	* test/lzma_xz_get.c test/lzma_xz_nframes.c: Renamed from
+	xz_{get|nframes}.c.
+	* test/encode_support.c: Update for LZMA writes.
+
+	* src/bzip.c: Remove unnecessary .write member.
+
+2014-05-10     D. V. Wiebe <getdata at ketiltrout.net> svn:903
+	* src/slim.c (_GD_SlimOpen _GD_SlimSize): Use slimdopen and slimdrawsize if
+	available to reduce race conditions.
+
+2014-05-06     D. V. Wiebe <getdata at ketiltrout.net> svn:901
+	* src/encoding.c: Add bzip2 OOP write support.
+	* src/bzip.c (_GD_Bzip2DoOpen _GD_Bzip2Open _GD_Bzip2Seek _GD_Bzip2Close
+	_GD_Bzip2Read): Handle writes.  Properly clean up on error.  Track file->pos.
+	* src/bzip.c (_GD_Bzip2Write _GD_Bzip2Sync): Added.
+	* test/bzip_add.c test/bzip_put_back.c test/bzip_move_to.c
+	test/bzip_get_far.c test/bzip_put_pad.c test/bzip_put_sub.c
+	test/bzip_get_get2.c test/bzip_put_get.c test/bzip_put_endian.c
+	test/bzip_sync.c test/bzip_get_put.c: Added.
+	* test/bzip_put.c: Replaced with a working test.
+
+	* src/fpos.c (_GD_WriteSeek): Fix offset in the seek call.
+	* src/gzip.c (_GD_GzipSeek): Handle seeks past the EOF while reading.
+	* test/gzip_get_far.c test/gzip_put_pad.c: Added.
+
+	* test/test.h: Remove unnecessary include statements.
+
+	* src/encoding.c (_GD_MoveOver): Don't attempt to change mode if not needed.
+
+	* bindings/matlab/matlab.c (gdmx_from_string_list): Use mxFree.
+
+	* bindings/perl/GetData.xs (gdp_get_type): Fix undef check.
+
+2014-05-05     D. V. Wiebe <getdata at ketiltrout.net> svn:896
+	* src/encoding.c (gd_encoding_support): Call _GD_InitialiseFramework().
+
+2014-05-05     D. V. Wiebe <getdata at ketiltrout.net> svn:895
+	* src/getdata.h.in: Remove GD_MAX_CARRAY_LENGTH.
+	* src/add.c (_GD_Add) src/mod.c (_GD_Change) src/parse.c (_GD_ParseArray):
+	Remove references to GD_MAX_CARRAY_LENGTH.
+
+	* src/add.c (gd_add_raw gd_add_lincom gd_add_clincom gd_add_linterp
+	gd_add_bit gd_add_sbit _GD_AddYoke gd_add_recip gd_add_crecip89
+	gd_add_polynom gd_add_cpolynom gd_add_phase gd_add_window gd_add_mplex
+	gd_madd_lincom gd_madd_clincom gd_madd_linterp gd_madd_bit gd_madd_sbit
+	_GD_MAddYoke gd_madd_phase gd_madd_polynom gd_madd_cpolynom gd_madd_recip
+	gd_madd_crecip89 gd_madd_window gd_madd_mplex): Call _GD_Add in a slightly
+	less ridiculous way.
+
+	* src/encoding.c (gd_encoding_support): Added.
+	* man/gd_encoding_support.3 test/encode_support.c: Added.
+
+2014-04-30   D. V. Wiebe <getdata at ketiltrout.net> svn:890 svn:891
+	* bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+	bindings/python/test/big_test.py: Fix test 157 for DSV 10.
+	* src/constant.c (gd_get_constant) src/string.c (gd_get_string): Fix call in
+	the case of using a [CS]ARRAY after breaking it.
+	* test/get_const_carray.c: Added.
+
+2014-04-30   D. V. Wiebe <getdata at ketiltrout.net> svn:889
+	* test/parse_indir.c test/get_sindir.c test/alter_entry_sarray.c
+	test/add_sindir.c test/getstr_sindir.c test/name_updb_sarray.c
+	test/add_indir.c test/get_indir.c test/getstr_here.c test/alter_sindir.c
+	test/parse_sindir.c test/alter_indir.c test/getstr_type.c
+	test/name_updb_carray.c test/madd_sindir.c test/put_indir.c
+	test/put_sindir.c test/madd_indir.c test/add_sarray_nil.c: Added.
+	* test/name_updb.c test/native_const.c: Update.
+
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate)
+	src/legacy.c (GetFormat) src/getdata.c (_GD_DoField gd_getdata64) src/name.c
+	(_GD_UpdateInputs) src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion)
+	src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF) src/putdata.c
+	(_GD_DoFieldOut) src/del.c (_GD_ClearDerived _GD_DeReference _GD_Delete) 
+	src/flimits.c (_GD_GetEOF _GD_GetBOF) src/fpos.c (_GD_GetFilePos _GD_Seek)
+	src/parse.c (_GD_ParseFieldSpec) src/mod.c (_GD_Change) src/add.c
+	(_GD_InvalidEntype _GD_Add): Handle INDIR and SINDIR.
+	* src/getdata.c (_GD_IndirData _GD_DoIndir gd_getstrdata64 gd_getdata64)
+	src/parse.c (_GD_ParseYoke) src/mod.c (_GD_AlterYoke gd_alter_indir
+	gd_alter_sindir) src/add.c (_GD_AddYoke gd_add_indir gd_add_sindir
+	_GD_MAddYoke gd_madd_indir gd_madd_sindir): Added.
+	* src/common.c (_GD_BadInput): Add entry type parameter and allow non-vector
+	input fields.
+
+	* src/parse.c (_GD_ParseDivide _GD_ParseMultiply): Deleted (merged into
+	_GD_ParseYoke).
+	* src/mod.c (gd_alter_divide gd_alter_multiply): Call _GD_AlterYoke.
+	* src/add.c (gd_add_multiply gd_add_divide): Call _GD_AddYoke.
+	* src/add.c (gd_madd_multiply gd_madd_divide): Call _GD_MAddYoke.
+
+	* src/errors.c: Add GD_E_FIELD_FORMAT and GD_E_FIELD_STR.
+
+	* src/native.c (_GD_NativeType): Return internal type for CONST/CARRAY not
+	storage type (ie. run it through _GD_ConstType).
+
+	* src/string.c (gd_get_sarray_slice gd_get_sarray) src/mod.c (_GD_Change)
+	src/add.c (_GD_Add): Nilify new SARRAYs on creation, not on read.
+
+	* src/getdata.h.in: Bump GD_DIRFILE_STANDARDS_VERSION.  Add GD_INDIR_ENTRY
+	and GD_SINDIR_ENTRY.
+
+2014-04-27   D. V. Wiebe <getdata at ketiltrout.net> svn:887
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate)
+	src/legacy.c (GetFormat) src/getdata.c (_GD_DoField) src/name.c
+	(_GD_UpdateInputs) src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion)
+	src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF) src/putdata.c
+	(_GD_DoFieldOut) src/del.c (_GD_DeReference) src/flimits.c (_GD_GetEOF
+	_GD_GetBOF) src/fpos.c (_GD_GetFilePos _GD_Seek) src/mod.c (_GD_Change)
+	src/add.c (_GD_InvalidEntype _GD_Add): Handle GD_SARRAY_ENTRY.
+	* src/string.c (gd_get_sarray_slice gd_get_sarray gd_sarray_len
+	gd_put_sarray_slice gd_put_sarray) src/mod.c (gd_alter_sarray) src/add.c
+	(gd_add_sarraygd_madd_sarray): Added.
+	* src/string.c (_GD_PutSarraySlice): Renamed from _GD_DoStringOut and
+	updated to handle SARRAYs.  Made static.
+	* src/parse.c (_GD_ParseArray): Renamed from _GD_ParseCarray and updated to
+	handle SARRAYs.
+
+	* test/get_sarray.c test/add_sarray.c test/get_sarray_len.c
+	test/get_string.c test/get_sarray_slice.c test/alter_sarray.c
+	test/parse_sarray.c test/madd_sarray.c test/put_sarray.c
+	test/put_sarray_slice.c test/parse_sarray_long.c: Added.
+
+	* src/add.c (gd_add_string gd_madd_string): Don't call _GD_DoStringOut to
+	set the value, just set it directly.
+
+	* src/compat.c: Define AT_SYMLINK_NOFOLLOW if necessary.
+
+	* src/mod.c (_GD_Change): Report AlterScalar errors for LINCOMs.
+
+	* src/errors.c: Add GD_E_FLUSH_WRITE and GD_E_FLUSH_TOO_LONG.
+	* src/flush.c (_GD_StringEscapeise): Return -1 on error; don't write
+	anything if stream == NULL.
+	* src/flush.c (_GD_StringEscapeise _GD_WriteFieldCode _GD_WriteConst
+	_GD_FieldSpec _GD_FlushFragment): Report write errors.
+	
+	* src/flush.c (_GD_WriteFieldCode): Write a trailing space if requested.
+
+	* src/flush.c (_GD_FlushFragment): Try USER if LOGNAME not available.
+
+	* src/constant.c (gd_get_carray_slice _GD_PutCarraySlice
+	gd_put_carray_slice): Make first long.
+
+2014-04-03   D. V. Wiebe <getdata at ketiltrout.net> svn:883
+	* src/add.c (gd_add_crecip gd_madd_crecip) src/mod.c (gd_alter_crecip): Call
+	the ...crecip89 function.
+
+	* src/getdata.h.in: Fix GD_MAX_CARRAY_LENGTH computation.
+
+2014-03-20   D. V. Wiebe <getdata at ketiltrout.net> svn:882
+	* bindings/php/getdata.c (gd_add_polynom gd_madd_polynom): Fix array size.
+	* bindings/python/pydirfile.c (gdpy_dirfile_getentry): Fix segfault.
+	* test/zzslim_get.c: Fix.
+
+2014-03-10   D. V. Wiebe <getdata at ketiltrout.net> svn:880
+	* bindings/matlab/gd_move_alias.c: Deleted.
+	* bindings/matlab/test/big_test/m: Delete test 224.
+
+2014-02-14   D. V. Wiebe <getdata at ketiltrout.net> svn:877
+	* bindings/cxx/entry.cpp (Entry::Entry): Zero E if gd_entry call fails.
+	
+	* bindings/cxx/fragment.cpp (Fragment::Fragment): Handle error in
+	gd_fragment_affixes call.
+
+	* bindings/f77/fgetdata.c (GDASCA): Handle error in gd_entry call.
+
+	* bindings/php/getdata.c (gdphp_data_to_array) src/types.c (_GD_ConvertType):
+	Add missing break.
+
+	* bindings/php/getdata.c (gd_error_string): Handle error in gd_error_string
+	call.
+
+	* bindings/python/pygetdata.h (PYGD_REPORT_ERROR): Added.
+	
 	* bindings/python/pydirfile.c (gdpy_dirfile_getentry gdpy_dirfile_getstring
 	gdpy_dirfile_putcarray gdpy_dirfile_putdata) src/include.c (_GD_Include)
-	src/putdata.c (_GD_DoMplexOut): Deallocate buffers on error. (r877)
+	src/name.c (_GD_PrepareRename) src/putdata.c (_GD_DoMplexOut) src/sie.c
+	(_GD_SampIndWrite): Deallocate buffers on error.
 
-	* src/parse.c (_GD_ParseCarray): Return on error. (r877)
+	* bindings/python/pyentry.c (gdpy_entry_seta): Set a[i] if the pyobj is
+	complex.
 
-	* src/parse.c (_GD_ParseFieldSpec): Only resize the dot_list when necessary.
-	Also, clean up if the resize doesn't work. (r877)
+	* src/bzip.c (_GD_Bzip2Size): Free ptr only after we're done with it.
+
+	* src/common.c (_GD_CanonicalPath): Don't let readlink overrun the buffer.
+	Also fix double free.
+
+	* src/entry.c (_GD_FreeE): Fix overrun on zeroing of in_fields.
+
+	* src/entry.c (gd_linterp_tablename): Don't use field_code after free.
 
 	* src/getdata.h.in: Remove __nonnull__ from parameter two of
-	gd_verbose_prefix. (r877)
+	gd_verbose_prefix.
 
-	* src/common.c (_GD_CanonicalPath): Don't let readlink overrun the buffer.
-	Also fix double free. (r877)
-	
-	* bindings/python/pygetdata.h (PYGD_REPORT_ERROR): Added. (r877)
+	* src/gzip.c (_GD_GzipOpen): Check that _GD_MakeTempFile() worked.
 
-	* bindings/python/pyentry.c (gdpy_entry_seta): Set a[i] if the pyobj is
-	complex. (r877)
+	* src/open.c (_GD_CreateDirfile _GD_Open): Close descriptors on error.
 
-	* bindings/cxx/entry.cpp (Entry::Entry): Zero E if gd_entry call fails.
-	(r877)
+	* src/parse.c (_GD_ParseCarray): Return on error.
 
-	* bindings/cxx/fragment.cpp (Fragment::Fragment): Handle error in
-	gd_fragment_affixes call. (r877)
+	* src/parse.c (_GD_ParseFieldSpec): Only resize the dot_list when necessary.
+		Also, clean up if the resize doesn't work.
+
+	* util/dirfile2ascii.c (main): Fix check for too many fields.
+
+	* src/entry.c (gd_naliases): Return unsigned int and zero on error per
+	documentation.
+	* bindings/idl/getdata.c (gdidl_naliases) src/entry.c (gd_aliases)
+	test/add_alias.c test/add_alias_affix.c test/add_alias_meta.c
+	test/add_resolv.c test/add_spec_resolv.c test/alias_num.c
+	test/alias_num_alias.c test/alias_num_missing.c test/madd_alias.c
+	test/madd_alias_affix.c test/madd_spec_resolv.c: Handle unsigned gd_naliases.
 
-	* bindings/f77/fgetdata.c (GDASCA): Handle error in gd_entry call. (r877)
+2014-02-13   D. V. Wiebe <getdata at ketiltrout.net> svn:876
+	* bindings/python/pyfragment.c (gdpy_fragment_init): Fix typo in keyword
+	names.
 
-	* util/dirfile2ascii.c (main): Fix check for too many fields. (r877)
+2013-12-17   D. V. Wiebe <getdata at ketiltrout.net> svn:875
+	* src/add.c (_GD_Add) src/fpos.c (_GD_GetFilePos _GD_WriteSeek _GD_Seek)
+	src/getdata.c (_GD_DoRaw) src/mod.c (_GD_Change) src/move.c
+	(_GD_MogrifyFile) src/parse.c (_GD_ParseFieldSpec) src/putdata.c
+	(_GD_InitRawIO): Call _GD_InitRawIO with fragment = -1.
+	* test/add_raw_sub.c test/ascii_get_sub.c test/gzip_put_sub.c test/put_sub.c
+	test/seek_sub.c test/tell_sub.c: Added.
 
-2014-12-06   D. V. Wiebe <getdata at ketiltrout.net> svn:931
-	Backport more bugfixes from trunk:
+	* src/errors.c src/internal.h: Add GD_E_UNCLEAN_CALL suberror.
 
-	* src/getdata.c (_GD_DoConst): Return len instead of 1. (r848)
-	* src/field_list.c (gd_carrays gd_mcarrays): Update _GD_DoField calls to
-	deal with the above. (r848)
-	* test/get_carray_c2r.c: Added. (r848)
+2013-12-12   D. V. Wiebe <getdata at ketiltrout.net> svn:874
+	* src/endian.c (_GD_CheckByteSex): Added.
+	* src/endian.c (_GD_FileSwapBytes): Added (replacing macro in internal.h).
+	* src/endian.c (_GD_FixEndianness): Call _GD_CheckByteSex() to check whether
+	correction is needed.
 
-	* src/add.c (_GD_CopyScalars): Added. (r848)
-	* src/add.c (_GD_Change): Fix scalar copying for GD_POLYNOM_ENTRY.  Don't
-	throw errors for passed members which will be ignored due to scalars (spf,
-	numbits, bitnum). (r848)
-	* test/add_bit_scalars.c test/add_mplex_scalars.c test/add_raw_spf_scalar.c
-	* test/add_polynom_scalar.c: Added. (r848)
+	* src/getdata.c (_GD_DoRaw) src/move.c (_GD_MogrifyFile) src/putdata.c
+	(_GD_DoRawOut): Let _GD_FixEndianness and _GD_CheckByteSex do the endianness
+	logic.
+
+2013-12-12   D. V. Wiebe <getdata at ketiltrout.net> svn:872
+	* configure.ac: Disable PHP bindings if we don't have a C99 compiler.
+
+	* src/common.c (_GD_CInvertData): Correct algebra in C89 INVERT macro.
+	* src/getdata.c (_GD_PolynomData): Implement correct C89 POLYNOMC macro.
+	* src/getdata.c (_GD_CDivideData): Correct algebra in C89 DIVIDEC macro.
+
+	* src/entry.c (_GD_CalculateEntry): Return success or failure separately
+	from Dirfile error.
+
+	* src/internal.h: Fix pointer arithmetic in C89 gd_cap_ macro.
+
+2013-12-10   D. V. Wiebe <getdata at ketiltrout.net> svn:868
+	* src/getdata.h.in src/internal.h: Merge gd_entry_t members 'comp_scal' and
+	'hidden', plus private member 'calculated' into (public) member 'flags', and
+	add GD_EN_CALC, GD_EN_COMPSCAL and GD_EN_HIDDEN flags.
+	* bindings/make_parameters.c: Add entry flags.
+	* bindings/cxx/getdata/entry.h (Entry::Flags) bindings/f77/fgetdata.c
+	(GDENFL): Added.
+	* bindings/f77/fgetdata.c (GDCSCL): Deleted.
+	* bindings/f77/getdata.f90.in: Replaced comp_scal with flags in gd_entry
+	type.
+	* bindings/idl/getdata.c: Replaced COMP_SCAL with FLAGS member in gd_entry
+	struct.
 
-	* src/mod.c (_GD_Change): Fix MPLEX scalar modifying. (r848)
+	* src/mod.c (_GD_Change): Allow hiddenness modification.
+	* test/alter_entry_hidden.c: Update test: hiddenness should change.
 
-2014-12-05   D. V. Wiebe <getdata at ketiltrout.net> svn:930
-	Backport bugfixes from trunk:
+	* test/cvlist_meta0.c: Check error.
 
-	* bindings/cxx/rawentry.cpp (RawEntry::RawEntry): Initialise filename.
-	Patch from S. J. Benton. (r863)
+	* bindings/cxx/getdata/entry.h (Entry::CompScal): Allow non-zero for
+	RECIP, too.
+
+2013-12-06   D. V. Wiebe <getdata at ketiltrout.net> svn:867
+	* test/add_dot.c test/alter_clincom.c test/alter_const_r2c.c test/sie_sync.c
+	test/alter_const_r2r.c test/alter_cpolynom_null.c test/alter_crecip89_null.c
+	test/alter_entry_lincom.c test/alter_entry_recode_recalc.c test/get_divide_s.c
+	test/alter_entry_scalar1.c test/alter_entry_scalar3c.c test/alter_index.c
+	test/alter_spec_polynom.c test/ascii_get_complex.c test/ascii_sync.c
+	test/bof_bit.c test/bof_index.c test/bof_phase_neg.c test/cvlist_array0.c
+	test/cvlist_array_free.c test/cvlist_array_meta0.c test/native_polynom_cmpin.c
+	test/cvlist_array_meta_free.c test/cvlist_meta0.c test/del_alias.c
+	test/del_data_enoent.c test/del_data_open.c test/del_ref.c test/desync_path.c
+	test/encode_alter_all.c test/encode_alter_open.c test/svlist_meta0.c
+	test/encode_recode_open.c test/endian_alter_all.c test/eof_bit.c test/flist2.c
+	test/eof_phase_neg.c test/flist0.c test/flist_meta2.c test/flush_lincom.c
+	test/flush_lincom1.c test/flush_mult.c test/sie_put_back.c test/put_cpolynom.c
+	test/flush_raw_close.c test/flush_string.c test/flush_sync.c test/svlist2.c
+	test/foffs_alter_all.c test/fragment_affix_alter_code.c test/native_recip.c
+	test/fragment_affix_alter_nop.c test/get_cpolynom1.c test/get_cpolynom_int.c
+	test/get_dim.c test/get_divide_ccin.c test/get_divide_crin.c test/native_raw.c
+	test/get_divide_crinr.c test/get_divide_rcin.c test/get_index_complex.c
+	test/get_lincom2s.c test/get_lincom3s.c test/get_lincom_mdt.c test/parse_hex.c
+	test/get_linterp1.c test/get_linterp_abs.c test/get_linterp_complex.c
+	test/get_linterp_empty.c test/get_mplex_complex.c test/get_mplex_s.c
+	test/get_mplex_saved.c test/get_multiply_ccin.c test/get_multiply_crin.c
+	test/get_multiply_crinr.c test/get_multiply_rcin.c test/get_multiply_s.c
+	test/get_neg.c test/get_polynom_cmpin.c test/get_window_complex.c
+	test/get_window_s.c test/get_zero_complex.c test/get_zero_float.c
+	test/gzip_del.c test/gzip_put_back.c test/gzip_sync.c test/index_s.c
+	test/index_subset.c test/legacy_error.c test/legacy_estring.c test/seek_mult.c
+	test/legacy_format.c test/move_affix_meta.c test/move_affix_updb.c
+	test/move_data_foffs_neg.c test/name_dangle.c test/name_dot.c test/name_meta.c
+	test/name_updb_affix.c test/native_bit.c test/native_const.c test/repr_bad.c
+	test/native_index.c test/native_lincom.c test/native_lincom_cmpin.c
+	test/native_lincom_cmpscal.c test/native_linterp.c test/native_linterp_cmp.c
+	test/native_mult.c test/native_mult1.c test/native_mult2.c test/native_phase.c
+	test/native_polynom.c test/native_polynom_cmpscal.c test/native_recip_cmpin.c
+	test/native_recip_cmpscal.c test/native_sbit.c test/native_string.c
+	test/open_cb_rescan_alloc.c test/open_invalid.c test/open_sym_as.c
+	test/open_sym_d.c test/open_sym_l.c test/parse_include_affix_bad.c
+	test/parse_literal_cmpbad.c test/parse_literal_fltcmp.c test/parse_meta_frag.c
+	test/parse_literal_fltcmp0.c test/parse_literal_intcmp.c test/sie_put_append.c
+	test/parse_literal_intcmp0.c test/parse_literal_uintcmp.c test/sie_put_trunc.c
+	test/parse_literal_uintcmp0.c test/parse_octal_zero.c test/protect_alter_all.c
+	test/parse_raw_char_bad.c test/parse_utf8.c test/parse_utf8_invalid.c
+	test/parse_utf8_zero.c test/put_carray_client.c test/put_clincom1.c
+	test/put_crecip.c test/put_mplex_complex.c test/svlist0.c test/seek_index.c
+	test/seek_lincom.c test/seek_phase.c test/sie_put_append2.c test/sie_put_pad.c
+	test/sie_put_trunc2.c test/sie_put_pad0.c test/unclude_open.c: Added.
+
+	* test/encode_recode.c: Renamed.
 
 	* src/add.c (_GD_Add): Set the right suberror (GD_E_ENTRY_POLYORD) for
-	poly_ord out of range. (r867)
+	poly_ord out of range.
+
+	* src/add.c (gd_add_alias) src/field_list.c (_GD_EntryList): Remove
+	duplicate check for invalid dirfile.
+
+	* src/ascii.c (_GD_ScanFormat): Append a newline.
+
+	* src/ascii.c (_GD_AsciiRead): Use ferror instead of feof to check for stdio
+	errors.
+
+	* src/common.c (_GD_ReadLinterpFile): Zero the LUT pointer on error.
+	* src/mod.c (_GD_Change): reset the LUT length to force table re-read.
+	Also, release the LUT directory.
+
+	* src/common.c (_GD_CanonicalPath): Set errno to ELOOP late.
+
+	* src/constant.c (_GD_PutCarraySlice): Added.
+	* src/constant.c (gd_put_carray_slice gd_put_carray): Call
+	_GD_PutCarraySlice.
+
+	* src/del.c (_GD_Delete): Always close an open raw file, even when
+	deleting it.
+
+	* src/encoding.c (_GD_RecodeFragment): Use _GD_FiniRawIO to close raw files.
+	Clear the internal cache of raw filenames.
+
+	* src/entry.c (_GD_GetScalar): Return non-zero on error.  Always call
+	_GD_DoField.
+	* src/entry.c (gd_entry): Return uncalculable entries rather than failing.
 
 	* src/flimits.c (_GD_GetBOF): Also zero *ds if we're before sample zero.
-	(r867)
 
-	* src/flush.c (_GD_Flush): Don't flush the second lincom field if it's not
-	used. (r867)
+	* src/flush.c (_GD_Flush): Validate input fields before trying to flush
+	them.  Don't flush the second lincom field if it's not used.
+
+	* src/flush.c (_GD_StringEscapeise): Remove duplicate check for ".
 
-	* src/fpos.c (_GD_Seek): Fix sign on PHASE shift. (r867)
+	* src/fpos.c (_GD_Seek): Fix sign on PHASE shift.
 
-	* src/fpos.c (gd_seek64): Pass index_pos=-1 to _GD_GetFilePos. (r867)
+	* src/fpos.c (gd_seek64): Pass index_pos=-1 to _GD_GetFilePos.
 
+	* src/getdata.c (_GD_CPolynomData _GD_CMultiplyData _GD_CDivideData):
+	Delete unused code: type is guaranteed to be complex in these calls.
 	* src/getdata.c (_GD_CDivideData): Fix computation of complex division.
-	(r867)
+
+	* src/getdata.c (_GD_DoLinterp): Delete check for uninitialised LUT: the
+	native type check done in DoField has already initialised the LUT.
 
 	* src/index.c (_GD_GetIndex): Fix extrapolations performed when required to
-	search for the EOF. (r867)
+	search for the EOF.
 	* src/index.c (gd_framenum_subset64): Fix conversion of field_end from
-	frames to samples. (r867)
+	frames to samples.
 
-	* src/add.c (_GD_Change): Don't throw an error on mplex.count_val < 0.
-	(r848)
-	* src/errors.c src/internal.h: Remove unused GD_E_ENTRY_CNTVAL. (r848)
-	* test/add_mplex_val.c: Deleted. (r848)
+	* src/legacy.c (GetFormat): Allocate Format.mplexEntries.
 
-	* src/legacy.c (GetFormat): Allocate Format.mplexEntries. (r867)
+	* src/mod.c (_GD_Change): Ensure a RAW entry is calculated before trying to
+	modify the data file.
 
 	* src/mod.c (gd_alter_spec gd_malter_spec): Set move flags for POLYNOM
-	entries to ensure co-efficients are updated. (r867)
+	entries to ensure co-efficients are updated.
+
+	* src/getdata.h.in: Added struct gd_rename_data_.  Added GD_REN_DANGLE,
+	GD_REN_FORCE.
+	* src/move.c (_GD_Move) src/name.c (_GD_Rename): Call _GD_PrepareRename and
+	_GD_PerformRename to handle metadata updates resulting from name changes.
+	* src/move.c (gd_move): Replace move_data with flags argument, which accepts
+	the GD_REN_* flags.
+	* src/name.c (_GD_MatchCode _GD_MakeNewCode _GD_SetNewCode _GD_UpdateInputs
+	_GD_CleanUpRename _GD_PerformRename _GD_PrepareRename): Added.
+	* src/name.c (_GD_InvalidateConst _GD_InvalidateVect): Deleted. (Combined into
+	_GD_UpdateInputs).
+	* src/name.c (_GD_UpdateScalar _GD_UpdateInField): Call _GD_MatchCode
+	_GD_MakeNewCode _GD_SetNewCode for common code.  Return non-zero on failure.
+	Update gd_rename_data_ struct in-place.
+	* src/name.c (_GD_MungeCode): If err_ok is 2, dont' worry at all about
+	errors.
+	* src/name.c (_GD_CheckCodeAffixes): Add set_error argument.  Remember
+	success or failure separately from the DIRFILE error.
+
+	* src/move.c (gd_move_alias): Deleted.
+	* src/move.c (gd_move): Don't delalias the provided field code.
+	* bindings/cxx/dirfile.cpp (Dirfile::MoveAlias) bindings/f77/fgetdata.c
+	(GDMOVA) bindings/f77/getdata.f90.in (fgd_move_alias)
+	bindings/perl/simple_funcs.xsin (move_alias) bindings/php/getdata.c
+	(gd_move_alias) bindings/python/pydirfile.c (gdpy_dirfile_movealias):
+	Deleted.
+	* bindings/idl/getdata.c (gdidl_move gdidl_rename): Remove keyword ALIAS;
+	add keywords DANGLE, FORCE, UPDATEDB.
+	* bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+	bindings/perl/t/big_test.t bindings/php/test/big_test.php
+	bindings/python/test/big_test.py: Delete test 224.
+
+	* src/native.c (_GD_NativeType): Don't always return GD_FLOAT64 for LINCOMs.
+
+	* src/errors.c: Added GD_E_OPEN_IO.
+	* src/open.c (_GD_Open): Throw GD_E_OPEN instead of GD_E_RAW_IO if resolving
+	the supplied path fails.
+
+	* src/parse.c (_GD_SetScalar): Allow literals in semicolon (complex) form in
+	all cases but require a zero imaginary part for non-complex data.
 
 	* src/parse.c (_GD_Tokenise): Fix parsing of \x and \u.  Don't unnecessarily
-	overwrite earlier errors with GD_E_FORMAT_UNTERM. (r867)
+	overwrite earlier errors with GD_E_FORMAT_UNTERM.
 
-	* bindings/idl/getdata.c (gdidl_rename): Fix handling of UPDATEDB. (r867)
+	* src/putdata.c (_GD_MplexOutData): Fix computation of complex data.
 
-	* bindings/cxx/getdata/entry.h (Entry::CompScal): Allow non-zero for
-	RECIP, too. (r868)
+	* src/sie.c: Added l, have_l and bof to struct gd_siedata.  Also, f->d[0]
+	is no longer endianness corrected (ie. f->d is now simply the raw record),
+	which means we use f->s in most places where we used f->d[0] previously.
 
-	* src/common.c (_GD_CInvertData): Correct algebra in C89 INVERT macro.
-	(r872)
-	* src/getdata.c (_GD_PolynomData): Implement correct C89 POLYNOMC macro.
-	(r872)
-	* src/getdata.c (_GD_CDivideData): Correct algebra in C89 DIVIDEC macro.
-	(r872)
+	* src/sie.c (_GD_Advance): remember the previous record in f->l.  Also set
+	f->bof.
 
-	* src/internal.h: Fix pointer arithmetic in C89 gd_cap_ macro. (r872)
+	* src/sie.c (_GD_SampIndSeek): check stdio calls for failure.  Correctly
+	format a padding record when write seeking past the EOF.
 
-	* bindings/python/pyfragment.c (gdpy_fragment_init): Fix typo in keyword
-	names. (r876)
+	* src/sie.c (_GD_SampIndWrite): Correctly deal with appending data,
+	including backing up a record when necessary to check whether we need to
+	combine the start of the new data with that record.  Compose p with the
+	output endianness.
+
+	* bindings/idl/getdata.c (gdidl_rename): Fix handling of UPDATEDB.
+
+	* bindings/php/getdata.c (gd_rewrite_fragment): Initalise zi.
+
+2013-11-15   D. V. Wiebe <getdata at ketiltrout.net> svn:866
+	* test/add_add.c test/close_close.c test/del_del.c test/flush_flush.c
+	test/include_include.c test/index_index.c test/move_move.c test/name_name.c
+	test/nfields_nfields.c test/nframes_nframes.c test/open_open.c
+	test/spf_raw.c: Renamed.
+
+2013-11-13   D. V. Wiebe <getdata at ketiltrout.net> svn:863
+	* bindings/cxx/rawentry.cpp (RawEntry::RawEntry): Initialise filename.
+	Patch from S. J. Benton.
+
+2013-10-26   D. V. Wiebe <getdata at ketiltrout.net> svn:862
+	* src/getdata.h.in: Add GD_GETDATA_VERSION and GD_GETDATA_INT_VERSION
+	* configure.ac cmake/CMakeLists.txt: Calculate GD_GETDATA_VERSION and
+	GD_GETDATA_INT_VERSION.
+
+2013-10-19   D. V. Wiebe <getdata at ketiltrout.net> svn:854
+	* src/add.c (_GD_Add) src/fpos.c (_GD_GetFilePos _GD_WriteSeek _GD_Seek)
+	src/getdata.c (_GD_DoRaw) src/mod.c (_GD_Change) src/move.c
+	(_GD_MogrifyFile) src/parse.c (_GD_ParseFieldSpec) src/putdata.c
+	(_GD_DoRawOut): Compute the swap argument correctly in _GD_InitRawIO calls.
+	* src/encoding.c (_GD_InitRawIO): Merge oop_write and temp file creation
+	code; also, assume that the caller has figured out the swap parameter.
+	* test/gzip_put_endian.c: Added.
+
+2013-10-19   D. V. Wiebe <getdata at ketiltrout.net> svn:852
+	
+	_GD_MakeTempFile patch from Seth:
+
+	* src/encoding.c (_GD_InitRawIO): Let the encoding framework deal with
+	creating temporary files.
+	* src/ascii.c (_GD_AsciiOpen)	src/gzip.c (_GD_GzipOpen) src/raw.c
+	(_GD_RawOpen) src/sie.c (_GD_SampIndDoOpen): Call _GD_MakeTempFile when
+	necessary.
+
+2013-10-19   D. V. Wiebe <getdata at ketiltrout.net> svn:850
+
+	Merge in getdata-distutils branch:
+
+	* m4/python.m4 bindings/python/test/Makefile.am bindings/python/Makefile.am
+	configure.ac: Use distutils to build Python bindings rather than rolling our
+	own.
+	* bindings/python/setup.py.in: Added.
+
+2013-10-18   D. V. Wiebe <getdata at ketiltrout.net> svn:848
+
+	* bindings/f77/fgetdata.c (GDASRW GDASLC GDASCL GDASPN GDASCP GDASPH GDASRC
+	GDASCR GDASWD GDASMX GDLSPH GDLSPN GDLSCP GDLSWD _GDF_AddBitSBit GDASBT
+	GDASSB _GDF_AlterBitSBit GDLSBT GDLSSB GDLSLC GDLSCL GDLSRC GDLSCR GDLSRW):
+	Added.
+	* bindings/f77/getdata.f90.in (fgd_add): Call GDAS.. instead of GDAD.. where
+	possible.
+	* bindings/f77/getdata.f90.in (fgd_alter_entry): Call GDLS.. instead of
+	GDAL.. where possible.
+	* bindings/f77/getdata.f90.in (fgd__set_field_len fgd__set_scalar_len):
+	Added.
+
+	* bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+	bindings/matlab/test/big_test.m bindings/perl/t/big_test.t
+	bindings/python/test/big_test.py: Reorganize, renumber tests.  Add tests
+	243-269 where appropriate.
+
+	* bindings/idl/getdata.c (gdidl_convert_entry_num gdidl_get_entry_num
+	gdidl_get_entry_scalars gdidl_get_in_fields gdidl_get_entry_cmparr): Added.
+	* bindings/idl/getdata.c (gdidl_read_idl_entry): Be less pedantic about
+	numerical types.
+	* bindings/idl/getdata.c (gdidl_make_idl_entry: Initialise both complex and
+	real floating point parameters.
+
+	* bindings/perl/GetData.xs (gdp_fetch_cmp_list gdp_fetch_in_fields
+	gdp_fetch_scalars gdp_to_entry): Be less pedantic about numerical types and
+	array sizes.
+	* bindings/perl/typemap (T_PENTRY): Added.
+
+	* bindings/php m4/php.m4: Added.
+	* bindings/make_parameters.c (PHP): Added.
+
+	* src/mod.c (_GD_Change): Fix MPLEX scalar modifying.
+
+	* src/add.c (_GD_CopyScalars): Added.
+	* src/add.c (_GD_Change): Fix scalar copying for GD_POLYNOM_ENTRY.  Don't
+	throw errors for passed members which will be ignored due to scalars (spf,
+	numbits, bitnum).
+	* test/add_bit_scalars.c test/add_mplex_scalars.c test/add_raw_spf_scalar.c
+	* test/add_polynom_scalar.c: Added.
+
+	* src/add.c (_GD_Change): Don't throw an error on mplex.count_val < 0.
+	* src/errors.c src/internal.h: Remove unused GD_E_ENTRY_CNTVAL.
+	* test/add_mplex_val.c: Deleted.
+	
+	* src/getdata.c (_GD_DoConst): Return len instead of 1.
+	* src/field_list.c (gd_carrays gd_mcarrays): Update _GD_DoField calls to
+	deal with the above.
+	* test/get_carray_c2r.c: Added.
+
+	* src/entry.c (_GD_FreeE): When priv == 0, zero free'd pointers.
 
-	* Makefile.am: Auotmake version bumped to 1.13. (r915)
-	* configure.ac: Autoconf version bumped to 2.65. (r915)
+	* bindings/perl/t/big_test.t: Added test 181.
 
 2013-09-05   D. V. Wiebe <getdata at ketiltrout.net> svn:845
 	GetData-0.8.5 released.
@@ -3046,7 +4041,7 @@
 
 	* util/dirfile2ascii.c util/checkdirfile.c: Update for new function names.
 
-	* util/checkdirifle.c: Report standards version compliance.
+	* util/checkdirfile.c: Report standards version compliance.
 
 	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
 	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
diff --git a/Makefile.am b/Makefile.am
index 02365e7..c80d666 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2011, 2014 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -18,7 +18,7 @@
 # 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.13
+AUTOMAKE_OPTIONS = foreign dist-xz check-news 1.13
 
 EXTRA_DIST = ChangeLog
 
@@ -35,18 +35,20 @@ clean-local:
 	rm -rf *~  m4/*~ README.txt $(distdir) idl_$(distdir) matlab_$(distdir)
 
 %.sig: %
-	gpg --use-agent -abo $@ $<
+	gpg -abo $@ $<
 
-DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" \
+DISTCHECK_CONFIGURE_FLAGS = --enable-legacy-api --enable-modules \
+														--with-idl-dlm-dir="$$dc_install_base/idl" \
 														--with-perl-dir="$$dc_install_base/perl" \
+														--with-php-dir="$$dc_install_base/php" \
 														--with-python-module-dir="$$dc_install_base/python"
 
 # a locally-installed library for building and testing the IDL and matlab packages
-$(distdir)/_inst/lib/pkgconfig:
+$(distdir)/_inst/lib/pkgconfig: $(distdir).tar.gz
 	tar -zxvf $(distdir).tar.gz
 	cd $(distdir) && \
-		mkdir _inst && \
-		./configure --disable-bindings --prefix=`pwd`/_inst && \
+	mkdir _inst && \
+	./configure --enable-legacy-api --disable-bindings --prefix=`pwd`/_inst && \
 		${MAKE} && \
 		${MAKE} install
 
@@ -81,11 +83,10 @@ matlabdist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
 		) )
 	rm -rf svn_export
 
-matlab_$(distdir).tar.gz:
-	${MAKE} matlabdist
-
 matlabdistcheck: matlab_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig
-	if [ -e matlab_$(distdir) ]; then chmod -R u+w matlab_$(distdir); rm -rf matlab_$(distdir); fi
+	if [ -e matlab_$(distdir) ]; then \
+		chmod -R u+w matlab_$(distdir); rm -rf matlab_$(distdir); \
+	fi
 	tar -zxvf $<
 	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
 	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
@@ -116,17 +117,16 @@ idldist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
 		autoheader && \
 		automake --add-missing --force-missing && \
 		./configure && \
-		make dist && \
+		${MAKE} dist && \
 		cp idl_${distdir}* ../.. \
 		) )
 	rm -rf svn_export
 
-idl_$(distdir).tar.gz:
-	${MAKE} idldist
-
 idldistcheck: idl_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig
-	if [ -e idl_$(distdir) ]; then chmod -R u+w idl_$(distdir); rm -rf idl_$(distdir); fi
-	tar -zxvf idl_$(distdir).tar.gz
+	if [ -e idl_$(distdir) ]; then \
+		chmod -R u+w idl_$(distdir); rm -rf idl_$(distdir); \
+	fi
+	tar -zxvf $<
 	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
 	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
 	cd idl_$(distdir) && ./configure && make dist && make distcheck
@@ -158,10 +158,18 @@ windist: $(DISTFILES)
 	)
 	rm -rf crlf_export
 
+# coverity scan target
+cov-scan:
+	rm -rf cov-int
+	make clean
+	./config.status --recheck
+	cov-build --dir cov-int make
+	tar -zcvf getdata-cov-int-${PACKAGE_VERSION}.tgz cov-int/
+
 # package lists
-PACKAGES=$(distdir).tar.gz $(distdir).tar.bz2 idl_$(distdir).tar.gz \
-				 idl_$(distdir).tar.bz2 getdata_win-$(PACKAGE_VERSION).zip \
-				 matlab_$(distdir).tar.gz matlab_$(distdir).tar.bz2
+PACKAGES=$(distdir).tar.gz $(distdir).tar.xz idl_$(distdir).tar.gz \
+				 idl_$(distdir).tar.xz getdata_win-$(PACKAGE_VERSION).zip \
+				 matlab_$(distdir).tar.gz matlab_$(distdir).tar.xz
 SIGS=$(addsuffix .sig,$(PACKAGES))
 
 # release stuff
@@ -173,4 +181,4 @@ dist-post: $(SIGS)
 
 dist-push: $(PACKAGES) $(SIGS) README.txt
 	@if [ -z "${SFUSER}" ]; then echo "ERROR: SFUSER unset"; false; fi
-	rsync -avP -e ssh $^ $(SFUSER)@frs.sourceforge.net:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/
+	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
index 24d821a..ae57dd8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -88,10 +88,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -223,9 +221,9 @@ am__relativize = \
     dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
   done; \
   reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
 GZIP_ENV = --best
-DIST_TARGETS = dist-bzip2 dist-gzip
+DIST_TARGETS = dist-xz dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -256,6 +254,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -281,8 +281,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -330,7 +341,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -345,12 +355,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -414,9 +428,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -424,6 +439,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -437,7 +453,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008, 2011, 2014 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -457,20 +473,22 @@ top_srcdir = @top_srcdir@
 # 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.13
+AUTOMAKE_OPTIONS = foreign dist-xz check-news 1.13
 EXTRA_DIST = ChangeLog
 ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = src . test bindings util man doc
 dist_doc_DATA = COPYING.DOC
-DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" \
+DISTCHECK_CONFIGURE_FLAGS = --enable-legacy-api --enable-modules \
+														--with-idl-dlm-dir="$$dc_install_base/idl" \
 														--with-perl-dir="$$dc_install_base/perl" \
+														--with-php-dir="$$dc_install_base/php" \
 														--with-python-module-dir="$$dc_install_base/python"
 
 
 # package lists
-PACKAGES = $(distdir).tar.gz $(distdir).tar.bz2 idl_$(distdir).tar.gz \
-				 idl_$(distdir).tar.bz2 getdata_win-$(PACKAGE_VERSION).zip \
-				 matlab_$(distdir).tar.gz matlab_$(distdir).tar.bz2
+PACKAGES = $(distdir).tar.gz $(distdir).tar.xz idl_$(distdir).tar.gz \
+				 idl_$(distdir).tar.xz getdata_win-$(PACKAGE_VERSION).zip \
+				 matlab_$(distdir).tar.gz matlab_$(distdir).tar.xz
 
 SIGS = $(addsuffix .sig,$(PACKAGES))
 all: all-recursive
@@ -720,6 +738,7 @@ distdir: $(DISTFILES)
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
+
 dist-bzip2: distdir
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
 	$(am__post_remove_distdir)
@@ -727,7 +746,6 @@ dist-bzip2: distdir
 dist-lzip: distdir
 	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
 	$(am__post_remove_distdir)
-
 dist-xz: distdir
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
 	$(am__post_remove_distdir)
@@ -976,14 +994,14 @@ clean-local:
 	rm -rf *~  m4/*~ README.txt $(distdir) idl_$(distdir) matlab_$(distdir)
 
 %.sig: %
-	gpg --use-agent -abo $@ $<
+	gpg -abo $@ $<
 
 # a locally-installed library for building and testing the IDL and matlab packages
-$(distdir)/_inst/lib/pkgconfig:
+$(distdir)/_inst/lib/pkgconfig: $(distdir).tar.gz
 	tar -zxvf $(distdir).tar.gz
 	cd $(distdir) && \
-		mkdir _inst && \
-		./configure --disable-bindings --prefix=`pwd`/_inst && \
+	mkdir _inst && \
+	./configure --enable-legacy-api --disable-bindings --prefix=`pwd`/_inst && \
 		${MAKE} && \
 		${MAKE} install
 
@@ -1018,11 +1036,10 @@ matlabdist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
 		) )
 	rm -rf svn_export
 
-matlab_$(distdir).tar.gz:
-	${MAKE} matlabdist
-
 matlabdistcheck: matlab_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig
-	if [ -e matlab_$(distdir) ]; then chmod -R u+w matlab_$(distdir); rm -rf matlab_$(distdir); fi
+	if [ -e matlab_$(distdir) ]; then \
+		chmod -R u+w matlab_$(distdir); rm -rf matlab_$(distdir); \
+	fi
 	tar -zxvf $<
 	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
 	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
@@ -1053,17 +1070,16 @@ idldist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
 		autoheader && \
 		automake --add-missing --force-missing && \
 		./configure && \
-		make dist && \
+		${MAKE} dist && \
 		cp idl_${distdir}* ../.. \
 		) )
 	rm -rf svn_export
 
-idl_$(distdir).tar.gz:
-	${MAKE} idldist
-
 idldistcheck: idl_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig
-	if [ -e idl_$(distdir) ]; then chmod -R u+w idl_$(distdir); rm -rf idl_$(distdir); fi
-	tar -zxvf idl_$(distdir).tar.gz
+	if [ -e idl_$(distdir) ]; then \
+		chmod -R u+w idl_$(distdir); rm -rf idl_$(distdir); \
+	fi
+	tar -zxvf $<
 	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
 	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
 	cd idl_$(distdir) && ./configure && make dist && make distcheck
@@ -1095,6 +1111,14 @@ windist: $(DISTFILES)
 	)
 	rm -rf crlf_export
 
+# coverity scan target
+cov-scan:
+	rm -rf cov-int
+	make clean
+	./config.status --recheck
+	cov-build --dir cov-int make
+	tar -zcvf getdata-cov-int-${PACKAGE_VERSION}.tgz cov-int/
+
 # release stuff
 README.txt: NEWS RELEASE_NOTES.in
 	cp -f RELEASE_NOTES.in $@ 
@@ -1104,7 +1128,7 @@ dist-post: $(SIGS)
 
 dist-push: $(PACKAGES) $(SIGS) README.txt
 	@if [ -z "${SFUSER}" ]; then echo "ERROR: SFUSER unset"; false; fi
-	rsync -avP -e ssh $^ $(SFUSER)@frs.sourceforge.net:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/
+	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.
diff --git a/NEWS b/NEWS
index 5c06739..561e936 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,289 @@
+New in verison 0.9.0:
+
+  Library Changes:
+
+  * Literals in format metadata may now have complex form (i.e. include a
+    semicolon) when the parameter is purely real.  However, a non-zero
+    imaginary part is still an error.
+
+  * gd_free_entry_strings() now NULLs pointers after freeing them.
+
+  * gd_entry() now returns entry metadata when they contain scalar field
+    codes which do not exist.  In this case the GD_EN_CALC flag in the
+    object will not be set.  Previously, on such entries, this function
+    would fail with the error GD_E_BAD_SCALAR, and return nothing.
+
+  * gd_rename() now by default updates the target of ALIASes pointing to a
+    renamed field to point to the new field instead of leaving them dangle.
+    (But see GD_REN_DANGLE in the API section below).
+
+  * CARRAYs are no longer truncated to GD_MAX_CARRAY_LENGTH elements.
+    Flushing metadata to disk will now fail if writing a CARRAY would
+    overflow a format file line.  (It's platform specific, but format file
+    lines are typically permitted to be at least 2**31 bytes long, so such
+    an error usually indicates something pathological happening.)  The
+    GD_MAX_CARRAY_LENGTH symbol has been removed from the GetData header
+    file.
+
+  * Write support for bzip2-encoded and lzma-encoded data has been added.
+    LZMA write support is only available for .xz files, not the obsolete
+    .lzma format.  The write support occurs out-of-place, just like how
+    writing gzip-encoded data works.  See the gzip discussion in the 0.8.0
+    section below for important notes.
+
+  * A new encoding scheme using the Free Lossless Audio Codec (FLAC) to
+    compress data has been implemented.  For some datasets, it provides a
+    good trade-off between speed and compression.  Like gzip, bzip2, and
+    lzma, is also uses out-of-place writes (see previous point).
+
+  * A newly-created dirfile is now always opened in read-write mode, ignor-
+    ing the access mode specified in the call.  Previously, specifying both
+    GD_RDONLY and GD_CREAT in open calls would result in an access mode
+    (GD_E_ACCMODE) error if the dirfile didn't already exist.
+
+  * Many functions which used to silently ignore representation suffixes in
+    field codes passed to them no longer do that.  Most of these will
+    report an error (GD_E_BAD_CODE) if passed a representation suffix.  The
+    affected functions are: gd_bof, gd_entry, gd_entry_type, gd_eof,
+    gd_flush, gd_linterp_tablename, gd_put_carray, gd_put_carray_slice,
+    gd_putdata, gd_raw_close, gd_raw_filename, gd_seek, gd_spf, gd_sync,
+    gd_tell.
+
+  * Attempts to seek past the end-of-field with gd_seek() now always
+    succeed, although the resultant position is encoding specific.
+    Previously, attempting to seek past the end-of-field on some encodings
+    would return an error.
+
+  * BUG FIX: The library now properly recovers from an I/O error while
+    trying to open an unencoded datafile.  Previously, such an error would
+    poison the library's bookkeeping data, preventing all subsequent
+    attempts to open that file unless the Dirfile was re-opened.  Reported
+    by Alexandra Rahlin.
+
+  * BUG FIX: GetData no longer segfaults when trying to do a large forward
+    seek before a write to a gzipped file.  Reported by Joy Didier.
+
+  * BUG FIX: gd_putdata() no longer ignores I/O errors while seeking to the
+    first sample of a write.
+
+  * BUG FIX: If the reference field is being written to, gd_nframes() now
+    flushes it first before calculating the size of the dirfile.
+    Previously a short count could result for some encodings in this case.
+
+  * BUG FIX: Calling gd_putdata() to write gzip data with a non-zero
+    starting offset equal to the field's current I/O position, no longer
+    result in the call hanging.
+  
+  * BUG FIX: In addition to the addition of write support mentioned above,
+    a number of problems with reading LZMA files has been fixed, which
+    should result in fewer segmentaion faults.
+
+  * BUG FIX: The parser no longer silently appends a closing > to scalar
+    field codes that contain an umatched opening < (e.g. "scalar<3").  This
+    is now interpreted as a simple field code (which may be rejected later
+    due to the presence of the invalid '<' character).
+
+  * BUG FIX: The parser no-longer interprets various numbers as field codes
+    when it shouldn't (e.g. when specifying a PHASE shift as "1." instead
+    of "1").
+
+  * BUG FIX: When writing scalar field codes to disk which could be inter-
+    preted as a number (e.g. the field code "1"), the library now forces
+    the interpretation of these field codes as codes rather than numbers by
+    appending a scalar index (making, e.g., "1<0>"), which is harmless.
+    Previously, these were written as-is, resulting in misinterpretation
+    the next time the Dirfile was opened.  This only happens with Standards
+    Version 8 or later, see the following for earlier versions.
+
+  * BUG FIX: If the current Standards Version in effect is 7 or earlier,
+    ambiguous field codes (e.g., "1"), are now rejected by gd_[m]add() and
+    gd_alter_entry() with the error GD_E_BAD_CODE, since they can't be
+    represented in the metadata on disk.  For the behaviour with later
+    Versions, and in permissive mode, see the previous.
+
+  * BUG FIX: If performing a metadata update due to renaming fields
+    (perhaps by passing GD_REN_UPDB to gd_rename()) results in an invalid
+    field code due to affix restrictions, the update now fails (but see
+    GD_REN_FORCE).  Previously the invalid field code would be stored,
+    leading to errors when flushing the modified metadata to disk.
+
+  * BUG FIX: When performing a metadata update due to a renamed field, the
+    field codes containing subfields of the renamed field are now also
+    updated, including field codes specifying meta subfields which do not
+    exist.
+
+  * BUG FIX: reading a LINTERP table with fewer than two lines no longer
+    results in a segfault on close/discard.
+  
+  * BUG FIX: gd_alter_raw() and similar no longer fail when asked to re-
+    encode the data file of a RAW field which has not been previously
+    accessed.
+
+  * BUG FIX: A previously-read LINTERP table is now always discarded when
+    changing table paths with gd_alter_linterp() or similar.  Previously
+    these obsolete, cached LUTs would sometimes linger, causing incorrect
+    LINTERP computation.
+
+  * BUG FIX: The library now properly recovers from an I/O error while
+    trying to open an unencoded datafile.  Previously, such an error would
+    poison the library's bookkeeping data, preventing all subsequent
+    attempts to open that file unless the Dirfile was re-opened.  Reported
+    by Alexandra Rahlin.
+
+  * BUG FIX: Calling gd_putdata() to write gzip data with a non-zero
+    starting offset equal to the field's current I/O position, no longer
+    result in the call hanging.
+
+  * BUG FIX: The I/O position reported by gd_tell and gd_seek for slim, zzip,
+    and zzslim encoded data is now correct.
+
+  API Changes:
+  
+  * CLARIFICATION: The macro GD_SIZE() declared in getdata.h is indeed part
+    of the public API.  It returns the size in bytes of a sample of data of
+    a given type (e.g. GD_SIZE(GD_COMPLEX64) returns 8).  It has been
+    around since GetData-0.3.0, but has only been documented since
+    GetData-0.8.3.
+
+  * The comp_scal member of the gd_entry_t object has been replaced with a
+    flags member, containing a flag (GD_EN_COMPSCAL) with the meaning of
+    the former comp_scal member.  There are also flags for hiddenness
+    (GD_EN_HIDDEN) and whether the scalar entry codes in the field defi-
+    nition have been dereferenced (GD_EN_CALC).
+
+  * gd_[m]add() and gd_alter_entry() can now be used to set or change the
+    hiddenness of a field by setting or clearing the GD_EN_HIDDEN bit in
+    the supplied gd_entry_t object.
+
+  * Two new rename flags have been added:
+    - GD_REN_DANGLE which indicates the library shouldn't update ALIASes
+      whose target has been renamed (instead it will turn them into
+      dangling aliases)
+    - GD_REN_FORCE which causes the library to skip updating field codes
+      which would be invalid due to affixes instead of failing.
+
+  * The move_data argument of gd_move() has been replaced with a flags
+    argument which accepts the GD_REN_* flags, which have the same meaning
+    as they do with gd_rename().
+
+  * gd_move_alias() and gd_delete_alias() have been deleted: their
+    functions are now performed by gd_move() and gd_delete(), which now
+    operate on the alias itself when given the field code to an alias,
+    rather than the field the alias points to.
+
+  * A number of different error codes which indicated the same problem (an
+    I/O error returned by the operating system) have been merged into one.
+    The error codes GD_E_OPEN, GD_E_TRUNC, GD_E_RAW_IO, GD_E_OPEN_FRAGMENT,
+    GD_E_FLUSH are replaced by the new error GD_E_IO.  The old symbols
+    remain as aliases but are deprecated.  The corresponding error strings
+    also now include information from the underlying encoding library,
+    where possible.  There is one exception to this merge: attempts to
+    flush metadata lines which are too long are now reported using
+    GD_E_LINE_TOO_LONG.  Previously, these errors used GD_E_FLUSH.
+
+  * The error code GD_E_OPEN_LINFILE has also been removed.  It has been
+    split into two parts:
+    - I/O errors resulting from reading the LINTERP table file are now
+      reported using GD_E_IO;
+    - Syntax errors in the table are reported using the new GD_E_LUT error
+      code.  GD_E_OPEN_LINFILE remains as a deprecated alias for GD_E_LUT.
+
+  * gd_encoding_support() has been added to permit run-time determination
+    of supported encodings.
+
+  * gd_array_len() is the new name for gd_carray_len().  It now also
+    handles STRINGs (which have a length of one).  The gd_carray_len() name
+    remains in the library, but has been marked deprecated.
+
+  * BUG FIX: If the dirfile path provided cannot be resolved (due to, for
+    instance, a symbolic link pointing to a non-existent path), gd_open()
+    and friends now return GD_E_OPEN, as documented, instead of
+    GD_E_RAW_IO.
+  
+  * BUG FIX: gd_naliases() now returns an unsigned int, and zero on error,
+    as documented.
+
+  * BUG FIX: The API on 32-bit systems, which was broken in 0.8.7 and only
+    partially fixed in 0.8.8, should now work as expected again.
+
+  Bindings Changes:
+
+  * PHP bindings have been added.
+
+  * C++: There is no longer a default value for the "index" argument for
+    Entry methods (including subclasses) which accept it (viz. Input,
+    Scalar, ScalarIndex, Scale, CScale, Offset COffset, Coefficient,
+    CCoefficient).  The exception to this is with Entry subclasses for which
+    zero is the only allowed value for the parameter.
+
+  * F77 and F95: The bindings no longer raise SIGABRT when the dirfile
+    space is exhausted.  Instead they simply return a invalid dirfile unit
+    number.
+
+  * F77: Functions to add fields with named scalar parameters have been
+    added (GDASBT GDASCL GDASCP GDASCR GDASLC GDASMX GDASPH GDASPN GDASRC
+    GDASRW GDASSB GDASWD), but only for those field types which permit
+    named scalars.  Similarly, functions for altering field metatdata with
+    named scalars are also present (GDLSBT GDLSCL GDLSCP GDLSCR GDLSLC
+    GDLSMX GDLSPH GDLSPN GDLSRC GDLSRW GDLSSB GDLSWD).  These are provided
+    as an alternative to using GDASCA after the fact.
+
+  * IDL: The entry structure parser has been rewritten.  It no longer
+    requires members which it doesn't need, and is also a lot more lax
+    about numerical data types.  Notably, it now ignores a supplied
+    COMP_SCAL member.  Floating point parameters can be specified in either
+    the base name (M, B, A, DIVIDEND) or else the member prefixed with 'C'
+    (CM, CB, CA, CDIVIDEND), whatever numerical type.  The bindings will
+    ingest them appropriately.  Also, N_FIELDS and POLY_ORD, may be
+    omitted, and will be calculated from the supplied data.  A scalar
+    IN_FIELDS is treated like an single element array.
+
+  * IDL: GD_REFERENCE is now a function, instead of a procedure, as the
+    documentation has always claimed it was.  It returns the current
+    reference field (or the empty string, if there is none).  The second
+    parameter, the new reference field, is optional. (Previously the
+    second parameter was required.)
+
+  * PERL: The entry hash parser has been rewritten.  It no longer requires
+    keys which it doesn't need.
+
+  * PERL: alter_entry() now only updates defined elements in the passed
+    entry hash.
+
+  * PYTHON: Building the python bindings now requires NumPy.  Previously,
+    NumPy support was optional.
+
+  * PYTHON: for backwards compatiblity, exceptions now exist for deprecated
+    error codes (such as OpenError).  These deprecated exceptions are
+    simply aliases for the current ones and are never returned by the
+    bindings.
+
+  * C++ BUG FIX: The Entry methods Input, Scalar, and ScalarIndex (including
+    subclasses) now return zero or NULL when passed an out-of-range index value.
+    Previously they would return, variously, zero, NULL, another value for some
+    other, valid index value, or segfault.
+
+  * C++ BUG FIX: The flags parameter to Dirfile::Delete() is now unsigned, as it
+    is in the C API.
+
+  * F95 BUG FIX: fgd_add and fgd_alter_entry no longer ignore named scalar
+    parameters provided in supplied entry structures.
+
+  * PYTHON BUG FIX: Several memory leaks have been plugged.  Patch from
+    Matthew Petroff.
+
+  Miscellaneous:
+
+  * The minimum autotools versions have been bumped.  Autoconf-2.65 or
+    newer, automake-1.13 or newer, and libtool-2.2.7b or newer are now
+    required to rebuild the configure script and associated build environ-
+    ment.  NOTE: In general, most people building GetData from a source
+    release don't need the tools to build GetData; the autotools are only
+    needed if changes need to be made to the configure script or Makefile
+    input files provided in the release or if building from the repository.
+
+|=========================================================================|
+
 New in verison 0.8.9:
 
   Library Changes:
@@ -44,11 +330,12 @@ New in verison 0.8.8:
 
   * BUG FIX: The incorrect handling of the explicit 64-bit API declarations
     in getdata.h (those associated with the GD_64BIT_API symbol), which
-    prevented GetData-0.8.7 from compiling on 32-bit systems, has been fixed.
+    prevented GetData-0.8.7 from compiling on 32-bit systems, has been
+    fixed.
 
   GetData-0.8.8 is ABI compatible with GetData-0.8.7.
 
-|==============================================================================|
+|=========================================================================|
 
 New in verison 0.8.7:
 
@@ -76,82 +363,86 @@ New in verison 0.8.7:
   * PYTHON BUG FIX: On error, dirfile.get_string() no longer segfaults or
     leaks memory.
 
-|==============================================================================|
+|=========================================================================|
 
-New in verison 0.8.6:
+New in version 0.8.6:
 
   Library Changes:
 
   * BUG FIX: Computation of LINCOMs with complex valued input fields now
-    correctly happens in the complex plane.  As a side effect, gd_native_type()
-    now also correctly reports such LINCOM fields to be complex valued.
+    correctly happens in the complex plane.  As a side effect,
+    gd_native_type() now also correctly reports such LINCOM fields to be
+    complex valued.
 
-  * BUG FIX: The gd_[m]add() functions now ignore zero-length scalar strings.
-    Previously they would store these invalid field codes, causing problems
-    later.
+  * BUG FIX: The gd_[m]add() functions now ignore zero-length scalar
+    strings.  Previously they would store these invalid field codes,
+    causing problems later.
 
   * BUG FIX: Returning complex-valued CARRAYs as purely real now works.
-    Previously only the first element requested would be returned, the remaining
-    output buffer containing uninitialised data.
+    Previously only the first element requested would be returned, the
+    remaining output buffer containing uninitialised data.
 
-  * BUG FIX: Entry members spf, bitnum, numbits, and period are now completely
-    ignored by gd_[m]add() when corresponding named scalars are specified.
-    Previously, an invalid value in these members would result in the entry
-    being rejected, even though the rest of GetData ignored the invalid, unsued
-    value.
+  * BUG FIX: Entry members spf, bitnum, numbits, and period are now com-
+    pletely ignored by gd_[m]add() when corresponding named scalars are
+    specified.  Previously, an invalid value in these members would result
+    in the entry being rejected, even though the rest of GetData ignored
+    the invalid, unsued value.
 
   * BUG FIX: The parsing of the \x and \u escape sequences is now correct.
 
   * BUG FIX: A scalar field code specified for the last factor in a POLYNOM
     entry is no longer ignored by gd_[m]add().
 
-  * BUG FIX: gd_[m]add() no longer rejects MPLEX fields with negative count_val.
+  * BUG FIX: gd_[m]add() no longer rejects MPLEX fields with negative
+    count_val.
 
   * BUG FIX: DIVIDE fields with complex-valued divisors are now properly
     computed.
-          
-  * BUG FIX: Complex-valued POLYNOM and RECIP fields are now computed properly
-    when the library is built in ANSI C mode.
+
+  * BUG FIX: Complex-valued POLYNOM and RECIP fields are now computed
+    properly when the library is built in ANSI C mode.
 
   * BUG FIX: gd_alter_entry() no longer corrupts the DIRFILE when modifying
     named scalars of MPLEX fields.
 
-  * BUG FIX: Writing complex-valued MPLEX fields no longer corrupts the stored
-    data.
+  * BUG FIX: Writing complex-valued MPLEX fields no longer corrupts the
+    stored data.
 
-  * BUG FIX: gd_bof() now returns the correct number (i.e.: zero) when reporting
-    the beginning of field of derived fields shifted to before the start of the
-    dirfile.  Previously, this function incorrectly returned values ranging from
-    zero to one less than the samples-per-frame of the requested field.
+  * BUG FIX: gd_bof() now returns the correct number (i.e.: zero) when
+    reporting the beginning of field of derived fields shifted to before
+    the start of the dirfile.  Previously, this function incorrectly
+    returned values ranging from zero to one less than the samples-per-
+    frame of the requested field.
 
   * BUG FIX: gd_flush(), gd_sync(), gd_raw_close() no longer segfault when
     operating on a LINCOM with only one input field.
-
   * BUG FIX: gd_seek() now works correctly on PHASE fields; previously, the
     sign of the PHASE shift was flipped.
 
-  * BUG FIX: gd_seek() now correctly positions the virtual I/O pointer of the
-    INDEX field.
+  * BUG FIX: gd_seek() now correctly positions the virtual I/O pointer of
+    the INDEX field.
 
-  * BUG FIX: gd_framenum_subset() now returns the correct value when passed a
-    field_end which is beyond the end of field, and then is required to
+  * BUG FIX: gd_framenum_subset() now returns the correct value when passed
+    a field_end which is beyond the end of field, and then is required to
     extrapolate outside of the specified frame range.
 
-  * BUG FIX: gd_error_string() now produces the correct string when reporting
-    an out-of-range poly_ord encountered by gd_add_polynom() and similar.
+  * BUG FIX: gd_error_string() now produces the correct string when
+    reporting an out-of-range poly_ord encountered by gd_add_polynom() and
+    similar.
 
-  * BUG FIX: gd_[m]alter_spec() no longer ignore co-efficients specified for
-    POLYNOM entries.
+  * BUG FIX: gd_[m]alter_spec() no longer ignore co-efficients specified
+    for POLYNOM entries.
 
-  * BUG FIX: gd_alter_encoding() now deletes the internal cache of RAW filenames
-    of the affected fragment; previously, these old, cached filenames could lead
-    to I/O errors when reading and writing the re-encoded RAW data files.
+  * BUG FIX: gd_alter_encoding() now deletes the internal cache of RAW
+    filenames of the affected fragment; previously, these old, cached
+    filenames could lead to I/O errors when reading and writing the re-
+    encoded RAW data files.
 
-  * BUG FIX: Calling the Legacy API function GetFormat() on a Dirfile with MPLEX
-    or WINDOW fields no longer results in a segmentation fault.
+  * BUG FIX: Calling the Legacy API function GetFormat() on a Dirfile with
+    MPLEX or WINDOW fields no longer results in a segmentation fault.
 
-  * BUG FIX: Attempts to read past the EOF of a gzipped field no longer results
-    in an I/O error, but successfully returns no data.
+  * BUG FIX: Attempts to read past the EOF of a gzipped field no longer
+    results in an I/O error, but successfully returns no data.
 
   * BUG FIX: The internal recursion counter wasn't being properly reset on
     certain error conditions, leading to spurious GD_E_RECURSE_LEVEL errors
@@ -159,8 +450,9 @@ New in verison 0.8.6:
 
   Bindings Changes:
 
-  * F77 and F95 BUG FIX: Named scalar indices are now indexed from one instead
-    of zero, like all other array indices are in the Fortran GetData bindings.
+  * F77 and F95 BUG FIX: Named scalar indices are now indexed from one
+    instead of zero, like all other array indices are in the Fortran
+    GetData bindings.
 
   * C++ BUG FIX: Fixed segfault in RawEntry destructor.  Reported by S. J.
     Benton.
@@ -169,215 +461,226 @@ New in verison 0.8.6:
     entries when appropriate, instead of always returning zero.  (The
     RecipEntry::ComplexScalars() method always returned the correct value.)
 
-  * IDL BUG FIX: The /UPDATEDB flag to gd_rename is no longer ignored; also, the
-    /MOVE_DATA flag no longer also acts as if /UPDATEDB had been specified.
+  * IDL BUG FIX: The /UPDATEDB flag to gd_rename is no longer ignored;
+    also, the /MOVE_DATA flag no longer also acts as if /UPDATEDB had been
+    specified.
 
   * PYTHON BUG FIX: The keyword for the "dirfile" parameter in the
     getdata.fragment constructor is now properly spelled.
 
-|==============================================================================|
+|=========================================================================|
 
 New in verison 0.8.5:
 
   Library Changes:
 
-  * The zzslim encoding framework, which was inadvertantly rendered
-    non-compilable in 0.8.4, should once again work.  Reported by Matthew
-    Hasselfield.
+  * BUG FIX: The zzslim encoding framework, which was inadvertantly
+    rendered non-compilable in 0.8.4, should once again work.  Reported by
+    Matthew Hasselfield.
 
   Bindings Changes:
 
   * PYTHON BUG FIX: A spurious debugging message accidentally left in the
     0.8.4 release has been expunged.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.8.4:
 
   Dirfile Changes:
 
   * CLARIFICATION: Inconsistant behaviour in the library, coupled with
-    contradictory statements in the Dirfile Standards, has resulted in confusion
-    over the meaning of the final, optional, parameter in a MPLEX definition.
-    To be clear: this parameter is simply the expected period between successive
-    occurances of the "count" value in the index vector.  (It is used by GetData
-    only to figure out a resonable length for the MPLEX lookback.)  The 
-    following clarifications and corrections have been made to the definition
-    of the MPLEX field type in dirfile-format(5):
-
-    - The final, optional parameter has been renamed from "max" to "period".
-
-    - This parameter indicates not the maximal range of the index vector, as 
-      previously stated, but the expected number of samples between successive
-      occurances of the specified "count" value in the index vector; as before,
-      it should be regarded as a hint, and does not place any actual restriction
-      on the contents of the index vector.
-
-    - The incorrect requirement that the "count" parameter be non-negative has
-      been deleted.
-
-    - The incorrect requirement that "count" be less than or equal to "max", if
-      "max" is present and non-zero, has been deleted.
-
-    - The meaning of an omitted or zero "period", indicating that the spacing of
-      "count" in the index vector is unknown or non-uniform, is now explicitly
-      stated.
-
-    - Different MPLEX fields using the same index vector may specify different
-      periods.
+    contradictory statements in the Dirfile Standards, has resulted in
+    confusion over the meaning of the final, optional, parameter in a MPLEX
+    definition.  To be clear: this parameter is simply the expected period
+    between successive occurances of the "count" value in the index vector.
+    (It is used by GetData only to figure out a resonable length for the
+    MPLEX lookback.)  The following clarifications and corrections have
+    been made to the definition of the MPLEX field type in
+    dirfile-format(5):
+
+    - The final, optional parameter has been renamed from "max" to
+      "period".
+
+    - This parameter indicates not the maximal range of the index vector,
+      as previously stated, but the expected number of samples between
+      successive occurances of the specified "count" value in the index
+      vector; as before, it should be regarded as a hint, and does not
+      place any actual restriction on the contents of the index vector.
+
+    - The incorrect requirement that the "count" parameter be non-negative
+      has been deleted.
+
+    - The incorrect requirement that "count" be less than or equal to
+      "max", if "max" is present and non-zero, has been deleted.
+
+    - The meaning of an omitted or zero "period", indicating that the
+      spacing of "count" in the index vector is unknown or non-uniform, is
+      now explicitly stated.
+
+    - Different MPLEX fields using the same index vector may specify
+      different periods.
     
     See also the related library bug fixes below.
 
   Library Changes:
 
-  * The count_max member of the gd_entry_t object has been renamed period.  The
-    corresponding dummy argument in various function prototypes has been
-    similarly renamed.
-
-  * BUG FIX: The library no longer incorrectly rejects negative count_val MPLEX
-    parameters.  Furthermore, a count_val of -1 in gd_alter_entry or
-    gd_[m]alter_mplex calls is not a special value: it just sets count_val to
-    -1.
+  * BUG FIX: The library no longer incorrectly rejects negative count_val
+    MPLEX parameters.  Furthermore, a count_val of -1 in gd_alter_entry or
+    gd_[m]alter_mplex calls is not a special value: it just sets count_val
+    to -1.
 
   * BUG FIX: The library no longer incorrectly rejects MPLEX fields where
     count_val is greater than the period (formerly called count_max).
 
-  * BUG FIX: The default MPLEX period, if none is specified, is 2*count_val + 1,
-    not simply 2 * count_val, when count_val is greater than 5.
+  * BUG FIX: The default MPLEX period, if none is specified, is
+    2 * count_val + 1, not simply 2 * count_val, when count_val is greater
+    than 5.
 
   * BUG FIX: Trying to position an I/O pointer to before sample zero with
-    gd_seek() now properly fails.  Previously it would allow it, causing bizarre
-    things to happen later.
+    gd_seek() now properly fails.  Previously it would allow it, causing
+    bizarre things to happen later.
 
-  * BUG FIX: Using gd_tell to get the I/O pointer position of a derived field
-    with exactly two input fields (MULTIPLY, DIVIDE, MPLEX, WINDOW) now properly
-    reports an error in the "multiposition" case (ie. when the two inputs are
-    ultimately reading from different locations in the same RAW field).
+  * BUG FIX: Using gd_tell to get the I/O pointer position of a derived
+    field with exactly two input fields (MULTIPLY, DIVIDE, MPLEX, WINDOW)
+    now properly reports an error in the "multiposition" case (ie. when the
+    two inputs are ultimately reading from different locations in the same
+    RAW field).
 
-  * BUG FIX: Trying to read sample zero of a gzipped RAW field the second time
-    now works as expected.  Previously, the request to reposition the I/O
-    pointer back to zero would be ignored by the gzip framework.  Reported by
-    Alexandra Rahlin.
+  * BUG FIX: Trying to read sample zero of a gzipped RAW field the second
+    time now works as expected.  Previously, the request to reposition the
+    I/O pointer back to zero would be ignored by the gzip framework.
+    Reported by Alexandra Rahlin.
 
   * BUG FIX: The field code of a reference field declared in a subfragment
-    included with affixes is no longer corrupted by spurious application of the
-    affixes when the subfragment's metadata are (re-)written.  Reported by Seth.
+    included with affixes is no longer corrupted by spurious application of
+    the affixes when the subfragment's metadata are (re-)written.  Reported
+    by Seth.
+
+  API Changes:
+
+  * The count_max member of the gd_entry_t object has been renamed to
+    period.  The corresponding dummy argument in various function proto-
+    types has been similarly renamed.
 
   Bindings Changes:
 
-  * C++: The Entry and MplexEntry member functions CountMax and SetCountMax have
-    been renamed to Period and SetPeriod for consistency with the changes listed
-    above.  CountMax and SetCountMax are still avaialbe as aliases, but are
-    marked deprecated.
+  * C++: The Entry and MplexEntry member functions CountMax and SetCountMax
+    have been renamed to Period and SetPeriod for consistency with the
+    changes listed above.  CountMax and SetCountMax are still avaialbe as
+    aliases, but are marked deprecated.
 
-  * IDL BUG FIX: GD_ENTRY structures representing MPLEX fields are now properly
-    interpreted.  Previously, the underlying gd_entry_t object was being
-    incorrectly initialised.
+  * IDL BUG FIX: GD_ENTRY structures representing MPLEX fields are now
+    properly interpreted.  Previously, the underlying gd_entry_t object was
+    being incorrectly initialised.
 
   * PYTHON BUG FIX: Numpy arrays returned by dirfile.getdata() are now the
-    correct length.  Previously they would always be the length requested (or
-    the length of the dirfile, if no length was explicitly given) even if fewer
-    samples were returned.  Extra elements would contain uninitialised memory.
+    correct length.  Previously they would always be the length requested
+    (or the length of the dirfile, if no length was explicitly given) even
+    if fewer samples were returned.  Extra elements would contain unini-
+    tialised memory.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.8.3:
 
   Library Changes:
   
-  * BUG FIX: Several bugs on big-ended systems have been fixed.  Reported by
-    Dinar Valeev.
+  * BUG FIX: Several bugs on big-ended systems have been fixed.  Reported
+    by Dinar Valeev.
 
-  * BUG FIX: Adding an entry via gd_[m]add() with a negative CARRAY scalar index
-    no longer results in an internal error or worse when the added field is
-    later read.
+  * BUG FIX: Adding an entry via gd_[m]add() with a negative CARRAY scalar
+    index no longer results in an internal error or worse when the added
+    field is later read.  Instead, a proper error is returned.
 
   * BUG FIX: Changing a CONST field to a real floating point type using
-    gd_alter_const() (or similar) no longer results in the value of the field
-    being corrupted.
+    gd_alter_const() (or similar) no longer results in the value of the
+    field being corrupted.
 
-  * BUG FIX: A bug in the parser's tokeniser has been fixed to prevent spurious
-    "unterminated token" syntax errors.  Typically this would only be seen when
-    using gd_strtok() to tokenise an (apparently innocuous) user-supplied
-    string, but a carefully crafted format file could also be made to get
-    gd_open() to produce it.
+  * BUG FIX: A bug in the parser's tokeniser has been fixed to prevent
+    spurious "unterminated token" syntax errors.  Typically this would only
+    be seen when using gd_strtok() to tokenise an (apparently innocuous)
+    user-supplied string, but a carefully crafted format file could also be
+    made to get gd_open() to produce it.
 
   Bindings Changes:
 
   * Bindings for MATLAB have been added.
 
-  * The IDL, Perl, and Python bindings no longer require a C99 compiler to be
-    built.
+  * The IDL, Perl, and Python bindings no longer require a C99 compiler to
+    be built.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.8.2:
 
   Library Changes:
   
-  * BUG FIX: A trailing symlink (i.e. situations where a symlink is the last
-    element of a path) no longer confuses GetData when the target of the
-    symlink: (1) is absolute, or (2) starts with "../".  Reported by S. J.
-    Benton.
+  * BUG FIX: A trailing symlink (i.e. situations where a symlink is the
+    last element of a path) no longer confuses GetData when the target of
+    the symlink: (1) is absolute, or (2) starts with "../".  Reported by
+    S. J.  Benton.
 
-  * BUG FIX: Trying to read data from the first sample of an MPLEX no longer
-    results in an internal error if the first sample of the index doesn't match
-    the target value.
+  * BUG FIX: Trying to read data from the first sample of an MPLEX no
+    longer results in an internal error if the first sample of the index
+    doesn't match the target value.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.8.1:
 
   Library Changes:
 
-  * BUG FIX: A segfault when negotiating symbolic links in file paths, typically
-    manifesting in gd_open calls, has been fixed.
+  * gd_dirfilename() now returns a fully canonicalised version of the
+    dirfile path.
+
+  * BUG FIX: A segfault when negotiating symbolic links in file paths,
+    typically manifesting in gd_open calls, has been fixed.
 
   * BUG FIX: gd_strtok now saves a copy of the string passed to it, as the
-    documentation suggests it should.  Previously it cached the pointer itself.
+    documentation suggests it should.  Previously it cached the pointer
+    itself.
 
-  * BUG FIX: A number of minor memory leaks, mostly occurring when the library
-    encounters an error, have been fixed.
+  * BUG FIX: A number of minor memory leaks, mostly occurring when the
+    library encounters an error, have been fixed.
 
   * BUG FIX: /HIDDEN directives weren't being written for aliases.
 
   * BUG FIX: The parser now fails properly on /INCLUDEs which specify paths
     which don't point to regular files.
 
-  * BUG FIX: Fixed a bug which would result in the parser getting confused over
-    the current Standards Version, potentially leading to rejected valid
-    dirfiles.  Reported by Daniel Flanigan.
+  * BUG FIX: Fixed a bug which would result in the parser getting confused
+    over the current Standards Version, potentially leading to rejected
+    valid dirfiles.  Reported by Daniel Flanigan.
 
-  * WIN32 BUG FIX: On Windows, the parser can now properly handle hexadecimal
-    floating point.
-
-  API Changes:
+  * BUG FIX: gd_alter_entry() and gd_madd_alias() weren't clearing the
+    Dirfile error before operation, resulting in them failing erroneously
+    in certain situations.
 
-  * How the API deals with field code affixes has changed.  Input vector and
-    scalar fields are reported by gd_entry(), &c. now include their prefix and
-    suffix, if any, which should remove the need to do manual affix bookkeeping
-    when reading metadata.  The other side to this change is that when modifying
-    metdata (gd_add(), gd_alter_entry(), &c.), supplied field codes must also
-    contain the appropriate suffixes.
+  * BUG FIX: When including an existing fragment which itself has subfrag-
+    ments, gd_include() no longer returns the wrong fragment index.
 
-  * gd_dirfilename() now returns a fully canonicalised version of the dirfile
-    path.
+  * WIN32 BUG FIX: On Windows, the parser can now properly handle hexade-
+    cimal floating point.
 
-  * A new function, gd_linterp_tablename() has been added which returns a fully
-    canonicalised version of the look-up table pathname for a LINTERP.
+  API Changes:
 
-  * BUG FIX: gd_alter_entry() and gd_madd_alias() weren't clearing the Dirfile
-    error before operation, resulting in them failing erroneously in certain
-    situations.
+  * How the API deals with field code affixes has changed.  Input vector
+    and scalar fields are reported by gd_entry(), &c. now include their
+    prefix and suffix, if any, which should remove the need to do manual
+    affix bookkeeping when reading metadata.  The other side to this change
+    is that when modifying metdata (gd_add(), gd_alter_entry(), &c.),
+    supplied field codes must also contain the appropriate affixes.
 
-  * BUG FIX: When including an existing fragment which itself has subfragments,
-    gd_include() no longer returns the wrong fragment index.
+  * A new function, gd_linterp_tablename() has been added which returns a
+    fully canonicalised version of the look-up table pathname for a
+    LINTERP.
 
   Bindings Changes:
 
   * F77 BUG FIX: A memory leak has been fixed in GDALLC.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.8.0:
 
@@ -415,11 +718,11 @@ New in version 0.8.0:
 
   * Three new encoding schemes are available.  The first is the Sample-
     Index Encoding (SIE), similar to run-length encoding, useful for
-    compressing data which changes very rarely varying data.  Like the
-    ASCII encoding, GetData implements it internally, so it's always
-    available.  The other two schemes (zzip and zzslim) are based around
-    the ZZip library, an access library for PKWARE ZIP files.  These are
-    unusual in that they store all raw data in the same ZIP archive.
+    compressing data which changes very rarely.  Like the ASCII encoding,
+    GetData implements it internally, so it's always available.  The other
+    two schemes (zzip and zzslim) are based around the ZZip library, an
+    access library for PKWARE ZIP files.  These are unusual in that they
+    store all raw data in the same ZIP archive.
 
   * The /ENCODING directive takes an optional second token.  The zzip and
     zzslim encoding schemes optionally use this token to specify the name
@@ -527,6 +830,9 @@ New in version 0.8.0:
     documentation indicates it should) and checks the protection of the
     fragment containing the parent field.
 
+  * BUG FIX: calling gd_putdata() with num_frames and num_samples both zero
+    no longer confuses GetData: instead it simply does nothing.
+
   API Changes:
 
   * Functions which add fields (gd_add(), gd_add_<type>(), &c.) can now be
@@ -630,9 +936,6 @@ New in version 0.8.0:
   * C89 API: Passing NULL to gd_alter_crecip() for cdividend is now treated
     as if it were passed zero (ie. it indicates no change for cdividend).
 
-  * BUG FIX: calling gd_putdata() with num_frames and num_samples both zero
-    no longer confuses GetData: instead it simply does nothing.
-
   * BUG FIX: gd_spf() now returns GD_E_DIMENSION when passed a scalar field
     code, as the documentation says it should.  Previously it returned
     GD_E_BAD_FIELD_TYPE.
@@ -709,86 +1012,90 @@ New in version 0.8.0:
   * IDL BUG FIX: The missing /IGNORE_REFS and /PRETTY_PRINT are now
     available in gd_open.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.7.3:
 
   Library Changes
 
-  * BUG FIX: Passing a zero dividend to alter_crecip() and alter_recip() now
-    results in the dividend not changing, per documentation.
+  * BUG FIX: 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: 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: 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.
+  * 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
+  * 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: 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: 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().
+  * 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).
+  * 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: 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).
+  * 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: Specifying both GD_VERBOSE and GD_IGNORE_DUPS no longer
+    results in spurious "Field code already defined" messages when dupli-
+    cate fields are encountered.
 
-  * BUG FIX: Calling gd_delete on a metafield no longer results in a segfault.
+  * 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.
 
@@ -798,192 +1105,199 @@ New in version 0.7.1:
     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".
+  * 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.
+    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.
+    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.
+  * 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 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.
+    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.
+  * GetData, including its bindings, is now supported under MacOS X,
+    Cygwin, and Win32 using MinGW.  In the case of MinGW, this includes
+    linking against the Microsoft C Runtime, which isn't POSIX compliant.
+    Users should exercise caution when writing to dirfiles in this case.
+
+  * GetData can now be used on ARM processors.  As a side-effect, GetData
+    can now read and write the middle-ended floating point format used by
+    older ARM processors (on any processor, via endianness conversion).
+
+  * Some changes have been made to the parser.  It now operates in one of
+    two modes: pedantic mode, which adheres strictly to one particular
+    Dirfile Standards Version, and permissive mode (the default) which is
+    more lenient, as the old parser was.  Encountering a /VERSION directive
+    will switch the parser from permissive to pedantic mode unless told not
+    to (see GD_PERMISSIVE below), and will change the particular Standards
+    Version to which pedantic mode is adhering.
+
+  * As a result of the previous change, the Standards compliance of the
+    parser in strict mode has been greatly increased.  This affects allowed
+    characters in field names, and field name lengths.  The existence or
+    lack thereof of the implicit FILEFRAM field (an alias for INDEX) is
+    also affected.
+
+  * Since Standards Versions 4 and earlier were never codified, we've made
+    some assumptions as to their behaviour in certain undocumented situta-
+    tions.  Most noticably, they still prohibit ASCII control codes (bytes
+    0x01 through 0x1F) and '/' in field names.  We also assume these
+    dirfiles have native byte sex, even though some early GetData behaviour
+    implied only little-ended data was acceptable.
 
   * Every Dirfile object now records its current Standards Version, which
-    affects functions such as gd_add_spec().  The Version will start out as the
-    value of the last /VERSION directive encountered by the parser, or else the
-    latest compliant Standards Version.  It can be changed (see below).
+    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.
+  * 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.
+    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.
+  * 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.
-
+    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: 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: 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.
+    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: 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 characters, this should only
-    occur in pathological situations.)
+  * BUG FIX: On encountering a line longer than it was prepared to deal
+    with, the parser used to get very confused, potentially resulting in
+    bizarre behaviour.  On the off chance such a line is encountered,
+    GetData will now raise GD_E_LINE_TOO_LONG in these cases. (And, since
+    the maxmium line length has been increased to at least 2**31 charac-
+    ters, this should only occur in pathological situations.)
 
   * BUG FIX: Deleting a metafield was not being communicated to its parent,
-    resulting in differing opinions within the library as to the deleted field's
-    exsitence.
+    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().
+  * 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.
+    - 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().
+  * 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.
+  * 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.
+  * 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.
+  * 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.
+    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.
+  * 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.
+    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.
+    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.
+  * 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.
+  * 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.
+    GD_NOT_ARM_ENDIAN allow specifying the default ordering of double pre-
+    cision data.  These flags may also be used with gd_alter_endianness()
+    and will be returned by gd_endianness().  On all platforms except for
+    middle-endian ARMs, GD_NOT_ARM_ENDIAN equals zero and may be omitted.
 
-  * Where gd_flush() and gd_metaflush() in the past raised GD_E_OPEN_INCLUDE
-    on I/O error, they now raise the new GD_FLUSH.
+  * Where gd_flush() and gd_metaflush() in the past raised
+    GD_E_OPEN_INCLUDE on I/O error, they now raise the new GD_E_FLUSH.
 
   * All functions now raise GD_E_DIMENSION when encountering a scalar field
     when expecting a vector.  In the past, the error value returned was
@@ -992,28 +1306,29 @@ New in version 0.7.0:
   * 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.
+  * 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.
+  * 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.)
+  * 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].
+  * 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.
+    (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().
+  * BUG FIX: A segfault involving the reporting of POLYNOM fields has been
+    fixed in GetFormat().
 
   Bindings
 
@@ -1027,9 +1342,9 @@ New in version 0.7.0:
   * 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: 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.
@@ -1040,24 +1355,25 @@ New in version 0.7.0:
 
   * 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: 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().
+  * IDL: Various constants defined in getdata.h but not used by the IDL
+    bindings have been removed from the structure returned by
+    GETDATA_CONSTANTS().
 
-  * Python: dirfile.getdata() now raises ValueError if neither num_frames nor
-    num_samples are specified.  In the past, it would happily return nothing
-    in this case.
+  * Python: 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.
+  * 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.
 
@@ -1066,38 +1382,39 @@ New in version 0.7.0:
 
   Miscellaneous
 
-  * The --disable-checkdirfile option has been removed from ./configure.  It
-    is now always installed.
+  * 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.
+  * 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.
+  * 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.
+  * 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.
+  * Attempting to get the number of frames from an ASCII file no longer
+    fails the second time.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.6.1:
 
@@ -1112,10 +1429,11 @@ New in version 0.6.1:
 
   Bindings
 
-  * C++ BUG FIX: Several bugs preventing compilation of the C++ test-suite under
-    Fedora 13 have been fixed.
+  * 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.
+  * IDL BUG FIX: Several segfaults in the IDL bindings have been
+    eradicated.
 
   Miscellaneous
 
@@ -1123,7 +1441,7 @@ New in version 0.6.1:
     Fortran-9x.  The outdated, internal libltdl has been removed.  Building
     modules now requires an installed libltdl.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.6.0:
 
@@ -1134,77 +1452,79 @@ New in version 0.6.0:
 
   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.
+  * 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.
+  * 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.
+    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.
+  * 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 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 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 shift field parameter is now a 64-bit integer type, called
+    gd_shift_t.
 
-  * The parser callback has received a new, API breaking signature, which should
-    hopefully reduce the amount of API breakage in the future.  It is also now
-    possible for the caller to pass data through GetData to the callback, if
-    desired.
+  * 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.)
+  * 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.
+  * 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: 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: 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.
+    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.)
+    (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: 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: 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.
+  * BUG FIX: 64-bit integer literals in the format file are no longer
+    truncated to double precision when read.
 
   API Changes
 
@@ -1212,60 +1532,66 @@ New in version 0.6.0:
     compatibility.  The SOVERSION of the library has been incremented
     accordingly.
 
+  * The dirfile flags, including encoding and endianness symbols are now
+    explicitly long ints.  Previously these quantities mixed long int with
+    int arbitrarily.  This affects the public API.
+
   * A C-89 API will be declared by getdata.h if GETDATA_C89_API is defined
-    before inclusion.  If this symbol is not defined, the C API defined will
-    include C-99 conforming complex types, and getdata.h will include complex.h
-    if `complex' has not been defined before inclusion.
+    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.
+  * 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,
+    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_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, 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.
+  * 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.
+  * 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.
+  * 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: 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: 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.
+  * 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.
+  * 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
 
@@ -1280,54 +1606,56 @@ New in version 0.6.0:
   * 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.)
+  * 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.
+  * 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: 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: Fragment::SetEncoding() now actually does what it adver-
+    tises, instead of doing nothing.
 
-  * C++ BUG FIX: The recode argument to various functions is now optional and
-    defaults to zero, as the documentation already indicated.
+  * C++ BUG FIX: 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.
+  * 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: 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: 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: 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: 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: 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: 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.
+  * 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.
@@ -1340,46 +1668,46 @@ New in version 0.6.0:
   * 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.
+  * Support for two new encoding schemes has been added which handle bzip2
+    and gzip compression.  Like the slim encoding, the bzip and gzip encod-
+    ing schemes currently do not support writing, but do allow reading
+    dirfile data compressed with the standard gzip and bzip2 utilities.
+    Reading compressed data is unsurprisingly slow.
 
   Library Changes
 
-  * Encoding schemes relying on external libraries (slim, gzip, bzip2) may now
-    be built into stand-alone library modules which will be loaded, as needed,
-    at runtime.  GetData will fail gracefully if modules are missing.  See the
-    README for full details.
+  * 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: 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: 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.
+  * 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.
+  * 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.
 
@@ -1398,10 +1726,11 @@ New in version 0.5.0:
 
   * Various functions now exist to modify field metadata:
 
-      - dirfile_alter_entry, dirfile_alter_<field-type>, dirfile_alter_spec,
-        dirfile_malter_spec
+      - 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 moved to a different format file fragment using
+    dirfile_move.
 
   * A field may be renamed by using dirfile_rename.
 
@@ -1410,24 +1739,26 @@ New in version 0.5.0:
   * 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.
+  * 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 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.
+    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.
+  * 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.
+  * 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
@@ -1435,11 +1766,11 @@ New in version 0.5.0:
 
   Miscellaneous:
 
-  * BUG FIX: The dirifle_madd_bit(3) manual page has been corrected to show
+  * BUG FIX: The dirfile_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:
 
@@ -1448,11 +1779,11 @@ New in version 0.4.2:
   * 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: 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().
+  * BUG FIX: A segmentation fault only encountered when reading slim
+    encoded data has been fixed in dirfile_flush().
 
   Legacy API Changes
 
@@ -1464,9 +1795,10 @@ New in version 0.4.2:
         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.)
+        are wrapped in an extern "C" block. (The new API functions are
+        not.)
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.4.1:
 
@@ -1480,31 +1812,32 @@ New in version 0.4.1:
 
   * 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.
+    field names are prohibited from ending with the known encoding exten-
+    sions.  The Standards still prohibit the full stop character in field
+    names, and the GD_PEDANTIC flag will disable this exception.  Further-
+    more, fields may not be added via GetData which contain a full stop
+    character.
 
   * Some minor speed improvements have been made to the format file parser
     resulting in a ~30% decrease in parsing time.
 
-|==============================================================================|
+|=========================================================================|
 
 New in version 0.4.0:
 
   Dirfile Changes
 
-  * GetData now supports Dirfile Standards Version 6.  Standards Version 6 adds
-    numerical (CONST) and string (STRING) scalar fields to the dirfile, as well
-    as other features outlined below.
+  * 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.
+  * 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).
+  * The tokeniser has been re-written.  Any sequence of non-NUL bytes can
+    now form a valid token.  Field codes may not have ASCII control charac-
+    ters or the "reserved characters" &, /, ;, <, >, |, . but may contain
+    any other characters (including whitespace).
 
   * Subordinate fields may now be attached to fields.  These subfields are
     defined with the META directive, and referenced in most cases as
@@ -1516,26 +1849,27 @@ New in version 0.4.0:
       - 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.
+    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.
+  * 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.
+  * "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.
+    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.
+  * 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
 
@@ -1547,11 +1881,11 @@ New in version 0.4.0:
 
   * 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.)
+    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.
+  * Field code look-ups for input fields are now cached, which should
+    result in slightly better performance from the library.
 
   API Changes
 
@@ -1559,17 +1893,19 @@ New in version 0.4.0:
 
     - 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.
+    - 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.
+  * 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.
+  * 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.
@@ -1587,15 +1923,15 @@ New in version 0.4.0:
   * 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.
+  * DIRFILE struct members and gd_entry_t private members are now com-
+    pletely hidden from the public interface.  Where previously callers
+    could query dirfile->error to check for an error, they must now call
+    get_error(dirfile).  This change was made to reduce unintentional ABI
+    breakage when modifying internal library properties.
 
-  * GD_VERBOSE has been added to the list of available dirfile_open() flags.
-    If this flag is specified, GetData will write errors to stderr as
-    encountered.
+  * 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
 
@@ -1607,27 +1943,27 @@ New in version 0.4.0:
     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.
+  * 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.
+  * 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:
 
@@ -1636,45 +1972,45 @@ New in version 0.3.0:
   * 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.)
+  * 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.
+    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.
+  * 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:
+  * 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
+      - 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
+      - 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.
 
diff --git a/TODO b/TODO
index 43c20fb..08b8750 100644
--- a/TODO
+++ b/TODO
@@ -3,3 +3,4 @@
 * linterp table path munging [MH]
 * Make webpage suck less
 * Fused multiply-add [CBN]
+* Entry list regex [AR]
diff --git a/aclocal.m4 b/aclocal.m4
index c4f38ec..cf88453 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -20,6 +20,9035 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+])
+
+# serial 58 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in @S|@*""; do
+      case $cc_temp in
+        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
+m4_defun([_LT_CC_BASENAME],
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test set != "${COLLECT_NAMES+set}"; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from 'configure', and 'config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain=$ac_aux_dir/ltmain.sh
+])# _LT_PROG_LTMAIN
+
+
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the 'libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# '#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+'$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <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) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test 0 != $[#]
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try '$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try '$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test yes = "$silent" &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options that allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}"; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile=${ofile}T
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Go],			[_LT_LANG(GO)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "$LT_MULTI_MODULE"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS=$save_LDFLAGS
+    ])
+
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]][[,.]]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+    fi
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+    m4_if([$1], [CXX],
+[   if test yes != "$lt_cv_apple_cc_single_mod"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+case $ECHO in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+  [Search for dependent libraries within DIR (or the compiler's sysroot
+   if not specified).])],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+   if test yes = "$GCC"; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([$with_sysroot])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and where our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE=32
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE=64
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
+	    ;;
+	  powerpc64le-*linux*)
+	    LD="${LD-ld} -m elf32lppclinux"
+	    ;;
+	  powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  powerpcle-*linux*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test yes != "$lt_cv_cc_needs_belf"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS=$SAVE_CFLAGS
+  fi
+  ;;
+*-*solaris*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*|x86_64-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD=${LD-ld}_sol2
+        fi
+        ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks=$enable_libtool_lock
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test 0 -eq "$ac_status"; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	AC_TRY_EVAL([lt_ar_try])
+	if test 0 -ne "$ac_status"; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test no = "$lt_cv_ar_at_file"; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  bitrig* | openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test yes = "[$]$2"; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+])
+
+if test yes = "[$]$2"; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring=ABCD
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test 17 != "$i" # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n "$lt_cv_sys_max_cmd_len"; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes = "$cross_compiling"; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <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 -fvisibility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes != "$enable_dlopen"; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen=load_add_on
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen=LoadLibrary
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+    # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+    lt_cv_dlopen=dyld
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen=shl_load],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen=dlopen],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test no = "$lt_cv_dlopen"; then
+    enable_dlopen=no
+  else
+    enable_dlopen=yes
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS=$LDFLAGS
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS=$LIBS
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test yes = "$lt_cv_dlopen_self"; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test no = "$hard_links"; then
+    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+  [Define to the sub-directory where libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP"; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x at S|@2 in
+    x)
+        ;;
+    *:)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+        ;;
+    x:*)
+        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+        ;;
+    *)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+	[], [
+if test yes = "$GCC"; then
+  case $host_os in
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary...
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo = "/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
+      # If using run time linking (on AIX 4.2 or later) use lib<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'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='$libname$shared_ext'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[23]].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+    fi
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test yes = "$lt_cv_prog_gnu_ld"; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+	 [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=sco
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+    [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program that can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$1"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool 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 that can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test no = "$withval" || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test yes = "$GCC"; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return, which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD=$ac_prog
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test yes = "$with_gnu_ld"; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD=$ac_dir/$ac_prog
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test no != "$with_gnu_ld" && break
+	;;
+      *)
+	test yes != "$with_gnu_ld" && 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 yes != "$GCC"; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+  [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM=$NM
+else
+  lt_nm_to_check=${ac_tool_prefix}nm
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS=$lt_save_ifs
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break 2
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break 2
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS=$lt_save_ifs
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols -headers"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test yes != "$lt_cv_path_mainfest_tool"; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+  test DEF = "`$SED -n dnl
+    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
+    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
+    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
+    -e q dnl                          Only consider the first "real" line
+    $1`" dnl
+])# _LT_DLL_DEF_P
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM=-lm)
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test yes = "$GCC"; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test ia64 = "$host_cpu"; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t 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* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
+	  LIBS=conftstm.$ac_objext
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+	    pipe_works=yes
+	  fi
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test yes = "$pipe_works"; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+    [Transform the output of nm into a list of symbols to manually relocate])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+    [The name lister interface])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test yes = "$GXX"; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+	# All AIX code is PIC.
+	if test ia64 = "$host_cpu"; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	m4_if([$1], [GCJ], [],
+	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64, which still supported -KPIC.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test yes = "$GCC"; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      esac
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64, which still supported -KPIC.
+      ecc*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+        *Intel*\ [[CF]]*Compiler*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	  ;;
+	*Portland\ Group*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t 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 GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      ;;
+    esac
+    ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test yes != "$GCC"; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd* | bitrig*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test yes = "$with_gnu_ld"; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test yes = "$lt_use_gnu_ld_interface"; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='$wl'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test ia64 != "$host_cpu"; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <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, use it as
+	# is; otherwise, prepend EXPORTS...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test linux-dietlibc = "$host_os"; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test no = "$tmp_diet"
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
+	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+        if test yes = "$supports_anon_versioning"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	tcc*)
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+	  ;;
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test yes = "$supports_anon_versioning"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test ia64 = "$host_cpu"; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+	;;
+      esac
+
+      if test yes = "$GCC"; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`$CC -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
+	fi
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
+      else
+	# not using gcc
+	if test ia64 = "$host_cpu"; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
+	  else
+	    shared_flag='$wl-bM:SRE'
+	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
+	fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+      else
+	if test ia64 = "$host_cpu"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX([$1])
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  fi
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 3 [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	_LT_TAGVAR(always_export_symbols, $1)=yes
+	_LT_TAGVAR(file_list_spec, $1)='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	# FIXME: Should let the user specify the lib program.
+	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+      ;;
+
+    hpux10*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	m4_if($1, [], [
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  _LT_LINKER_OPTION([if $CC understands -b],
+	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  ;;
+	esac
+      fi
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+	  [lt_cv_irix_exported_symbol],
+	  [save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+	   AC_LINK_IFELSE(
+	     [AC_LANG_SOURCE(
+	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+			      [C++], [[int foo (void) { return 0; }]],
+			      [Fortran 77], [[
+      subroutine foo
+      end]],
+			      [Fortran], [[
+      subroutine foo
+      end]])])],
+	      [lt_cv_irix_exported_symbol=yes],
+	      [lt_cv_irix_exported_symbol=no])
+           LDFLAGS=$save_LDFLAGS])
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+	fi
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd* | bitrig*)
+      if test -f /usr/libexec/ld.so; then
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	else
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	fi
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    osf3*)
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='$wl'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test yes = "$GCC"; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+	else
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test sequent = "$host_vendor"; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test sni = "$host_vendor"; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+	[$RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+	  _LT_TAGVAR(allow_undefined_flag, $1)=
+	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+	  then
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	  else
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  fi
+	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+	])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting $shlibpath_var if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC=$CC
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report what library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test no = "$can_build_shared" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test yes = "$enable_shared" && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test yes = "$enable_shared" || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC=$lt_save_CC
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test yes = "$GXX"; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test yes = "$GXX"; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test yes = "$with_gnu_ld"; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='$wl'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test ia64 = "$host_cpu"; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	      # so we don't have lib.a shared libs to link our executables.
+	      # We have to force runtime linking in this case.
+	      aix_use_runtimelinking=yes
+	      LDFLAGS="$LDFLAGS -Wl,-brtl"
+	    fi
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;	# no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          _LT_TAGVAR(hardcode_direct, $1)=no
+          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+          ;;
+        esac
+
+        if test yes = "$GXX"; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`$CC -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
+	  fi
+	  # Need to ensure runtime linking is disabled for the traditional
+	  # shared library, or the linker may eventually find shared libraries
+	  # /with/ Import File - we do not want to mix them.
+	  shared_flag_aix='-shared'
+	  shared_flag_svr4='-shared $wl-G'
+        else
+          # not using gcc
+          if test ia64 = "$host_cpu"; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
+	    else
+	      shared_flag='$wl-bM:SRE'
+	    fi
+	    shared_flag_aix='$wl-bM:SRE'
+	    shared_flag_svr4='$wl-G'
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          # The "-G" linker flag allows undefined symbols.
+          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX([$1])
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+        else
+          if test ia64 = "$host_cpu"; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX([$1])
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    fi
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	    # -brtl affects multiple linker settings, -berok does not and is overridden later
+	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	    if test svr4 != "$with_aix_soname"; then
+	      # This is similar to how AIX traditionally builds its shared
+	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	    fi
+	    if test aix != "$with_aix_soname"; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# [...]
+	    else
+	      # used by -dlpreopen to get the symbols
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	    fi
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	  # Don't use ranlib
+	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=no
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	  ;;
+	esac
+	;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      os2*)
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	shrext_cmds=.dll
+	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  prefix_cmds="$SED"~
+	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	    prefix_cmds="$prefix_cmds -e 1d";
+	  fi~
+	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test yes = "$GXX"; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test no = "$with_gnu_ld"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd* | bitrig*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands '-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We CANNOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+              '"$_LT_TAGVAR(old_archive_cmds, $1)"
+	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+              '"$_LT_TAGVAR(reload_cmds, $1)"
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)=$GXX
+    _LT_TAGVAR(LD, $1)=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case @S|@2 in
+  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $prev$p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)=$prev$p
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test no = "$pre_test_object_deps_done"; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)=$p
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)=$p
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test no = "$F77"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_F77"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test no = "$can_build_shared" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test yes = "$enable_shared" && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test yes = "$enable_shared" || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)=$G77
+    _LT_TAGVAR(LD, $1)=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test no = "$FC"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_FC"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test no = "$can_build_shared" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test yes = "$enable_shared" && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test yes = "$enable_shared" || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+    _LT_TAGVAR(LD, $1)=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_FC"
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=$lt_simple_compile_test_code
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f "$lt_ac_sed" && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test 10 -lt "$lt_ac_count" && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test "$lt_ac_count" -gt "$lt_ac_max"; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine what file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
+
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+#   Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 8 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option '$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+		   [_LT_ENABLE_FAST_INSTALL])
+  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+		   [_LT_WITH_AIX_SONAME([aix])])
+  ])
+])# _LT_SET_OPTIONS
+
+
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+	IFS=$lt_save_ifs
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+	IFS=$lt_save_ifs
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+	IFS=$lt_save_ifs
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+  AC_MSG_CHECKING([which variant of shared library versioning to provide])
+  AC_ARG_WITH([aix-soname],
+    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+    [case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname],
+    [AC_CACHE_VAL([lt_cv_with_aix_soname],
+      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+    with_aix_soname=$lt_cv_with_aix_soname])
+  AC_MSG_RESULT([$with_aix_soname])
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# LT_INIT options.
+# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for lt_pkg in $withval; do
+	IFS=$lt_save_ifs
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [pic_mode=m4_default([$1], [default])])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
+
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59, which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
+
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 4179 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.6'
+macro_revision='2.4.6'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+#   Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
+
 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -1407,12 +10436,8 @@ m4_include([m4/compiler.m4])
 m4_include([m4/encoding.m4])
 m4_include([m4/floatordering.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/matlab.m4])
 m4_include([m4/perl.m4])
+m4_include([m4/php.m4])
 m4_include([m4/python.m4])
 m4_include([m4/win32.m4])
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index df53b0f..ad9f0d2 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -46,13 +46,17 @@ if MAKE_PERLBINDINGS
 PERL_SUBDIR=perl
 endif
 
+if MAKE_PHPBINDINGS
+PHP_SUBDIR=php
+endif
+
 noinst_PROGRAMS=make_parameters
 
 make_parameters_SOURCES = make_parameters.c
 nodist_make_parameters_SOURCES = ../src/getdata.h ../src/gd_config.h
 
-SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${IDL_SUBDIR} ${MATLAB_SUBDIR} \
-					${PY_SUBDIR} ${PERL_SUBDIR}
+SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${IDL_SUBDIR} ${PY_SUBDIR} \
+					${PERL_SUBDIR} ${MATLAB_SUBDIR} ${PHP_SUBDIR}
 
 make_parameters$(EXEEXT): $(make_parameters_SOURCES) \
 				    $(nodist_make_parameters_SOURCES)
diff --git a/bindings/Makefile.in b/bindings/Makefile.in
index b1925a4..b81e0b3 100644
--- a/bindings/Makefile.in
+++ b/bindings/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -185,7 +183,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = . f77 cxx idl matlab python perl
+DIST_SUBDIRS = . f77 cxx idl python perl matlab php
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -238,6 +236,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -263,8 +263,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -312,7 +323,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -327,12 +337,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -396,9 +410,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -406,6 +421,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -419,7 +435,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -446,10 +462,11 @@ AUTOMAKE_OPTIONS = foreign
 @MAKE_MATLABBINDINGS_TRUE at MATLAB_SUBDIR = matlab
 @MAKE_PYBINDINGS_TRUE at PY_SUBDIR = python
 @MAKE_PERLBINDINGS_TRUE at PERL_SUBDIR = perl
+ at MAKE_PHPBINDINGS_TRUE@PHP_SUBDIR = php
 make_parameters_SOURCES = make_parameters.c
 nodist_make_parameters_SOURCES = ../src/getdata.h ../src/gd_config.h
-SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${IDL_SUBDIR} ${MATLAB_SUBDIR} \
-					${PY_SUBDIR} ${PERL_SUBDIR}
+SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${IDL_SUBDIR} ${PY_SUBDIR} \
+					${PERL_SUBDIR} ${MATLAB_SUBDIR} ${PHP_SUBDIR}
 
 all: all-recursive
 
diff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am
index b87c686..2f50a7b 100644
--- a/bindings/cxx/Makefile.am
+++ b/bindings/cxx/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2012 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -21,15 +21,7 @@
 AUTOMAKE_OPTIONS = foreign
 getdata_includedir = ${includedir}/getdata
 
-if CXX_WALL
-WALL=-Wall
-endif
-
-if CXX_WEXTRA
-WEXTRA=-Wextra
-endif
-
-AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(top_srcdir)/src
+AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(top_srcdir)/src
 LIBS=
 
 SUBDIRS=test
@@ -47,11 +39,12 @@ getdata_include_HEADERS = getdata/dirfile.h getdata/entry.h getdata/rawentry.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 \
+													fragment.cpp lincomentry.cpp \
 													linterpentry.cpp mplexentry.cpp multiplyentry.cpp \
 													phaseentry.cpp polynomentry.cpp rawentry.cpp \
-													recipentry.cpp sbitentry.cpp stringentry.cpp \
-													windowentry.cpp ${getdata_include_HEADERS} internal.h
+													recipentry.cpp sbitentry.cpp \
+													stringentry.cpp windowentry.cpp \
+													${getdata_include_HEADERS} internal.h
 libgetdata___la_LIBADD=../../src/libgetdata.la
 libgetdata___la_LDFLAGS = -version-info @GETDATAXX_VERSION@
 
diff --git a/bindings/cxx/Makefile.in b/bindings/cxx/Makefile.in
index fb71891..7df17ba 100644
--- a/bindings/cxx/Makefile.in
+++ b/bindings/cxx/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -133,10 +131,9 @@ 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 mplexentry.lo \
-	multiplyentry.lo phaseentry.lo polynomentry.lo rawentry.lo \
-	recipentry.lo sbitentry.lo stringentry.lo windowentry.lo \
-	$(am__objects_1)
+	lincomentry.lo linterpentry.lo mplexentry.lo multiplyentry.lo \
+	phaseentry.lo polynomentry.lo rawentry.lo recipentry.lo \
+	sbitentry.lo stringentry.lo windowentry.lo $(am__objects_1)
 libgetdata___la_OBJECTS = $(am_libgetdata___la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -294,6 +291,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -319,8 +318,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -368,7 +378,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -383,12 +392,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -452,9 +465,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -462,6 +476,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -475,7 +490,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008-2012 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -497,9 +512,7 @@ top_srcdir = @top_srcdir@
 #
 AUTOMAKE_OPTIONS = foreign
 getdata_includedir = ${includedir}/getdata
- at CXX_WALL_TRUE@WALL = -Wall
- at CXX_WEXTRA_TRUE@WEXTRA = -Wextra
-AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(top_srcdir)/src
+AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(top_srcdir)/src
 SUBDIRS = test
 getdata_include_HEADERS = getdata/dirfile.h getdata/entry.h getdata/rawentry.h \
 													getdata/lincomentry.h getdata/linterpentry.h \
@@ -514,11 +527,12 @@ getdata_include_HEADERS = getdata/dirfile.h getdata/entry.h getdata/rawentry.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 \
+													fragment.cpp lincomentry.cpp \
 													linterpentry.cpp mplexentry.cpp multiplyentry.cpp \
 													phaseentry.cpp polynomentry.cpp rawentry.cpp \
-													recipentry.cpp sbitentry.cpp stringentry.cpp \
-													windowentry.cpp ${getdata_include_HEADERS} internal.h
+													recipentry.cpp sbitentry.cpp \
+													stringentry.cpp windowentry.cpp \
+													${getdata_include_HEADERS} internal.h
 
 libgetdata___la_LIBADD = ../../src/libgetdata.la
 libgetdata___la_LDFLAGS = -version-info @GETDATAXX_VERSION@
@@ -608,7 +622,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/divideentry.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry.Plo at am__quote@
 @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@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lincomentry.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/linterpentry.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mplexentry.Plo at am__quote@
diff --git a/bindings/cxx/bitentry.cpp b/bindings/cxx/bitentry.cpp
index a3cdd05..e15fe6c 100644
--- a/bindings/cxx/bitentry.cpp
+++ b/bindings/cxx/bitentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2011 D. V. Wiebe
+// Copyright (C) 2008-2012 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -67,22 +67,6 @@ int BitEntry::SetNumBits(int num_bits)
   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;
diff --git a/bindings/cxx/constentry.cpp b/bindings/cxx/constentry.cpp
index 7d72667..83b6f7b 100644
--- a/bindings/cxx/constentry.cpp
+++ b/bindings/cxx/constentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+// Copyright (C) 2008-2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/dirfile.cpp b/bindings/cxx/dirfile.cpp
index b25c13b..cc6ec8b 100644
--- a/bindings/cxx/dirfile.cpp
+++ b/bindings/cxx/dirfile.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2012 D. V. Wiebe
+// Copyright (C) 2008-2012, 2014 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -18,8 +18,15 @@
 // along with GetData; if not, write to the Free Software Foundation, Inc.,
 // 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
+#include "getdata/dirfile.h"
 #include "internal.h"
 
+// This is not part of the Dirfile class, but it's convenient to put it here
+int GetData::EncodingSupport(GetData::EncodingScheme encoding)
+{
+  return gd_encoding_support((unsigned long)encoding);
+}
+
 Dirfile::Dirfile()
 {
   D = gd_invalid_dirfile();
@@ -198,9 +205,14 @@ const gd_carray_t *Dirfile::Carrays(DataType type) const
   return gd_carrays(D, (gd_type_t)type);
 }
 
+size_t Dirfile::ArrayLen(const char *field_code) const
+{
+  return gd_array_len(D, field_code);
+}
+
 size_t Dirfile::CarrayLen(const char *field_code) const
 {
-  return gd_carray_len(D, field_code);
+  return ArrayLen(field_code);
 }
 
 const void *Dirfile::Constants(DataType type) const
@@ -401,7 +413,7 @@ 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
+int Dirfile::Delete(const char* field_code, unsigned flags) const
 {
   return gd_delete(D, field_code, flags);
 }
@@ -469,11 +481,6 @@ const char* Dirfile::AliasTarget(const char* field_code) const
   return gd_alias_target(D, field_code);
 }
 
-int Dirfile::DeleteAlias(const char* field_code, int flags) const
-{
-  return gd_delete_alias(D, field_code, flags);
-}
-
 int Dirfile::Hide(const char* field_code) const
 {
   return gd_hide(D, field_code);
@@ -496,11 +503,6 @@ int Dirfile::MAddAlias(const char* parent, const char* name, const char* target)
   return gd_madd_alias(D, parent, name, target);
 }
 
-int Dirfile::MoveAlias(const char* field_code, int new_fragment) const
-{
-  return gd_move_alias(D, field_code, new_fragment);
-}
-
 int Dirfile::NAliases(const char* field_code) const
 {
   return gd_naliases(D, field_code);
diff --git a/bindings/cxx/entry.cpp b/bindings/cxx/entry.cpp
index 5b7c8f6..13581c3 100644
--- a/bindings/cxx/entry.cpp
+++ b/bindings/cxx/entry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2012, 2014, 2015 D. V. Wiebe
+// Copyright (C) 2008-2014 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -32,7 +32,7 @@ Entry::Entry(const GetData::Dirfile *dirfile, const char* field_code)
 {
   D = dirfile;
   if (gd_entry(D->D, field_code, &E))
-    memset(&E, 9, sizeof(E));
+    memset(&E, 0, sizeof(E));
 }
 
 Entry::~Entry()
@@ -77,12 +77,12 @@ int Entry::CheckIndex(gd_entype_t field_type, int n_fields, int index)
   return 1;
 }
 
-int Entry::Move(int new_fragment, int move_data)
+int Entry::Move(int new_fragment, unsigned flags)
 {
   int ret = -1;
 
   if (D != NULL)
-    ret = gd_move(D->D, E.field, new_fragment, move_data);
+    ret = gd_move(D->D, E.field, new_fragment, flags);
 
   if (!ret)
     E.fragment_index = new_fragment;
@@ -90,22 +90,30 @@ int Entry::Move(int new_fragment, int move_data)
   return ret;
 }
 
-int Entry::Rename(const char* new_name, int move_data)
+int Entry::Rename(const char* new_name, unsigned flags)
 {
   char* ptr;
   int ret = -1;
 
   if (D != NULL)
-    ret = gd_rename(D->D, E.field, new_name, move_data);
+    ret = gd_rename(D->D, E.field, new_name, flags);
 
   if (ret) {
     if (E.field == NULL) {
       E.field = strdup(new_name);
     } else {
-      /* For a metafield, the length of the string that ends up in nn cannot
-       * be larger than the following, because E.field must have at least one
-       * character after the / which will be deleted (and it's space used for
-       * the terminating NUL).
+      /* this buffer is used if E is a metafield, in which case we'll
+       * replace the subfield name in E.field with new_name.  The length
+       * of the new code is
+       *
+       *   strlen(E.field) - strlen(<subfield-name>) + strlen(new_name)
+       *     + 1 (for the trailing NUL).
+       *
+       * The subfield name in E.field must be at least one character long, so
+       * the length of the new code is at most:
+       *
+       *   strlen(E.field) - 1 + strlen(new_name) + 1
+       *   = strlen(E.field) + strlen(new_name)
        */
       char* nn = (char*)malloc(strlen(E.field) + strlen(new_name));
       strcpy(nn, E.field);
diff --git a/bindings/cxx/fragment.cpp b/bindings/cxx/fragment.cpp
index 83d914b..da84501 100644
--- a/bindings/cxx/fragment.cpp
+++ b/bindings/cxx/fragment.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010, 2011, 2014 D. V. Wiebe
+// Copyright (C) 2008-2012, 2014 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/getdata/bitentry.h b/bindings/cxx/getdata/bitentry.h
index 845633b..54b586a 100644
--- a/bindings/cxx/getdata/bitentry.h
+++ b/bindings/cxx/getdata/bitentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2010 D. V. Wiebe
+// Copyright (C) 2008-2012, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -37,7 +37,9 @@ namespace GetData {
       BitEntry(const char* field_code, const char* in_field, int bitnum,
           int numbits = 1, int fragment_index = 0);
 
-      virtual const char *Input() const { return E.in_fields[0]; };
+      virtual const char *Input(int index = 0) const {
+        return (index == 0) ? E.in_fields[0] : NULL;
+      };
 
       virtual int FirstBit() const { return E.u.bit.bitnum; };
 
@@ -49,9 +51,13 @@ namespace GetData {
       int SetNumBits(int num_bits);
       int SetNumBits(const char* num_bits);
 
-      virtual const char *Scalar(int index = 0) const;
+      virtual const char *Scalar(int index) const {
+        return (index == 0 || index == 1) ? E.scalar[index] : NULL;
+      };
 
-      virtual int ScalarIndex(int index = 0) const;
+      virtual int ScalarIndex(int index) const {
+        return (index == 0 || index == 1) ? E.scalar_ind[index] : 0;
+      };
 
     private:
       BitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
diff --git a/bindings/cxx/getdata/carrayentry.h b/bindings/cxx/getdata/carrayentry.h
index dc55ff5..1f4e554 100644
--- a/bindings/cxx/getdata/carrayentry.h
+++ b/bindings/cxx/getdata/carrayentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010 D. V. Wiebe
+// Copyright (C) 2010, 2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/getdata/constentry.h b/bindings/cxx/getdata/constentry.h
index 1e4436d..587698e 100644
--- a/bindings/cxx/getdata/constentry.h
+++ b/bindings/cxx/getdata/constentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010 D. V. Wiebe
+// Copyright (C) 2008-2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/getdata/dirfile.h b/bindings/cxx/getdata/dirfile.h
index babe414..33010da 100644
--- a/bindings/cxx/getdata/dirfile.h
+++ b/bindings/cxx/getdata/dirfile.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2012 D. V. Wiebe
+// Copyright (C) 2008-2012, 2014 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -64,6 +64,8 @@ namespace GetData {
   class Entry;
   class RawEntry;
 
+  int EncodingSupport(EncodingScheme encoding);
+
   class Dirfile {
     friend class Entry;
     friend class RawEntry;
@@ -107,9 +109,11 @@ namespace GetData {
 
       int AlterSpec(const char* spec, int recode = 0) const;
 
+      size_t ArrayLen(const char *field_code) const;
+
       gd_off64_t BoF(const char *field_code) const;
 
-      size_t CarrayLen(const char *field_code) const;
+      size_t CarrayLen(const char *field_code) const gd_deprecated;
 
       const gd_carray_t *Carrays(DataType type = Float64) const;
 
@@ -117,9 +121,7 @@ namespace GetData {
 
       const void *Constants(DataType type = Float64) const;
 
-      int Delete(const char* field_code, int flags = 0) const;
-
-      int DeleteAlias(const char* field_code, int flags = 0) const;
+      int Delete(const char* field_code, unsigned flags = 0) const;
 
       int DeSync(unsigned int flags = 0);
 
@@ -205,8 +207,6 @@ namespace GetData {
 
       const char **MStrings(const char *parent) const;
 
-      int MoveAlias(const char* field_code, int new_fragment) const;
-
       const char **MVectorList(const char *parent) const;
 
       int NAliases(const char* field_code) const;
diff --git a/bindings/cxx/getdata/divideentry.h b/bindings/cxx/getdata/divideentry.h
index 2b4a4e7..d0026ff 100644
--- a/bindings/cxx/getdata/divideentry.h
+++ b/bindings/cxx/getdata/divideentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010 D. V. Wiebe
+// Copyright (C) 2010, 2011, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -37,8 +37,8 @@ namespace GetData {
       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];
+      virtual const char *Input(int index) const {
+        return (index == 0 || index == 1) ? E.in_fields[index] : NULL;
       };
 
       int SetInput(const char* field, int index);
diff --git a/bindings/cxx/getdata/entry.h b/bindings/cxx/getdata/entry.h
index 93af1c1..359e23c 100644
--- a/bindings/cxx/getdata/entry.h
+++ b/bindings/cxx/getdata/entry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2012 D. V. Wiebe
+// Copyright (C) 2008-2013, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -89,25 +89,31 @@ namespace GetData {
 
       int FragmentIndex() const { return E.fragment_index; };
 
-      int Move(int new_fragment, int move_data = 0);
+      int Move(int new_fragment, unsigned flags = 0);
 
-      int Rename(const char* new_name, int move_data = 0);
+      int Rename(const char* new_name, unsigned flags = 0);
 
       /* Specific data */
-      virtual const char *Input(int index = 0) const {
+      virtual const char *Input(int index) const {
         return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
           E.in_fields[index] : NULL;
       };
 
       virtual int ComplexScalars() const {
-        return (E.field_type == GD_LINCOM_ENTRY ||
+        if (E.field_type == GD_LINCOM_ENTRY ||
             E.field_type == GD_POLYNOM_ENTRY ||
-            E.field_type == GD_RECIP_ENTRY) ? E.comp_scal : 0;
+            E.field_type == GD_RECIP_ENTRY)
+          if (E.flags & GD_EN_COMPSCAL)
+            return 1;
+
+        return 0;
       }
 
-      virtual const char *Scalar(int index = 0) const;
+      unsigned int Flags() const { return E.flags; };
+
+      virtual const char *Scalar(int index) const;
 
-      virtual int ScalarIndex(int index = 0) const;
+      virtual int ScalarIndex(int index) const;
 
       /* RAW methods */
       virtual unsigned int SamplesPerFrame() const {
@@ -124,26 +130,26 @@ namespace GetData {
         return (E.field_type == GD_LINCOM_ENTRY) ? E.u.lincom.n_fields : 0;
       };
 
-      virtual double Scale(int index = 0) const {
+      virtual double Scale(int index) const {
         return (E.field_type == GD_LINCOM_ENTRY &&
             CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
           E.u.lincom.m[index] : 0;
       }
 
-      virtual std::complex<double> CScale(int index = 0) const {
+      virtual std::complex<double> CScale(int index) 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 {
+      virtual double Offset(int index) const {
         return (E.field_type == GD_LINCOM_ENTRY &&
             CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
           E.u.lincom.b[index] : 0;
       }
 
-      virtual std::complex<double> COffset(int index = 0) const {
+      virtual std::complex<double> COffset(int index) 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],
@@ -185,12 +191,12 @@ namespace GetData {
         return (E.field_type == GD_POLYNOM_ENTRY) ? E.u.polynom.poly_ord : 0;
       };
 
-      virtual double Coefficient(int index = 0) const {
+      virtual double Coefficient(int index) const {
         return (E.field_type == GD_POLYNOM_ENTRY && index <=
             E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
       }
 
-      virtual std::complex<double> CCoefficient(int index = 0) const {
+      virtual std::complex<double> CCoefficient(int index) const {
         return (E.field_type == GD_POLYNOM_ENTRY && index <=
             E.u.polynom.poly_ord) ?
           std::complex<double>(E.u.polynom.ca[index][0],
diff --git a/bindings/cxx/getdata/fragment.h b/bindings/cxx/getdata/fragment.h
index be06adc..fd39cba 100644
--- a/bindings/cxx/getdata/fragment.h
+++ b/bindings/cxx/getdata/fragment.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010 D. V. Wiebe
+// Copyright (C) 2008-2012 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -28,11 +28,17 @@
 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,
-    SieEncoding   = GD_SIE_ENCODED,  ZzipEncoding  = GD_ZZIP_ENCODED,
-    ZzslimEncoding = GD_ZZSLIM_ENCODED, UnsupportedEncoding = GD_ENC_UNSUPPORTED
+    AutoEncoding   = GD_AUTO_ENCODED,
+    Bzip2Encoding  = GD_BZIP2_ENCODED,
+    FlacEncoding   = GD_FLAC_ENCODED,
+    GzipEncoding   = GD_GZIP_ENCODED,
+    RawEncoding    = GD_UNENCODED,
+    SieEncoding    = GD_SIE_ENCODED,
+    SlimEncoding   = GD_SLIM_ENCODED,
+    TextEncoding   = GD_TEXT_ENCODED,
+    ZzipEncoding   = GD_ZZIP_ENCODED,
+    ZzslimEncoding = GD_ZZSLIM_ENCODED,
+    UnsupportedEncoding = GD_ENC_UNSUPPORTED
   };
 
   class Dirfile;
diff --git a/bindings/cxx/getdata/indexentry.h b/bindings/cxx/getdata/indexentry.h
index 35aa046..e8980f1 100644
--- a/bindings/cxx/getdata/indexentry.h
+++ b/bindings/cxx/getdata/indexentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010 D. V. Wiebe
+// Copyright (C) 2008-2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/getdata/lincomentry.h b/bindings/cxx/getdata/lincomentry.h
index b795140..bd221c8 100644
--- a/bindings/cxx/getdata/lincomentry.h
+++ b/bindings/cxx/getdata/lincomentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2010 D. V. Wiebe
+// Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -41,49 +41,51 @@ namespace GetData {
           std::complex<double>* cm, std::complex<double>* cb,
           int fragment_index = 0);
 
-      virtual const char *Input(int index = 0) const {
+      virtual const char *Input(int index) const {
         return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? 
             E.in_fields[index] : NULL;
       };
 
-      virtual int ComplexScalars() const { return E.comp_scal; }
+      virtual int ComplexScalars() const {
+        return (E.flags & GD_EN_COMPSCAL) ? 1 : 0;
+      }
 
       virtual int NFields() const { return E.u.lincom.n_fields; };
 
-      virtual double Scale(int index = 0) const {
+      virtual double Scale(int index) const {
         return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
           E.u.lincom.m[index] : 0;
       };
 
-      virtual std::complex<double> CScale(int index = 0) const {
+      virtual std::complex<double> CScale(int index) 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 {
+      virtual double Offset(int index) const {
         return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
           E.u.lincom.b[index] : 0;
       };
 
-      virtual std::complex<double> COffset(int index = 0) const {
+      virtual std::complex<double> COffset(int index) 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 const char *Scalar(int index) const;
 
-      virtual int ScalarIndex(int index = 0) const;
+      virtual int ScalarIndex(int index) 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);
+      int SetInput(const char* field, int index);
+      int SetScale(double scale, int index);
+      int SetScale(const char* scale, int index);
+      int SetScale(std::complex<double> scale, int index);
+      int SetOffset(double offset, int index);
+      int SetOffset(const char* scale, int index);
+      int SetOffset(std::complex<double> offset, int index);
 
     private:
       LincomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
diff --git a/bindings/cxx/getdata/linterpentry.h b/bindings/cxx/getdata/linterpentry.h
index 48151db..7c1a652 100644
--- a/bindings/cxx/getdata/linterpentry.h
+++ b/bindings/cxx/getdata/linterpentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010 D. V. Wiebe
+// Copyright (C) 2008-2011, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -37,7 +37,9 @@ namespace GetData {
       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 *Input(int index = 0) const {
+        return (index == 0) ? E.in_fields[0] : NULL;
+      };
 
       virtual const char *Table() const { return E.u.linterp.table; };
 
diff --git a/bindings/cxx/getdata/mplexentry.h b/bindings/cxx/getdata/mplexentry.h
index f1e7029..aea09af 100644
--- a/bindings/cxx/getdata/mplexentry.h
+++ b/bindings/cxx/getdata/mplexentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2012 D. V. Wiebe
+// Copyright (C) 2012, 2013, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -38,13 +38,17 @@ namespace GetData {
           const char *check_field, int count_val, int period,
           int fragment_index = 0);
 
-      virtual const char *Input(int index = 0) const {
-        return E.in_fields[(index == 0) ? 0 : 1];
+      virtual const char *Input(int index) const {
+        return (index == 0 || index == 1) ? E.in_fields[index] : NULL;
       };
 
-      virtual const char *Scalar() const { return E.scalar[0]; }
+      virtual const char *Scalar(int index) const {
+        return (index == 0 || index == 1) ? E.scalar[index] : NULL;
+      };
 
-      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+      virtual int ScalarIndex(int index) const {
+        return (index == 0 || index == 1) ? E.scalar_ind[index] : 0;
+      };
 
       virtual int CountVal() const { return E.u.mplex.count_val; };
 
diff --git a/bindings/cxx/getdata/multiplyentry.h b/bindings/cxx/getdata/multiplyentry.h
index b589050..a5fefea 100644
--- a/bindings/cxx/getdata/multiplyentry.h
+++ b/bindings/cxx/getdata/multiplyentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010 D. V. Wiebe
+// Copyright (C) 2008-2011, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -37,8 +37,8 @@ namespace GetData {
       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];
+      virtual const char *Input(int index) const {
+        return (index == 0 || index == 1) ? E.in_fields[index] : NULL;
       };
 
       int SetInput(const char* field, int index);
diff --git a/bindings/cxx/getdata/phaseentry.h b/bindings/cxx/getdata/phaseentry.h
index 14f0bc7..b88ab4b 100644
--- a/bindings/cxx/getdata/phaseentry.h
+++ b/bindings/cxx/getdata/phaseentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2010 D. V. Wiebe
+// Copyright (C) 2008-2011, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -37,7 +37,9 @@ namespace GetData {
       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 const char *Input(int index = 0) const {
+        return (index == 0) ? E.in_fields[0] : NULL;
+      };
 
       virtual gd_shift_t Shift() const { return E.u.phase.shift; };
 
@@ -45,9 +47,13 @@ namespace GetData {
       int SetShift(gd_shift_t shift);
       int SetShift(const char* shift);
 
-      const char *Scalar() const { return E.scalar[0]; };
+      virtual const char *Scalar(int index = 0) const {
+        return (index == 0) ? E.scalar[0] :  NULL;
+      };
 
-      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+      virtual int ScalarIndex(int index = 0) const {
+        return (index == 0) ? E.scalar_ind[0] :  0;
+      };
 
     private:
       PhaseEntry(const GetData::Dirfile *dirfile, const char* field_code) :
diff --git a/bindings/cxx/getdata/polynomentry.h b/bindings/cxx/getdata/polynomentry.h
index 1d6630e..0005c00 100644
--- a/bindings/cxx/getdata/polynomentry.h
+++ b/bindings/cxx/getdata/polynomentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010 D. V. Wiebe
+// Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -40,31 +40,36 @@ namespace GetData {
       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 const char *Input(int index = 0) const {
+        return (index == 0) ? E.in_fields[0] : NULL;
+      };
 
-      virtual int ComplexScalars() const { return E.comp_scal; }
+      virtual int ComplexScalars() const {
+        return (E.flags & GD_EN_COMPSCAL) ? 1 : 0;
+      }
 
       virtual int PolyOrd() const { return E.u.polynom.poly_ord; };
 
-      virtual double Coefficient(int index = 0) const {
-        return (index <= E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
+      virtual double Coefficient(int index) const {
+        return (index >= 0 && 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],
+      virtual std::complex<double> CCoefficient(int index) const {
+        return (index >= 0 && 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 const char *Scalar(int index) const;
 
-      virtual int ScalarIndex(int index = 0) const;
+      virtual int ScalarIndex(int index) 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);
+      int SetCoefficient(double coeff, int index);
+      int SetCoefficient(const char* coeff, int index);
+      int SetCoefficient(std::complex<double> coeff, int index);
 
     private:
       PolynomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
diff --git a/bindings/cxx/getdata/rawentry.h b/bindings/cxx/getdata/rawentry.h
index 758fcd0..dae490b 100644
--- a/bindings/cxx/getdata/rawentry.h
+++ b/bindings/cxx/getdata/rawentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2010 D. V. Wiebe
+// Copyright (C) 2008-2012, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -51,9 +51,13 @@ namespace GetData {
       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 const char *Scalar(int index = 0) const {
+        return (index == 0) ? E.scalar[0] :  NULL;
+      };
 
-      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+      virtual int ScalarIndex(int index = 0) const {
+        return (index == 0) ? E.scalar_ind[0] :  0;
+      };
 
     private:
       RawEntry(const GetData::Dirfile *dirfile, const char* field_code) :
diff --git a/bindings/cxx/getdata/recipentry.h b/bindings/cxx/getdata/recipentry.h
index 3d87417..c946b1f 100644
--- a/bindings/cxx/getdata/recipentry.h
+++ b/bindings/cxx/getdata/recipentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010 D. V. Wiebe
+// Copyright (C) 2010, 2011, 2013, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -40,13 +40,21 @@ namespace GetData {
       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 *Input(int index = 0) const {
+        return (index == 0) ? E.in_fields[0] : NULL;
+      };
 
-      virtual const char *Scalar() const { return E.scalar[0]; }
+      virtual const char *Scalar(int index = 0) const {
+        return (index == 0) ? E.scalar[0] :  NULL;
+      };
 
-      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+      virtual int ScalarIndex(int index = 0) const {
+        return (index == 0) ? E.scalar_ind[0] :  0;
+      };
 
-      virtual int ComplexScalars() const { return E.comp_scal; }
+      virtual int ComplexScalars() const {
+        return (E.flags & GD_EN_COMPSCAL) ? 1 : 0;
+      }
 
       virtual double Dividend() const { return E.u.recip.dividend; };
 
diff --git a/bindings/cxx/getdata/sbitentry.h b/bindings/cxx/getdata/sbitentry.h
index ae8a75b..ed77471 100644
--- a/bindings/cxx/getdata/sbitentry.h
+++ b/bindings/cxx/getdata/sbitentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2010 D. V. Wiebe
+// Copyright (C) 2008-2012, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -37,7 +37,9 @@ namespace GetData {
       SBitEntry(const char* field_code, const char* in_field, int bitnum,
           int numbits = 1, int fragment_index = 0);
 
-      virtual const char *Input() const { return E.in_fields[0]; };
+      virtual const char *Input(int index = 0) const {
+        return (index == 0) ? E.in_fields[0] : NULL;
+      };
 
       virtual int FirstBit() const { return E.u.bit.bitnum; };
 
@@ -49,9 +51,13 @@ namespace GetData {
       int SetNumBits(int num_bits);
       int SetNumBits(const char* num_bits);
 
-      virtual const char *Scalar(int index = 0) const;
+      virtual const char *Scalar(int index) const {
+        return (index == 0 || index == 1) ? E.scalar[index] : NULL;
+      };
 
-      virtual int ScalarIndex(int index = 0) const;
+      virtual int ScalarIndex(int index) const {
+        return (index == 0 || index == 1) ? E.scalar_ind[index] : 0;
+      };
 
     private:
       SBitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
diff --git a/bindings/cxx/getdata/stringentry.h b/bindings/cxx/getdata/stringentry.h
index 1b3662f..bc64886 100644
--- a/bindings/cxx/getdata/stringentry.h
+++ b/bindings/cxx/getdata/stringentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010 D. V. Wiebe
+// Copyright (C) 2008-2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/getdata/windowentry.h b/bindings/cxx/getdata/windowentry.h
index 61b67c7..4a4c1f7 100644
--- a/bindings/cxx/getdata/windowentry.h
+++ b/bindings/cxx/getdata/windowentry.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2012 D. V. Wiebe
+// Copyright (C) 2011, 2012, 2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -38,13 +38,17 @@ namespace GetData {
           const char *check_Field, WindOpType windop, gd_triplet_t threshold,
           int fragment_index = 0);
 
-      virtual const char *Input(int index = 0) const {
-        return E.in_fields[(index == 0) ? 0 : 1];
+      virtual const char *Input(int index) const {
+        return (index == 0 || index == 1) ? E.in_fields[index] : NULL;
       };
 
-      virtual const char *Scalar() const { return E.scalar[0]; }
+      virtual const char *Scalar(int index = 0) const {
+        return (index == 0) ? E.scalar[0] :  NULL;
+      };
 
-      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+      virtual int ScalarIndex(int index = 0) const {
+        return (index == 0) ? E.scalar_ind[0] :  0;
+      };
 
       virtual WindOpType WindOp() const {
         return (WindOpType)E.u.window.windop;
diff --git a/bindings/cxx/indexentry.cpp b/bindings/cxx/indexentry.cpp
deleted file mode 100644
index c20dec1..0000000
--- a/bindings/cxx/indexentry.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (C) 2011 D. V. Wiebe
-//
-///////////////////////////////////////////////////////////////////////////
-//
-// This file is part of the GetData project.
-//
-// GetData is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License as published by the
-// Free Software Foundation; either version 2.1 of the License, or (at your
-// option) any later version.
-//
-// GetData is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
-// License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with GetData; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-#include "internal.h"
diff --git a/bindings/cxx/internal.h b/bindings/cxx/internal.h
index 06a913d..83f1a8c 100644
--- a/bindings/cxx/internal.h
+++ b/bindings/cxx/internal.h
@@ -34,14 +34,14 @@
 extern "C" const char* gd_colnil(void);
 extern "C" const char* gd_coladd(void);
 extern "C" const char* gd_colsub(void);
-#define dtracevoid() printf("%s %s()\n", gd_coladd(), __FUNCTION__)
+#define dtracevoid() printf("%s %s()\n", gd_coladd(), __func__)
 #define dtrace(fmt, ...) printf("%s %s(" fmt ")\n", gd_coladd(), \
-    __FUNCTION__, ##__VA_ARGS__)
+    __func__, ##__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__)
+    __func__, __LINE__, ##__VA_ARGS__)
+#define dreturnvoid() printf("%s %s = (nil)\n", gd_colsub(), __func__)
 #define dreturn(fmt, ...) printf("%s %s = " fmt "\n", gd_colsub(), \
-    __FUNCTION__, ##__VA_ARGS__)
+    __func__, ##__VA_ARGS__)
 #define dwatch(fmt, v) printf("%s %s = " fmt "\n", gd_colnil(), #v, v)
 #else
 #define dtracevoid()
diff --git a/bindings/cxx/lincomentry.cpp b/bindings/cxx/lincomentry.cpp
index 00b04bf..01cfee0 100644
--- a/bindings/cxx/lincomentry.cpp
+++ b/bindings/cxx/lincomentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2011 D. V. Wiebe
+// Copyright (C) 2008-2011, 2013 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -32,7 +32,7 @@ LincomEntry::LincomEntry(const char* field_code, int n_fields,
   E.field_type = GD_LINCOM_ENTRY;
   E.u.lincom.n_fields = n_fields;
   E.fragment_index = fragment_index;
-  E.comp_scal = 0;
+  E.flags = 0;
   for (i = 0; i < n_fields; ++i) {
     E.in_fields[i] = strdup(in_fields[i]);
     E.u.lincom.m[i] = m[i];
@@ -50,7 +50,7 @@ LincomEntry::LincomEntry(const char* field_code, int n_fields,
   E.field_type = GD_LINCOM_ENTRY;
   E.u.lincom.n_fields = n_fields;
   E.fragment_index = fragment_index;
-  E.comp_scal = 1;
+  E.flags = GD_EN_COMPSCAL;
   for (i = 0; i < n_fields; ++i) {
     E.in_fields[i] = strdup(in_fields[i]);
     E.u.lincom.cm[i][0] = cm[i].real();
@@ -121,7 +121,7 @@ int LincomEntry::SetScale(std::complex<double> scale, int index)
 
   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;
+  E.flags = GD_EN_COMPSCAL;
 
   if (D != NULL)
     return gd_alter_entry(D->D, E.field, &E, 0);
@@ -171,7 +171,7 @@ int LincomEntry::SetOffset(std::complex<double> offset, int index)
 
   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;
+  E.flags = GD_EN_COMPSCAL;
 
   if (D != NULL)
     return gd_alter_entry(D->D, E.field, &E, 0);
diff --git a/bindings/cxx/linterpentry.cpp b/bindings/cxx/linterpentry.cpp
index 541437a..93a891f 100644
--- a/bindings/cxx/linterpentry.cpp
+++ b/bindings/cxx/linterpentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+// Copyright (C) 2008-2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/mplexentry.cpp b/bindings/cxx/mplexentry.cpp
index 341d9ff..ebf8d6b 100644
--- a/bindings/cxx/mplexentry.cpp
+++ b/bindings/cxx/mplexentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2012 D. V. Wiebe
+// Copyright (C) 2012, 2013 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/multiplyentry.cpp b/bindings/cxx/multiplyentry.cpp
index fe6884a..fff2d14 100644
--- a/bindings/cxx/multiplyentry.cpp
+++ b/bindings/cxx/multiplyentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+// Copyright (C) 2008-2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/polynomentry.cpp b/bindings/cxx/polynomentry.cpp
index 3ce0c4c..c0db586 100644
--- a/bindings/cxx/polynomentry.cpp
+++ b/bindings/cxx/polynomentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 D. V. Wiebe
+// Copyright (C) 2009, 2010, 2011, 2013 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -31,7 +31,7 @@ PolynomEntry::PolynomEntry(const char* field_code, int poly_ord,
   E.field_type = GD_POLYNOM_ENTRY;
   E.u.polynom.poly_ord = poly_ord;
   E.fragment_index = fragment_index;
-  E.comp_scal = 0;
+  E.flags = 0;
   E.in_fields[0] = strdup(in_field);
   for (i = 0; i <= poly_ord; ++i)
     E.u.polynom.a[i] = a[i];
@@ -47,7 +47,7 @@ PolynomEntry::PolynomEntry(const char* field_code, int poly_ord,
   E.field_type = GD_POLYNOM_ENTRY;
   E.u.polynom.poly_ord = poly_ord;
   E.fragment_index = fragment_index;
-  E.comp_scal = 1;
+  E.flags = GD_EN_COMPSCAL;
   E.in_fields[0] = strdup(in_field);
   for (i = 0; i <= poly_ord; ++i) {
     E.u.polynom.ca[i][0] = ca[i].real();
@@ -113,7 +113,7 @@ int PolynomEntry::SetCoefficient(std::complex<double> coeff, int index)
 
   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;
+  E.flags = GD_EN_COMPSCAL;
 
   if (D != NULL)
     return gd_alter_entry(D->D, E.field, &E, 0);
diff --git a/bindings/cxx/rawentry.cpp b/bindings/cxx/rawentry.cpp
index cfd1a72..a552eae 100644
--- a/bindings/cxx/rawentry.cpp
+++ b/bindings/cxx/rawentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2011 D. V. Wiebe
+// Copyright (C) 2008-2013 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/recipentry.cpp b/bindings/cxx/recipentry.cpp
index 58a6ccc..7cf5767 100644
--- a/bindings/cxx/recipentry.cpp
+++ b/bindings/cxx/recipentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2011 D. V. Wiebe
+// Copyright (C) 2010, 2011, 2013 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -31,7 +31,7 @@ RecipEntry::RecipEntry(const char* field_code, const char* 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.flags = 0;
   E.fragment_index = fragment_index;
 }
 
@@ -44,7 +44,7 @@ RecipEntry::RecipEntry(const char* field_code, const char* 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.flags = GD_EN_COMPSCAL;
   E.fragment_index = fragment_index;
 }
 
@@ -97,7 +97,7 @@ 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;
+  E.flags = GD_EN_COMPSCAL;
 
   if (D != NULL)
     return gd_alter_entry(D->D, E.field, &E, 0);
diff --git a/bindings/cxx/sbitentry.cpp b/bindings/cxx/sbitentry.cpp
index 6246614..25a389f 100644
--- a/bindings/cxx/sbitentry.cpp
+++ b/bindings/cxx/sbitentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008-2011 D. V. Wiebe
+// Copyright (C) 2008-2012 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -69,22 +69,6 @@ int SBitEntry::SetNumBits(int num_bits)
   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;
diff --git a/bindings/cxx/stringentry.cpp b/bindings/cxx/stringentry.cpp
index 15898bd..f16b2d3 100644
--- a/bindings/cxx/stringentry.cpp
+++ b/bindings/cxx/stringentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+// Copyright (C) 2008, 2009, 2011 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/cxx/test/Makefile.am b/bindings/cxx/test/Makefile.am
index 0720984..9fe86ce 100644
--- a/bindings/cxx/test/Makefile.am
+++ b/bindings/cxx/test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2012, 2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -20,15 +20,7 @@
 #
 AUTOMAKE_OPTIONS = foreign serial-tests
 
-if CXX_WALL
-WALL=-Wall
-endif
-
-if CXX_WEXTRA
-WEXTRA=-Wextra
-endif
-
-AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src
+AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src
 LDADD=../libgetdata++.la
 TESTS=big_test
 
diff --git a/bindings/cxx/test/Makefile.in b/bindings/cxx/test/Makefile.in
index 5b134cd..eac6347 100644
--- a/bindings/cxx/test/Makefile.in
+++ b/bindings/cxx/test/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -217,6 +215,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -242,8 +242,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -291,7 +302,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -306,12 +316,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -375,9 +389,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -385,6 +400,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -398,7 +414,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2012, 2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -419,9 +435,7 @@ top_srcdir = @top_srcdir@
 # 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 AUTOMAKE_OPTIONS = foreign serial-tests
- at CXX_WALL_TRUE@WALL = -Wall
- at CXX_WEXTRA_TRUE@WEXTRA = -Wextra
-AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src
+AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src
 LDADD = ../libgetdata++.la
 big_test_SOURCES = big_test.cpp
 all: all-am
diff --git a/bindings/cxx/test/big_test.cpp b/bindings/cxx/test/big_test.cpp
index b57d82e..32b3828 100644
--- a/bindings/cxx/test/big_test.cpp
+++ b/bindings/cxx/test/big_test.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2012 D. V. Wiebe
+// Copyright (C) 2009-2015 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -96,9 +96,10 @@ template <class T> static void CheckFloat(char c, int i, int t, int n, T v, T g)
 #define CHECK_OK2(t,n) CHECK_ERROR2(t,n,GD_E_OK)
 
 #define CHECK_NONNULL(t,v) CheckT<const void*>('p', -1, t, -1, v, NULL, !(v))
+#define CHECK_NONNULL2(t,n,v) CheckT<const void*>('p', -1, t, n, v, NULL, !(v))
 
-#define CHECK_NULL(t,v) CheckT<const void*>('p', -1, t, -1, v, NULL, !(!(v)))
-#define CHECK_NULL2(t,n,v) CheckT<const void*>('p', -1, t, n, v, NULL, !(!(v)))
+#define CHECK_NULL(t,v) CheckT<const void*>('p', -1, t, -1, v, NULL, !!(v))
+#define CHECK_NULL2(t,n,v) CheckT<const void*>('p', -1, t, n, v, NULL, !!(v))
 
 #define CHECK_INT(t,v,g) CheckInt(-1, t, -1, v, g)
 #define CHECK_INT2(t,n,v,g) CheckInt(-1, t, n, v, g)
@@ -112,8 +113,9 @@ template <class T> static void CheckFloat(char c, int i, int t, int n, T v, T g)
 #define CHECK_DOUBLE_ARRAY(t,n,m,v,g) \
   for (i = 0; i < m; ++i) CheckFloat<double>('d', i, t, n, v, g)
 
-#define CHECK_STRING(t,v,g) \
-  CheckT<const char*>('s', -1, t, -1, v, g, (strcmp((v), (g))))
+#define CHECK_STRINGi(t,i,v,g) \
+  CheckT<const char*>('s', i, t, -1, v, g, (strcmp((v), (g))))
+#define CHECK_STRING(t,v,g) CHECK_STRINGi(t,-1,v,g)
 #define CHECK_STRING2(t,n,v,g) \
   CheckT<const char*>('s', -1, t, n, v, g, (strcmp((v), (g))))
 
@@ -130,15 +132,16 @@ CheckT<const char*>('s', i, t, -1, v, g, (strcmp((v), (g))))
 #define CHECK_COMPLEX_ARRAY(t,m,v,g) \
   for (i = 0; i < m; ++i) CheckFloat<complex<double> >('c', i, t, -1, v, g)
 
-#define FILEDIR "dirfile"
-int main(void)
+void run_tests(void)
 {
-  const char* filedir = FILEDIR;
-  const char* format = FILEDIR "/format";
-  const char* format1 = FILEDIR "/format1";
-  const char* form2 = FILEDIR "/form2";
-  const char* new1 = FILEDIR "/new1";
-  const char* data = FILEDIR "/data";
+  const char* filedir = "dirfile";
+  const char* format = "dirfile/format";
+  const char* empty = "dirfile/empty";
+  const char* eformat = "dirfile/empty/format";
+  const char* format1 = "dirfile/format1";
+  const char* form2 = "dirfile/form2";
+  const char* new1 = "dirfile/new1";
+  const char* data = "dirfile/data";
   const char* format_data =
     "/ENDIAN little\n"
     "data RAW INT8 8\n"
@@ -146,7 +149,7 @@ int main(void)
     "/META data mstr STRING \"This is a string constant.\"\n"
     "/META data mconst CONST COMPLEX128 3.3;4.4\n"
     "/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n"
-    "/META data mlut LINTERP DATA ./lut\n"
+    "/META data mlut LINTERP data ./lut\n"
     "const CONST FLOAT64 5.5\n"
     "carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n"
     "linterp LINTERP data ./lut\n"
@@ -196,12 +199,12 @@ int main(void)
   gd_triplet_t thresh;
   const gd_carray_t *carrays;
 
-  char* fields[nfields + 9] = {(char*)"INDEX", (char*)"alias", (char*)"bit",
+  char* fields[nfields + 10] = {(char*)"INDEX", (char*)"alias", (char*)"bit",
     (char*)"carray", (char*)"const", (char*)"data", (char*)"div",
     (char*)"lincom", (char*)"linterp", (char*)"mplex", (char*)"mult",
     (char*)"phase", (char*)"polynom", (char*)"recip", (char*)"sbit",
     (char*)"string", (char*)"window", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL, NULL};
+    NULL, NULL, NULL};
   char *strings[3];
 
   unlink(data);
@@ -229,90 +232,90 @@ int main(void)
   write(n, data_data, 80);
   close(n);
 
-  // 0: Dirfile::Error check
+  // 1: Dirfile::Error check
   d = new Dirfile("x");
-  CHECK_ERROR(0, GD_E_OPEN);
+  CHECK_ERROR(1, GD_E_IO);
   delete d;
 
-  // 1: Dirfile::Dirfile check
+  // 2: Dirfile::Dirfile check
   d = new Dirfile(filedir, GD_RDWR);
-  CHECK_OK(1);
+  CHECK_OK(2);
 
-  // 2: Dirfile::GetData check
+  // 3: 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);
+  CHECK_OK(3);
+  CHECK_INT(3,n,8);
+  CHECK_INT_ARRAY(3,8,c[i],41 + i);
 
-  // 3: Dirfile::GetConstant check
+  // 12: Dirfile::GetConstant check
   n = d->GetConstant("const", Float64, &dp);
-  CHECK_OK(3);
-  CHECK_INT(3,n,0);
-  CHECK_DOUBLE(3,dp,5.5);
+  CHECK_OK(12);
+  CHECK_INT(12,n,0);
+  CHECK_DOUBLE(12,dp,5.5);
 
-  // 6: Dirfile::NFields check
+  // 23: Dirfile::NFields check
   n = d->NFields();
-  CHECK_OK(6);
-  CHECK_INT(6,n,nfields);
+  CHECK_OK(23);
+  CHECK_INT(23,n,nfields);
 
-  // 8: Dirfile::FieldList check
+  // 25: Dirfile::FieldList check
   list = d->FieldList();
-  CHECK_OK(8);
-  CHECK_STRING_ARRAY(8,n,list[i],fields[i]);
+  CHECK_OK(25);
+  CHECK_STRING_ARRAY(25,n,list[i],fields[i]);
 
-  // 9: Dirfile::NFields check
+  // 26: Dirfile::NFields check
   n = d->NMFields("data");
-  CHECK_OK(9);
-  CHECK_INT(9,n,4);
+  CHECK_OK(26);
+  CHECK_INT(26,n,4);
 
-  // 10: Dirfile::MFieldList check
+  // 27: Dirfile::MFieldList check
   fields[0] = (char*)"mstr";
   fields[1] = (char*)"mconst";
   fields[2] = (char*)"mcarray";
   fields[3] = (char*)"mlut";
   list = d->MFieldList("data");
-  CHECK_OK(10);
-  CHECK_STRING_ARRAY(10,n,list[i],fields[i]);
+  CHECK_OK(27);
+  CHECK_STRING_ARRAY(27,n,list[i],fields[i]);
 
-  // 11: Dirfile::NFrames check
+  // 28: Dirfile::NFrames check
   n = d->NFrames();
-  CHECK_OK(11);
-  CHECK_INT(11,n,10);
+  CHECK_OK(28);
+  CHECK_INT(28,n,10);
 
-  // 12: Dirfile::SamplesPerFrame check
+  // 29: Dirfile::SamplesPerFrame check
   n = d->SamplesPerFrame("data");
-  CHECK_OK(12);
-  CHECK_INT(12,n,8);
+  CHECK_OK(29);
+  CHECK_INT(29,n,8);
 
-  // 13: Dirfile::PutData check
+  // 30: Dirfile::PutData check
   c[0] = 13;
   c[1] = 14;
   c[2] = 15;
   c[3] = 16;
   n = d->PutData("data", 5, 1, 0, 4, UInt8, c);
-  CHECK_OK2(13,1);
-  CHECK_INT2(13,1,n,4);
+  CHECK_OK2(30,1);
+  CHECK_INT2(30,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);
+  CHECK_OK2(30,2);
+  CHECK_INT2(30,2,n,8);
+  CHECK_INT_ARRAY(30,8,c[i],(i == 0 || i > 4) ? 41 + i : 12 + i);
 
-  // 14: Dirfile::ErrorString check
+  // 38: Dirfile::ErrorString check
   d->GetData("x", 5, 0, 1, 0, Null, NULL);
   str = d->ErrorString();
-  CHECK_STRING(14,str,"Field not found: x");
+  CHECK_STRING(38,str,"Field not found: x");
 
-  // 16: Dirfile::Entry / RawEntry check
+  // 40: 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);
+  CHECK_OK(40);
+  CHECK_INT2(40,1,ent->Type(),RawEntryType);
+  CHECK_INT2(40,2,ent->FragmentIndex(),0);
+  CHECK_INT2(40,3,ent->SamplesPerFrame(),8);
+  CHECK_INT2(40,4,ent->RawType(),Int8);
   delete ent;
 
-  // 18: Dirfile::Entry / LincomEntry check
+  // 42: Dirfile::Entry / LincomEntry check
   cq[0] = 1.1;
   cq[1] = 2.2;
   cq[2] = 2.2;
@@ -320,113 +323,113 @@ int main(void)
   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]);
+  CHECK_OK(42);
+  CHECK_INT2(42,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(42,2,ent->NFields(),3);
+  CHECK_INT2(42,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(42,4,ent->Input(0),"data");
+  CHECK_STRING2(42,5,ent->Input(1),"INDEX");
+  CHECK_STRING2(42,6,ent->Input(2),"linterp");
+  CHECK_INT2(42,7,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(42,3,ent->CScale(i),cq[i * 2]);
+  CHECK_COMPLEX_ARRAY(42,3,ent->COffset(i),cq[i * 2 + 1]);
   delete ent;
 
-  // 20: Dirfile::Entry / PolynomEntry check
+  // 44: 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]);
+  CHECK_OK(44);
+  CHECK_INT2(44,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(44,2,ent->PolyOrd(),5);
+  CHECK_INT2(44,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(44,4,ent->Input(0),"data");
+  CHECK_INT2(44,7,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(44,6,ent->CCoefficient(i),cq[i]);
   delete ent;
 
-  // 21: Dirfile::Entry / LinterpEntry check
+  // 45: 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(),"./lut");
+  CHECK_OK(45);
+  CHECK_INT2(45,1,ent->Type(),LinterpEntryType);
+  CHECK_INT2(45,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(45,3,ent->Input(0),"data");
+  CHECK_STRING2(45,4,ent->Table(),"./lut");
   delete ent;
 
-  // 22: Dirfile::Entry / BitEntry check
+  // 46: 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);
+  CHECK_OK(46);
+  CHECK_INT2(46,1,ent->Type(),BitEntryType);
+  CHECK_INT2(46,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(46,3,ent->Input(0),"data");
+  CHECK_INT2(46,4,ent->NumBits(),4);
+  CHECK_INT2(46,5,ent->FirstBit(),3);
   delete ent;
 
-  // 23: Dirfile::Entry / SBitEntry check
+  // 47: 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);
+  CHECK_OK(47);
+  CHECK_INT2(47,1,ent->Type(),SBitEntryType);
+  CHECK_INT2(47,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(47,3,ent->Input(0),"data");
+  CHECK_INT2(47,4,ent->NumBits(),6);
+  CHECK_INT2(47,5,ent->FirstBit(),5);
   delete ent;
 
-  // 24: Dirfile::Entry / MultiplyEntry check
+  // 48: 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");
+  CHECK_OK(48);
+  CHECK_INT2(48,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(48,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(48,3,ent->Input(0),"data");
+  CHECK_STRING2(48,4,ent->Input(1),"sbit");
   delete ent;
 
-  // 25: Dirfile::Entry / PhaseEntry check
+  // 49: 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);
+  CHECK_OK(49);
+  CHECK_INT2(49,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(49,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(49,3,ent->Input(0),"data");
+  CHECK_INT2(49,4,ent->Shift(),11);
   delete ent;
 
-  // 26: Dirfile::Entry / ConstEntry check
+  // 50: 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);
+  CHECK_OK(50);
+  CHECK_INT2(50,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(50,2,ent->FragmentIndex(),0);
+  CHECK_INT2(50,3,ent->ConstType(),Float64);
   delete ent;
 
-  // 134: Dirfile::Entry / StringEntry check
+  // 51: 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);
+  CHECK_OK(51);
+  CHECK_INT2(51,1,ent->Type(),StringEntryType);
+  CHECK_INT2(51,2,ent->FragmentIndex(),0);
   delete ent;
 
-  // 27: Dirfile::FragmentIndex check
+  // 52: Dirfile::FragmentIndex check
   n = d->FragmentIndex("data");
-  CHECK_OK(27);
-  CHECK_INT(27,n,0);
+  CHECK_OK(52);
+  CHECK_INT(52,n,0);
 
-  // 28: Dirfile::Add / RawEntry check
+  // 53: Dirfile::Add / RawEntry check
   rent.SetName("new1");
   rent.SetFragmentIndex(0);
   rent.SetSamplesPerFrame(3);
   rent.SetType(Float64);
   d->Add(rent);
-  CHECK_OK2(28,1);
+  CHECK_OK2(53,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);
+  CHECK_OK2(53,2);
+  CHECK_INT2(53,1,ent->Type(),RawEntryType);
+  CHECK_INT2(53,2,ent->FragmentIndex(),0);
+  CHECK_INT2(53,3,ent->SamplesPerFrame(),3);
+  CHECK_INT2(53,4,ent->RawType(),Float64);
   delete ent;
 
-  // 29: Dirfile::Add / LincomEntry check
+  // 54: Dirfile::Add / LincomEntry check
   q[0] = 9.9;
   q[1] = 8.8;
   q[2] = 7.7;
@@ -441,21 +444,21 @@ int main(void)
   lent.SetScale(q[2], 1);
   lent.SetOffset(q[3], 1);
   d->Add(lent);
-  CHECK_OK2(29,1);
+  CHECK_OK2(54,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]);
+  CHECK_OK2(54,2);
+  CHECK_INT2(54,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(54,2,ent->NFields(),2);
+  CHECK_INT2(54,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(54,4,ent->Input(0),"in1");
+  CHECK_STRING2(54,5,ent->Input(1),"in2");
+  CHECK_INT2(54,6,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(54,7,2,ent->Scale(i),q[i * 2]);
+  CHECK_DOUBLE_ARRAY(54,8,2,ent->Offset(i),q[i * 2 + 1]);
   delete ent;
 
-  // 30: Dirfile::Add / LincomEntry check
+  // 55: 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);
@@ -471,21 +474,21 @@ int main(void)
   lent.SetScale(cq[2], 1);
   lent.SetOffset(cq[3], 1);
   d->Add(lent);
-  CHECK_OK2(30,1);
+  CHECK_OK2(55,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]);
+  CHECK_OK2(55,2);
+  CHECK_INT2(55,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(55,2,ent->NFields(),2);
+  CHECK_INT2(55,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(55,4,ent->Input(0),"in1");
+  CHECK_STRING2(55,5,ent->Input(1),"in2");
+  CHECK_INT2(55,6,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(55,2,ent->CScale(i),cq[i * 2]);
+  CHECK_COMPLEX_ARRAY(55,2,ent->COffset(i),cq[i * 2 + 1]);
   delete ent;
 
-  // 31: Dirfile::Add / PolynomEntry check
+  // 56: Dirfile::Add / PolynomEntry check
   q[0] = 3.9;
   q[1] = 4.8;
   q[2] = 5.7;
@@ -499,19 +502,19 @@ int main(void)
   yent.SetCoefficient(q[2], 2);
   yent.SetCoefficient(q[3], 3);
   d->Add(yent);
-  CHECK_OK2(31,1);
+  CHECK_OK2(56,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]);
+  CHECK_OK2(56,2);
+  CHECK_INT2(56,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(56,2,ent->PolyOrd(),3);
+  CHECK_INT2(56,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(56,4,ent->Input(0),"in1");
+  CHECK_INT2(56,5,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(56,6,4,ent->Coefficient(i),q[i]);
   delete ent;
 
-  // 32: Dirfile::Add / PolynomEntry check
+  // 57: 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);
@@ -526,155 +529,155 @@ int main(void)
   yent.SetCoefficient(cq[2], 2);
   yent.SetCoefficient(cq[3], 3);
   d->Add(yent);
-  CHECK_OK2(32,1);
+  CHECK_OK2(57,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]);
+  CHECK_OK2(57,2);
+  CHECK_INT2(57,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(57,2,ent->PolyOrd(),3);
+  CHECK_INT2(57,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(57,4,ent->Input(0),"in2");
+  CHECK_INT2(57,7,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(57,4,ent->CCoefficient(i),cq[i]);
   delete ent;
 
-  // 33: Dirfile::Add / LinterpEntry check
+  // 58: Dirfile::Add / LinterpEntry check
   nent.SetName("new6");
   nent.SetFragmentIndex(0);
   nent.SetInput("in");
   nent.SetTable("./some/table");
   d->Add(nent);
-  CHECK_OK2(33,1);
+  CHECK_OK2(58,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");
+  CHECK_OK2(58,2);
+  CHECK_INT2(58,1,ent->Type(),LinterpEntryType);
+  CHECK_INT2(58,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(58,3,ent->Input(0),"in");
+  CHECK_STRING2(58,4,ent->Table(),"./some/table");
   delete ent;
 
-  // 34: Dirfile::Add / BitEntry check
+  // 59: Dirfile::Add / BitEntry check
   bent.SetName("new7");
   bent.SetFragmentIndex(0);
   bent.SetInput("in1");
   bent.SetFirstBit(13);
   bent.SetNumBits(12);
   d->Add(bent);
-  CHECK_OK2(34,1);
+  CHECK_OK2(59,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);
+  CHECK_OK(59);
+  CHECK_INT2(59,1,ent->Type(),BitEntryType);
+  CHECK_INT2(59,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(59,3,ent->Input(0),"in1");
+  CHECK_INT2(59,4,ent->NumBits(),12);
+  CHECK_INT2(59,5,ent->FirstBit(),13);
   delete ent;
 
-  // 35: Dirfile::Add / SBitEntry check
+  // 60: Dirfile::Add / SBitEntry check
   sent.SetName("new8");
   sent.SetFragmentIndex(0);
   sent.SetInput("in2");
   sent.SetFirstBit(14);
   sent.SetNumBits(15);
   d->Add(sent);
-  CHECK_OK2(35,1);
+  CHECK_OK2(60,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);
+  CHECK_OK(60);
+  CHECK_INT2(60,1,ent->Type(),SBitEntryType);
+  CHECK_INT2(60,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(60,3,ent->Input(0),"in2");
+  CHECK_INT2(60,4,ent->NumBits(),15);
+  CHECK_INT2(60,5,ent->FirstBit(),14);
   delete ent;
 
-  // 36: Dirfile::Add / MultiplyEntry check
+  // 61: 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);
+  CHECK_OK2(61,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");
+  CHECK_OK2(61,2);
+  CHECK_INT2(61,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(61,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(61,3,ent->Input(0),"in1");
+  CHECK_STRING2(61,4,ent->Input(1),"in2");
   delete ent;
 
-  // 37: Dirfile::Add / PhaseEntry check
+  // 62: Dirfile::Add / PhaseEntry check
   pent.SetName("new10");
   pent.SetFragmentIndex(0);
   pent.SetInput("in1");
   pent.SetShift(22);
   d->Add(pent);
-  CHECK_OK2(37,1);
+  CHECK_OK2(62,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);
+  CHECK_OK(62);
+  CHECK_INT2(62,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(62,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(62,3,ent->Input(0),"in1");
+  CHECK_INT2(62,4,ent->Shift(),22);
   delete ent;
 
-  // 38: Dirfile::Add / ConstEntry check
+  // 63: Dirfile::Add / ConstEntry check
   cent.SetName("new11");
   cent.SetFragmentIndex(0);
   cent.SetType(Float64);
   d->Add(cent);
-  CHECK_OK2(38,1);
+  CHECK_OK2(63,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);
+  CHECK_OK2(63,2);
+  CHECK_INT2(63,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(63,2,ent->FragmentIndex(),0);
+  CHECK_INT2(63,3,ent->ConstType(),Float64);
   delete ent;
 
-  // 39: Fragment check
+  // 64: Fragment check
   frag = d->Fragment(0);
-  CHECK_OK(39);
+  CHECK_OK(64);
   sprintf(buf, "dirfile%cformat", GD_DIRSEP);
-  CHECK_EOSTRING(39,frag->Name(), buf);
+  CHECK_EOSTRING(64,frag->Name(), buf);
   delete frag;
 
-  // 40: Dirfile::NFragments check
+  // 65: Dirfile::NFragments check
   n = d->NFragments();
-  CHECK_OK(40);
-  CHECK_INT(40,n,1);
+  CHECK_OK(65);
+  CHECK_INT(65,n,1);
 
-  // 41: Dirfile::Include check
+  // 66: Dirfile::Include check
   n = d->Include("form2");
-  CHECK_OK2(41,1);
-  CHECK_INT2(41,1,n,1);
+  CHECK_OK2(66,1);
+  CHECK_INT2(66,1,n,1);
   n = d->GetConstant("const2", Int8, &sc);
-  CHECK_OK2(41,2);
-  CHECK_INT2(41,2,sc,-19);
+  CHECK_OK2(66,2);
+  CHECK_INT2(66,2,sc,-19);
 
-  // 42: Dirfile::NFieldsByType check
+  // 67: Dirfile::NFieldsByType check
   n = d->NFieldsByType(LincomEntryType);
-  CHECK_OK(42);
-  CHECK_INT(42,n,3);
+  CHECK_OK(67);
+  CHECK_INT(67,n,3);
 
-  // 43: Dirfile::FieldListByType check
+  // 68: 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]);
+  CHECK_OK(68);
+  CHECK_STRING_ARRAY(68,n,list[i],fields[i]);
 
-  // 44: Dirfile::NVectors check
+  // 69: Dirfile::NVectors check
   n = d->NVectors();
-  CHECK_OK(44);
-  CHECK_INT(44,n,24);
+  CHECK_OK(69);
+  CHECK_INT(69,n,24);
 
-  // 45: Dirfile::VectorList check
+  // 70: Dirfile::VectorList check
   fields[0] = (char*)"INDEX";
   fields[1] = (char*)"alias";
   fields[2] = (char*)"bit";
@@ -700,150 +703,120 @@ int main(void)
   fields[22] = (char*)"sbit";
   fields[23] = (char*)"window";
   list = d->VectorList();
-  CHECK_OK(45);
-  CHECK_STRING_ARRAY(45,n,list[i],fields[i]);
+  CHECK_OK(70);
+  CHECK_STRING_ARRAY(70,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
+  // 81: 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");
+  CHECK_OK(81);
+  CHECK_INT(81,n,18);
+  CHECK_STRING(81,buf,"Zaphod Beeblebrox");
 
-  // 57: Dirfile::Add / StringEntry check
+  // 82: Dirfile::Add / StringEntry check
   gent.SetName("new12");
   gent.SetFragmentIndex(0);
   d->Add(gent);
-  CHECK_OK2(57,1);
+  CHECK_OK2(82,1);
 
   ent = d->Entry("new12");
-  CHECK_OK2(57,2);
-  CHECK_INT2(57,1,ent->Type(),StringEntryType);
-  CHECK_INT2(57,2,ent->FragmentIndex(),0);
+  CHECK_OK2(82,2);
+  CHECK_INT2(82,1,ent->Type(),StringEntryType);
+  CHECK_INT2(82,2,ent->FragmentIndex(),0);
   delete ent;
 
   n = d->GetString("new12", GD_MAX_LINE_LENGTH, buf);
-  CHECK_OK2(57,3);
-  CHECK_INT(57,n,1);
-  CHECK_STRING(57,buf,"");
+  CHECK_OK2(82,3);
+  CHECK_INT(82,n,1);
+  CHECK_STRING(82,buf,"");
 
-  // 59: Dirfile::AddSpec check
+  // 84: Dirfile::AddSpec check
   d->AddSpec("lorem STRING \"Lorem ipsum\"", 0);
-  CHECK_OK2(59,1);
+  CHECK_OK2(84,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");
+  CHECK_OK2(84,2);
+  CHECK_INT(84,n,12);
+  CHECK_STRING(84,buf,"Lorem ipsum");
 
-  // 60: Dirfile::MAddSpec check
+  // 85: Dirfile::MAddSpec check
   d->MAddSpec("ipsum STRING \"dolor sit amet.\"", "lorem");
-  CHECK_OK2(60,1);
+  CHECK_OK2(85,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.");
+  CHECK_OK2(85,2);
+  CHECK_INT(85,n,16);
+  CHECK_STRING(85,buf,"dolor sit amet.");
 
-  // 61: Dirfile::PutConstant check
-  sc = 61;
+  // 86: Dirfile::PutConstant check
+  sc = 86;
   n = d->PutConstant("const", Int8, &sc);
-  CHECK_OK2(61,1);
-  CHECK_INT2(61,1,n,0);
+  CHECK_OK2(86,1);
+  CHECK_INT2(86,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);
+  CHECK_OK2(86,2);
+  CHECK_INT2(86,2,n,0);
+  CHECK_DOUBLE2(86,3,fl,86);
 
-  // 62: Dirfile::PutString check
+  // 94: Dirfile::PutString check
   n = d->PutString("string", "Arthur Dent");
-  CHECK_OK2(62,1);
-  CHECK_INT2(62,1,n,12);
+  CHECK_OK2(94,1);
+  CHECK_INT2(94,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]);
+  CHECK_OK2(94,2);
+  CHECK_INT2(94,2,n,12);
+  CHECK_STRING(94,buf,"Arthur Dent");
+
+  // 95: Dirfile::NMFieldsByType check
+  n = d->NMFieldsByType("data", LinterpEntryType);
+  CHECK_OK(95);
+  CHECK_INT(95,n,1);
+
+  // 96: Dirfile::MFieldListByType check
+  fields[0] = (char*)"mlut";
+  list = d->MFieldListByType("data", LinterpEntryType);
+  CHECK_OK(96);
+  CHECK_STRING_ARRAY(96,n,list[i],fields[i]);
 
-  // 65: Dirfile::NMVectors check
+  // 97: Dirfile::NMVectors check
   n = d->NMVectors("data");
-  CHECK_OK(65);
-  CHECK_INT(65,n,2);
+  CHECK_OK(97);
+  CHECK_INT(97,n,1);
 
-  // 66: Dirfile::MVectorList check
+  // 98: 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]);
+  CHECK_OK(98);
+  CHECK_STRING_ARRAY(98,n,list[i],fields[i]);
 
-  // 67: RawEntry check
+  // 99: RawEntry check
   rep = reinterpret_cast<RawEntry*>(d->Entry("new1"));
-  CHECK_OK2(67,1);
+  CHECK_OK2(99,1);
   rep->SetType(Int32,0);
-  CHECK_OK2(67,2);
+  CHECK_OK2(99,2);
   rep->SetSamplesPerFrame(4,0);
-  CHECK_OK2(67,3);
+  CHECK_OK2(99,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);
+  CHECK_OK2(99,4);
+  CHECK_INT2(99,1,ent->Type(),RawEntryType);
+  CHECK_INT2(99,2,ent->FragmentIndex(),0);
+  CHECK_INT2(99,3,ent->SamplesPerFrame(),4);
+  CHECK_INT2(99,4,ent->RawType(),Int32);
   delete ent;
 
-  // 68: LincomEntry check
+  // 100: LincomEntry check
   lep = reinterpret_cast<LincomEntry*>(d->Entry("new2"));
-  CHECK_OK2(68,1);
+  CHECK_OK2(100,1);
   lep->SetNFields(3);
-  CHECK_OK2(68,2);
+  CHECK_OK2(100,2);
   lep->SetInput("in4",2);
-  CHECK_OK2(68,3);
+  CHECK_OK2(100,3);
   lep->SetScale(1.96,2);
-  CHECK_OK2(68,4);
+  CHECK_OK2(100,4);
   lep->SetOffset(0.22,2);
-  CHECK_OK2(68,5);
+  CHECK_OK2(100,5);
   delete lep;
 
   q[0] = 9.9;
@@ -853,27 +826,27 @@ int main(void)
   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]);
+  CHECK_OK2(100,6);
+  CHECK_INT2(100,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(100,2,ent->NFields(),3);
+  CHECK_INT2(100,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(100,4,ent->Input(0),"in1");
+  CHECK_STRING2(100,5,ent->Input(1),"in2");
+  CHECK_STRING2(100,6,ent->Input(2),"in4");
+  CHECK_INT2(100,7,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(100,8,3,ent->Scale(i),q[i * 2]);
+  CHECK_DOUBLE_ARRAY(100,9,3,ent->Offset(i),q[i * 2 + 1]);
   delete ent;
 
-  // 70: PolynomEntry check
+  // 102: PolynomEntry check
   yep = reinterpret_cast<PolynomEntry*>(d->Entry("new4"));
-  CHECK_OK2(70,1);
+  CHECK_OK2(102,1);
   yep->SetInput("in4");
-  CHECK_OK2(70,2);
+  CHECK_OK2(102,2);
   yep->SetPolyOrd(4);
-  CHECK_OK2(70,3);
+  CHECK_OK2(102,3);
   yep->SetCoefficient(55.5,4);
-  CHECK_OK2(70,4);
+  CHECK_OK2(102,4);
   delete yep;
 
   q[0] = 3.9;
@@ -882,276 +855,302 @@ int main(void)
   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]);
+  CHECK_OK2(102,5);
+  CHECK_INT2(102,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(102,2,ent->PolyOrd(),4);
+  CHECK_INT2(102,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(102,4,ent->Input(0),"in4");
+  CHECK_INT2(102,5,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(102,6,5,ent->Coefficient(i),q[i]);
   delete ent;
 
-  // 72: LinterpEntry check
+  // 104: LinterpEntry check
   nep = reinterpret_cast<LinterpEntry*>(d->Entry("new6"));
-  CHECK_OK2(72,1);
+  CHECK_OK2(104,1);
   nep->SetInput("in3");
-  CHECK_OK2(72,2);
+  CHECK_OK2(104,2);
   nep->SetTable("./other/table");
-  CHECK_OK2(72,3);
+  CHECK_OK2(104,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");
+  CHECK_OK2(104,2);
+  CHECK_INT2(104,1,ent->Type(),LinterpEntryType);
+  CHECK_INT2(104,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(104,3,ent->Input(0),"in3");
+  CHECK_STRING2(104,4,ent->Table(),"./other/table");
   delete ent;
 
-  // 73: BitEntry check
+  // 105: BitEntry check
   bep = reinterpret_cast<BitEntry*>(d->Entry("new7"));
-  CHECK_OK2(73,1);
+  CHECK_OK2(105,1);
   bep->SetInput("in3");
-  CHECK_OK2(73,2);
+  CHECK_OK2(105,2);
   bep->SetFirstBit(3);
-  CHECK_OK2(73,3);
+  CHECK_OK2(105,3);
   bep->SetNumBits(2);
-  CHECK_OK2(73,4);
+  CHECK_OK2(105,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);
+  CHECK_OK(105);
+  CHECK_INT2(105,1,ent->Type(),BitEntryType);
+  CHECK_INT2(105,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(105,3,ent->Input(0),"in3");
+  CHECK_INT2(105,4,ent->NumBits(),2);
+  CHECK_INT2(105,5,ent->FirstBit(),3);
   delete ent;
 
-  // 74: SBitEntry check
+  // 106: SBitEntry check
   sep = reinterpret_cast<SBitEntry*>(d->Entry("new8"));
-  CHECK_OK2(74,1);
+  CHECK_OK2(106,1);
   sep->SetInput("in4");
-  CHECK_OK2(74,2);
+  CHECK_OK2(106,2);
   sep->SetFirstBit(1);
-  CHECK_OK2(74,3);
+  CHECK_OK2(106,3);
   sep->SetNumBits(22);
-  CHECK_OK2(74,4);
+  CHECK_OK2(106,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);
+  CHECK_OK(106);
+  CHECK_INT2(106,1,ent->Type(),SBitEntryType);
+  CHECK_INT2(106,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(106,3,ent->Input(0),"in4");
+  CHECK_INT2(106,4,ent->NumBits(),22);
+  CHECK_INT2(106,5,ent->FirstBit(),1);
   delete ent;
 
-  // 75: MultiplyEntry check
+  // 107: MultiplyEntry check
   mep = reinterpret_cast<MultiplyEntry*>(d->Entry("new9"));
-  CHECK_OK2(75,1);
+  CHECK_OK2(107,1);
   mep->SetInput("in4",0);
-  CHECK_OK2(75,2);
+  CHECK_OK2(107,2);
   mep->SetInput("in5",1);
-  CHECK_OK2(75,3);
+  CHECK_OK2(107,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");
+  CHECK_OK2(107,2);
+  CHECK_INT2(107,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(107,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(107,3,ent->Input(0),"in4");
+  CHECK_STRING2(107,4,ent->Input(1),"in5");
   delete ent;
 
-  // 76: PhsaeEntry check
+  // 108: PhsaeEntry check
   pep = reinterpret_cast<PhaseEntry*>(d->Entry("new10"));
-  CHECK_OK2(76,1);
+  CHECK_OK2(108,1);
   pep->SetInput("in2");
-  CHECK_OK2(76,2);
+  CHECK_OK2(108,2);
   pep->SetShift(8);
-  CHECK_OK2(76,3);
+  CHECK_OK2(108,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);
+  CHECK_OK(108);
+  CHECK_INT2(108,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(108,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(108,3,ent->Input(0),"in2");
+  CHECK_INT2(108,4,ent->Shift(),8);
   delete ent;
 
-  // 77: ConstEntry check
+  // 109: ConstEntry check
   cep = reinterpret_cast<ConstEntry*>(d->Entry("new11"));
-  CHECK_OK2(77,1);
+  CHECK_OK2(109,1);
   cep->SetType(Float32);
-  CHECK_OK2(77,2);
+  CHECK_OK2(109,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);
+  CHECK_OK2(109,2);
+  CHECK_INT2(109,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(109,2,ent->FragmentIndex(),0);
+  CHECK_INT2(109,3,ent->ConstType(),Float32);
   delete ent;
 
-  // 78: Fragment::Encoding check
+  // 110: Fragment::Encoding check
   frag = d->Fragment(0);
-  CHECK_OK(78);
-  CHECK_INT(78,frag->Encoding(),RawEncoding);
+  CHECK_OK(110);
+  CHECK_INT(110,frag->Encoding(),RawEncoding);
 
-  // 79: Fragment::Endianness check
-  CHECK_INT(79,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
+  // 111: Fragment::Endianness check
+  CHECK_INT(111,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
   delete frag;
 
-  // 80: Dirfile::Name check
+  // 112: Dirfile::Name check
   str = d->Name();
-  CHECK_OK(80);
-  CHECK_EOSTRING(80,str,"dirfile");
+  CHECK_OK(112);
+  CHECK_EOSTRING(112,str,"dirfile");
 
-  // 81: Fragment::Parent check
+  // 113: Fragment::Parent check
   frag = d->Fragment(1);
-  CHECK_OK(81);
-  CHECK_INT(81,frag->Parent(),0);
+  CHECK_OK(113);
+  CHECK_INT(113,frag->Parent(),0);
 
-  // 82: Fragment::SetProtection check
+  // 114: Fragment::SetProtection check
   frag->SetProtection(GD_PROTECT_DATA);
-  CHECK_OK(82);
+  CHECK_OK(114);
   delete frag;
 
-  // 83: Fragment::Protection check
+  // 115: Fragment::Protection check
   frag = d->Fragment(1);
-  CHECK_OK(83);
-  CHECK_INT(83,frag->Protection(),GD_PROTECT_DATA);
+  CHECK_OK(115);
+  CHECK_INT(115,frag->Protection(),GD_PROTECT_DATA);
 
-  // 84: RawEntry::FileName check
+  // 116: RawEntry::FileName check
   str = rep->FileName();
-  CHECK_OK(84);
+  CHECK_OK(116);
   sprintf(buf, "dirfile%cnew1", GD_DIRSEP);
-  CHECK_EOSTRING(84,str, buf);
+  CHECK_EOSTRING(116,str, buf);
   delete rep;
 
-  // 85: Dirfile::Reference check
+  // 117: Dirfile::Reference check
   rep = d->Reference("new1");
-  CHECK_OK(85);
-  CHECK_STRING(85,rep->Name(),"new1");
+  CHECK_OK(117);
+  CHECK_STRING(117,rep->Name(),"new1");
   delete rep;
 
-  // 135: Dirfile::ReferenceFilename check
-  str = d->ReferenceFilename();
-  CHECK_OK(135);
-  CHECK_EOSTRING(135,str, buf);
+  // 118: Dirfile::EoF check
+  n = d->EoF("lincom");
+  CHECK_OK(118);
+  CHECK_INT(118,n,80);
   
-  // 87: Fragment::SetEncoding check
+  // 119: Fragment::SetEncoding check
   frag->SetEncoding(SlimEncoding,0);
-  CHECK_OK(87);
-  CHECK_INT(87,frag->Encoding(),SlimEncoding);
+  CHECK_OK(119);
+  CHECK_INT(119,frag->Encoding(),SlimEncoding);
 
-  // 88: Fragment::SetEndianness check
+  // 120: Fragment::SetEndianness check
   frag->SetEndianness(GD_BIG_ENDIAN,0);
-  CHECK_OK(88);
-  CHECK_INT(88,frag->Endianness(),GD_BIG_ENDIAN);
+  CHECK_OK(120);
+  CHECK_INT(120,frag->Endianness(),GD_BIG_ENDIAN);
   delete frag;
 
-  // 89: Dirfile::AlterSpec check
+  // 121: Dirfile::AlterSpec check
   d->AlterSpec("new10 PHASE in1 3");
-  CHECK_OK2(89,1);
+  CHECK_OK2(121,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);
+  CHECK_OK2(121,2);
+  CHECK_INT2(121,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(121,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(121,3,ent->Input(0),"in1");
+  CHECK_INT2(121,4,ent->Shift(),3);
   delete ent;
 
-  //  90: Dirfile::Delete check
+  //  122: Dirfile::Delete check
   d->Delete("new10", 0);
-  CHECK_OK2(90,1);
+  CHECK_OK2(122,1);
 
   ent = d->Entry("new10");
-  CHECK_ERROR2(90,2,GD_E_BAD_CODE);
+  CHECK_ERROR2(122,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);
+  // 123: Dirfile::MAlterSpec check
+  d->MAlterSpec("mlut LINTERP data /new/lut", "data", 0);
+  CHECK_OK2(123,1);
+
+  ent = d->Entry("data/mlut");
+  CHECK_OK2(123,2);
+  CHECK_INT2(123,3,ent->Type(),LinterpEntryType);
+  CHECK_INT2(123,4,ent->FragmentIndex(),0);
+  CHECK_STRING2(123,5,ent->Input(0),"data");
+  CHECK_STRING2(123,6,ent->Table(),"/new/lut");
   delete ent;
 
-  // 92: Entry::Move check
+  // 124: Entry::Move check
   ent = d->Entry("new9");
-  CHECK_OK2(92,1);
+  CHECK_OK2(124,1);
   ent->Move(1,0);
-  CHECK_OK2(92,2);
-  CHECK_INT(92,ent->FragmentIndex(),1);
+  CHECK_OK2(124,2);
+  CHECK_INT(124,ent->FragmentIndex(),1);
 
-  // 93: Entry::Rename check
+  // 125: Entry::Rename check
   ent->Rename("newer",0);
-  CHECK_OK2(93,1);
+  CHECK_OK2(125,1);
   delete ent;
 
   ent = d->Entry("new9");
-  CHECK_ERROR2(93,2,GD_E_BAD_CODE);
+  CHECK_ERROR2(125,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");
+  CHECK_OK2(125,3);
+  CHECK_INT2(125,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(125,2,ent->FragmentIndex(),1);
+  CHECK_STRING2(125,3,ent->Input(0),"in4");
+  CHECK_STRING2(125,4,ent->Input(1),"in5");
   delete ent;
 
-  // 94: Dirfile::UnInclude check
+  // 126: Dirfile::UnInclude check
   d->UnInclude(1,0);
-  CHECK_OK2(94,1);
+  CHECK_OK2(126,1);
 
   ent = d->Entry("newer");
-  CHECK_ERROR2(94,2,GD_E_BAD_CODE);
+  CHECK_ERROR2(126,2,GD_E_BAD_CODE);
   delete ent;
 
-  // 95: Fragment::FrameOffset check
+  // 127: Fragment::FrameOffset check
   frag = d->Fragment(0);
-  CHECK_OK(95);
-  CHECK_INT(95,frag->FrameOffset(),0);
+  CHECK_OK(127);
+  CHECK_INT(127,frag->FrameOffset(),0);
 
-  // 96: Fragment::SetFrameOffset check
+  // 128: Fragment::SetFrameOffset check
   frag->SetFrameOffset(33,0);
-  CHECK_OK(96);
-  CHECK_INT(96,frag->FrameOffset(),33);
+  CHECK_OK(128);
+  CHECK_INT(128,frag->FrameOffset(),33);
 
-  // 97: Dirfile::NativeType check
+  // 129: Dirfile::NativeType check
   n = d->NativeType("data");
-  CHECK_OK(97);
-  CHECK_INT(97,n,Int8);
+  CHECK_OK(129);
+  CHECK_INT(129,n,Int8);
 
-  // 99: Dirfile::Validate check
+  // 131: Dirfile::Validate check
   n = d->Validate("new7");
-  CHECK_ERROR(99,GD_E_BAD_CODE);
-  CHECK_INT(99,n,-1);
+  CHECK_ERROR(131,GD_E_BAD_CODE);
+  CHECK_INT(131,n,-1);
 
-  // 101: Dirfile::FrameNum check
+  // 133: Dirfile::FrameNum check
   delete d->Reference("data");
   dp = d->FrameNum("data", 33.3, 6);
-  CHECK_OK(101);
-  CHECK_DOUBLE(101,dp,37.0375);
+  CHECK_OK(133);
+  CHECK_DOUBLE(133,dp,37.0375);
 
-  // 86: Dirfile::EoF check
-  n = d->EoF("lincom");
-  CHECK_OK(86);
-  CHECK_INT(86,n,344);
+  // 136: Dirfile::MAdd check
+  q[0] = 9.9;
+  q[1] = 8.8;
+  q[2] = 7.7;
+  q[3] = 6.6;
+  lent.Dissociate();
+  lent.SetName("mnew136");
+  lent.SetNFields(2);
+  lent.SetInput("in1", 0);
+  lent.SetScale(q[0], 0);
+  lent.SetOffset(q[1], 0);
+  lent.SetInput("in2", 1);
+  lent.SetScale(q[2], 1);
+  lent.SetOffset(q[3], 1);
+  d->MAdd(lent, "data");
+  CHECK_OK2(136,1);
+
+  ent = d->Entry("data/mnew136");
+  CHECK_OK2(136,2);
+  CHECK_INT2(136,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(136,2,ent->NFields(),2);
+  CHECK_INT2(136,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(136,4,ent->Input(0),"in1");
+  CHECK_STRING2(136,5,ent->Input(1),"in2");
+  CHECK_INT2(136,6,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(136,7,2,ent->Scale(i),q[i * 2]);
+  CHECK_DOUBLE_ARRAY(136,8,2,ent->Offset(i),q[i * 2 + 1]);
+  delete ent;
+
+  // 137: Dirfile::ReferenceFilename check
+  str = d->ReferenceFilename();
+  CHECK_OK(137);
+  sprintf(buf, "dirfile%cdata", GD_DIRSEP);
+  CHECK_EOSTRING(137,str, buf);
   
   // 142: Dirfile::BoF check
   n = d->BoF("lincom");
@@ -1275,23 +1274,23 @@ int main(void)
   // 157: Dirfile::Standards check
   n = d->Standards();
   CHECK_OK2(157,1);
-  CHECK_INT(157,n,9);
+  CHECK_INT(157,n,GD_DIRFILE_STANDARDS_VERSION);
   d->Standards(0);
   CHECK_ERROR2(157,2,GD_E_ARGUMENT);
 
-  // 158 gd_get_carray
+  // 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)
+  // 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
+  // 167: gd_carrays
   carrays = d->Carrays(Float64);
   CHECK_OK(167);
   CHECK_NONNULL(167,carrays);
@@ -1299,7 +1298,7 @@ int main(void)
   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
+  // 168: gd_put_carray
   p[0] = 9.6;
   p[1] = 8.5;
   p[2] = 7.4;
@@ -1314,7 +1313,7 @@ int main(void)
   CHECK_INT(168,n,0);
   CHECK_DOUBLE_ARRAY(168,1,6,q[i],9.6 - i * 1.1);
 
-  // 169 gd_put_carray_slice (INT8)
+  // 169: gd_put_carray_slice (INT8)
   p[0] = 2.2;
   p[1] = 3.3;
   n = d->PutCarray("carray", Float64, p, 2, 2);
@@ -1325,20 +1324,21 @@ int main(void)
   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");
+  // 177: gd_array_len
+  n = (int)d->ArrayLen("carray");
   CHECK_OK(177);
   CHECK_INT(177,n,6);
 
-  // 178 gd_entry (CARRAY)
-  ent = d->Entry("const");
+  // 178: gd_entry (CARRAY)
+  ent = d->Entry("carray");
   CHECK_OK(178);
-  CHECK_INT2(178,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(178,1,ent->Type(),CarrayEntryType);
   CHECK_INT2(178,2,ent->FragmentIndex(),0);
   CHECK_INT2(178,3,ent->ConstType(),Float64);
+  CHECK_INT2(178,4,ent->ArrayLen(),6);
   delete ent;
 
-  // 179 gd_add_carray
+  // 179: gd_add_carray
   aent.SetName("new17");
   aent.SetFragmentIndex(0);
   aent.SetType(Float64);
@@ -1371,7 +1371,7 @@ int main(void)
   CHECK_INT2(180,4,ent->ArrayLen(),2);
   delete ent;
 
-  // 181 gd_alter_carray
+  // 181: gd_alter_carray
   aep = reinterpret_cast<CarrayEntry*>(d->Entry("new17"));
   CHECK_OK2(181,1);
   aep->SetType(Float32);
@@ -1389,7 +1389,7 @@ int main(void)
   delete ent;
 
   // 183: gd_constants
-  p[0] = 61.;
+  p[0] = 86.;
   p[1] = 0.;
   n = d->NFieldsByType(ConstEntryType);
   qp = reinterpret_cast<const double *>(d->Constants());
@@ -1425,7 +1425,7 @@ int main(void)
   CHECK_OK2(203,0);
   m = d->GetData("data", GD_HERE, 0, 1, 0, UInt8, c);
   CHECK_OK2(203,1);
-  CHECK_INT2(203,0,n,280);
+  CHECK_INT2(203,0,n,35 * 8);
   CHECK_INT2(203,1,m,8);
   CHECK_INT_ARRAY(203,8,c[i],17 + i);
 
@@ -1578,22 +1578,6 @@ int main(void)
   d->IncludeAffix("format1", 0, "A", "Z", GD_CREAT | GD_EXCL);
   CHECK_OK(223);
 
-  // 224: gd_move_alias check
-  d->MoveAlias("new20", 1);
-  CHECK_OK2(224, 1);
-
-  n = d->FragmentIndex("Anew20Z");
-  CHECK_OK2(224, 2);
-  CHECK_INT(224, n, 1);
-
-  // 225: gd_delete_alias check
-  d->DeleteAlias("Anew20Z", 0);
-  CHECK_OK2(225, 1);
-
-  n = d->FragmentIndex("Anew20Z");
-  CHECK_ERROR2(225, 2, GD_E_BAD_CODE);
-  CHECK_INT(225, n, -1);
-
   // 226: gd_fragment_affixes check
   frag = d->Fragment(1);
 
@@ -1772,13 +1756,17 @@ int main(void)
   CHECK_DOUBLE_ARRAY(242,4,2,((double*)carrays[1].d)[i],0);
   CHECK_INT2(242,5,carrays[2].n,0);
 
-  // 243: NULL return from gd_reference
-  id = new Dirfile(FILEDIR "/empty", GD_RDWR | GD_CREAT | GD_EXCL);
-  CHECK_OK2(243, 1);
+  // 271: gd_encoding_support
+  n = EncodingSupport(GetData::SieEncoding);
+  CHECK_INT(271, n, GD_RDWR);
+
+  // 272: NULL return from gd_reference
+  id = new Dirfile("dirfile/empty", GD_RDWR | GD_CREAT | GD_EXCL);
+  CHECK_OK2(272, 1);
 
   rep = id->Reference();
-  CHECK_OK2(243, 2);
-  CHECK_NULL(243, rep);
+  CHECK_OK2(272, 2);
+  CHECK_NULL(272, rep);
 
   id->Discard();
 
@@ -1788,17 +1776,23 @@ int main(void)
 
 
 
+
   // ===================================================================
   d->Discard();
   delete d;
-  unlink(FILEDIR "/empty/format");
-  rmdir(FILEDIR "/empty");
+  unlink(eformat);
+  rmdir(empty);
   unlink(data);
   unlink(new1);
   unlink(format);
   unlink(format1);
   unlink(form2);
   rmdir(filedir);
+}
+
+int main(void)
+{
+  run_tests();
 
   if (ne) {
     cerr << "ne = " << ne << endl;
diff --git a/bindings/cxx/windowentry.cpp b/bindings/cxx/windowentry.cpp
index 3c0a020..e500ca1 100644
--- a/bindings/cxx/windowentry.cpp
+++ b/bindings/cxx/windowentry.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2012 D. V. Wiebe
+// Copyright (C) 2011, 2012 D. V. Wiebe
 //
 ///////////////////////////////////////////////////////////////////////////
 //
diff --git a/bindings/f77/Makefile.am b/bindings/f77/Makefile.am
index fc42d0b..7483326 100644
--- a/bindings/f77/Makefile.am
+++ b/bindings/f77/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -23,28 +23,12 @@ 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
 
-FCFLAGS += $(FC_WALL) $(FC_WEXTRA)
+FCFLAGS += $(GD_FC_WALL) $(GD_FC_WEXTRA)
 EXTRA_DIST=getdata.f.in getdata.f90.in
 
 SUBDIRS = test
@@ -55,7 +39,7 @@ LIBS=
 nodist_include_HEADERS=getdata.f $(F95_INC)
 
 lib_LTLIBRARIES=libfgetdata.la $(F95_LIB)
-libfgetdata_la_CPPFLAGS = ${CC_WALL} $(CC_WEXTRA) -I$(top_srcdir)/src
+libfgetdata_la_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src
 libfgetdata_la_SOURCES = fgetdata.c fgetdata.h
 libfgetdata_la_LIBADD=../../src/libgetdata.la
 libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@
diff --git a/bindings/f77/Makefile.in b/bindings/f77/Makefile.in
index dcb216b..b9bd333 100644
--- a/bindings/f77/Makefile.in
+++ b/bindings/f77/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -292,6 +290,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -313,12 +313,23 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 F95GETDATA_VERSION = @F95GETDATA_VERSION@
 FC = @FC@
-FCFLAGS = @FCFLAGS@ $(FC_WALL) $(FC_WEXTRA)
+FCFLAGS = @FCFLAGS@ $(GD_FC_WALL) $(GD_FC_WEXTRA)
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -366,7 +377,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -381,12 +391,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -450,9 +464,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -460,6 +475,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -473,7 +489,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -494,10 +510,6 @@ top_srcdir = @top_srcdir@
 # 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
 @MAKE_F95BINDINGS_TRUE at F95_INC = getdata.mod
 @MAKE_F95BINDINGS_TRUE at F95_LIB = libf95getdata.la
 EXTRA_DIST = getdata.f.in getdata.f90.in
@@ -505,7 +517,7 @@ 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) -I$(top_srcdir)/src
+libfgetdata_la_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src
 libfgetdata_la_SOURCES = fgetdata.c fgetdata.h
 libfgetdata_la_LIBADD = ../../src/libgetdata.la
 libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@
diff --git a/bindings/f77/fgetdata.c b/bindings/f77/fgetdata.c
index 3ddaf48..493bf25 100644
--- a/bindings/f77/fgetdata.c
+++ b/bindings/f77/fgetdata.c
@@ -75,7 +75,7 @@ static char *_GDF_CString(char **out, const char *in, int l)
   if (l < 0) {
     *out = NULL;
     dreturn("%p", NULL);
-    return *out;
+    return NULL;
   }
 
   *out = (char*)malloc(l + 1);
@@ -105,11 +105,11 @@ static DIRFILE* _GDF_GetDirfile(int d)
 }
 
 /* convert a new DIRFILE* into an int */
-static int _GDF_SetDirfile(DIRFILE* D)
+static int _GDF_SetDirfile(DIRFILE* D, int close)
 {
   int i;
 
-  dtrace("%p", D);
+  dtrace("%p, %i", D, close);
 
   if (!f77dirfiles_initialised)
     _GDF_InitDirfiles();
@@ -122,9 +122,11 @@ static int _GDF_SetDirfile(DIRFILE* D)
       return i;
     }
 
-  /* out of f77dirfiles space: complain and abort */
+  /* out of f77dirfiles space: complain */
   fputs("libfgetdata: DIRFILE space exhausted.", stderr);
-  abort();
+  if (close)
+    gd_discard(D);
+  return -1;
 }
 
 /* delete the supplied dirfile */
@@ -141,10 +143,10 @@ static void _GDF_ClearDirfile(int d)
 /* create a gd_triple_t value */
 static gd_triplet_t _GDF_SetTriplet(gd_windop_t op, const void *data)
 {
-  dtrace("%i, %p", op, data);
-
   gd_triplet_t t;
 
+  dtrace("%i, %p", op, data);
+
   switch(op) {
     case GD_WINDOP_EQ:
     case GD_WINDOP_NE:
@@ -207,7 +209,11 @@ static int _GDF_Callback(gd_parser_data_t* pdata, void *f77_callback)
   dtrace("%p, %p", pdata, f77_callback);
 
   if (c != NULL && c->func != NULL) {
-    unit = _GDF_SetDirfile((DIRFILE*)pdata->dirfile);
+    unit = _GDF_SetDirfile((DIRFILE*)pdata->dirfile, 0);
+    if (unit < 0) {
+      dreturn("%i", r);
+      return r;
+    }
 
     (c->func)(&r, &unit, &pdata->suberror, pdata->line, &pdata->linenum,
         pdata->filename);
@@ -230,7 +236,7 @@ void F77_FUNC(gdopen, GDOPEN) (int32_t *dirfile, const char *dirfilename,
   dtrace("%p, %p, %i, %i", dirfile, dirfilename, *dirfilename_l, *flags);
 
   *dirfile = _GDF_SetDirfile(gd_open(_GDF_CString(&out, dirfilename,
-          *dirfilename_l), *flags));
+          *dirfilename_l), *flags), 1);
 
   free(out);
 
@@ -278,7 +284,7 @@ void F77_FUNC(gdgetd, GDGETD) (int32_t *n_read, const int32_t *dirfile,
 {
   char *out;
 
-  dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%x, %p", n_read, *dirfile,
+  dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%X, %p", n_read, *dirfile,
       field_code, *field_code_l, *first_frame, *first_sample, *num_frames,
       *num_samples, *return_type, data_out);
 
@@ -454,7 +460,7 @@ void F77_FUNC(gdputd, GDPUTD) (int32_t *n_wrote, const int32_t *dirfile,
     const int32_t *data_type, const void *data_in)
 {
   char *out;
-  dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%x, %p", n_wrote, *dirfile,
+  dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%X, %p", n_wrote, *dirfile,
       field_code, *field_code_l, *first_frame, *first_sample, *num_frames,
       *num_samples, *data_type, data_in);
 
@@ -799,20 +805,20 @@ void F77_FUNC(gdgesb, GDGESB) (char *in_field, int32_t *in_field_l,
   dreturnvoid();
 }
 
-/* gd_entry wrapper for MULTIPLY */
-void F77_FUNC(gdgemt, GDGEMT) (char *in_field1, int32_t *in_field1_l,
+static void _GDF_GetEntryYoke(char *in_field1, int32_t *in_field1_l,
     char *in_field2, int32_t *in_field2_l, int32_t *fragment_index,
-    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l,
+    gd_entype_t type)
 {
   char *out;
   gd_entry_t E;
 
-  dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field1, *in_field1_l,
+  dtrace("%p, %i, %p, %i, %p, %i, %p, %i, 0x%X", in_field1, *in_field1_l,
       in_field2, *in_field2_l, fragment_index, *dirfile, field_code,
-      *field_code_l);
+      *field_code_l, type);
 
   if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
-          *field_code_l), &E) || E.field_type != GD_MULTIPLY_ENTRY)
+          *field_code_l), &E) || E.field_type != type)
     *in_field1_l = 0;
   else {
     _GDF_FString(in_field1, in_field1_l, E.in_fields[0]);
@@ -825,29 +831,32 @@ void F77_FUNC(gdgemt, GDGEMT) (char *in_field1, int32_t *in_field1_l,
   dreturnvoid();
 }
 
+/* gd_entry wrapper for MULTIPLY */
+void F77_FUNC(gdgemt, GDGEMT) (char *in_field1, int32_t *in_field1_l,
+    char *in_field2, int32_t *in_field2_l, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field1, *in_field1_l,
+      in_field2, *in_field2_l, fragment_index, *dirfile, field_code,
+      *field_code_l);
+
+  _GDF_GetEntryYoke(in_field1, in_field1_l, in_field2, in_field2_l,
+      fragment_index, dirfile, field_code, field_code_l, GD_MULTIPLY_ENTRY);
+
+  dreturnvoid();
+}
+
 /* gd_entry wrapper for DIVIDE */
 void F77_FUNC(gdgedv, GDGEDV) (char *in_field1, int32_t *in_field1_l,
     char *in_field2, int32_t *in_field2_l, int32_t *fragment_index,
     const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
 {
-  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);
 
-  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);
+  _GDF_GetEntryYoke(in_field1, in_field1_l, in_field2, in_field2_l,
+      fragment_index, dirfile, field_code, field_code_l, GD_DIVIDE_ENTRY);
 
   dreturnvoid();
 }
@@ -1380,24 +1389,17 @@ void F77_FUNC(gdadrc, GDADRC) (const int32_t *dirfile, const char *field_code,
 
 void F77_FUNC(gdadcr, GDADCR) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
-    const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend),
+    const int32_t *in_field_l, const double *cdividend,
     const int32_t *fragment_index)
 {
   char *fc, *in;
 
   dtrace("%i, %p, %i, %p, %i, %g;%g, %i", *dirfile, field_code, *field_code_l,
-      in_field, *in_field_l, crealp(cdividend), cimagp(cdividend),
-      *fragment_index);
+      in_field, *in_field_l, cdividend[0], cdividend[1], *fragment_index);
 
-#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);
@@ -1481,7 +1483,7 @@ void F77_FUNC(gdincl, GDINCL) (const int32_t *dirfile, const char *file,
 void F77_FUNC(gdnfdt, GDNFDT) (int32_t *nfields, const int32_t *dirfile,
     const int32_t *type)
 {
-  dtrace("%p, %i, 0x%x", nfields, *dirfile, *type);
+  dtrace("%p, %i, 0x%X", nfields, *dirfile, *type);
 
   *nfields = gd_nfields_by_type(_GDF_GetDirfile(*dirfile), (gd_entype_t)*type);
 
@@ -2006,7 +2008,7 @@ void F77_FUNC(gdadca, GDADCA) (const int32_t *dirfile, const char *field_code,
 {
   char *fc;
 
-  dtrace("%i, %p, %i, %x, %i, %x, %p, %i", *dirfile, field_code,
+  dtrace("%i, %p, %i, 0x%X, %i, 0x%X, %p, %i", *dirfile, field_code,
       *field_code_l, *const_type, *array_len, *data_type, value,
       *fragment_index);
 
@@ -2026,7 +2028,7 @@ void F77_FUNC(gdmdca, GDMDCA) (const int32_t *dirfile, const char *parent,
 {
   char *pa, *fc;
 
-  dtrace("%i, %p, %i, %p, %i, %x, %i, %x, %p", *dirfile, parent, *parent_l,
+  dtrace("%i, %p, %i, %p, %i, 0x%X, %i, 0x%X, %p", *dirfile, parent, *parent_l,
       field_code, *field_code_l, *const_type, *array_len, *data_type, value);
 
   gd_madd_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
@@ -2130,7 +2132,7 @@ void F77_FUNC(gdgtca, GDGTCA) (const int32_t *dirfile, const char *field_code,
 {
   char *fc;
 
-  dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l,
+  dtrace("%i, %p, %i, 0x%X, %p", *dirfile, field_code, *field_code_l,
       *return_type, data_out);
 
   gd_get_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
@@ -2147,7 +2149,7 @@ void F77_FUNC(gdgcas, GDGCAS) (const int32_t *dirfile, const char *field_code,
 {
   char *fc;
 
-  dtrace("%i, %p, %i, %i, %i, %x, %p", *dirfile, field_code, *field_code_l,
+  dtrace("%i, %p, %i, %i, %i, 0x%X, %p", *dirfile, field_code, *field_code_l,
       *start, *n, *return_type, data_out);
 
   gd_get_carray_slice(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
@@ -2158,7 +2160,7 @@ void F77_FUNC(gdgcas, GDGCAS) (const int32_t *dirfile, const char *field_code,
   dreturnvoid();
 }
 
-/* gd_carray_len wrapper */
+/* gd_carray_len wrapper -- deprecated */
 void F77_FUNC(gdcaln, GDCALN) (int32_t *len, const int32_t *dirfile,
     const char *field_code, const int32_t *field_code_l)
 {
@@ -2166,11 +2168,11 @@ void F77_FUNC(gdcaln, GDCALN) (int32_t *len, const int32_t *dirfile,
 
   dtrace("%p, %i, %p, %i", len, *dirfile, field_code, *field_code_l);
 
-  *len = gd_carray_len(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+  *len = gd_array_len(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
         *field_code_l));
   free(fc);
 
-  dreturnvoid();
+  dreturn("%i", *len);
 }
 
 /* gd_get_string wrapper */
@@ -2202,8 +2204,8 @@ void F77_FUNC(gdptco, GDPTCO) (const int32_t *dirfile, const char *field_code,
 {
   char *fc;
 
-  dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l, *data_type,
-      data_in);
+  dtrace("%i, %p, %i, 0x%X, %p", *dirfile, field_code, *field_code_l,
+      *data_type, data_in);
 
   gd_put_constant(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
         *field_code_l), (gd_type_t)*data_type, data_in);
@@ -2218,8 +2220,8 @@ void F77_FUNC(gdptca, GDPTCA) (const int32_t *dirfile, const char *field_code,
 {
   char *fc;
 
-  dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l, *data_type,
-      data_in);
+  dtrace("%i, %p, %i, 0x%X, %p", *dirfile, field_code, *field_code_l,
+      *data_type, data_in);
 
   gd_put_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
         *field_code_l), (gd_type_t)*data_type, data_in);
@@ -2235,7 +2237,7 @@ void F77_FUNC(gdpcas, GDPCAS) (const int32_t *dirfile, const char *field_code,
 {
   char *fc;
 
-  dtrace("%i, %p, %i, %i, %i, %x, %p", *dirfile, field_code, *field_code_l,
+  dtrace("%i, %p, %i, %i, %i, 0x%X, %p", *dirfile, field_code, *field_code_l,
       *start, *n, *data_type, data_in);
 
   gd_put_carray_slice(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
@@ -2279,7 +2281,7 @@ void F77_FUNC(gdnmft, GDNMFT) (int32_t *nfields, const int32_t *dirfile,
     const char *parent, const int32_t *parent_l, const int32_t *type)
 {
   char *pa;
-  dtrace("%p, %i, %p, %i, 0x%x", nfields, *dirfile, parent, *parent_l, *type);
+  dtrace("%p, %i, %p, %i, 0x%X", nfields, *dirfile, parent, *parent_l, *type);
 
   *nfields = gd_nmfields_by_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa,
         parent, *parent_l), (gd_entype_t)*type);
@@ -2326,18 +2328,20 @@ void F77_FUNC(gdcopn, GDCOPN) (int32_t *dirfile, const char *dirfilename,
   DIRFILE *D;
   char *out;
 
-  dtrace("%p, %p, %i, %x, %p", dirfile, dirfilename, *dirfilename_l, *flags,
+  dtrace("%p, %p, %i, 0x%X, %p", dirfile, dirfilename, *dirfilename_l, *flags,
       callback);
 
   _GDF_CString(&out, dirfilename, *dirfilename_l);
 
   D = gd_cbopen(out, *flags, _GDF_Callback, (void*)&temp);
-  *dirfile = _GDF_SetDirfile(D);
+  *dirfile = _GDF_SetDirfile(D, 1);
 
-  /* save the callback */
-  f77callbacks[*dirfile].func = callback;
-  /* and tell getdata its new location */
-  gd_parser_callback(D, _GDF_Callback, f77callbacks + *dirfile);
+  if (*dirfile >= 0) {
+    /* save the callback */
+    f77callbacks[*dirfile].func = callback;
+    /* and tell getdata its new location */
+    gd_parser_callback(D, _GDF_Callback, f77callbacks + *dirfile);
+  }
 
   free(out);
   dreturn("%i", *dirfile);
@@ -2442,8 +2446,8 @@ void F77_FUNC(gdalca, GDALCA) (const int32_t *dirfile, const char *field_code,
 {
   char *fc;
 
-  dtrace("%i, %p, %i, %x, %i", *dirfile, field_code, *field_code_l, *const_type,
-      *array_len);
+  dtrace("%i, %p, %i, 0x%X, %i", *dirfile, field_code, *field_code_l,
+      *const_type, *array_len);
 
   gd_alter_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
         *field_code_l), (gd_type_t)*const_type, (size_t)*array_len);
@@ -2924,15 +2928,15 @@ void F77_FUNC(gdmlsp, GDMLSP) (const int32_t *dirfile, const char *spec,
 /* gd_move wrapper */
 void F77_FUNC(gdmove, GDMOVE) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const int32_t *new_fragment,
-    const int32_t *move_data)
+    const int32_t *flags)
 {
   char *fc;
 
   dtrace("%i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l,
-      *new_fragment, *move_data);
+      *new_fragment, *flags);
 
   gd_move(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
-        *field_code_l), *new_fragment, *move_data);
+        *field_code_l), *new_fragment, *flags);
 
   free(fc);
   dreturnvoid();
@@ -2941,15 +2945,15 @@ void F77_FUNC(gdmove, GDMOVE) (const int32_t *dirfile, const char *field_code,
 /* gd_rename wrapper */
 void F77_FUNC(gdrenm, GDRENM) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const char *new_name,
-    const int32_t *new_name_l, const int32_t *move_data)
+    const int32_t *new_name_l, const int32_t *flags)
 {
   char *fc, *nn;
 
   dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
-      new_name, *new_name_l, *move_data);
+      new_name, *new_name_l, *flags);
 
   gd_rename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
-        *field_code_l), _GDF_CString(&nn, new_name, *new_name_l), *move_data);
+        *field_code_l), _GDF_CString(&nn, new_name, *new_name_l), *flags);
 
   free(nn);
   free(fc);
@@ -2993,30 +2997,27 @@ void F77_FUNC(gdntyp, GDNTYP) (int32_t *type, const int32_t *dirfile,
   dreturn("%i", *type);
 }
 
-/* returns the value of the comp_scal member */
-void F77_FUNC(gdcscl, GDCSCL) (int32_t *comp_scal, const int32_t *dirfile,
+/* returns the entry flags */
+void F77_FUNC(gdenfl, GDENFL) (int32_t *flags, const int32_t *dirfile,
     const char *field_code, const int32_t *field_code_l)
 {
   char *fc;
   gd_entry_t E;
   DIRFILE *D;
 
-  dtrace("%p, %i, %p, %i", comp_scal, *dirfile, field_code, *field_code_l);
+  dtrace("%p, %i, %p, %i", flags, *dirfile, field_code, *field_code_l);
 
   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;
+  if (gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E) == 0) {
+    *flags = E.flags;
 
-  gd_free_entry_strings(&E);
+    gd_free_entry_strings(&E);
+  } else
+    *flags = -1;
   free(fc);
 
-  dreturn("%i", *comp_scal);
+  dreturn("%i", *flags);
 }
 
 /* gd_validate wrapper */
@@ -3223,7 +3224,7 @@ void F77_FUNC(gdinvd, GDINVD) (int32_t *dirfile)
 {
   dtrace("%p", dirfile);
 
-  *dirfile = _GDF_SetDirfile(gd_invalid_dirfile());
+  *dirfile = _GDF_SetDirfile(gd_invalid_dirfile(), 1);
 
   dreturn("%i", *dirfile);
 }
@@ -3244,7 +3245,7 @@ void F77_FUNC(gdseek, GDSEEK) (int32_t *pos, const int32_t *dirfile,
     const int32_t *frame_num, const int32_t *sample_num, const int32_t *flags)
 {
   char *fc;
-  dtrace("%p, %i, %p, %i, %i, %i, 0x%x", pos, *dirfile, field_code,
+  dtrace("%p, %i, %p, %i, %i, %i, 0x%X", pos, *dirfile, field_code,
       *field_code_l, *frame_num, *sample_num, *flags);
 
   *pos = (int)gd_seek(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
@@ -3273,11 +3274,13 @@ void F77_FUNC(gdcons, GDCONS) (void *value, const int32_t *dirfile,
     const int32_t *return_type, const int32_t *field_num)
 {
   const void *v;
+  DIRFILE *D;
+  unsigned int nfields;
 
-  dtrace("%p, %i, 0x%x, %i", value, *dirfile, *return_type, *field_num);
+  dtrace("%p, %i, 0x%X, %i", value, *dirfile, *return_type, *field_num);
 
-  DIRFILE *D = _GDF_GetDirfile(*dirfile);
-  unsigned int nfields = gd_nfields_by_type(D, GD_CONST_ENTRY);
+  D = _GDF_GetDirfile(*dirfile);
+  nfields = gd_nfields_by_type(D, GD_CONST_ENTRY);
 
   if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) {
     v = gd_constants(D, (gd_type_t)*return_type);
@@ -3298,7 +3301,7 @@ void F77_FUNC(gdmcos, GDMCOS) (void *value, const int32_t *dirfile,
   char *pa;
   unsigned int nfields;
 
-  dtrace("%p, %i, %p, %i, 0x%x, %i", value, *dirfile, parent, *parent_l,
+  dtrace("%p, %i, %p, %i, 0x%X, %i", value, *dirfile, parent, *parent_l,
       *return_type, *field_num);
 
   D = _GDF_GetDirfile(*dirfile);
@@ -3321,11 +3324,13 @@ void F77_FUNC(gdstrs, GDSTRS) (char *value, int32_t *value_l,
     const int32_t *dirfile, const int32_t *field_num)
 {
   const char **v;
+  DIRFILE *D;
+  unsigned int nfields;
 
   dtrace("%p, %i, %i, %i", value, *value_l, *dirfile, *field_num);
 
-  DIRFILE *D = _GDF_GetDirfile(*dirfile);
-  unsigned int nfields = gd_nfields_by_type(D, GD_STRING_ENTRY);
+  D = _GDF_GetDirfile(*dirfile);
+  nfields = gd_nfields_by_type(D, GD_STRING_ENTRY);
 
   if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) {
     v = gd_strings(D);
@@ -3367,12 +3372,15 @@ void F77_FUNC(gdmsts, GDMSTS) (void *value, int32_t *value_l,
 /* Return the maximum string value length */
 void F77_FUNC(gdstrx, GDSTRX) (int32_t *max, const int32_t *dirfile)
 {
-  dtrace("%p, %i", max, *dirfile);
-
   const char **v;
   size_t len = 0;
-  DIRFILE *D = _GDF_GetDirfile(*dirfile);
-  unsigned int i, nfields = gd_nfields_by_type(D, GD_STRING_ENTRY);
+  DIRFILE *D;
+  unsigned int i, nfields;
+
+  dtrace("%p, %i", max, *dirfile);
+
+  D = _GDF_GetDirfile(*dirfile);
+  nfields = gd_nfields_by_type(D, GD_STRING_ENTRY);
 
   if (!gd_error(D)) {
     v = gd_strings(D);
@@ -3498,18 +3506,18 @@ void F77_FUNC(gdmdwd, GDMDWD) (const int32_t *dirfile, const char *parent,
 void F77_FUNC(gdadmx, GDADMX) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
     const int32_t *in_field_l, const char *count_field,
-    const int32_t *count_field_l, const int32_t *val, const int32_t *max,
+    const int32_t *count_field_l, const int32_t *val, const int32_t *period,
     const int32_t *fragment_index)
 {
   char *in, *cf, *fc;
 
   dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code,
       *field_code_l, in_field, *in_field_l, count_field, *count_field_l,
-      *val, *max, *fragment_index);
+      *val, *period, *fragment_index);
 
   gd_add_mplex(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
         *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
-      _GDF_CString(&cf, count_field, *count_field_l), *val, *max,
+      _GDF_CString(&cf, count_field, *count_field_l), *val, *period,
       *fragment_index);
 
   free(fc);
@@ -3524,18 +3532,18 @@ void F77_FUNC(gdmdmx, GDMDMX) (const int32_t *dirfile, const char *parent,
     const int32_t *parent_l, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
     const int32_t *in_field_l, const char *count_field,
-    const int32_t *count_field_l, const int32_t *val, const int32_t *max)
+    const int32_t *count_field_l, const int32_t *val, const int32_t *period)
 {
   char *in, *cf, *fc, *pa;
 
   dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, parent,
       *parent_l, field_code, *field_code_l, in_field, *in_field_l, count_field,
-      *count_field_l, *val, *max);
+      *count_field_l, *val, *period);
 
   gd_madd_mplex(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l),
       _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field,
         *in_field_l), _GDF_CString(&cf, count_field, *count_field_l), *val,
-      *max);
+      *period);
 
   free(pa);
   free(fc);
@@ -3573,10 +3581,11 @@ void F77_FUNC(gdalsx, GDALSX) (int32_t *max, const int32_t *dirfile,
   size_t len = 0;
   char *fc;
   unsigned int i, nalias;
+  DIRFILE *D;
 
   dtrace("%p, %i, %p, %i", max, *dirfile, field_code, *field_code_l);
 
-  DIRFILE* D = _GDF_GetDirfile(*dirfile);
+  D = _GDF_GetDirfile(*dirfile);
   _GDF_CString(&fc, field_code, *field_code_l);
 
   nalias = gd_naliases(D, fc);
@@ -3618,11 +3627,12 @@ void F77_FUNC(gdalss, GDALSS) (char *alias, int32_t *alias_l,
   const char **al;
   char *fc;
   unsigned int nalias;
+  DIRFILE *D;
 
   dtrace("%p, %i, %i, %p, %i, %i", alias, *alias_l, *dirfile, field_code,
       *field_code_l, *num);
 
-  DIRFILE* D = _GDF_GetDirfile(*dirfile);
+  D = _GDF_GetDirfile(*dirfile);
   _GDF_CString(&fc, field_code, *field_code_l);
 
   nalias = gd_naliases(D, fc);
@@ -3685,17 +3695,17 @@ void F77_FUNC(gdalwd, GDALWD) (const int32_t *dirfile, const char *field_code,
 void F77_FUNC(gdalmx, GDALMX) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
     const int32_t *in_field_l, const char *count_field,
-    const int32_t *count_field_l, const int32_t *val, const int32_t *max)
+    const int32_t *count_field_l, const int32_t *val, const int32_t *period)
 {
   char *fc, *in, *cf;
 
   dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, field_code,
       *field_code_l, in_field, *in_field_l, count_field, *count_field_l,
-      *val, *max);
+      *val, *period);
 
   gd_alter_mplex(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
         *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
-      _GDF_CString(&cf, count_field, *count_field_l), *val, *max);
+      _GDF_CString(&cf, count_field, *count_field_l), *val, *period);
 
   free(cf);
   free(in);
@@ -3703,21 +3713,6 @@ void F77_FUNC(gdalmx, GDALMX) (const int32_t *dirfile, const char *field_code,
   dreturnvoid();
 }
 
-/* gd_delete_alias */
-void F77_FUNC(gddela, GDDELA) (const int32_t *dirfile, const char *field_code,
-    const int32_t *field_code_l, const int32_t *flags)
-{
-  char *fc;
-
-  dtrace("%i, %p, %i, %i", *dirfile, field_code, *field_code_l, *flags);
-
-  gd_delete_alias(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
-        *field_code_l), (unsigned int)*flags);
-
-  free(fc);
-  dreturnvoid();
-}
-
 /* gd_fragment_affixes */
 void F77_FUNC(gdfraf, GDFRAF) (char *prefix, int32_t *prefix_l, char *suffix,
     int32_t *suffix_l, const int32_t *dirfile, const int32_t *index)
@@ -3804,21 +3799,6 @@ void F77_FUNC(gdmdal, GDMDAL) (const int32_t *dirfile, const char *parent,
   dreturnvoid();
 }
 
-/* gd_move_alias wrapper */
-void F77_FUNC(gdmova, GDMOVA) (const int32_t *dirfile, const char *field_code,
-    const int32_t *field_code_l, const int32_t *new_fragment)
-{
-  char *fc;
-
-  dtrace("%i, %p, %i, %i", *dirfile, field_code, *field_code_l, *new_fragment);
-
-  gd_move_alias(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
-        *field_code_l), *new_fragment);
-
-  free(fc);
-  dreturnvoid();
-}
-
 /* gd_include_affix wrapper */
 void F77_FUNC(gdinca, GDINCA) (const int32_t *dirfile, const char *file,
     const int32_t *file_l, const int32_t *fragment_index, const char *prefix,
@@ -4044,3 +4024,1206 @@ void F77_FUNC(gdlttn, GDLTTN) (char *name, int32_t *name_l,
 
   dreturn("%i", *name_l);
 }
+
+/* gd_add_raw with scalar parameters */
+void F77_FUNC(gdasrw, GDASRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const char *spf_scalar, const int32_t *spf_scalar_l,
+    const int32_t *spf_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+
+  dtrace("%i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile, field_code,
+      *field_code_l, *data_type, *spf, spf_scalar, *spf_scalar_l,
+      *spf_scalar_ind, *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = *fragment_index;
+  E.EN(raw,data_type) = *data_type;
+  E.EN(raw,spf) = *spf;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(E.scalar, spf_scalar, *spf_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *spf_scalar_ind);
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdaslc, GDASLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1,
+    const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const double *m2, const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2,
+    const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const double *m3, const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3,
+    const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+  int i, n;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %p, %i, "
+      "%g, %p, %i, %i, %g, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, "
+      "%i, %i", *dirfile, field_code, *field_code_l, *n_fields, in_field1,
+      *in_field1_l, *m1, m1_scalar, *m1_scalar_l, *m1_scalar_ind, *b1,
+      b1_scalar, *b1_scalar_l, *b1_scalar_ind, in_field2, *in_field2_l, *m2,
+      m2_scalar, *m2_scalar_l, *m2_scalar_ind, *b2, b2_scalar, *b2_scalar_l,
+      *b2_scalar_ind, in_field3, *in_field3_l, *m3, m3_scalar, *m3_scalar_l,
+      *m3_scalar_ind, *b3, b3_scalar, *b3_scalar_l, *b3_scalar_ind,
+      *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_LINCOM_ENTRY;
+  E.fragment_index = *fragment_index;
+  n = E.EN(lincom,n_fields) = *n_fields;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+
+  _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l);
+  _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l);
+  _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l);
+
+  GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind);
+  GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind);
+  E.EN(lincom,m[0]) = *m1;
+  E.EN(lincom,b[0]) = *b1;
+
+  if (n > 1) {
+    _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l);
+    _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l);
+    _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind);
+    E.EN(lincom,m[1]) = *m2;
+    E.EN(lincom,b[1]) = *b2;
+  }
+
+  if (n > 2) {
+    _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l);
+    _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l);
+    _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind);
+    E.EN(lincom,m[2]) = *m3;
+    E.EN(lincom,b[2]) = *b3;
+  }
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  for (i = 0; i < n; ++i) {
+    free(E.in_fields[i]);
+    free(E.scalar[i]);
+    free(E.scalar[i + GD_MAX_LINCOM]);
+  }
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdascl, GDASCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind,
+    const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind,
+    const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind,
+    const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+  int i, n;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, "
+      "%i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, "
+      "%g;%g, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *n_fields,
+      in_field1, *in_field1_l, crealp(m1), cimagp(m1), m1_scalar, *m1_scalar_l,
+      *m1_scalar_ind, crealp(b1), cimagp(b1), b1_scalar, *b1_scalar_l,
+      *b1_scalar_ind, in_field2, *in_field2_l, crealp(m2), cimagp(m2),
+      m2_scalar, *m2_scalar_l, *m2_scalar_ind, crealp(b2), cimagp(b2),
+      b2_scalar, *b2_scalar_l, *b2_scalar_ind, in_field3, *in_field3_l,
+      crealp(m3), cimagp(m3), m3_scalar, *m3_scalar_l, *m3_scalar_ind,
+      crealp(b3), cimagp(b3), b3_scalar, *b3_scalar_l, *b3_scalar_ind,
+      *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_LINCOM_ENTRY;
+  E.fragment_index = *fragment_index;
+  n = E.EN(lincom,n_fields) = *n_fields;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  E.flags = GD_EN_COMPSCAL;
+
+  _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l);
+  _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l);
+  _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l);
+
+  GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind);
+  GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind);
+  gd_cp2cs_(E.EN(lincom,cm)[0], m1);
+  gd_cp2cs_(E.EN(lincom,cb)[0], b1);
+
+  if (n > 1) {
+    _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l);
+    _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l);
+    _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind);
+    gd_cp2cs_(E.EN(lincom,cm)[1], m2);
+    gd_cp2cs_(E.EN(lincom,cb)[1], b2);
+  }
+
+  if (n > 2) {
+    _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l);
+    _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l);
+    _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind);
+    gd_cp2cs_(E.EN(lincom,cm)[2], m3);
+    gd_cp2cs_(E.EN(lincom,cb)[2], b3);
+  }
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  for (i = 0; i < n; ++i) {
+    free(E.in_fields[i]);
+    free(E.scalar[i]);
+    free(E.scalar[i + GD_MAX_LINCOM]);
+  }
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdaspn, GDASPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const double *a1,
+    const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const double *a3,
+    const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const double *a5,
+    const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+  int i, n;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %g, %p, %i, "
+      "%i, %g, %p, %i, %i, %g, %p, %i, %i, %g, %p, %i, %i, %i",
+      *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l,
+      *a0, a0_scalar, *a0_scalar_l, *a0_scalar_ind, *a1, a1_scalar,
+      *a1_scalar_l, *a1_scalar_ind, *a2, a2_scalar, *a2_scalar_l,
+      *a2_scalar_ind, *a3, a3_scalar, *a3_scalar_l, *a3_scalar_ind, *a4,
+      a4_scalar, *a4_scalar_l, *a4_scalar_ind, *a5, a5_scalar, *a5_scalar_l,
+      *a5_scalar_ind, *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_POLYNOM_ENTRY;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  E.fragment_index = *fragment_index;
+  n = E.EN(polynom,poly_ord) = *poly_ord;
+
+  if (n > 5)
+    n = 5;
+  else if (n < 1)
+    n = 1;
+
+  switch (n) {
+    case 5:
+      _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind);
+      E.EN(polynom,a[5]) = *a5;
+      /* fallthrough */
+    case 4:
+      _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind);
+      E.EN(polynom,a[4]) = *a4;
+      /* fallthrough */
+    case 3:
+      _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind);
+      E.EN(polynom,a[3]) = *a3;
+      /* fallthrough */
+    case 2:
+      _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind);
+      E.EN(polynom,a[2]) = *a2;
+      /* fallthrough */
+    default:
+      _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind);
+      E.EN(polynom,a[1]) = *a1;
+      _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind);
+      E.EN(polynom,a[0]) = *a0;
+  }
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  for (i = 0; i <= n; ++i)
+    free(E.scalar[i]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdascp, GDASCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind,
+    const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind,
+    const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind,
+    const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+  int i, n;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, "
+      "%p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %i",
+      *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l,
+      crealp(a0), cimagp(a0), a0_scalar, *a0_scalar_l, *a0_scalar_ind,
+      crealp(a1), cimagp(a1), a1_scalar, *a1_scalar_l, *a1_scalar_ind,
+      crealp(a2), cimagp(a2), a2_scalar, *a2_scalar_l, *a2_scalar_ind,
+      crealp(a3), cimagp(a3), a3_scalar, *a3_scalar_l, *a3_scalar_ind,
+      crealp(a4), cimagp(a4), a4_scalar, *a4_scalar_l, *a4_scalar_ind,
+      crealp(a5), cimagp(a5), a5_scalar, *a5_scalar_l, *a5_scalar_ind,
+      *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_POLYNOM_ENTRY;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  E.fragment_index = *fragment_index;
+  n = E.EN(polynom,poly_ord) = *poly_ord;
+  E.flags = GD_EN_COMPSCAL;
+
+  if (n > 5)
+    n = 5;
+  else if (n < 1)
+    n = 1;
+
+  switch (n) {
+    case 5:
+      _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[5], a5);
+      /* fallthrough */
+    case 4:
+      _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[4], a4);
+      /* fallthrough */
+    case 3:
+      _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[3], a3);
+      /* fallthrough */
+    case 2:
+      _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[2], a2);
+      /* fallthrough */
+    default:
+      _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[1], a1);
+      _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[0], a0);
+  }
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  for (i = 0; i <= n; ++i)
+    free(E.scalar[i]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdasph, GDASPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift,
+    const char *shift_scalar, const int32_t *shift_scalar_l,
+    const int32_t *shift_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, *shift, shift_scalar,
+      *shift_scalar_l, *shift_scalar_ind, *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_PHASE_ENTRY;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  E.fragment_index = *fragment_index;
+  E.EN(phase,shift) = *shift;
+  _GDF_CString(E.scalar + 0, shift_scalar, *shift_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *shift_scalar_ind);
+  
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdasrc, GDASRC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const char *dividend_scalar, const int32_t *dividend_scalar_l,
+    const int32_t *dividend_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+
+  dtrace("%i, %p, %i, %p, %i, %g, %p, %i, %i, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, *dividend, dividend_scalar,
+      *dividend_scalar_l, *dividend_scalar_ind, *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_RECIP_ENTRY;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  E.fragment_index = *fragment_index;
+  E.EN(recip,dividend) = *dividend;
+  _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind);
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdascr, GDASCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const char *dividend_scalar, const int32_t *dividend_scalar_l,
+    const int32_t *dividend_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+
+  dtrace("%i, %p, %i, %p, %i, %g;%g, %p, %i, %i, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, dividend[0], dividend[1],
+      dividend_scalar, *dividend_scalar_l, *dividend_scalar_ind,
+      *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_RECIP_ENTRY;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  E.fragment_index = *fragment_index;
+  gd_li2cs_(E.EN(recip,cdividend), dividend[0], dividend[1]);
+  _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind);
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdaswd, GDASWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold,
+    const char *threshold_scalar, const int32_t *threshold_scalar_l,
+    const int32_t *threshold_scalar_ind, const int32_t *fragment_index)
+{
+  gd_entry_t E;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %p, %i, %i, %i", *dirfile,
+      field_code, *field_code_l, in_field, *in_field_l, check_field,
+      *check_field_l, *windop, threshold, threshold_scalar, *threshold_scalar_l,
+      *threshold_scalar_ind, *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_WINDOW_ENTRY;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  _GDF_CString(&E.in_fields[1], check_field, *check_field_l);
+  E.fragment_index = *fragment_index;
+  E.EN(window,windop) = *windop;
+  E.EN(window,threshold) = _GDF_SetTriplet(E.EN(window,windop), threshold);
+  _GDF_CString(E.scalar + 0, threshold_scalar, *threshold_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *threshold_scalar_ind);
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  free(E.in_fields[1]);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdasmx, GDASMX) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const char *val_scalar,
+    const int32_t *val_scalar_l, const int32_t *val_scalar_ind,
+    const int32_t *period, const char *period_scalar,
+    const int32_t *period_scalar_l, const int32_t *period_scalar_ind,
+    const int32_t *fragment_index)
+{
+  gd_entry_t E;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i",
+      *dirfile, field_code, *field_code_l, in_field, *in_field_l, count_field,
+      *count_field_l, *val, val_scalar, *val_scalar_l, *val_scalar_ind,
+      *period, period_scalar, *period_scalar_l, *period_scalar_ind,
+      *fragment_index);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_MPLEX_ENTRY;
+  _GDF_CString(&E.field, field_code, *field_code_l);
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  _GDF_CString(&E.in_fields[1], count_field, *count_field_l);
+  E.fragment_index = *fragment_index;
+  E.EN(mplex,count_val) = *val;
+  E.EN(mplex,period) = *period;
+  _GDF_CString(E.scalar + 0, val_scalar, *val_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *val_scalar_ind);
+  _GDF_CString(E.scalar + 1, period_scalar, *period_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[1], *period_scalar_ind);
+
+  gd_add(_GDF_GetDirfile(*dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  free(E.in_fields[1]);
+  free(E.scalar[0]);
+  free(E.scalar[1]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdlsph, GDLSPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift,
+    const char *shift_scalar, const int32_t *shift_scalar_l,
+    const int32_t *shift_scalar_ind)
+{
+  gd_entry_t E;
+  char *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, *shift, shift_scalar,
+      *shift_scalar_l, *shift_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_PHASE_ENTRY;
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  E.EN(phase,shift) = *shift;
+  _GDF_CString(E.scalar + 0, shift_scalar, *shift_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *shift_scalar_ind);
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+  dreturnvoid();
+}
+
+void F77_FUNC(gdlspn, GDLSPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind,
+    const double *a1, const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind,
+    const double *a3, const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind,
+    const double *a5, const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind)
+{
+  char *fc;
+  gd_entry_t E;
+  int i, n;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %g, "
+      "%p, %i, %i, %g, %p, %i, %i, %g, %p, %i, %i, %g, %p, %i, %i",
+      *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l,
+      *a0, a0_scalar, *a0_scalar_l, *a0_scalar_ind,
+      *a1, a1_scalar, *a1_scalar_l, *a1_scalar_ind,
+      *a2, a2_scalar, *a2_scalar_l, *a2_scalar_ind,
+      *a3, a3_scalar, *a3_scalar_l, *a3_scalar_ind,
+      *a4, a4_scalar, *a4_scalar_l, *a4_scalar_ind,
+      *a5, a5_scalar, *a5_scalar_l, *a5_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_POLYNOM_ENTRY;
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  n = E.EN(polynom,poly_ord) = *poly_ord;
+
+  if (n > 5)
+    n = 5;
+  else if (n < 1)
+    n = 1;
+
+  switch (n) {
+    case 5:
+      _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind);
+      E.EN(polynom,a)[5] = *a5;
+      /* fallthrough */
+    case 4:
+      _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind);
+      E.EN(polynom,a)[4] = *a4;
+      /* fallthrough */
+    case 3:
+      _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind);
+      E.EN(polynom,a)[3] = *a3;
+      /* fallthrough */
+    case 2:
+      _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind);
+      E.EN(polynom,a)[2] = *a2;
+      /* fallthrough */
+    default:
+      _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind);
+      E.EN(polynom,a)[1] = *a1;
+      _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind);
+      E.EN(polynom,a)[0] = *a0;
+  }
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  for (i = 0; i <= n; ++i)
+    free(E.scalar[i]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdlscp, GDLSCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind,
+    const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind,
+    const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind,
+    const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind)
+{
+  char *fc;
+  gd_entry_t E;
+  int i, n;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, "
+      "%p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i",
+      *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l,
+      crealp(a0), cimagp(a0), a0_scalar, *a0_scalar_l, *a0_scalar_ind,
+      crealp(a1), cimagp(a1), a1_scalar, *a1_scalar_l, *a1_scalar_ind,
+      crealp(a2), cimagp(a2), a2_scalar, *a2_scalar_l, *a2_scalar_ind,
+      crealp(a3), cimagp(a3), a3_scalar, *a3_scalar_l, *a3_scalar_ind,
+      crealp(a4), cimagp(a4), a4_scalar, *a4_scalar_l, *a4_scalar_ind,
+      crealp(a5), cimagp(a5), a5_scalar, *a5_scalar_l, *a5_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_POLYNOM_ENTRY;
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  n = E.EN(polynom,poly_ord) = *poly_ord;
+  E.flags = GD_EN_COMPSCAL;
+
+  if (n > 5)
+    n = 5;
+  else if (n < 1)
+    n = 1;
+
+  switch (n) {
+    case 5:
+      _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[5], a5);
+      /* fallthrough */
+    case 4:
+      _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[4], a4);
+      /* fallthrough */
+    case 3:
+      _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[3], a3);
+      /* fallthrough */
+    case 2:
+      _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[2], a2);
+      /* fallthrough */
+    default:
+      _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[1], a1);
+      _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l);
+      GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind);
+      gd_cp2cs_(E.EN(polynom,ca)[0], a0);
+  }
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  for (i = 0; i <= n; ++i)
+    free(E.scalar[i]);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdlswd, GDLSWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold,
+    const char *threshold_scalar, const int32_t *threshold_scalar_l,
+    const int32_t *threshold_scalar_ind)
+{
+  gd_entry_t E;
+  char *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %p, %i, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, check_field, *check_field_l,
+      *windop, threshold, threshold_scalar, *threshold_scalar_l,
+      *threshold_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_WINDOW_ENTRY;
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  _GDF_CString(&E.in_fields[1], check_field, *check_field_l);
+  E.EN(window,windop) = *windop;
+  E.EN(window,threshold) = _GDF_SetTriplet(E.EN(window,windop), threshold);
+  _GDF_CString(E.scalar + 0, threshold_scalar, *threshold_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *threshold_scalar_ind);
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  free(E.in_fields[1]);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+/* common code for gdasbt and gdassb */
+static void _GDF_AddBitSBit(int32_t dirfile, const char *field_code,
+    int32_t field_code_l, const char *in_field, int32_t in_field_l,
+    int32_t bitnum, const char *bitnum_scalar, int32_t bitnum_scalar_l,
+    int32_t bitnum_scalar_ind, int32_t numbits, const char *numbits_scalar,
+    int32_t numbits_scalar_l, int32_t numbits_scalar_ind,
+    int32_t fragment_index, int sbit)
+{
+  gd_entry_t E;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i, %i", dirfile,
+      field_code, field_code_l, in_field, in_field_l, bitnum, bitnum_scalar,
+      bitnum_scalar_l, bitnum_scalar_ind, numbits, numbits_scalar,
+      numbits_scalar_l, numbits_scalar_ind, fragment_index, sbit);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = sbit ? GD_SBIT_ENTRY : GD_BIT_ENTRY;
+  E.fragment_index = fragment_index;
+  E.EN(bit,bitnum) = bitnum;
+  E.EN(bit,numbits) = numbits;
+  _GDF_CString(&E.field, field_code, field_code_l);
+  _GDF_CString(E.in_fields, in_field, in_field_l);
+  _GDF_CString(E.scalar, bitnum_scalar, bitnum_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], bitnum_scalar_ind);
+  _GDF_CString(E.scalar + 1, numbits_scalar, numbits_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[1], numbits_scalar_ind);
+
+  gd_add(_GDF_GetDirfile(dirfile), &E);
+
+  free(E.field);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+  free(E.scalar[1]);
+
+  dreturnvoid();
+}
+
+/* gd_add_bit with scalar parameters */
+void F77_FUNC(gdasbt, GDASBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind,
+    const int32_t *fragment_index)
+{
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile,
+      field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar,
+      *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar,
+      *numbits_scalar_l, *numbits_scalar_ind, *fragment_index);
+
+  _GDF_AddBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l,
+      *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits,
+      numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, *fragment_index,
+      0);
+
+  dreturnvoid();
+}
+
+/* gd_add_sbit with scalar parameters */
+void F77_FUNC(gdassb, GDASSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind,
+    const int32_t *fragment_index)
+{
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile,
+      field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar,
+      *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar,
+      *numbits_scalar_l, *numbits_scalar_ind, *fragment_index);
+
+
+  _GDF_AddBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l,
+      *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits,
+      numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, *fragment_index,
+      1);
+
+  dreturnvoid();
+}
+
+/* common code for gdlsbt and gdlssb */
+static void _GDF_AlterBitSBit(int32_t dirfile, const char *field_code,
+    int32_t field_code_l, const char *in_field, int32_t in_field_l,
+    int32_t bitnum, const char *bitnum_scalar, int32_t bitnum_scalar_l,
+    int32_t bitnum_scalar_ind, int32_t numbits, const char *numbits_scalar,
+    int32_t numbits_scalar_l, int32_t numbits_scalar_ind, int sbit)
+{
+  gd_entry_t E;
+  char *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i", dirfile,
+      field_code, field_code_l, in_field, in_field_l, bitnum, bitnum_scalar,
+      bitnum_scalar_l, bitnum_scalar_ind, numbits, numbits_scalar,
+      numbits_scalar_l, numbits_scalar_ind, sbit);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = sbit ? GD_SBIT_ENTRY : GD_BIT_ENTRY;
+  E.EN(bit,bitnum) = bitnum;
+  E.EN(bit,numbits) = numbits;
+  _GDF_CString(E.in_fields, in_field, in_field_l);
+  _GDF_CString(E.scalar, bitnum_scalar, bitnum_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], bitnum_scalar_ind);
+  _GDF_CString(E.scalar + 1, numbits_scalar, numbits_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[1], numbits_scalar_ind);
+
+  gd_alter_entry(_GDF_GetDirfile(dirfile), _GDF_CString(&fc, field_code,
+        field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+  free(E.scalar[1]);
+
+  dreturnvoid();
+}
+
+/* gd_alter_bit with scalar parameters */
+void F77_FUNC(gdlsbt, GDLSBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind)
+{
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i", *dirfile,
+      field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar,
+      *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar,
+      *numbits_scalar_l, *numbits_scalar_ind);
+
+  _GDF_AlterBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l,
+      *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits,
+      numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, 0);
+
+  dreturnvoid();
+}
+
+/* gd_alter_sbit with scalar parameters */
+void F77_FUNC(gdlssb, GDLSSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind)
+{
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i", *dirfile,
+      field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar,
+      *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar,
+      *numbits_scalar_l, *numbits_scalar_ind);
+
+  _GDF_AlterBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l,
+      *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits,
+      numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, 1);
+
+  dreturnvoid();
+}
+
+/* gd_alter_lincom with scalar parameters */
+void F77_FUNC(gdlslc, GDLSLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1,
+    const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const double *m2, const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2,
+    const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const double *m3, const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3,
+    const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind)
+{
+  gd_entry_t E;
+  int i, n;
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %p, %i, "
+      "%g, %p, %i, %i, %g, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, "
+      "%i", *dirfile, field_code, *field_code_l, *n_fields, in_field1,
+      *in_field1_l, *m1, m1_scalar, *m1_scalar_l, *m1_scalar_ind, *b1,
+      b1_scalar, *b1_scalar_l, *b1_scalar_ind, in_field2, *in_field2_l, *m2,
+      m2_scalar, *m2_scalar_l, *m2_scalar_ind, *b2, b2_scalar, *b2_scalar_l,
+      *b2_scalar_ind, in_field3, *in_field3_l, *m3, m3_scalar, *m3_scalar_l,
+      *m3_scalar_ind, *b3, b3_scalar, *b3_scalar_l, *b3_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_LINCOM_ENTRY;
+  n = E.EN(lincom,n_fields) = *n_fields;
+
+  _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l);
+  _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l);
+  _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l);
+
+  GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind);
+  GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind);
+  E.EN(lincom,m[0]) = *m1;
+  E.EN(lincom,b[0]) = *b1;
+
+  if (n > 1) {
+    _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l);
+    _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l);
+    _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind);
+    E.EN(lincom,m[1]) = *m2;
+    E.EN(lincom,b[1]) = *b2;
+  }
+
+  if (n > 2) {
+    _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l);
+    _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l);
+    _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind);
+    E.EN(lincom,m[2]) = *m3;
+    E.EN(lincom,b[2]) = *b3;
+  }
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  for (i = 0; i < n; ++i) {
+    free(E.in_fields[i]);
+    free(E.scalar[i]);
+    free(E.scalar[i + GD_MAX_LINCOM]);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_alter_clincom with scalar parameters */
+void F77_FUNC(gdlscl, GDLSCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind,
+    const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind,
+    const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind,
+    const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind)
+{
+  gd_entry_t E;
+  int i, n;
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, "
+      "%i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, "
+      "%g;%g, %p, %i, %i", *dirfile, field_code, *field_code_l, *n_fields,
+      in_field1, *in_field1_l, crealp(m1), cimagp(m1), m1_scalar, *m1_scalar_l,
+      *m1_scalar_ind, crealp(b1), cimagp(b1), b1_scalar, *b1_scalar_l,
+      *b1_scalar_ind, in_field2, *in_field2_l, crealp(m2), cimagp(m2),
+      m2_scalar, *m2_scalar_l, *m2_scalar_ind, crealp(b2), cimagp(b2),
+      b2_scalar, *b2_scalar_l, *b2_scalar_ind, in_field3, *in_field3_l,
+      crealp(m3), cimagp(m3), m3_scalar, *m3_scalar_l, *m3_scalar_ind,
+      crealp(b3), cimagp(b3), b3_scalar, *b3_scalar_l, *b3_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_LINCOM_ENTRY;
+  n = E.EN(lincom,n_fields) = *n_fields;
+  E.flags = GD_EN_COMPSCAL;
+
+  _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l);
+  _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l);
+  _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l);
+
+  GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind);
+  GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind);
+  gd_cp2cs_(E.EN(lincom,cm)[0], m1);
+  gd_cp2cs_(E.EN(lincom,cb)[0], b1);
+
+  if (n > 1) {
+    _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l);
+    _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l);
+    _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind);
+    gd_cp2cs_(E.EN(lincom,cm)[1], m2);
+    gd_cp2cs_(E.EN(lincom,cb)[1], b2);
+  }
+
+  if (n > 2) {
+    _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l);
+    _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l);
+    _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l);
+
+    GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind);
+    GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind);
+    gd_cp2cs_(E.EN(lincom,cm)[2], m3);
+    gd_cp2cs_(E.EN(lincom,cb)[2], b3);
+  }
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  for (i = 0; i < n; ++i) {
+    free(E.in_fields[i]);
+    free(E.scalar[i]);
+    free(E.scalar[i + GD_MAX_LINCOM]);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_alter_recip with scalar parameters */
+void F77_FUNC(gdlsrc, GDLSRC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const char *dividend_scalar, const int32_t *dividend_scalar_l,
+    const int32_t *dividend_scalar_ind)
+{
+  gd_entry_t E;
+  char *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %g, %p, %i, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, *dividend, dividend_scalar,
+      *dividend_scalar_l, *dividend_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_RECIP_ENTRY;
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  E.EN(recip,dividend) = *dividend;
+  _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind);
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+/* gd_alter_crecip with scalar parameters */
+void F77_FUNC(gdlscr, GDLSCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const char *dividend_scalar, const int32_t *dividend_scalar_l,
+    const int32_t *dividend_scalar_ind)
+{
+  gd_entry_t E;
+  char *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %g;%g, %p, %i, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, dividend[0], dividend[1],
+      dividend_scalar, *dividend_scalar_l, *dividend_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_RECIP_ENTRY;
+  E.flags = GD_EN_COMPSCAL;
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  gd_li2cs_(E.EN(recip,cdividend), dividend[0], dividend[1]);
+  _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind);
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+/* gd_alter_raw with scalar parameters */
+void F77_FUNC(gdlsrw, GDLSRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const char *spf_scalar, const int32_t *spf_scalar_l,
+    const int32_t *spf_scalar_ind, const int32_t *recode)
+{
+  gd_entry_t E;
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile, field_code,
+      *field_code_l, *data_type, *spf, spf_scalar, *spf_scalar_l,
+      *spf_scalar_ind, *recode);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_RAW_ENTRY;
+  E.EN(raw,data_type) = *data_type;
+  E.EN(raw,spf) = *spf;
+  _GDF_CString(E.scalar, spf_scalar, *spf_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *spf_scalar_ind);
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, *recode);
+
+  free(fc);
+  free(E.scalar[0]);
+
+  dreturnvoid();
+}
+
+/* gd_alter_mplex with scalar parameters */
+void F77_FUNC(gdlsmx, GDLSMX) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const char *val_scalar,
+    const int32_t *val_scalar_l, const int32_t *val_scalar_ind,
+    const int32_t *period, const char *period_scalar,
+    const int32_t *period_scalar_l, const int32_t *period_scalar_ind)
+{
+  gd_entry_t E;
+  char *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i",
+      *dirfile, field_code, *field_code_l, in_field, *in_field_l, count_field,
+      *count_field_l, *val, val_scalar, *val_scalar_l, *val_scalar_ind,
+      *period, period_scalar, *period_scalar_l, *period_scalar_ind);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_MPLEX_ENTRY;
+  _GDF_CString(&E.in_fields[0], in_field, *in_field_l);
+  _GDF_CString(&E.in_fields[1], count_field, *count_field_l);
+  E.EN(mplex,count_val) = *val;
+  E.EN(mplex,period) = *period;
+  _GDF_CString(E.scalar + 0, val_scalar, *val_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[0], *val_scalar_ind);
+  _GDF_CString(E.scalar + 1, period_scalar, *period_scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[1], *period_scalar_ind);
+
+  gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), &E, 0);
+
+  free(fc);
+  free(E.in_fields[0]);
+  free(E.in_fields[1]);
+  free(E.scalar[0]);
+  free(E.scalar[1]);
+
+  dreturnvoid();
+}
+
+/* gd_encoding_support */
+void F77_FUNC(gdencs,GDENCS) (int32_t *ret, const int32_t *encoding)
+{
+  dtrace("%p, 0x%X", ret, *encoding);
+
+  *ret = gd_encoding_support((unsigned long)*encoding);
+
+  dreturn("%i", *ret);
+}
+
+/* gd_array_len wrapper */
+void F77_FUNC(gdarln, GDARLN) (int32_t *len, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i", len, *dirfile, field_code, *field_code_l);
+
+  *len = gd_array_len(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+  free(fc);
+
+  dreturn("%i", *len);
+}
diff --git a/bindings/f77/fgetdata.h b/bindings/f77/fgetdata.h
index 0b91d45..8d5df20 100644
--- a/bindings/f77/fgetdata.h
+++ b/bindings/f77/fgetdata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008, 2010, 2012-2014 D. V. Wiebe
  *
  *************************************************************************
  *
@@ -470,7 +470,7 @@ void F77_FUNC(gdalcp, GDALCP) (const int32_t *dirfile, const char *field_code,
     const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
     const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5));
 
-void F77_FUNC(gdcscl, GDCSCL) (int32_t *comp_scal, const int32_t *dirfile,
+void F77_FUNC(gdenfl, GDENFL) (int32_t *flags, const int32_t *dirfile,
     const char *field_code, const int32_t *field_code_l);
 
 void F77_FUNC(gdvldt, GDVLDT) (int32_t *valid, const int32_t *dirfile,
@@ -535,7 +535,7 @@ void F77_FUNC(gdadrc, GDADRC) (const int32_t *dirfile, const char *field_code,
 
 void F77_FUNC(gdadcr, GDADCR) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
-    const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend),
+    const int32_t *in_field_l, const double *cdividend,
     const int32_t *fragment_index);
 
 void F77_FUNC(gdmddv, GDMDDV) (const int32_t *dirfile, const char *parent,
@@ -635,19 +635,19 @@ void F77_FUNC(gdalwd, GDALWD) (const int32_t *dirfile, const char *field_code,
 void F77_FUNC(gdadmx, GDADMX) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
     const int32_t *in_field_l, const char *count_field,
-    const int32_t *count_field_l, const int32_t *val, const int32_t *max,
+    const int32_t *count_field_l, const int32_t *val, const int32_t *period,
     const int32_t *fragment_index);
 
 void F77_FUNC(gdmdmx, GDMDMX) (const int32_t *dirfile, const char *parent,
     const int32_t *parent_l, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
     const int32_t *in_field_l, const char *count_field,
-    const int32_t *count_field_l, const int32_t *val, const int32_t *max);
+    const int32_t *count_field_l, const int32_t *val, const int32_t *period);
 
 void F77_FUNC(gdalmx, GDALMX) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l, const char *in_field,
     const int32_t *in_field_l, const char *count_field,
-    const int32_t *count_field_l, const int32_t *val, const int32_t *max);
+    const int32_t *count_field_l, const int32_t *val, const int32_t *period);
 
 void F77_FUNC(gdsync, GDSYNC) (const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l);
@@ -679,9 +679,6 @@ void F77_FUNC(gdhidn, GDHIDN) (int32_t *result, const int32_t *dirfile,
 void F77_FUNC(gdfraf, GDFRAF) (char *prefix, int32_t *prefix_l, char *suffix,
     int32_t *suffix_l, const int32_t *dirfile, const int32_t *index);
 
-void F77_FUNC(gddela, GDDELA) (const int32_t *dirfile, const char *field_code,
-    const int32_t *field_code_l, const int32_t *flags);
-
 void F77_FUNC(gdaafx, GDAAFX) (const int32_t *dirfile, const int32_t *index,
     const char *prefix, const int32_t *prefix_l, const char *suffix,
     const int32_t *suffix_l);
@@ -741,13 +738,226 @@ void F77_FUNC(gdtoke, GDTOKE) (char *toke, int32_t *toke_l,
     const int32_t *dirfile, const char *string, const int32_t *string_l);
 
 void F77_FUNC(gdgemx, GDGEMX) (char *in_field, int32_t *in_field_l,
-    char *count_field, int32_t *count_field_l, int32_t *val, int32_t *max,
+    char *count_field, int32_t *count_field_l, int32_t *val, int32_t *period,
     int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l);
 
 void F77_FUNC(gdlttn, GDLTTN) (char *name, int32_t *name_l,
     const int32_t *dirfile, const char *field_code,
     const int32_t *field_code_l);
+
+void F77_FUNC(gdasrw, GDASRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const char *spf_scalar, const int32_t *spf_scalar_l,
+    const int32_t *spf_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdasbt, GDASBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdaslc, GDASLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1,
+    const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const double *m2, const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2,
+    const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const double *m3, const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3,
+    const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdascl, GDASCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind,
+    const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind,
+    const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind,
+    const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdasph, GDASPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift,
+    const char *shift_scalar, const int32_t *shift_scalar_l,
+    const int32_t *shift_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdaswd, GDASWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold,
+    const char *threshold_scalar, const int32_t *threshold_scalar_l,
+    const int32_t *threshold_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdasmx, GDASMX) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const char *val_scalar,
+    const int32_t *val_scalar_l, const int32_t *val_scalar_ind,
+    const int32_t *period, const char *period_scalar,
+    const int32_t *period_scalar_l, const int32_t *period_scalar_ind,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdasrc, GDASCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const char *dividend_scalar, const int32_t *dividend_scalar_l,
+    const int32_t *dividend_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdlsrw, GDLSRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const char *spf_scalar, const int32_t *spf_scalar_l,
+    const int32_t *spf_scalar_ind, const int32_t *recode);
+
+void F77_FUNC(gdlsbt, GDLSBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind);
+
+void F77_FUNC(gdlslc, GDLSLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1,
+    const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const double *m2, const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2,
+    const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const double *m3, const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3,
+    const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind);
+
+void F77_FUNC(gdlscl, GDLSCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar,
+    const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind,
+    const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l,
+    const int32_t *b1_scalar_ind, const char *in_field2,
+    const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar,
+    const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind,
+    const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l,
+    const int32_t *b2_scalar_ind, const char *in_field3,
+    const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar,
+    const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind,
+    const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l,
+    const int32_t *b3_scalar_ind);
+
+void F77_FUNC(gdlsph, GDLSPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift,
+    const char *shift_scalar, const int32_t *shift_scalar_l,
+    const int32_t *shift_scalar_ind);
+
+void F77_FUNC(gdlswd, GDLSWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold,
+    const char *threshold_scalar, const int32_t *threshold_scalar_l,
+    const int32_t *threshold_scalar_ind);
+
+void F77_FUNC(gdlsmx, GDLSMX) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const char *val_scalar,
+    const int32_t *val_scalar_l, const int32_t *val_scalar_ind,
+    const int32_t *period, const char *period_scalar,
+    const int32_t *period_scalar_l, const int32_t *period_scalar_ind);
+
+void F77_FUNC(gdlsrc, GDLSCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const char *dividend_scalar, const int32_t *dividend_scalar_l,
+    const int32_t *dividend_scalar_ind);
+
+void F77_FUNC(gdencs,GDENCS) (int32_t *ret, const int32_t *encoding);
+
+void F77_FUNC(gdarln, GDARLN) (int32_t *len, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdaspn, GDASPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const double *a1,
+    const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const double *a3,
+    const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const double *a5,
+    const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdascp, GDASCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind,
+    const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind,
+    const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind,
+    const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind, const int32_t *fragment_index);
+
+void F77_FUNC(gdassb, GDASSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdlspn, GDLSPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind,
+    const double *a1, const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind,
+    const double *a3, const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind,
+    const double *a5, const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind);
+
+void F77_FUNC(gdlscp, GDLSCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar,
+    const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind,
+    const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l,
+    const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar,
+    const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind,
+    const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l,
+    const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar,
+    const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind,
+    const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l,
+    const int32_t *a5_scalar_ind);
+
+void F77_FUNC(gdlssb, GDLSSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar,
+    const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind,
+    const int32_t *numbits, const char *numbits_scalar,
+    const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/bindings/f77/getdata.f.in b/bindings/f77/getdata.f.in
index f228e2e..4357efe 100644
--- a/bindings/f77/getdata.f.in
+++ b/bindings/f77/getdata.f.in
@@ -1,4 +1,4 @@
-C     Copyright (C) 2008-2012 D. V. Wiebe
+C     Copyright (C) 2008-2014 D. V. Wiebe
 C
 C     CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
 C
@@ -115,11 +115,37 @@ C     Corresponding to gd_alter_window(3)
       EXTERNAL GDALWD
 C     Corresponding to gd_alter_protection(3)
       EXTERNAL GDAPRT
+C     Corresponding to gd_array_len(3)
+      EXTERNAL GDARLN
 C     Alter a scalar parameter
       EXTERNAL GDASCA
+C     Corresponding to gd_add(3) for BIT fields
+      EXTERNAL GDASBT
+C     Corresponding to gd_add(3) for complex-valued LINCOM fields
+      EXTERNAL GDASCL
+C     Corresponding to gd_add(3) for complex-valued POLYNOM fields
+      EXTERNAL GDASCP
+C     Corresponding to gd_add(3) for complex-valued RECIP fields
+      EXTERNAL GDASCR
+C     Corresponding to gd_add(3) for LINCOM fields
+      EXTERNAL GDASLC
+C     Corresponding to gd_add(3) for MPLEX fields
+      EXTERNAL GDASMX
+C     Corresponding to gd_add(3) for PHASE fields
+      EXTERNAL GDASPH
+C     Corresponding to gd_add(3) for POLYNOM fields
+      EXTERNAL GDASPN
+C     Corresponding to gd_add(3) for RECIP fields
+      EXTERNAL GDASRC
+C     Corresponding to gd_add(3) for RAW fields
+      EXTERNAL GDASRW
+C     Corresponding to gd_add(3) for SBIT fields
+      EXTERNAL GDASSB
+C     Corresponding to gd_add(3) for WINDOW fields
+      EXTERNAL GDASWD
 C     Corresponding to gd_alias_target(3)
       EXTERNAL GDATRG
-C     Corresponding to gd_carray_len(3)
+C     The following function is deprecated! use GDARLN instead
       EXTERNAL GDCALN
 C     Corresponding to gd_parser_callback(3)
       EXTERNAL GDCLBK
@@ -129,10 +155,6 @@ C     Corresponding to gd_constants(3) (sort of)
       EXTERNAL GDCONS
 C     Corresponding to gd_copen(3)
       EXTERNAL GDCOPN
-C     Check whether an entry contains complex scalars
-      EXTERNAL GDCSCL
-C     Correpsonding to gd_delete_alias(3)
-      EXTERNAL GDDELA
 C     Correpsonding to gd_delete(3)
       EXTERNAL GDDELE
 C     Corresponding to gd_discard(3)
@@ -141,6 +163,10 @@ C     Corresponding to gd_desync(3)
       EXTERNAL GDDSYN
 C     Corresponding to gd_error_count(3)
       EXTERNAL GDECNT
+C     Corresponding to gd_encoding_support(3)
+      EXTERNAL GDENCS
+C     Returns entry flags
+      EXTERNAL GDENFL
 C     Corresponding to gd_entry_list(3) (sort of)
       EXTERNAL GDENTN
 C     Returns the maximum entry name length
@@ -179,13 +205,13 @@ 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
+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
+C     Corresponding to gd_entry(3) for complex-valued POLYNOM fields
       EXTERNAL GDGECP
-C     Corresponding to gd_entry(3) for complex valued RECIP fields
+C     Corresponding to gd_entry(3) for complex-valued RECIP fields
       EXTERNAL GDGECR
 C     Corresponding to gd_entry(3) for LINCOM fields
       EXTERNAL GDGELC
@@ -237,6 +263,30 @@ C     Corresponding to gd_include(3)
       EXTERNAL GDINCL
 C     Corresponding to gd_invalid_dirfile(3)
       EXTERNAL GDINVD
+C     Corresponding to gd_alter_entry(3) for BIT fields
+      EXTERNAL GDLSBT
+C     Corresponding to gd_alter_entry(3) for complex-valued LINCOM fields
+      EXTERNAL GDLSCL
+C     Corresponding to gd_alter_entry(3) for complex-valued POLYNOM fields
+      EXTERNAL GDLSCP
+C     Corresponding to gd_alter_entry(3) for complex-valued RECIP fields
+      EXTERNAL GDLSCR
+C     Corresponding to gd_alter_entry(3) for LINCOM fields
+      EXTERNAL GDLSLC
+C     Corresponding to gd_alter_entry(3) for MPLEX fields
+      EXTERNAL GDLSMX
+C     Corresponding to gd_alter_entry(3) for PHASE fields
+      EXTERNAL GDLSPH
+C     Corresponding to gd_alter_entry(3) for POLYNOM fields
+      EXTERNAL GDLSPN
+C     Corresponding to gd_alter_entry(3) for RECIP fields
+      EXTERNAL GDLSRC
+C     Corresponding to gd_alter_entry(3) for RAW fields
+      EXTERNAL GDLSRW
+C     Corresponding to gd_alter_entry(3) for SBIT fields
+      EXTERNAL GDLSSB
+C     Corresponding to gd_alter_entry(3) for WINDOW fields
+      EXTERNAL GDLSWD
 C     Corresponding to gd_linterp_tablename(3)
       EXTERNAL GDLTTN
 C     Corresponding to gd_mconstants(3) (sort of)
@@ -247,7 +297,7 @@ 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)
+C     Corresponding to gd_madd_clincom(3)
       EXTERNAL GDMDCL
 C     Corresponding to gd_madd_const(3)
       EXTERNAL GDMDCO
@@ -289,8 +339,6 @@ 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_alias(3)
-      EXTERNAL GDMOVA
 C     Correpsonding to gd_move(3)
       EXTERNAL GDMOVE
 C     Corresponding to gd_mstrings(3) (sort of)
diff --git a/bindings/f77/getdata.f90.in b/bindings/f77/getdata.f90.in
index 0df5478..e148e4c 100644
--- a/bindings/f77/getdata.f90.in
+++ b/bindings/f77/getdata.f90.in
@@ -1,4 +1,4 @@
-! Copyright (C) 2008-2012 D. V. Wiebe
+! Copyright (C) 2008-2015 D. V. Wiebe
 !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
@@ -29,7 +29,7 @@ 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, windop, ithreshold
+  integer :: fragment_index, flags, poly_ord, array_len, windop, ithreshold
   integer :: count_val, period
   character (len=GD_FIELD_LEN), dimension(3) :: field
   character (len=GD_FIELD_LEN), dimension(6) :: scalar
@@ -801,6 +801,9 @@ function fgd_entry (dirfile, field_code, ent)
   ! get field type from f77 library
   call gdenty(fgd_entry, dirfile, TRIM(field_code), LEN_TRIM(field_code))
 
+  ! flags
+  call gdenfl(ent%flags, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+
   if (fgd_entry .EQ. GD_RAW_ENTRY) then
     ! raw
     call gdgerw(ent%spf, ent%data_type, ent%fragment_index, dirfile, &
@@ -809,8 +812,7 @@ function fgd_entry (dirfile, field_code, ent)
     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
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
       call gdgecl(ent%n_fields, ent%field(1), len1, ent%cm(1), ent%cb(1), &
       ent%field(2), len2, ent%cm(2), ent%cb(2), ent%field(3), len3, ent%cm(3), &
       ent%cb(3), ent%fragment_index, dirfile, TRIM(field_code), &
@@ -838,7 +840,7 @@ function fgd_entry (dirfile, field_code, ent)
     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, &
+    call gdgsca(ent%scalar(2), len1, ent%scalar_ind(2), dirfile, &
     TRIM(field_code), LEN_TRIM(field_code), 2)
   else if (fgd_entry .EQ. GD_SBIT_ENTRY) then
     ! sbit
@@ -866,8 +868,7 @@ function fgd_entry (dirfile, field_code, ent)
     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
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
       call gdgecp(ent%poly_ord, ent%field(1), len1, ent%ca(1), ent%ca(2), &
       ent%ca(3), ent%ca(4), ent%ca(5), ent%ca(6), ent%fragment_index, dirfile, &
       TRIM(field_code), LEN_TRIM(field_code))
@@ -878,13 +879,12 @@ function fgd_entry (dirfile, field_code, ent)
     end if
     do i=1,6
       len1 = GD_FIELD_LEN
-      call gdgsca(ent%scalar(i), len1, ent%scalar_ind(1), dirfile, &
+      call gdgsca(ent%scalar(i), len1, ent%scalar_ind(i), dirfile, &
       TRIM(field_code), LEN_TRIM(field_code), i)
     end do
   else if (fgd_entry .EQ. GD_RECIP_ENTRY) then
     ! recip
-    call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code))
-    if (ent%comp_scal .NE. 0) then
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
       call gdgecr(ent%field(1), len1, ent%cdividend, ent%fragment_index, &
       dirfile, TRIM(field_code), LEN_TRIM(field_code))
     else
@@ -961,34 +961,52 @@ subroutine fgd_add (dirfile, field_code, ent)
   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)
+    call gdasrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    ent%data_type, ent%spf, TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), &
+    ent%scalar_ind(1), ent%fragment_index)
   else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
-    if (ent%comp_scal .EQ. 0) then
-      call gdadlc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then
+      call gdaslc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%m(1), &
-      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)
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+      ent%b(1), TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), &
+      ent%scalar_ind(4), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%m(2), &
+      TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), ent%scalar_ind(2), &
+      ent%b(2), TRIM(ent%scalar(5)), LEN_TRIM(ent%scalar(5)), &
+      ent%scalar_ind(5), TRIM(ent%field(3)), LEN_TRIM(ent%field(3)), ent%m(3), &
+      TRIM(ent%scalar(3)), LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), &
+      ent%b(3), TRIM(ent%scalar(6)), LEN_TRIM(ent%scalar(6)), &
+      ent%scalar_ind(6), ent%fragment_index)
     else
-      call gdadcl(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      call gdascl(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cm(1), &
-      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)
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+      ent%cb(1), TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), &
+      ent%scalar_ind(4), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), &
+      ent%cm(2), TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), &
+      ent%scalar_ind(2), ent%cb(2), TRIM(ent%scalar(5)), &
+      LEN_TRIM(ent%scalar(5)), ent%scalar_ind(5), TRIM(ent%field(3)), &
+      LEN_TRIM(ent%field(3)), ent%cm(3), TRIM(ent%scalar(3)), &
+      LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), ent%cb(3), &
+      TRIM(ent%scalar(6)), LEN_TRIM(ent%scalar(6)), ent%scalar_ind(6), &
+      ent%fragment_index)
     end if
   else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then
     call gdadlt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
     TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
     LEN_TRIM(ent%field(2)), ent%fragment_index)
   else if (ent%field_type .EQ. GD_BIT_ENTRY) then
-    call 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)
+    call gdasbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, &
+    TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+    ent%numbits, TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), &
+    ent%scalar_ind(2), ent%fragment_index)
   else if (ent%field_type .EQ. GD_SBIT_ENTRY) then
-    call 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)
+    call gdassb(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, &
+    TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+    ent%numbits, TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), &
+    ent%scalar_ind(2), ent%fragment_index)
   else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then
     call gdadmt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
     TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
@@ -998,44 +1016,69 @@ subroutine fgd_add (dirfile, field_code, ent)
     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)
+    call gdasph(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift, &
+    TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+    ent%fragment_index)
   else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then
-    if (ent%comp_scal .EQ. 0) then
-      call gdadpn(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then
+      call gdaspn(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), &
-      ent%a(2), ent%a(3), ent%a(4), ent%a(5), ent%a(6), ent%fragment_index)
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+      ent%a(2), TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), &
+      ent%scalar_ind(2), ent%a(3), TRIM(ent%scalar(3)), &
+      LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), ent%a(4), &
+      TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), ent%scalar_ind(4), &
+      ent%a(5), TRIM(ent%scalar(5)), LEN_TRIM(ent%scalar(5)), &
+      ent%scalar_ind(5), ent%a(6), TRIM(ent%scalar(6)), &
+      LEN_TRIM(ent%scalar(6)), ent%scalar_ind(6), ent%fragment_index)
     else
-      call gdadcp(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      call gdascp(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%ca(1), &
-      ent%ca(2), ent%ca(3), ent%ca(4), ent%ca(5), ent%ca(6), ent%fragment_index)
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+      ent%ca(2), TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), &
+      ent%scalar_ind(2), ent%ca(3), TRIM(ent%scalar(3)), &
+      LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), ent%ca(4), &
+      TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), ent%scalar_ind(4), &
+      ent%ca(5), TRIM(ent%scalar(5)), LEN_TRIM(ent%scalar(5)), &
+      ent%scalar_ind(5), ent%ca(6), TRIM(ent%scalar(6)), &
+      LEN_TRIM(ent%scalar(6)), ent%scalar_ind(6), ent%fragment_index)
     end if
   else if (ent%field_type .EQ. GD_RECIP_ENTRY) then
-    if (ent%comp_scal .EQ. 0) then
-      call gdadcr(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then
+      call gdasrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%dividend, &
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
       ent%fragment_index)
     else
-      call gdadrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      call gdascr(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cdividend, &
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
       ent%fragment_index)
     end if
   else if (ent%field_type .EQ. GD_WINDOW_ENTRY) then
     if ((ent%windop .EQ. GD_WINDOP_EQ) .OR. (ent%windop .EQ. GD_WINDOP_NE) &
     .OR. (ent%windop .EQ. GD_WINDOP_SET) .OR. (ent%windop .EQ. GD_WINDOP_CLR)) &
     then
-      call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      call gdaswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-      LEN_TRIM(ent%field(2)), ent%windop, ent%ithreshold, ent%fragment_index)
+      LEN_TRIM(ent%field(2)), ent%windop, ent%ithreshold, &
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+      ent%fragment_index)
     else
-      call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      call gdaswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
       TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-      LEN_TRIM(ent%field(2)), ent%windop, ent%rthreshold, ent%fragment_index)
+      LEN_TRIM(ent%field(2)), ent%windop, ent%rthreshold, &
+      TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), &
+      ent%fragment_index)
     end if
   else if (ent%field_type .EQ. GD_MPLEX_ENTRY) then
-    call gdadmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    call gdasmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
     TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-    LEN_TRIM(ent%field(2)), ent%count_val, ent%period, ent%fragment_index)
+    LEN_TRIM(ent%field(2)), ent%count_val, TRIM(ent%scalar(1)), &
+    LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), ent%period, &
+    TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), ent%scalar_ind(2), &
+    ent%fragment_index)
   else if (ent%field_type .EQ. GD_CONST_ENTRY) then
     call gdadco(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
     ent%data_type, GD_INT32, zero, ent%fragment_index)
@@ -1204,7 +1247,7 @@ subroutine fgd_madd (dirfile, parent, field_code, ent)
   character (len=1) :: nil = ""
 
   if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
-    if (ent%comp_scal .NE. 0) then
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
       call gdmdcl(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
       LEN_TRIM(field_code), ent%n_fields, TRIM(ent%field(1)), &
       LEN_TRIM(ent%field(1)), ent%cm(1), ent%cb(1), TRIM(ent%field(2)), &
@@ -1238,7 +1281,7 @@ subroutine fgd_madd (dirfile, parent, field_code, ent)
     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
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
       call gdmdcp(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
       LEN_TRIM(field_code), ent%poly_ord, TRIM(ent%field(1)), &
       LEN_TRIM(ent%field(1)), ent%ca(1), ent%ca(2), ent%ca(3), ent%ca(4), &
@@ -1250,7 +1293,7 @@ subroutine fgd_madd (dirfile, parent, field_code, ent)
       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
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
       call gdmdcr(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
       LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
       ent%cdividend)
@@ -1491,7 +1534,7 @@ function fgd_reference (dirfile, field_code)
 
   call gdrefe(fgd_reference, l, dirfile, TRIM(field_code), LEN_TRIM(field_code))
 
-  if (l .LE. 0) then
+  if (l .EQ. 0) then
     fgd_reference = ""
   endif
 end function 
@@ -1585,90 +1628,202 @@ function fgd_raw_filename (dirfile, 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
+subroutine fgd_move (dirfile, field_code, new_fragment, flags)
+  integer, intent(in) :: dirfile, new_fragment, flags
   character (len=*), intent(in) :: field_code
 
   call gdmove (dirfile, TRIM(field_code), LEN_TRIM(field_code), new_fragment, &
-  move_data)
+  flags)
 end subroutine
 
-subroutine fgd_alter_entry (dirfile, field_code, ent, recode)
-  integer, intent(in) :: dirfile, recode
+! calculate in_fields string lengths
+subroutine fgd__set_field_len (field_len, m, ent)
+  integer, dimension(3), intent(out) :: field_len
+  integer, intent(in) :: m
+  type(gd_entry), intent(in) :: ent
+  
+  integer :: i
+
+  do i=1,m
+    field_len(i) = LEN_TRIM(ent%field(i))
+    if (field_len(i) .eq. 0) then
+      field_len(i) = -1
+    end if
+  end do
+end subroutine
+
+! calculate scalar string lengths
+subroutine fgd__set_scalar_len (scalar_len, remove_scalars, mask, ent)
+  integer, dimension(6), intent(out) :: scalar_len
+  integer, intent(in) :: remove_scalars, mask
+  type(gd_entry), intent(in) :: ent
+  
+  integer :: i
+
+  do i=1,6
+    if (BTEST(IAND(NOT(remove_scalars), mask), i - 1)) then
+      scalar_len(i) = LEN_TRIM(ent%scalar(i))
+    else
+      scalar_len(i) = -1
+    end if
+  end do
+end subroutine
+
+subroutine fgd_alter_entry (dirfile, field_code, ent, remove_scalars, recode)
+  integer, intent(in) :: dirfile, remove_scalars, recode
   character (len=*), intent(in) :: field_code
   type(gd_entry), intent(in) :: ent
 
+  ! lincom scalar bitmasks
+  integer, parameter, dimension(3) :: lincom_mask = (/ 9, 27, 63 /)
+
+  ! polynom scalar bitmasks
+  integer, parameter, dimension(6) :: polynom_mask = (/ 3, 7, 15, 31, 63, 127 /)
+
+  integer, dimension(6) :: scalar_len
+  integer, dimension(3) :: field_len
+  integer :: n
+
   if (ent%field_type .EQ. GD_RAW_ENTRY) then
-    call gdalrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    ent%data_type, ent%spf, recode)
+    call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent)
+
+    call gdlsrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    ent%data_type, ent%spf, TRIM(ent%scalar(1)), scalar_len(1), &
+    ent%scalar_ind(1), recode)
   else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
-    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))
+    n = ent%n_fields
+    if (n .gt. 3 .or. n .lt. 1) then
+      n = 3
+    end if
+    call fgd__set_scalar_len(scalar_len, remove_scalars, lincom_mask(n), ent)
+    call fgd__set_field_len(field_len, n, ent)
+
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
+      call gdlscl(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%n_fields, TRIM(ent%field(1)), field_len(1), &
+      ent%cm(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), &
+      ent%cb(1), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), &
+      TRIM(ent%field(2)), field_len(2), &
+      ent%cm(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), &
+      ent%cb(2), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), &
+      TRIM(ent%field(3)), field_len(3), &
+      ent%cm(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), &
+      ent%cb(3), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6))
     else
-      call 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))
+      call gdlslc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%n_fields, TRIM(ent%field(1)), field_len(1), &
+      ent%m(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), &
+      ent%b(1), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), &
+      TRIM(ent%field(2)), field_len(2), &
+      ent%m(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), &
+      ent%b(2), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), &
+      TRIM(ent%field(3)), field_len(3), &
+      ent%m(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), &
+      ent%b(3), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6))
     end if
   else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then
+    call fgd__set_field_len(field_len, 2, ent)
+
     call gdallt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-    LEN_TRIM(ent%field(2)), recode)
+    TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), recode)
   else if (ent%field_type .EQ. GD_BIT_ENTRY) then
-    call gdalbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits)
+    call fgd__set_scalar_len(scalar_len, remove_scalars, 3, ent)
+    call fgd__set_field_len(field_len, 1, ent)
+
+    call gdlsbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), field_len(1), &
+    ent%bitnum, TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), &
+    ent%numbits, TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2))
   else if (ent%field_type .EQ. GD_SBIT_ENTRY) then
-    call gdalsb(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits)
+    call fgd__set_scalar_len(scalar_len, remove_scalars, 3, ent)
+    call fgd__set_field_len(field_len, 1, ent)
+
+    call gdlssb(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), field_len(1), &
+    ent%bitnum, TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), &
+    ent%numbits, TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2))
   else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then
+    call fgd__set_field_len(field_len, 2, ent)
+
     call gdalmt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-    LEN_TRIM(ent%field(2)))
+    TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2))
   else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then
+    call fgd__set_field_len(field_len, 2, ent)
+
     call gdaldv(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-    LEN_TRIM(ent%field(2)))
+    TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2))
   else if (ent%field_type .EQ. GD_PHASE_ENTRY) then
-    call gdalph(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift)
+    call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent)
+    call fgd__set_field_len(field_len, 1, ent)
+
+    call gdlsph(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), field_len(1), ent%shift, &
+    TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1))
   else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then
-    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))
+    n = ent%poly_ord
+    if (n .gt. 6 .or. n .lt. 2) then
+      n = 6
+    end if
+    call fgd__set_scalar_len(scalar_len, remove_scalars, polynom_mask(n), ent)
+    call fgd__set_field_len(field_len, 1, ent)
+
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
+      call gdlscp(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%poly_ord, TRIM(ent%field(1)), field_len(1), &
+      ent%ca(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), &
+      ent%ca(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), &
+      ent%ca(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), &
+      ent%ca(4), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), &
+      ent%ca(5), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), &
+      ent%ca(6), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6))
     else
-      call 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))
+      call gdlspn(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%poly_ord, TRIM(ent%field(1)), field_len(1), &
+      ent%a(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), &
+      ent%a(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), &
+      ent%a(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), &
+      ent%a(4), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), &
+      ent%a(5), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), &
+      ent%a(6), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6))
     end if
   else if (ent%field_type .EQ. GD_RECIP_ENTRY) then
-    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)
+    call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent)
+    call fgd__set_field_len(field_len, 1, ent)
+
+    if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then
+      call gdlscr(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), field_len(1), ent%cdividend, TRIM(ent%scalar(1)), &
+      scalar_len(1), ent%scalar_ind(1))
     else
-      call gdalrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), ent%dividend)
+      call gdlsrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), field_len(1), ent%dividend, TRIM(ent%scalar(1)), &
+      scalar_len(1), ent%scalar_ind(1))
     end if
   else if (ent%field_type .EQ. GD_WINDOW_ENTRY) then
+    call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent)
+    call fgd__set_field_len(field_len, 2, ent)
+
     if ((ent%windop .EQ. GD_WINDOP_EQ) .OR. (ent%windop .EQ. GD_WINDOP_NE) &
     .OR. (ent%windop .EQ. GD_WINDOP_SET) .OR. (ent%windop .EQ. GD_WINDOP_CLR)) &
     then
-      call gdalwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-      LEN_TRIM(ent%field(2)), ent%windop, ent%ithreshold, ent%fragment_index)
+      call gdlswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), &
+      ent%windop, ent%ithreshold, TRIM(ent%scalar(1)), scalar_len(1), &
+      ent%scalar_ind(1))
     else
-      call gdalwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-      LEN_TRIM(ent%field(2)), ent%windop, ent%rthreshold, ent%fragment_index)
+      call gdlswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), &
+      ent%windop, ent%rthreshold, TRIM(ent%scalar(1)), scalar_len(1), &
+      ent%scalar_ind(1))
     end if
-  else if (ent%field_type .EQ. GD_CONST_ENTRY) then
-    call gdalmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
-    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
-    LEN_TRIM(ent%field(2)), ent%count_val, ent%period, ent%fragment_index)
+  else if (ent%field_type .EQ. GD_MPLEX_ENTRY) then
+    call fgd__set_scalar_len(scalar_len, remove_scalars, 3, ent)
+    call fgd__set_field_len(field_len, 2, ent)
+
+    call gdlsmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), &
+    ent%count_val, TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), &
+    ent%period, TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2))
   else if (ent%field_type .EQ. GD_CONST_ENTRY) then
     call gdalco(dirfile, TRIM(field_code), LEN_TRIM(field_code), ent%data_type)
   else if (ent%field_type .EQ. GD_CARRAY_ENTRY) then
@@ -1815,12 +1970,12 @@ subroutine fgd_malter_spec (dirfile, spec, parent, recode)
   LEN_TRIM(parent), recode)
 end subroutine
 
-subroutine fgd_rename (dirfile, field_code, new_name, move_data)
-  integer, intent(in) :: dirfile, move_data
+subroutine fgd_rename (dirfile, field_code, new_name, flags)
+  integer, intent(in) :: dirfile, flags
   character (len=*), intent(in) :: field_code, new_name
 
   call gdrenm(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(new_name), &
-  LEN_TRIM(new_name), move_data)
+  LEN_TRIM(new_name), flags)
 end subroutine
 
 subroutine fgd_delete (dirfile, field_code, flags)
@@ -2160,13 +2315,21 @@ subroutine fgd_put_carray_c16 (dirfile, field_code, start, array_len, data_in)
   end if
 end subroutine
 
+function fgd_array_len (dirfile, field_code)
+  integer :: fgd_array_len
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  ! call f77 library
+  call gdarln(fgd_array_len, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
 function fgd_carray_len (dirfile, field_code)
   integer :: fgd_carray_len
   integer, intent(in) :: dirfile
   character (len=*), intent(in) :: field_code
 
-  ! call f77 library
-  call gdcaln(fgd_carray_len, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+  fgd_carray_len = fgd_array_len(dirfile,field_code)
 end function
 
 subroutine fgd_add_carray (dirfile, field_name, const_type, array_len, &
@@ -2195,9 +2358,6 @@ 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)
@@ -2677,13 +2837,6 @@ subroutine fgd_alter_window_r (dirfile, field_name, in_field, check_field, &
   end if
 end subroutine
 
-subroutine fgd_delete_alias (dirfile, field_code, flags)
-  integer, intent(in) :: dirfile, flags
-  character (len=*), intent(in) :: field_code
-
-  call gddela(dirfile, TRIM(field_code), LEN_TRIM(field_code), flags)
-end subroutine
-
 function fgd_hidden (dirfile, field_code)
   integer :: fgd_hidden
   integer, intent(in) :: dirfile
@@ -2714,13 +2867,6 @@ subroutine fgd_madd_alias (dirfile, parent, field_code, targ)
   LEN_TRIM(field_code), TRIM(targ), LEN_TRIM(targ))
 end subroutine
 
-subroutine fgd_move_alias (dirfile, field_code, new_fragment)
-  integer, intent(in) :: dirfile, new_fragment
-  character (len=*), intent(in) :: field_code
-
-  call gdmova (dirfile, TRIM(field_code), LEN_TRIM(field_code), new_fragment)
-end subroutine
-
 subroutine fgd_include_affix (dirfile, fragmentname, fragment_index, prefix, &
 suffix, flags)
   integer, intent(in) :: dirfile, fragment_index, flags
@@ -2883,4 +3029,11 @@ function fgd_linterp_tablename (dirfile, field_code)
   LEN_TRIM(field_code))
 end function
 
+function fgd_encoding_support (encoding)
+  integer :: fgd_encoding_support
+  integer, intent(in) :: encoding
+
+  call gdencs(fgd_encoding_support, encoding)
+end function
+
 end module
diff --git a/bindings/f77/test/Makefile.am b/bindings/f77/test/Makefile.am
index 5fb0698..8b9a104 100644
--- a/bindings/f77/test/Makefile.am
+++ b/bindings/f77/test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2010, 2012 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -20,34 +20,14 @@
 #
 AUTOMAKE_OPTIONS = foreign serial-tests
 
-if FC_WALL
-FC_WALL=-Wall
-endif
-
-if F77_WALL
-F77_WALL=-Wall
-endif
-
-if F77_FNO_BACKSLASH
-F77_FNO_BACKSLASH=-fno-backslash
-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
 
 BUILT_SOUCES = test_getdata.f
 
-FFLAGS += -I. -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME) $(F77_FNO_BACKSLASH)
-FCFLAGS += -I. -I.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
+FFLAGS += -I. -I.. $(GD_F77_WALL) $(GD_F77_WEXTRA)
+FCFLAGS += -I. -I.. $(GD_F77_WALL) $(GD_FC_WEXTRA)
 F95LDADD=../libf95getdata.la $(F77LDADD)
 F77LDADD=../libfgetdata.la
 AM_LDFLAGS = -L..
diff --git a/bindings/f77/test/Makefile.in b/bindings/f77/test/Makefile.in
index 2305a3d..9b9da64 100644
--- a/bindings/f77/test/Makefile.in
+++ b/bindings/f77/test/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -254,6 +252,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -275,13 +275,23 @@ EXEEXT = @EXEEXT@
 F77 = @F77@
 F95GETDATA_VERSION = @F95GETDATA_VERSION@
 FC = @FC@
-FCFLAGS = @FCFLAGS@ -I. -I.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
-FFLAGS = @FFLAGS@ -I. -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME) \
-	$(F77_FNO_BACKSLASH)
+FCFLAGS = @FCFLAGS@ -I. -I.. $(GD_F77_WALL) $(GD_FC_WEXTRA)
+FFLAGS = @FFLAGS@ -I. -I.. $(GD_F77_WALL) $(GD_F77_WEXTRA)
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -329,7 +339,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -344,12 +353,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -413,9 +426,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -423,6 +437,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -436,7 +451,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008-2010, 2012 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -457,11 +472,6 @@ top_srcdir = @top_srcdir@
 # 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 AUTOMAKE_OPTIONS = foreign serial-tests
- at FC_WALL_TRUE@FC_WALL = -Wall
- at F77_WALL_TRUE@F77_WALL = -Wall
- at F77_FNO_BACKSLASH_TRUE@F77_FNO_BACKSLASH = -fno-backslash
- at INTEL_F77_COMPILER_TRUE@F77_ASSUME = -assume byterecl
- at INTEL_FC_COMPILER_TRUE@FC_ASSUME = -assume byterecl
 @MAKE_F95BINDINGS_TRUE at F95TESTS = big_test95
 BUILT_SOUCES = test_getdata.f
 F95LDADD = ../libf95getdata.la $(F77LDADD)
diff --git a/bindings/f77/test/big_test.f b/bindings/f77/test/big_test.f
index 46ea53b..d0e1849 100644
--- a/bindings/f77/test/big_test.f
+++ b/bindings/f77/test/big_test.f
@@ -1,4 +1,4 @@
-C     Copyright (C) 2009-2012 D. V. Wiebe
+C     Copyright (C) 2009-2015 D. V. Wiebe
 C
 C     CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
 C
@@ -35,7 +35,7 @@ C     Check functions
         NE = NE + 1
         WRITE(*, 9001) T, E, V
       ENDIF
- 9001 FORMAT('e[', i3, '] = ', i4, ', expected ', i4)
+ 9001 FORMAT('e[', i6, '] = ', i4, ', expected ', i4)
       END SUBROUTINE
 
       SUBROUTINE CHKINT(NE, T, N, V)
@@ -45,7 +45,7 @@ C     Check functions
         NE = NE + 1
         WRITE(*, 9002) T, N, V
       ENDIF
- 9002 FORMAT('n[', i3, '] = ', i4, ', expected ', i4)
+ 9002 FORMAT('n[', i6, '] = ', i4, ', expected ', i4)
       END SUBROUTINE
 
       SUBROUTINE CHKER2(NE, T, I, D, V)
@@ -57,7 +57,7 @@ C     Check functions
         NE = NE + 1
         WRITE(*, 9006) I, T, E, V
       ENDIF
- 9006 FORMAT('e(', i3, ')[', i3, '] = ', i4, ', expected ', i4)
+ 9006 FORMAT('e(', i6, ')[', i6, '] = ', i4, ', expected ', i4)
       END SUBROUTINE
 
       SUBROUTINE CHKIN2(NE, T, I, N, V)
@@ -67,7 +67,7 @@ C     Check functions
         NE = NE + 1
         WRITE(*, 9007) I, T, N, V
       ENDIF
- 9007 FORMAT('n(', i3, ')[', i3, '] = ', i4, ', expected ', i4)
+ 9007 FORMAT('n(', i6, ')[', i6, '] = ', i4, ', expected ', i4)
       END SUBROUTINE
 
       SUBROUTINE CHKST2(NE, T, I, N, V)
@@ -78,7 +78,7 @@ C     Check functions
         NE = NE + 1
         WRITE(*, 9008) I, T, N, V
       ENDIF
- 9008 FORMAT('s(', i3, ')[', i3, '] = "', a, '", expected "', a, '"')
+ 9008 FORMAT('s(', i6, ')[', i6, '] = "', a, '", expected "', a, '"')
       END SUBROUTINE
 
       SUBROUTINE CHKSTR(NE, T, N, V)
@@ -89,30 +89,31 @@ C     Check functions
         NE = NE + 1
         WRITE(*, 9009) T, N, V
       ENDIF
- 9009 FORMAT('s[', i3, '] = "', a, '", expected "', a, '"')
+ 9009 FORMAT('s[', i6, '] = "', a, '", expected "', a, '"')
       END SUBROUTINE
 
       SUBROUTINE CHKDB2(NE, T, I, N, V)
       INTEGER NE, T, I
       REAL*8 N, V
 
-      IF (ABS(N - V) .GT. 1E-5) THEN
+C     This is good to single precision
+      IF (ABS(N - V) .GT. 1E-7) THEN
         NE = NE + 1
         WRITE(*, 9010) I, T, N, V
       ENDIF
- 9010 FORMAT('d(', i3, ')[', i3, '] = ', d16.10, ', expected ', d16.10)
+ 9010 FORMAT('d(', i6, ')[', i6, '] = ', d16.10, ', expected ', d16.10)
       END SUBROUTINE
 
       SUBROUTINE CHKCP2(NE, T, I, N, V)
       INTEGER NE, T, I
       COMPLEX*16 N, V
 
-      IF (ABS(N - V) .GT. 1E-5) THEN
+      IF (ABS(N - V) .GT. 1E-7) THEN
         NE = NE + 1
         WRITE(*, 9011) I, T, REAL(REAL(N)), REAL(AIMAG(N)),
      +REAL(REAL(V)), REAL(AIMAG(V))
       ENDIF
- 9011 FORMAT('x(', i3, ')[', i3, '] = ', d16.10, ';', d16.10,
+ 9011 FORMAT('x(', i6, ')[', i6, '] = ', d16.10, ';', d16.10,
      +', expected ', d16.10, ';', d16.10)
       END SUBROUTINE
 
@@ -120,23 +121,23 @@ C     Check functions
       INTEGER NE, T
       REAL*8 N, V
 
-      IF (ABS(N - V) .GT. 1E-5) THEN
+      IF (ABS(N - V) .GT. 1E-7) THEN
         NE = NE + 1
         WRITE(*, 9012) T, N, V
       ENDIF
- 9012 FORMAT('d[', i3, '] = ', d16.10, ', expected ', d16.10)
+ 9012 FORMAT('d[', i6, '] = ', d16.10, ', expected ', d16.10)
       END SUBROUTINE
 
       SUBROUTINE CHKCPX(NE, T, N, V)
       INTEGER NE, T
       COMPLEX*16 N, V
 
-      IF (ABS(N - V) .GT. 1E-5) THEN
+      IF (ABS(N - V) .GT. 1E-7) THEN
         NE = NE + 1
         WRITE(*, 9013) T, REAL(REAL(N)), REAL(AIMAG(N)),
      +REAL(REAL(V)), REAL(AIMAG(V))
       ENDIF
- 9013 FORMAT('x[', i3, '] = ', d16.10, ';', d16.10,
+ 9013 FORMAT('x[', i6, '] = ', d16.10, ';', d16.10,
      +', expected ', d16.10, ';', d16.10)
       END SUBROUTINE
 
@@ -188,8 +189,15 @@ C     Check functions
       INTEGER plen
       PARAMETER (plen = 4096)
 
+C     An ISO-1539 conforming Fortran-77 compiler will either consider
+C     this a single character, if it treats backslash as an escape
+C     character, or else silently truncate it to a single '\', if it
+C     doesn't.
+      CHARACTER*1 backslash
+      PARAMETER (backslash = '\\')
+
       CHARACTER*26 strings(3)
-      CHARACTER*11 fields(nfields + 9)
+      CHARACTER*11 fields(nfields + 10)
       CHARACTER*11 fn
       CHARACTER*26 str
       CHARACTER*4096 path
@@ -215,16 +223,16 @@ C     Check functions
       DO 10 k = 1, 80
       datdat(k) = k
    10 CONTINUE
-
-      fields(1) = 'INDEX  '
-      fields(2) = 'alias  '
-      fields(3) = 'bit    '
-      fields(4) = 'carray '
-      fields(5) = 'const  '
-      fields(6) = 'data   '
-      fields(7) = 'div    '
-      fields(8) = 'lincom '
-      fields(9) = 'linterp'
+ 
+      fields( 1) = 'INDEX  '
+      fields( 2) = 'alias  '
+      fields( 3) = 'bit    '
+      fields( 4) = 'carray '
+      fields( 5) = 'const  '
+      fields( 6) = 'data   '
+      fields( 7) = 'div    '
+      fields( 8) = 'lincom '
+      fields( 9) = 'linterp'
       fields(10) = 'mplex  '
       fields(11) = 'mult   '
       fields(12) = 'phase  '
@@ -270,86 +278,86 @@ C     Write the test dirfile
       CLOSE(1, STATUS='KEEP')
 
       ne = 0
-C     0: GDEROR check
+C     1: GDEROR check
       CALL GDOPEN(d, "x", 1, GD_RO)
-      CALL CHKERR(ne, 0, d, GD_EOP)
+      CALL CHKERR(ne, 1, d, GD_EIO)
 
-C     1: GDOPEN check
+C     2: GDOPEN check
       CALL GDOPEN(d, fildir, 12, GD_RW)
-      CALL CHKEOK(ne, 1, d)
+      CALL CHKEOK(ne, 2, d)
 
-C     2: GDGETD check
+C     3: GDGETD check
       CALL GDGETD(n, d, 'data', 4, 5, 0, 1, 0, GD_I8, c)
-      CALL CHKEOK(ne, 2, d)
-      CALL CHKINT(ne, 2, n, 8)
+      CALL CHKEOK(ne, 3, d)
+      CALL CHKINT(ne, 3, n, 8)
 
-      DO 20 i = 1, 8
-      CALL CHKIN2(ne, 2, i, INT(c(i)), 40 + i)
-   20 CONTINUE
+      DO 30 i = 1, 8
+      CALL CHKIN2(ne, 3, i, INT(c(i)), 40 + i)
+   30 CONTINUE
 
-C     3: GDGTCO check
+C     12: GDGTCO check
       CALL GDGTCO(d, 'const', 5, GD_F32, fl)
-      CALL CHKEOK(ne, 3, d)
-      CALL CHKDBL(ne, 3, 1d0 * fl, 5.5d0)
+      CALL CHKEOK(ne, 12, d)
+      CALL CHKDBL(ne, 12, 1d0 * fl, 5.5d0)
 
-C     4: GDFDNX check
+C     21: GDFDNX check
       CALL GDFDNX(i, d)
-      CALL CHKEOK(ne, 4, d)
-      CALL CHKINT(ne, 4, i, 7)
+      CALL CHKEOK(ne, 21, d)
+      CALL CHKINT(ne, 21, i, 7)
 
-C     5: GDMFNX check
+C     22: GDMFNX check
       CALL GDMFNX(i, d, 'data', 4)
-      CALL CHKEOK(ne, 5, d)
-      CALL CHKINT(ne, 5, i, 6)
+      CALL CHKEOK(ne, 22, d)
+      CALL CHKINT(ne, 22, i, 6)
 
-C     6: GDNFLD check
+C     23: GDNFLD check
       CALL GDNFLD(n, d)
-      CALL CHKEOK(ne, 6, d)
-      CALL CHKINT(ne, 6, n, nfields)
+      CALL CHKEOK(ne, 23, d)
+      CALL CHKINT(ne, 23, n, nfields)
 
-C     7: This is a check of (one of many instances of) _GDF_FString
+C     24: This is a check of (one of many instances of) _GDF_FString
       l = 2
       CALL GDFLDN(fn, l, d, 1)
-      CALL CHKEOK(ne, 7, d)
-      CALL CHKINT(ne, 7, l, 5)
+      CALL CHKEOK(ne, 24, d)
+      CALL CHKINT(ne, 24, l, 5)
 
-C     8: GDFLDN check
-      DO 80 i = 1, n
+C     25: GDFLDN check
+      DO 250 i = 1, n
       l = flen
       CALL GDFLDN(fn, l, d, i)
-      CALL CHKOK2(ne, 8, i, d)
-      CALL CHKIN2(ne, 8, i, l, flen)
-      CALL CHKST2(ne, 8, i, fn, fields(i))
-   80 CONTINUE
+      CALL CHKOK2(ne, 25, i, d)
+      CALL CHKIN2(ne, 25, i, l, flen)
+      CALL CHKST2(ne, 25, i, fn, fields(i))
+  250 CONTINUE
 
-C     9: GDNMFD check
+C     26: GDNMFD check
       CALL GDNMFD(n, d, 'data', 4)
-      CALL CHKEOK(ne, 9, d)
-      CALL CHKINT(ne, 9, n, 3)
+      CALL CHKEOK(ne, 26, d)
+      CALL CHKINT(ne, 26, n, 3)
 
-C     10: GDMFDN check
+C     27: GDMFDN check
       fields(1) = 'mstr'
       fields(2) = 'mconst'
       fields(3) = 'mlut'
-      DO 100 i = 1, n
+      DO 270 i = 1, n
       l = flen
       CALL GDMFDN(fn, l, d, 'data', 4, i)
-      CALL CHKOK2(ne, 10, i, d)
-      CALL CHKIN2(ne, 10, i, l, flen)
-      CALL CHKST2(ne, 10, i, fn, fields(i))
-  100 CONTINUE
+      CALL CHKOK2(ne, 27, i, d)
+      CALL CHKIN2(ne, 27, i, l, flen)
+      CALL CHKST2(ne, 27, i, fn, fields(i))
+  270 CONTINUE
 
-C     11: GDNFRM check
+C     28: GDNFRM check
       CALL GDNFRM(n, d)
-      CALL CHKEOK(ne, 11, d)
-      CALL CHKINT(ne, 11, n, 10)
+      CALL CHKEOK(ne, 28, d)
+      CALL CHKINT(ne, 28, n, 10)
 
-C     12: GDGSPF check
+C     29: GDGSPF check
       CALL GDGSPF(n, d, 'data', 4)
-      CALL CHKEOK(ne, 12, d)
-      CALL CHKINT(ne, 12, n, 8)
+      CALL CHKEOK(ne, 29, d)
+      CALL CHKINT(ne, 29, n, 8)
 
-C     13: GDPUTD check
+C     30: GDPUTD check
       c(1) = 13
       c(2) = 14
       c(3) = 15
@@ -359,48 +367,48 @@ C     13: GDPUTD check
       c(7) = 19
       c(8) = 20
       CALL GDPUTD(n, d, 'data', 4, 5, 1, 0, 4, GD_I8, c)
-      CALL CHKEOK(ne, 13, d)
-      CALL CHKINT(ne, 13, n, 4)
+      CALL CHKEOK(ne, 30, d)
+      CALL CHKINT(ne, 30, n, 4)
 
       CALL GDGETD(n, d, 'data', 4, 5, 0, 1, 0, GD_I8, c)
 
-      DO 130 i = 1, 8
+      DO 300 i = 1, 8
       IF (i .EQ. 1 .OR. i .GT. 5) THEN
         n = 40 + i
       ELSE
         n = 11 + i
       ENDIF
-      CALL CHKIN2(ne, 13, i, INT(c(i)), n)
-  130 CONTINUE
+      CALL CHKIN2(ne, 30, i, INT(c(i)), n)
+  300 CONTINUE
 
-C     14: GDESTR check
+C     38: GDESTR check
       CALL GDGETD(n, d, 'x', 1, 5, 0, 1, 0, GD_I8, c)
       CALL GDESTR(d, str, slen)
-      CALL CHKSTR(ne, 14, str, 'Field not found: x')
+      CALL CHKSTR(ne, 38, str, 'Field not found: x')
 
-C     15: GDENTY check
+C     39: GDENTY check
       CALL GDENTY(n, d, 'data', 4)
-      CALL CHKEOK(ne, 15, d)
-      CALL CHKINT(ne, 15, n, GD_RWE)
+      CALL CHKEOK(ne, 39, d)
+      CALL CHKINT(ne, 39, n, GD_RWE)
 
-C     16: GDGERW check
+C     40: GDGERW check
       CALL GDGERW(l, i, n, d, 'data', 4)
-      CALL CHKEOK(ne, 16, d)
-      CALL CHKIN2(ne, 16, 1, n, 0)
-      CALL CHKIN2(ne, 16, 2, l, 8)
-      CALL CHKIN2(ne, 16, 3, i, GD_I8)
+      CALL CHKEOK(ne, 40, d)
+      CALL CHKIN2(ne, 40, 1, n, 0)
+      CALL CHKIN2(ne, 40, 2, l, 8)
+      CALL CHKIN2(ne, 40, 3, i, GD_I8)
 
-C     17: GDGELC check
+C     41: GDGELC check
       l = flen
       CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3),
      +p(4), fields(3), l, p(5), p(6), n, d, 'lincom', 6)
-      CALL CHKEOK(ne, 17, d)
-      CALL CHKIN2(ne, 17, 1, l, flen)
-      CALL CHKIN2(ne, 17, 2, i, 3)
-      CALL CHKIN2(ne, 17, 3, n, 0)
-      CALL CHKST2(ne, 17, 4, fields(1), 'data')
-      CALL CHKST2(ne, 17, 5, fields(2), 'INDEX')
-      CALL CHKST2(ne, 17, 6, fields(3), 'linterp')
+      CALL CHKEOK(ne, 41, d)
+      CALL CHKIN2(ne, 41, 1, l, flen)
+      CALL CHKIN2(ne, 41, 2, i, 3)
+      CALL CHKIN2(ne, 41, 3, n, 0)
+      CALL CHKST2(ne, 41, 4, fields(1), 'data')
+      CALL CHKST2(ne, 41, 5, fields(2), 'INDEX')
+      CALL CHKST2(ne, 41, 6, fields(3), 'linterp')
 
       q(1) = 1.1
       q(2) = 2.2
@@ -408,41 +416,41 @@ C     17: GDGELC check
       q(4) = 3.3
       q(5) = 5.5
       q(6) = 5.5
-      DO 170 i=1,6
-      CALL CHKDB2(ne, 17, i, p(i), q(i))
-  170 CONTINUE
+      DO 410 i=1,6
+      CALL CHKDB2(ne, 41, i, p(i), q(i))
+  410 CONTINUE
 
-C     18: GDGECL check
+C     42: GDGECL check
       l = flen
       CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3),
      +cp(4), fields(3), l, cp(5), cp(6), n, d, 'lincom', 6)
-      CALL CHKEOK(ne, 18, d)
-      CALL CHKIN2(ne, 18, 1, l, flen)
-      CALL CHKIN2(ne, 18, 2, i, 3)
-      CALL CHKIN2(ne, 18, 3, n, 0)
-      CALL CHKST2(ne, 18, 4, fields(1), 'data')
-      CALL CHKST2(ne, 18, 5, fields(2), 'INDEX')
-      CALL CHKST2(ne, 18, 6, fields(3), 'linterp')
-
-      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
-      CALL CHKCP2(ne, 18, i, cp(i), cq(i))
-  180 CONTINUE
-
-C     19: GDGEPN check
+      CALL CHKEOK(ne, 42, d)
+      CALL CHKIN2(ne, 42, 1, l, flen)
+      CALL CHKIN2(ne, 42, 2, i, 3)
+      CALL CHKIN2(ne, 42, 3, n, 0)
+      CALL CHKST2(ne, 42, 4, fields(1), 'data')
+      CALL CHKST2(ne, 42, 5, fields(2), 'INDEX')
+      CALL CHKST2(ne, 42, 6, fields(3), 'linterp')
+
+      cq(1) = dcmplx(1.1d0, 0.0d0)
+      cq(2) = dcmplx(2.2d0, 0.0d0)
+      cq(3) = dcmplx(2.2d0, 0.0d0)
+      cq(4) = dcmplx(3.3d0, 4.4d0)
+      cq(5) = dcmplx(5.5d0, 0.0d0)
+      cq(6) = dcmplx(5.5d0, 0.0d0)
+      DO 420 i=1,6
+      CALL CHKCP2(ne, 42, 6 + i, cp(i), cq(i))
+  420 CONTINUE
+
+C     43: GDGEPN check
       l = flen
       CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
      +n, d, 'polynom', 7)
-      CALL CHKEOK(ne, 19, d)
-      CALL CHKIN2(ne, 19, 1, l, flen)
-      CALL CHKIN2(ne, 19, 2, i, 5)
-      CALL CHKIN2(ne, 19, 3, n, 0)
-      CALL CHKST2(ne, 19, 4, fn, 'data')
+      CALL CHKEOK(ne, 43, d)
+      CALL CHKIN2(ne, 43, 1, l, flen)
+      CALL CHKIN2(ne, 43, 2, i, 5)
+      CALL CHKIN2(ne, 43, 3, n, 0)
+      CALL CHKST2(ne, 43, 4, fn, 'data')
 
       q(1) = 1.1
       q(2) = 2.2
@@ -450,163 +458,163 @@ C     19: GDGEPN check
       q(4) = 3.3
       q(5) = 5.5
       q(6) = 5.5
-      DO 190 i=1,6
-      CALL CHKDB2(ne, 19, i, p(i), q(i))
-  190 CONTINUE
+      DO 430 i=1,6
+      CALL CHKDB2(ne, 43, i, p(i), q(i))
+  430 CONTINUE
 
-C     20: GDGECP check
+C     44: GDGECP check
       l = flen
       CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
      +n, d, 'polynom', 7)
-      CALL CHKEOK(ne, 20, d)
-      CALL CHKIN2(ne, 20, 1, l, flen)
-      CALL CHKIN2(ne, 20, 2, i, 5)
-      CALL CHKIN2(ne, 20, 3, n, 0)
-      CALL CHKST2(ne, 20, 4, fn, 'data')
-
-      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
-      CALL CHKCP2(ne, 20, i, cp(i), cq(i))
-  200 CONTINUE
-
-C     21: GDGELT check
+      CALL CHKEOK(ne, 44, d)
+      CALL CHKIN2(ne, 44, 1, l, flen)
+      CALL CHKIN2(ne, 44, 2, i, 5)
+      CALL CHKIN2(ne, 44, 3, n, 0)
+      CALL CHKST2(ne, 44, 4, fn, 'data')
+
+      cq(1) = dcmplx(1.1d0, 0.0)
+      cq(2) = dcmplx(2.2d0, 0.0)
+      cq(3) = dcmplx(2.2d0, 0.0)
+      cq(4) = dcmplx(3.3d0, 4.4d0)
+      cq(5) = dcmplx(5.5d0, 0.0)
+      cq(6) = dcmplx(5.5d0, 0.0)
+      DO 440 i=1,6
+      CALL CHKCP2(ne, 44, i, cp(i), cq(i))
+  440 CONTINUE
+
+C     45: GDGELT check
       l = flen
       CALL GDGELT(fn, l, str, slen, n, d, 'linterp', 7)
-      CALL CHKEOK(ne, 21, d)
-      CALL CHKIN2(ne, 21, 1, l, flen)
-      CALL CHKIN2(ne, 21, 2, n, 0)
-      CALL CHKST2(ne, 21, 3, fn, 'data')
-      CALL CHKST2(ne, 21, 4, str, './lut')
+      CALL CHKEOK(ne, 45, d)
+      CALL CHKIN2(ne, 45, 1, l, flen)
+      CALL CHKIN2(ne, 45, 2, n, 0)
+      CALL CHKST2(ne, 45, 3, fn, 'data')
+      CALL CHKST2(ne, 45, 4, str, './lut')
 
-C     22: GDGEBT check
+C     46: GDGEBT check
       l = flen
       CALL GDGEBT(fn, l, m, i, n, d, 'bit', 3)
-      CALL CHKEOK(ne, 22, d)
-      CALL CHKIN2(ne, 22, 1, l, flen)
-      CALL CHKIN2(ne, 22, 2, n, 0)
-      CALL CHKIN2(ne, 22, 3, i, 4)
-      CALL CHKIN2(ne, 22, 4, m, 3)
-      CALL CHKST2(ne, 22, 5, fn, 'data')
+      CALL CHKEOK(ne, 46, d)
+      CALL CHKIN2(ne, 46, 1, l, flen)
+      CALL CHKIN2(ne, 46, 2, n, 0)
+      CALL CHKIN2(ne, 46, 3, i, 4)
+      CALL CHKIN2(ne, 46, 4, m, 3)
+      CALL CHKST2(ne, 46, 5, fn, 'data')
 
-C     23: GDGESB check
+C     47: GDGESB check
       l = flen
       CALL GDGESB(fn, l, m, i, n, d, 'sbit', 4)
-      CALL CHKEOK(ne, 23, d)
-      CALL CHKIN2(ne, 23, 1, l, flen)
-      CALL CHKIN2(ne, 23, 2, n, 0)
-      CALL CHKIN2(ne, 23, 3, i, 6)
-      CALL CHKIN2(ne, 23, 4, m, 5)
-      CALL CHKST2(ne, 23, 5, fn, 'data')
+      CALL CHKEOK(ne, 47, d)
+      CALL CHKIN2(ne, 47, 1, l, flen)
+      CALL CHKIN2(ne, 47, 2, n, 0)
+      CALL CHKIN2(ne, 47, 3, i, 6)
+      CALL CHKIN2(ne, 47, 4, m, 5)
+      CALL CHKST2(ne, 47, 5, fn, 'data')
 
-C     24: GDGEMT check
+C     48: GDGEMT check
       l = flen
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'mult', 4)
-      CALL CHKEOK(ne, 24, d)
-      CALL CHKIN2(ne, 24, 1, l, flen)
-      CALL CHKIN2(ne, 24, 2, n, 0)
-      CALL CHKST2(ne, 24, 3, fields(1), 'data')
-      CALL CHKST2(ne, 24, 4, fields(2), 'sbit')
+      CALL CHKEOK(ne, 48, d)
+      CALL CHKIN2(ne, 48, 1, l, flen)
+      CALL CHKIN2(ne, 48, 2, n, 0)
+      CALL CHKST2(ne, 48, 3, fields(1), 'data')
+      CALL CHKST2(ne, 48, 4, fields(2), 'sbit')
 
-C     25: GDGEPH check
+C     49: GDGEPH check
       l = flen
       CALL GDGEPH(fn, l, i, n, d, 'phase', 5)
-      CALL CHKEOK(ne, 25, d)
-      CALL CHKIN2(ne, 25, 1, l, flen)
-      CALL CHKIN2(ne, 25, 2, n, 0)
-      CALL CHKIN2(ne, 25, 3, i, 11)
-      CALL CHKST2(ne, 25, 4, fn, 'data')
+      CALL CHKEOK(ne, 49, d)
+      CALL CHKIN2(ne, 49, 1, l, flen)
+      CALL CHKIN2(ne, 49, 2, n, 0)
+      CALL CHKIN2(ne, 49, 3, i, 11)
+      CALL CHKST2(ne, 49, 4, fn, 'data')
 
-C     26: GDGECO check
+C     50: GDGECO check
       CALL GDGECO(i, n, d, 'const', 5)
-      CALL CHKEOK(ne, 26, d)
-      CALL CHKIN2(ne, 26, 1, n, 0)
-      CALL CHKIN2(ne, 26, 2, i, GD_F64)
+      CALL CHKEOK(ne, 50, d)
+      CALL CHKIN2(ne, 50, 1, n, 0)
+      CALL CHKIN2(ne, 50, 2, i, GD_F64)
 
-C     27: GDFRGI check
+C     52: GDFRGI check
       CALL GDFRGI(n, d, 'const', 5)
-      CALL CHKEOK(ne, 27, d)
-      CALL CHKINT(ne, 27, n, 0)
+      CALL CHKEOK(ne, 52, d)
+      CALL CHKINT(ne, 52, n, 0)
 
-C     28: GDADRW check
+C     53: GDADRW check
       CALL GDADRW(d, 'new1', 4, GD_F64, 3, 0)
-      CALL CHKOK2(ne, 28, 1, d)
+      CALL CHKOK2(ne, 53, 1, d)
 
       CALL GDGERW(l, i, n, d, 'new1', 4)
-      CALL CHKOK2(ne, 28, 2, d)
-      CALL CHKIN2(ne, 28, 3, n, 0)
-      CALL CHKIN2(ne, 28, 4, l, 3)
-      CALL CHKIN2(ne, 28, 5, i, GD_F64)
+      CALL CHKOK2(ne, 53, 2, d)
+      CALL CHKIN2(ne, 53, 3, n, 0)
+      CALL CHKIN2(ne, 53, 4, l, 3)
+      CALL CHKIN2(ne, 53, 5, i, GD_F64)
 
-C     29: GDADLC check
+C     54: GDADLC check
       CALL GDADLC(d, 'new2', 4, 2, 'in1', 3, 9.9d0, 8.8d0, 'in2', 3,
      +7.7d0, 6.6d0, '', 0, 0d0, 0d0, 0)
-      CALL CHKOK2(ne, 29, 1, d)
+      CALL CHKOK2(ne, 54, 1, d)
 
       l = flen
       CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3),
      +p(4), fields(3), l, p(5), p(6), n, d, 'new2', 4)
-      CALL CHKOK2(ne, 29, 2, d)
-      CALL CHKIN2(ne, 29, 3, l, flen)
-      CALL CHKIN2(ne, 29, 4, i, 2)
-      CALL CHKIN2(ne, 29, 5, n, 0)
-      CALL CHKST2(ne, 29, 6, fields(1), 'in1')
-      CALL CHKST2(ne, 29, 7, fields(2), 'in2')
-
-      q(1) = 9.9
-      q(2) = 8.8
-      q(3) = 7.7
-      q(4) = 6.6
+      CALL CHKOK2(ne, 54, 2, d)
+      CALL CHKIN2(ne, 54, 3, l, flen)
+      CALL CHKIN2(ne, 54, 4, i, 2)
+      CALL CHKIN2(ne, 54, 5, n, 0)
+      CALL CHKST2(ne, 54, 6, fields(1), 'in1')
+      CALL CHKST2(ne, 54, 7, fields(2), 'in2')
+
+      q(1) = 9.9d0
+      q(2) = 8.8d0
+      q(3) = 7.7d0
+      q(4) = 6.6d0
       q(5) = 5.5
       q(6) = 5.5
-      DO 290 i=1,4
-      CALL CHKDB2(ne, 29, i, p(i), q(i))
-  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)
+      DO 540 i=1,4
+      CALL CHKDB2(ne, 54, i, p(i), q(i))
+  540 CONTINUE
+
+C     55: GDADCL check
+      cq(1) = dcmplx(1.1d0, 1.2d0)
+      cq(2) = dcmplx(1.3d0, 1.4d0)
+      cq(3) = dcmplx(1.4d0, 1.5d0)
+      cq(4) = dcmplx(1.6d0, 1.7d0)
       CALL GDADCL(d, 'new3', 4, 2, 'in1', 3, cq(1), cq(2), 'in2', 3,
      +cq(3), cq(4), '', 0, cq(5), cq(6), 0)
-      CALL CHKOK2(ne, 30, 1, d)
+      CALL CHKOK2(ne, 55, 1, d)
 
       l = flen
       CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3),
      +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new3', 4)
-      CALL CHKOK2(ne, 30, 2, d)
-      CALL CHKIN2(ne, 30, 1, l, flen)
-      CALL CHKIN2(ne, 30, 2, i, 2)
-      CALL CHKIN2(ne, 30, 3, n, 0)
-      CALL CHKST2(ne, 30, 4, fields(1), 'in1')
-      CALL CHKST2(ne, 30, 5, fields(2), 'in2')
-
-      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
-      CALL CHKCP2(ne, 30, i, cp(i), cq(i))
-  300 CONTINUE
-
-C     31: GDADPN check
+      CALL CHKOK2(ne, 55, 2, d)
+      CALL CHKIN2(ne, 55, 3, l, flen)
+      CALL CHKIN2(ne, 55, 4, i, 2)
+      CALL CHKIN2(ne, 55, 5, n, 0)
+      CALL CHKST2(ne, 55, 6, fields(1), 'in1')
+      CALL CHKST2(ne, 55, 7, fields(2), 'in2')
+
+      cq(1) = dcmplx(1.1d0, 1.2d0)
+      cq(2) = dcmplx(1.3d0, 1.4d0)
+      cq(3) = dcmplx(1.4d0, 1.5d0)
+      cq(4) = dcmplx(1.6d0, 1.7d0)
+      DO 550 i=1,4
+      CALL CHKCP2(ne, 55, i + 7, cp(i), cq(i))
+  550 CONTINUE
+
+C     56: GDADPN check
       CALL GDADPN(d, 'new4', 4, 3, 'in1', 3, 3d3, 4d4, 5d5, 6d6, 0d0,
      +0d0, 0)
-      CALL CHKOK2(ne, 31, 1, d)
+      CALL CHKOK2(ne, 56, 1, d)
 
       l = flen
       CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
      +n, d, 'new4', 4)
-      CALL CHKOK2(ne, 31, 2, d)
-      CALL CHKIN2(ne, 31, 1, l, flen)
-      CALL CHKIN2(ne, 31, 2, i, 3)
-      CALL CHKIN2(ne, 31, 3, n, 0)
-      CALL CHKST2(ne, 31, 4, fn, 'in1')
+      CALL CHKOK2(ne, 56, 2, d)
+      CALL CHKIN2(ne, 56, 1, l, flen)
+      CALL CHKIN2(ne, 56, 2, i, 3)
+      CALL CHKIN2(ne, 56, 3, n, 0)
+      CALL CHKST2(ne, 56, 4, fn, 'in1')
 
       q(1) = 3d3
       q(2) = 4d4
@@ -615,164 +623,164 @@ C     31: GDADPN check
       q(5) = 5.5d0
       q(6) = 5.5d0
 
-      DO 310 i=1,4
-      CALL CHKDB2(ne, 31, i, p(i), q(i))
-  310 CONTINUE
+      DO 560 i=1,4
+      CALL CHKDB2(ne, 56, i, p(i), q(i))
+  560 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)
+C     57: GDADCP check
+      cq(1) = dcmplx(3.1d0, 7.0d0)
+      cq(2) = dcmplx(4.2d0, 8.0d0)
+      cq(3) = dcmplx(5.2d0, 9.0d0)
+      cq(4) = dcmplx(6.3d0, 4.4d0)
       CALL GDADCP(d, 'new5', 4, 3, 'in1', 3, cq(1), cq(2), cq(3), cq(4),
      +cq(5), cq(6), 0)
-      CALL CHKOK2(ne, 32, 1, d)
+      CALL CHKOK2(ne, 57, 1, d)
 
       l = flen
       CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
      +n, d, 'new5', 4)
-      CALL CHKOK2(ne, 32, 2, d)
-      CALL CHKIN2(ne, 32, 1, l, flen)
-      CALL CHKIN2(ne, 32, 2, i, 3)
-      CALL CHKIN2(ne, 32, 3, n, 0)
-      CALL CHKST2(ne, 32, 4, fn, 'in1')
-
-      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
-      CALL CHKCP2(ne, 32, i, cp(i), cq(i))
-  320 CONTINUE
-
-C     33: GDADLT check
+      CALL CHKOK2(ne, 57, 2, d)
+      CALL CHKIN2(ne, 57, 1, l, flen)
+      CALL CHKIN2(ne, 57, 2, i, 3)
+      CALL CHKIN2(ne, 57, 3, n, 0)
+      CALL CHKST2(ne, 57, 4, fn, 'in1')
+
+      cq(1) = dcmplx(3.1d0, 7.0d0)
+      cq(2) = dcmplx(4.2d0, 8.0d0)
+      cq(3) = dcmplx(5.2d0, 9.0d0)
+      cq(4) = dcmplx(6.3d0, 4.4d0)
+      DO 570 i=1,4
+      CALL CHKCP2(ne, 57, i, cp(i), cq(i))
+  570 CONTINUE
+
+C     58: GDADLT check
       CALL GDADLT(d, "new6", 4, "in", 2, "./some/table", 12, 0)
-      CALL CHKOK2(ne, 33, 1, d)
+      CALL CHKOK2(ne, 58, 1, d)
 
       l = flen
       CALL GDGELT(fn, l, str, slen, n, d, 'new6', 4)
-      CALL CHKOK2(ne, 33, 2, d)
-      CALL CHKIN2(ne, 33, 1, l, flen)
-      CALL CHKIN2(ne, 33, 2, n, 0)
-      CALL CHKST2(ne, 33, 3, fn, 'in')
-      CALL CHKST2(ne, 33, 4, str, './some/table')
+      CALL CHKOK2(ne, 58, 2, d)
+      CALL CHKIN2(ne, 58, 1, l, flen)
+      CALL CHKIN2(ne, 58, 2, n, 0)
+      CALL CHKST2(ne, 58, 3, fn, 'in')
+      CALL CHKST2(ne, 58, 4, str, './some/table')
 
-C     34: GDADBT check
+C     59: GDADBT check
       CALL GDADBT(d, "new7", 4, "in", 2, 13, 12, 0)
-      CALL CHKOK2(ne, 34, 1, d)
+      CALL CHKOK2(ne, 59, 1, d)
 
       l = flen
       CALL GDGEBT(fn, l, m, i, n, d, 'new7', 4)
-      CALL CHKOK2(ne, 34, 2, d)
-      CALL CHKIN2(ne, 34, 1, l, flen)
-      CALL CHKIN2(ne, 34, 2, n, 0)
-      CALL CHKIN2(ne, 34, 3, i, 12)
-      CALL CHKIN2(ne, 34, 4, m, 13)
-      CALL CHKST2(ne, 34, 5, fn, 'in')
-
-C     35: GDADSB check
+      CALL CHKOK2(ne, 59, 2, d)
+      CALL CHKIN2(ne, 59, 1, l, flen)
+      CALL CHKIN2(ne, 59, 2, n, 0)
+      CALL CHKIN2(ne, 59, 3, i, 12)
+      CALL CHKIN2(ne, 59, 4, m, 13)
+      CALL CHKST2(ne, 59, 5, fn, 'in')
+
+C     60: GDADSB check
       CALL GDADSB(d, "new8", 4, "in", 2, 13, 12, 0)
-      CALL CHKOK2(ne, 35, 1, d)
+      CALL CHKOK2(ne, 60, 1, d)
 
       l = flen
       CALL GDGESB(fn, l, m, i, n, d, 'new8', 4)
-      CALL CHKOK2(ne, 35, 2, d)
-      CALL CHKIN2(ne, 35, 1, l, flen)
-      CALL CHKIN2(ne, 35, 2, n, 0)
-      CALL CHKIN2(ne, 35, 3, i, 12)
-      CALL CHKIN2(ne, 35, 4, m, 13)
-      CALL CHKST2(ne, 35, 5, fn, 'in')
-
-C     36: GDADMT check
+      CALL CHKOK2(ne, 60, 2, d)
+      CALL CHKIN2(ne, 60, 1, l, flen)
+      CALL CHKIN2(ne, 60, 2, n, 0)
+      CALL CHKIN2(ne, 60, 3, i, 12)
+      CALL CHKIN2(ne, 60, 4, m, 13)
+      CALL CHKST2(ne, 60, 5, fn, 'in')
+
+C     61: GDADMT check
       CALL GDADMT(d, 'new9', 4, 'in1', 3, 'in2', 3, 0)
-      CALL CHKOK2(ne, 36, 1, d)
+      CALL CHKOK2(ne, 61, 1, d)
 
       l = flen
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
-      CALL CHKOK2(ne, 36, 2, d)
-      CALL CHKIN2(ne, 36, 1, l, flen)
-      CALL CHKIN2(ne, 36, 2, n, 0)
-      CALL CHKST2(ne, 36, 3, fields(1), 'in1')
-      CALL CHKST2(ne, 36, 4, fields(2), 'in2')
+      CALL CHKOK2(ne, 61, 2, d)
+      CALL CHKIN2(ne, 61, 1, l, flen)
+      CALL CHKIN2(ne, 61, 2, n, 0)
+      CALL CHKST2(ne, 61, 3, fields(1), 'in1')
+      CALL CHKST2(ne, 61, 4, fields(2), 'in2')
 
-C     37: GDADPH check
+C     62: GDADPH check
       CALL GDADPH(d, 'new10', 5, 'in1', 3, 22, 0)
-      CALL CHKOK2(ne, 37, 1, d)
+      CALL CHKOK2(ne, 62, 1, d)
 
       l = flen
       CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
-      CALL CHKOK2(ne, 37, 2, d)
-      CALL CHKIN2(ne, 37, 1, l, flen)
-      CALL CHKIN2(ne, 37, 2, n, 0)
-      CALL CHKIN2(ne, 37, 3, i, 22)
-      CALL CHKST2(ne, 37, 4, fn, 'in1')
+      CALL CHKOK2(ne, 62, 2, d)
+      CALL CHKIN2(ne, 62, 1, l, flen)
+      CALL CHKIN2(ne, 62, 2, n, 0)
+      CALL CHKIN2(ne, 62, 3, i, 22)
+      CALL CHKST2(ne, 62, 4, fn, 'in1')
 
-C     38: GDADCO check
+C     63: GDADCO check
       CALL GDADCO(d, 'new11', 5, GD_F64, GD_F32, -8.1, 0)
-      CALL CHKOK2(ne, 38, 1, d)
+      CALL CHKOK2(ne, 63, 1, d)
 
       CALL GDGECO(i, n, d, 'new11', 5)
-      CALL CHKOK2(ne, 38, 2, d)
-      CALL CHKIN2(ne, 38, 1, n, 0)
-      CALL CHKIN2(ne, 38, 2, i, GD_F64)
+      CALL CHKOK2(ne, 63, 2, d)
+      CALL CHKIN2(ne, 63, 1, n, 0)
+      CALL CHKIN2(ne, 63, 2, i, GD_F64)
 
       CALL GDGTCO(d, 'new11', 5, GD_F32, fl)
-      CALL CHKOK2(ne, 38, 3, d)
-      CALL CHKDBL(ne, 38, 1d0 * fl, -8.1d0)
+      CALL CHKOK2(ne, 63, 3, d)
+      CALL CHKDBL(ne, 63, 1d0 * fl, 1d0 * (-8.1))
 
-C     39: GDFRGN check
+C     64: GDFRGN check
       l = plen
       CALL GDFRGN(path, l, d, 0)
 
-      CALL CHKEOK(ne, 39, d)
-      CALL CHKINT(ne, 39, l, plen)
-      CALL CHKEOS(ne, 39, path, fildir//DIRSEP//'format')
+      CALL CHKEOK(ne, 64, d)
+      CALL CHKINT(ne, 64, l, plen)
+      CALL CHKEOS(ne, 64, path, fildir//DIRSEP//'format')
 
-C     40: GDNFRG check
+C     65: GDNFRG check
       CALL GDNFRG(n, d)
-      CALL CHKEOK(ne, 40, d)
-      CALL CHKINT(ne, 40, n, 1)
+      CALL CHKEOK(ne, 65, d)
+      CALL CHKINT(ne, 65, n, 1)
 
-C     41: GDINCL check
+C     66: GDINCL check
       CALL GDINCL(d, 'form2', 5, 0, 0)
-      CALL CHKOK2(ne, 41, 1, d)
+      CALL CHKOK2(ne, 66, 1, d)
 
       CALL GDGTCO(d, 'const2', 6, GD_I8, c(1))
-      CALL CHKOK2(ne, 41, 2, d)
-      CALL CHKINT(ne, 41, INT(c(1)), -19)
+      CALL CHKOK2(ne, 66, 2, d)
+      CALL CHKINT(ne, 66, INT(c(1)), -19)
 
-C     42: GDNFDT check
+C     67: GDNFDT check
       CALL GDNFDT(n, d, GD_LCE)
-      CALL CHKEOK(ne, 42, d)
-      CALL CHKINT(ne, 42, n, 3)
+      CALL CHKEOK(ne, 67, d)
+      CALL CHKINT(ne, 67, n, 3)
 
-C     43: GDFDNT check
+C     68: GDFDNT check
       fields(1) = 'lincom'
       fields(2) = 'new2'
       fields(3) = 'new3'
-      DO 430 i = 1, n
+      DO 680 i = 1, n
       l = flen
       CALL GDFDNT(fn, l, d, GD_LCE, i)
-      CALL CHKOK2(ne, 43, i, d)
-      CALL CHKIN2(ne, 43, i, l, flen)
-      CALL CHKST2(ne, 43, i, fn, fields(i))
-  430 CONTINUE
+      CALL CHKOK2(ne, 68, i, d)
+      CALL CHKIN2(ne, 68, i, l, flen)
+      CALL CHKST2(ne, 68, i, fn, fields(i))
+  680 CONTINUE
 
-C     44: GDNVEC check
+C     69: GDNVEC check
       CALL GDNVEC(n, d)
-      CALL CHKEOK(ne, 44, d)
-      CALL CHKINT(ne, 44, n, 24)
-
-C     45: GDVECN check
-      fields(1) = 'INDEX  '
-      fields(2) = 'alias  '
-      fields(3) = 'bit    '
-      fields(4) = 'data   '
-      fields(5) = 'div    '
-      fields(6) = 'lincom '
-      fields(7) = 'linterp'
-      fields(8) = 'mplex  '
-      fields(9) = 'mult   '
+      CALL CHKEOK(ne, 69, d)
+      CALL CHKINT(ne, 69, n, 24)
+
+C     70: GDVECN check
+      fields( 1) = 'INDEX  '
+      fields( 2) = 'alias  '
+      fields( 3) = 'bit    '
+      fields( 4) = 'data   '
+      fields( 5) = 'div    '
+      fields( 6) = 'lincom '
+      fields( 7) = 'linterp'
+      fields( 8) = 'mplex  '
+      fields( 9) = 'mult   '
       fields(10) = 'new1   '
       fields(11) = 'new10  '
       fields(12) = 'new2   '
@@ -788,79 +796,79 @@ C     45: GDVECN check
       fields(22) = 'recip  '
       fields(23) = 'sbit   '
       fields(24) = 'window '
-      DO 450 i = 1, n
+      DO 700 i = 1, n
       l = flen
       CALL GDVECN(fn, l, d, i)
-      CALL CHKOK2(ne, 45, i, d)
-      CALL CHKIN2(ne, 45, i, l, flen)
-      CALL CHKST2(ne, 45, i, fn, fields(i))
-  450 CONTINUE
+      CALL CHKOK2(ne, 70, i, d)
+      CALL CHKIN2(ne, 70, i, l, flen)
+      CALL CHKST2(ne, 70, i, fn, fields(i))
+  700 CONTINUE
 
-C     46: GDMDLC check
+C     71: GDMDLC check
       CALL GDMDLC(d, 'data', 4, 'mnew1', 5, 2, 'in1', 3, 9.9d0, 8.8d0,
      +'in2', 3, 7.7d0, 6.6d0, '', 0, 0d0, 0d0)
-      CALL CHKOK2(ne, 46, 1, d)
+      CALL CHKOK2(ne, 71, 1, d)
 
       l = flen
       CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3),
      +p(4), fields(3), l, p(5), p(6), n, d, 'data/mnew1', 10)
-      CALL CHKOK2(ne, 46, 2, d)
-      CALL CHKIN2(ne, 46, 3, l, flen)
-      CALL CHKIN2(ne, 46, 4, i, 2)
-      CALL CHKIN2(ne, 46, 5, n, 0)
-      CALL CHKST2(ne, 46, 6, fields(1), 'in1')
-      CALL CHKST2(ne, 46, 7, fields(2), 'in2')
-
-      q(1) = 9.9
-      q(2) = 8.8
-      q(3) = 7.7
-      q(4) = 6.6
+      CALL CHKOK2(ne, 71, 2, d)
+      CALL CHKIN2(ne, 71, 3, l, flen)
+      CALL CHKIN2(ne, 71, 4, i, 2)
+      CALL CHKIN2(ne, 71, 5, n, 0)
+      CALL CHKST2(ne, 71, 6, fields(1), 'in1')
+      CALL CHKST2(ne, 71, 7, fields(2), 'in2')
+
+      q(1) = 9.9d0
+      q(2) = 8.8d0
+      q(3) = 7.7d0
+      q(4) = 6.6d0
       q(5) = 5.5
       q(6) = 5.5
-      DO 460 i=1,4
-      CALL CHKDB2(ne, 46, i, p(i), q(i))
-  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)
+      DO 710 i=1,4
+      CALL CHKDB2(ne, 71, i, p(i), q(i))
+  710 CONTINUE
+
+C     72: GDMDCL check
+      cq(1) = dcmplx(1.1d0, 1.2d0)
+      cq(2) = dcmplx(1.3d0, 1.4d0)
+      cq(3) = dcmplx(1.4d0, 1.5d0)
+      cq(4) = dcmplx(1.6d0, 1.7d0)
       CALL GDMDCL(d, 'data', 4, 'mnew2', 5, 2, 'in1', 3, cq(1), cq(2),
      +'in2', 3, cq(3), cq(4), '', 0, cq(5), cq(6))
-      CALL CHKOK2(ne, 47, 1, d)
+      CALL CHKOK2(ne, 72, 1, d)
 
       l = flen
       CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3),
      +cp(4), fields(3), l, cp(5), cp(6), n, d, 'data/mnew2', 10)
-      CALL CHKOK2(ne, 47, 2, d)
-      CALL CHKIN2(ne, 47, 1, l, flen)
-      CALL CHKIN2(ne, 47, 2, i, 2)
-      CALL CHKIN2(ne, 47, 3, n, 0)
-      CALL CHKST2(ne, 47, 4, fields(1), 'in1')
-      CALL CHKST2(ne, 47, 5, fields(2), 'in2')
-
-      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
-      CALL CHKCP2(ne, 47, i, cp(i), cq(i))
-  470 CONTINUE
-
-C     48: GDMDPN check
+      CALL CHKOK2(ne, 72, 2, d)
+      CALL CHKIN2(ne, 72, 1, l, flen)
+      CALL CHKIN2(ne, 72, 2, i, 2)
+      CALL CHKIN2(ne, 72, 3, n, 0)
+      CALL CHKST2(ne, 72, 4, fields(1), 'in1')
+      CALL CHKST2(ne, 72, 5, fields(2), 'in2')
+
+      cq(1) = dcmplx(1.1d0, 1.2d0)
+      cq(2) = dcmplx(1.3d0, 1.4d0)
+      cq(3) = dcmplx(1.4d0, 1.5d0)
+      cq(4) = dcmplx(1.6d0, 1.7d0)
+      DO 720 i=1,4
+      CALL CHKCP2(ne, 72, i, cp(i), cq(i))
+  720 CONTINUE
+
+C     73: GDMDPN check
       CALL GDMDPN(d, 'data', 4, 'mnew3', 5, 3, 'in1', 3, 3d3, 4d4, 5d5,
      +6d6, 0d0, 0d0)
-      CALL CHKOK2(ne, 48, 1, d)
+      CALL CHKOK2(ne, 73, 1, d)
 
       l = flen
       CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
      +n, d, 'data/mnew3', 10)
-      CALL CHKOK2(ne, 48, 2, d)
-      CALL CHKIN2(ne, 48, 1, l, flen)
-      CALL CHKIN2(ne, 48, 2, i, 3)
-      CALL CHKIN2(ne, 48, 3, n, 0)
-      CALL CHKST2(ne, 48, 4, fn, 'in1')
+      CALL CHKOK2(ne, 73, 2, d)
+      CALL CHKIN2(ne, 73, 1, l, flen)
+      CALL CHKIN2(ne, 73, 2, i, 3)
+      CALL CHKIN2(ne, 73, 3, n, 0)
+      CALL CHKST2(ne, 73, 4, fn, 'in1')
 
       q(1) = 3d3
       q(2) = 4d4
@@ -868,189 +876,189 @@ C     48: GDMDPN check
       q(4) = 6d6
       q(5) = 5.5d0
       q(6) = 5.5d0
-      DO 480 i=1,4
-      CALL CHKDB2(ne, 48, i, p(i), q(i))
-  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)
+      DO 730 i=1,4
+      CALL CHKDB2(ne, 73, i, p(i), q(i))
+  730 CONTINUE
+
+C     74: GDMDCP check
+      cq(1) = dcmplx(1.1d0, 0.0)
+      cq(2) = dcmplx(2.2d0, 0.0)
+      cq(3) = dcmplx(2.2d0, 0.0)
+      cq(4) = dcmplx(3.3d0, 4.4d0)
       CALL GDMDCP(d, 'data', 4, 'mnew5', 5, 3, 'in1', 3, cq(1), cq(2),
      +cq(3), cq(4), cq(5), cq(6))
-      CALL CHKOK2(ne, 49, 1, d)
+      CALL CHKOK2(ne, 74, 1, d)
 
       l = flen
       CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
      +n, d, 'data/mnew5', 10)
-      CALL CHKOK2(ne, 49, 2, d)
-      CALL CHKIN2(ne, 49, 1, l, flen)
-      CALL CHKIN2(ne, 49, 2, i, 3)
-      CALL CHKIN2(ne, 49, 3, n, 0)
-      CALL CHKST2(ne, 49, 4, fn, 'in1')
-
-      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
-      CALL CHKCP2(ne, 49, i, cp(i), cq(i))
-  490 CONTINUE
-
-C     50: GDMDLT check
+      CALL CHKOK2(ne, 74, 2, d)
+      CALL CHKIN2(ne, 74, 1, l, flen)
+      CALL CHKIN2(ne, 74, 2, i, 3)
+      CALL CHKIN2(ne, 74, 3, n, 0)
+      CALL CHKST2(ne, 74, 4, fn, 'in1')
+
+      cq(1) = dcmplx(1.1d0, 0.0)
+      cq(2) = dcmplx(2.2d0, 0.0)
+      cq(3) = dcmplx(2.2d0, 0.0)
+      cq(4) = dcmplx(3.3d0, 4.4d0)
+      DO 740 i=1,4
+      CALL CHKCP2(ne, 74, i, cp(i), cq(i))
+  740 CONTINUE
+
+C     75: GDMDLT check
       CALL GDMDLT(d, "data", 4, "mnew6", 5, "in", 2, "./more/table", 12)
-      CALL CHKOK2(ne, 50, 1, d)
+      CALL CHKOK2(ne, 75, 1, d)
 
       l = flen
       CALL GDGELT(fn, l, str, slen, n, d, 'data/mnew6', 10)
-      CALL CHKOK2(ne, 50, 2, d)
-      CALL CHKIN2(ne, 50, 1, l, flen)
-      CALL CHKIN2(ne, 50, 2, n, 0)
-      CALL CHKST2(ne, 50, 3, fn, 'in')
-      CALL CHKST2(ne, 50, 4, str, './more/table')
+      CALL CHKOK2(ne, 75, 2, d)
+      CALL CHKIN2(ne, 75, 1, l, flen)
+      CALL CHKIN2(ne, 75, 2, n, 0)
+      CALL CHKST2(ne, 75, 3, fn, 'in')
+      CALL CHKST2(ne, 75, 4, str, './more/table')
 
-C     51: GDMDBT check
+C     76: GDMDBT check
       CALL GDMDBT(d, "data", 4, "mnew7", 5, "in", 2, 13, 12)
-      CALL CHKOK2(ne, 51, 1, d)
+      CALL CHKOK2(ne, 76, 1, d)
 
       l = flen
       CALL GDGEBT(fn, l, m, i, n, d, 'data/mnew7', 10)
-      CALL CHKOK2(ne, 51, 2, d)
-      CALL CHKIN2(ne, 51, 1, l, flen)
-      CALL CHKIN2(ne, 51, 2, n, 0)
-      CALL CHKIN2(ne, 51, 3, i, 12)
-      CALL CHKIN2(ne, 51, 4, m, 13)
-      CALL CHKST2(ne, 51, 5, fn, 'in')
-
-C     52: GDMDSB check
+      CALL CHKOK2(ne, 76, 2, d)
+      CALL CHKIN2(ne, 76, 1, l, flen)
+      CALL CHKIN2(ne, 76, 2, n, 0)
+      CALL CHKIN2(ne, 76, 3, i, 12)
+      CALL CHKIN2(ne, 76, 4, m, 13)
+      CALL CHKST2(ne, 76, 5, fn, 'in')
+
+C     77: GDMDSB check
       CALL GDMDSB(d, "data", 4, "mnew8", 5, "in", 2, 13, 12)
-      CALL CHKOK2(ne, 52, 1, d)
+      CALL CHKOK2(ne, 77, 1, d)
 
       l = flen
       CALL GDGESB(fn, l, m, i, n, d, 'data/mnew8', 10)
-      CALL CHKOK2(ne, 52, 2, d)
-      CALL CHKIN2(ne, 52, 1, l, flen)
-      CALL CHKIN2(ne, 52, 2, n, 0)
-      CALL CHKIN2(ne, 52, 3, i, 12)
-      CALL CHKIN2(ne, 52, 4, m, 13)
-      CALL CHKST2(ne, 52, 5, fn, 'in')
-
-C     53: GDMDMT check
+      CALL CHKOK2(ne, 77, 2, d)
+      CALL CHKIN2(ne, 77, 1, l, flen)
+      CALL CHKIN2(ne, 77, 2, n, 0)
+      CALL CHKIN2(ne, 77, 3, i, 12)
+      CALL CHKIN2(ne, 77, 4, m, 13)
+      CALL CHKST2(ne, 77, 5, fn, 'in')
+
+C     78: GDMDMT check
       CALL GDMDMT(d, 'data', 4, 'mnew9', 5, 'in1', 3, 'in2', 3)
-      CALL CHKOK2(ne, 53, 1, d)
+      CALL CHKOK2(ne, 78, 1, d)
 
       l = flen
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'data/mnew9', 10)
-      CALL CHKOK2(ne, 53, 2, d)
-      CALL CHKIN2(ne, 53, 1, l, flen)
-      CALL CHKIN2(ne, 53, 2, n, 0)
-      CALL CHKST2(ne, 53, 3, fields(1), 'in1')
-      CALL CHKST2(ne, 53, 4, fields(2), 'in2')
+      CALL CHKOK2(ne, 78, 2, d)
+      CALL CHKIN2(ne, 78, 1, l, flen)
+      CALL CHKIN2(ne, 78, 2, n, 0)
+      CALL CHKST2(ne, 78, 3, fields(1), 'in1')
+      CALL CHKST2(ne, 78, 4, fields(2), 'in2')
 
-C     54: GDMDPH check
+C     79: GDMDPH check
       CALL GDMDPH(d, 'data', 4, 'mnew10', 6, 'in1', 3, 22)
-      CALL CHKOK2(ne, 54, 1, d)
+      CALL CHKOK2(ne, 79, 1, d)
 
       l = flen
       CALL GDGEPH(fn, l, i, n, d, 'data/mnew10', 11)
-      CALL CHKOK2(ne, 54, 2, d)
-      CALL CHKIN2(ne, 54, 1, l, flen)
-      CALL CHKIN2(ne, 54, 2, n, 0)
-      CALL CHKIN2(ne, 54, 3, i, 22)
-      CALL CHKST2(ne, 54, 4, fn, 'in1')
+      CALL CHKOK2(ne, 79, 2, d)
+      CALL CHKIN2(ne, 79, 1, l, flen)
+      CALL CHKIN2(ne, 79, 2, n, 0)
+      CALL CHKIN2(ne, 79, 3, i, 22)
+      CALL CHKST2(ne, 79, 4, fn, 'in1')
 
-C     55: GDMDCO check
+C     80: GDMDCO check
       CALL GDMDCO(d, 'data', 4, 'mnew11', 6, GD_F64, GD_F32, -8.1)
-      CALL CHKOK2(ne, 55, 1, d)
+      CALL CHKOK2(ne, 80, 1, d)
 
       CALL GDGECO(i, n, d, 'data/mnew11', 11)
-      CALL CHKOK2(ne, 55, 2, d)
-      CALL CHKIN2(ne, 55, 1, l, flen)
-      CALL CHKIN2(ne, 55, 2, n, 0)
-      CALL CHKIN2(ne, 55, 3, i, GD_F64)
+      CALL CHKOK2(ne, 80, 2, d)
+      CALL CHKIN2(ne, 80, 1, l, flen)
+      CALL CHKIN2(ne, 80, 2, n, 0)
+      CALL CHKIN2(ne, 80, 3, i, GD_F64)
 
       CALL GDGTCO(d, 'data/mnew11', 11, GD_F32, fl)
-      CALL CHKOK2(ne, 55, 3, d)
-      CALL CHKDBL(ne, 55, 1d0 * fl, -8.1d0)
+      CALL CHKOK2(ne, 80, 3, d)
+      CALL CHKDBL(ne, 80, 1d0 * fl, 1d0 * (-8.1))
 
-C     56: GDGTST check
+C     81: GDGTST check
       CALL GDGTST(n, d, 'string', 6, slen, str)
-      CALL CHKEOK(ne, 56, d)
-      CALL CHKINT(ne, 56, n, 17)
-      CALL CHKSTR(ne, 56, str, "Zaphod Beeblebrox")
+      CALL CHKEOK(ne, 81, d)
+      CALL CHKINT(ne, 81, n, 17)
+      CALL CHKSTR(ne, 81, str, "Zaphod Beeblebrox")
 
-C     57: GDADST check
+C     82: GDADST check
       CALL GDADST(d, 'new12', 5, "---string---", 12, 0)
-      CALL CHKOK2(ne, 57, 1, d)
+      CALL CHKOK2(ne, 82, 1, d)
 
       CALL GDGTST(n, d, 'new12', 5, slen, str)
-      CALL CHKOK2(ne, 57, 2, d)
-      CALL CHKSTR(ne, 57, str, "---string---")
+      CALL CHKOK2(ne, 82, 2, d)
+      CALL CHKSTR(ne, 82, str, "---string---")
 
-C     58: GDMDST check
+C     83: GDMDST check
       CALL GDMDST(d, "data", 4, 'mnew12', 6, "kai su, technon;", 16)
-      CALL CHKOK2(ne, 58, 1, d)
+      CALL CHKOK2(ne, 83, 1, d)
 
       CALL GDGTST(n, d, 'data/mnew12', 11, slen, str)
-      CALL CHKOK2(ne, 58, 2, d)
-      CALL CHKSTR(ne, 58, str, "kai su, technon;")
+      CALL CHKOK2(ne, 83, 2, d)
+      CALL CHKSTR(ne, 83, str, "kai su, technon;")
 
-C     59: GDADSP check
+C     84: GDADSP check
       CALL GDADSP(d, 'lorem STRING "Lorem ipsum"', 26, 0)
-      CALL CHKOK2(ne, 59, 1, d)
+      CALL CHKOK2(ne, 84, 1, d)
 
       CALL GDGTST(n, d, 'lorem', 5, slen, str)
-      CALL CHKOK2(ne, 59, 2, d)
-      CALL CHKSTR(ne, 59, str, "Lorem ipsum")
+      CALL CHKOK2(ne, 84, 2, d)
+      CALL CHKSTR(ne, 84, str, "Lorem ipsum")
 
-C     60: GDMDSP check
+C     85: GDMDSP check
       CALL GDMDSP(d, 'ipsum STRING "dolor sit amet."', 30, 'lorem', 5)
-      CALL CHKOK2(ne, 60, 1, d)
+      CALL CHKOK2(ne, 85, 1, d)
 
       CALL GDGTST(n, d, 'lorem/ipsum', 11, slen, str)
-      CALL CHKOK2(ne, 60, 2, d)
-      CALL CHKSTR(ne, 60, str, "dolor sit amet.")
+      CALL CHKOK2(ne, 85, 2, d)
+      CALL CHKSTR(ne, 85, str, "dolor sit amet.")
 
-C     61: GDPTCO check
+C     86: GDPTCO check
       CALL GDPTCO(d, 'const', 5, GD_I32, 10)
-      CALL CHKOK2(ne, 61, 1, d)
+      CALL CHKOK2(ne, 86, 1, d)
 
       CALL GDGTCO(d, 'const', 5, GD_F32, fl)
-      CALL CHKOK2(ne, 61, 2, d)
-      CALL CHKDBL(ne, 61, 1d0 * fl, 10.0d0)
+      CALL CHKOK2(ne, 86, 2, d)
+      CALL CHKDBL(ne, 86, 1d0 * fl, 10.0d0)
 
-C     62: GDPTST check
+C     94: GDPTST check
       CALL GDPTST(n, d, 'string', 6, 11, "Arthur Dent")
-      CALL CHKOK2(ne, 62, 1, d)
-      CALL CHKINT(ne, 62, n, 11)
+      CALL CHKOK2(ne, 94, 1, d)
+      CALL CHKINT(ne, 94, n, 11)
 
       CALL GDGTST(n, d, 'string', 6, slen, str)
-      CALL CHKOK2(ne, 62, 2, d)
-      CALL CHKSTR(ne, 62, str, "Arthur Dent")
+      CALL CHKOK2(ne, 94, 2, d)
+      CALL CHKSTR(ne, 94, str, "Arthur Dent")
 
-C     63: GDNMFT check
+C     95: GDNMFT check
       CALL GDNMFT(n, d, "data", 4, GD_LCE)
-      CALL CHKEOK(ne, 63, d)
-      CALL CHKINT(ne, 63, n, 2)
+      CALL CHKEOK(ne, 95, d)
+      CALL CHKINT(ne, 95, n, 2)
 
-C     64: GDMFDT check
+C     96: GDMFDT check
       fields(1) = 'mnew1'
       fields(2) = 'mnew2'
-      DO 640 i = 1, n
+      DO 960 i = 1, n
       l = flen
       CALL GDMFDT(fn, l, d, "data", 4, GD_LCE, i)
-      CALL CHKOK2(ne, 64, i, d)
-      CALL CHKIN2(ne, 64, i, l, flen)
-      CALL CHKST2(ne, 64, i, fn, fields(i))
-  640 CONTINUE
+      CALL CHKOK2(ne, 96, i, d)
+      CALL CHKIN2(ne, 96, i, l, flen)
+      CALL CHKST2(ne, 96, i, fn, fields(i))
+  960 CONTINUE
 
-C     65: GDNMVE check
+C     97: GDNMVE check
       CALL GDNMVE(n, d, "data", 4)
-      CALL CHKEOK(ne, 65, d)
-      CALL CHKINT(ne, 65, n, 10)
+      CALL CHKEOK(ne, 97, d)
+      CALL CHKINT(ne, 97, n, 10)
 
-C     66: GDMVEN check
+C     98: GDMVEN check
       fields(1) = 'mlut  '
       fields(2) = 'mnew1 '
       fields(3) = 'mnew2 '
@@ -1061,39 +1069,39 @@ C     66: GDMVEN check
       fields(8) = 'mnew8 '
       fields(9) = 'mnew9 '
       fields(10) = 'mnew10'
-      DO 660 i = 1, n
+      DO 980 i = 1, n
       l = flen
       CALL GDMVEN(fn, l, d, "data", 4, i)
-      CALL CHKOK2(ne, 66, i, d)
-      CALL CHKIN2(ne, 66, i, l, flen)
-      CALL CHKST2(ne, 66, i, fn, fields(i))
-  660 CONTINUE
+      CALL CHKOK2(ne, 98, i, d)
+      CALL CHKIN2(ne, 98, i, l, flen)
+      CALL CHKST2(ne, 98, i, fn, fields(i))
+  980 CONTINUE
 
-C     67: GDALRW check
+C     99: GDALRW check
       CALL GDALRW(d, 'new1', 4, GD_I32, 4, 0)
-      CALL CHKOK2(ne, 67, 1, d)
+      CALL CHKOK2(ne, 99, 1, d)
 
       CALL GDGERW(l, i, n, d, 'new1', 4)
-      CALL CHKOK2(ne, 67, 2, d)
-      CALL CHKIN2(ne, 67, 3, n, 0)
-      CALL CHKIN2(ne, 67, 4, l, 4)
-      CALL CHKIN2(ne, 67, 5, i, GD_I32)
+      CALL CHKOK2(ne, 99, 2, d)
+      CALL CHKIN2(ne, 99, 3, n, 0)
+      CALL CHKIN2(ne, 99, 4, l, 4)
+      CALL CHKIN2(ne, 99, 5, i, GD_I32)
 
-C     68: GDALLC check
+C     100: GDALLC check
       CALL GDALLC(d, 'new2', 4, 3, 'in4', 3, 9.9d-1, 7.8d0, 'in5', 3,
      +1.1d1, 2.2d-2, 'in6', 3, 1.96d0, 0d0)
-      CALL CHKOK2(ne, 68, 1, d)
+      CALL CHKOK2(ne, 100, 1, d)
 
       l = flen
       CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3),
      +p(4), fields(3), l, p(5), p(6), n, d, 'new2', 4)
-      CALL CHKOK2(ne, 68, 2, d)
-      CALL CHKIN2(ne, 68, 3, l, flen)
-      CALL CHKIN2(ne, 68, 4, i, 3)
-      CALL CHKIN2(ne, 68, 5, n, 0)
-      CALL CHKST2(ne, 68, 6, fields(1), 'in4')
-      CALL CHKST2(ne, 68, 7, fields(2), 'in5')
-      CALL CHKST2(ne, 68, 8, fields(3), 'in6')
+      CALL CHKOK2(ne, 100, 2, d)
+      CALL CHKIN2(ne, 100, 3, l, flen)
+      CALL CHKIN2(ne, 100, 4, i, 3)
+      CALL CHKIN2(ne, 100, 5, n, 0)
+      CALL CHKST2(ne, 100, 6, fields(1), 'in4')
+      CALL CHKST2(ne, 100, 7, fields(2), 'in5')
+      CALL CHKST2(ne, 100, 8, fields(3), 'in6')
 
       q(1) = 9.9d-1
       q(2) = 7.8d0
@@ -1101,345 +1109,378 @@ C     68: GDALLC check
       q(4) = 2.2d-2
       q(5) = 1.96d0
       q(6) = 0d0
-      DO 680 i=1,6
-      CALL CHKDB2(ne, 68, i, p(i), q(i))
-  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)
+      DO 1000 i=1,6
+      CALL CHKDB2(ne, 100, i, p(i), q(i))
+ 1000 CONTINUE
+
+C     101: GDALCL check
+      cq(1) = dcmplx(0.1d0, 0.2d0)
+      cq(2) = dcmplx(0.3d0, 0.4d0)
+      cq(3) = dcmplx(0.4d0, 0.5d0)
+      cq(4) = dcmplx(0.6d0, 0.7d0)
       CALL GDALCL(d, 'new3', 4, 2, 'in4', 3, cq(1), cq(2), 'in3', 3,
      +cq(3), cq(4), '', 0, cq(5), cq(6))
-      CALL CHKOK2(ne, 69, 1, d)
+      CALL CHKOK2(ne, 101, 1, d)
 
       l = flen
       CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3),
      +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new3', 4)
-      CALL CHKOK2(ne, 69, 2, d)
-      CALL CHKIN2(ne, 69, 1, l, flen)
-      CALL CHKIN2(ne, 69, 2, i, 2)
-      CALL CHKIN2(ne, 69, 3, n, 0)
-      CALL CHKST2(ne, 69, 4, fields(1), 'in4')
-      CALL CHKST2(ne, 69, 5, fields(2), 'in3')
-
-      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
-      CALL CHKCP2(ne, 69, i, cp(i), cq(i))
-  690 CONTINUE
-
-C     70: GDALPN check
+      CALL CHKOK2(ne, 101, 2, d)
+      CALL CHKIN2(ne, 101, 1, l, flen)
+      CALL CHKIN2(ne, 101, 2, i, 2)
+      CALL CHKIN2(ne, 101, 3, n, 0)
+      CALL CHKST2(ne, 101, 4, fields(1), 'in4')
+      CALL CHKST2(ne, 101, 5, fields(2), 'in3')
+
+      cq(1) = dcmplx(0.1d0, 0.2d0)
+      cq(2) = dcmplx(0.3d0, 0.4d0)
+      cq(3) = dcmplx(0.4d0, 0.5d0)
+      cq(4) = dcmplx(0.6d0, 0.7d0)
+      DO 1010 i=1,4
+      CALL CHKCP2(ne, 101, i, cp(i), cq(i))
+ 1010 CONTINUE
+
+C     102: GDALPN check
       CALL GDALPN(d, 'new4', 4, 4, 'in1', 3, 3d0, 4d0, 5d0, 6d0, 7d0,
      +0d0)
-      CALL CHKOK2(ne, 70, 1, d)
+      CALL CHKOK2(ne, 102, 1, d)
 
       l = flen
       CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
      +n, d, 'new4', 4)
-      CALL CHKOK2(ne, 70, 2, d)
-      CALL CHKIN2(ne, 70, 1, l, flen)
-      CALL CHKIN2(ne, 70, 2, i, 4)
-      CALL CHKIN2(ne, 70, 3, n, 0)
-      CALL CHKST2(ne, 70, 4, fn, 'in1')
-
-      DO 700 i=1,5
-      CALL CHKDB2(ne, 70, i, p(i), 2d0 + i)
-  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 CHKOK2(ne, 102, 2, d)
+      CALL CHKIN2(ne, 102, 1, l, flen)
+      CALL CHKIN2(ne, 102, 2, i, 4)
+      CALL CHKIN2(ne, 102, 3, n, 0)
+      CALL CHKST2(ne, 102, 4, fn, 'in1')
+
+      DO 1020 i=1,5
+      CALL CHKDB2(ne, 102, i, p(i), 2d0 + i)
+ 1020 CONTINUE
+
+C     103: GDALCP check
+      cq(1) = dcmplx(1.1d0, 5.0d0)
+      cq(2) = dcmplx(1.2d0, 4.0d0)
+      cq(3) = dcmplx(1.2d0, 3.0d0)
+      cq(4) = dcmplx(1.3d0, 2.4d0)
       CALL GDALCP(d, 'new5', 4, 3, 'in1', 3, cq(1), cq(2), cq(3), cq(4),
      +cq(5), cq(6))
-      CALL CHKOK2(ne, 71, 1, d)
+      CALL CHKOK2(ne, 103, 1, d)
 
       l = flen
       CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
      +n, d, 'new5', 4)
-      CALL CHKOK2(ne, 71, 2, d)
-      CALL CHKIN2(ne, 71, 1, l, flen)
-      CALL CHKIN2(ne, 71, 2, i, 3)
-      CALL CHKIN2(ne, 71, 3, n, 0)
-      CALL CHKST2(ne, 71, 4, fn, 'in1')
-
-      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
-      CALL CHKCP2(ne, 71, i, cp(i), cq(i))
-  710 CONTINUE
-
-C     72: GDALLT check
+      CALL CHKOK2(ne, 103, 2, d)
+      CALL CHKIN2(ne, 103, 1, l, flen)
+      CALL CHKIN2(ne, 103, 2, i, 3)
+      CALL CHKIN2(ne, 103, 3, n, 0)
+      CALL CHKST2(ne, 103, 4, fn, 'in1')
+
+      cq(1) = dcmplx(1.1d0, 5.0d0)
+      cq(2) = dcmplx(1.2d0, 4.0d0)
+      cq(3) = dcmplx(1.2d0, 3.0d0)
+      cq(4) = dcmplx(1.3d0, 2.4d0)
+      DO 1030 i=1,4
+      CALL CHKCP2(ne, 103, i, cp(i), cq(i))
+ 1030 CONTINUE
+
+C     104: GDALLT check
       CALL GDALLT(d, "new6", 4, "in3", 3, "./other/table", 13, 0)
-      CALL CHKOK2(ne, 72, 1, d)
+      CALL CHKOK2(ne, 104, 1, d)
 
       l = flen
       CALL GDGELT(fn, l, str, slen, n, d, 'new6', 4)
-      CALL CHKOK2(ne, 72, 2, d)
-      CALL CHKIN2(ne, 72, 1, l, flen)
-      CALL CHKIN2(ne, 72, 2, n, 0)
-      CALL CHKST2(ne, 72, 3, fn, 'in3')
-      CALL CHKST2(ne, 73, 4, str, './other/table')
+      CALL CHKOK2(ne, 104, 2, d)
+      CALL CHKIN2(ne, 104, 1, l, flen)
+      CALL CHKIN2(ne, 104, 2, n, 0)
+      CALL CHKST2(ne, 104, 3, fn, 'in3')
+      CALL CHKST2(ne, 104, 4, str, './other/table')
 
-C     73: GDALBT check
+C     105: GDALBT check
       CALL GDALBT(d, "new7", 4, "in3", 3, 3, 2)
-      CALL CHKOK2(ne, 73, 1, d)
+      CALL CHKOK2(ne, 105, 1, d)
 
       l = flen
       CALL GDGEBT(fn, l, m, i, n, d, 'new7', 4)
-      CALL CHKOK2(ne, 73, 2, d)
-      CALL CHKIN2(ne, 73, 1, l, flen)
-      CALL CHKIN2(ne, 73, 2, n, 0)
-      CALL CHKIN2(ne, 73, 3, i, 2)
-      CALL CHKIN2(ne, 73, 4, m, 3)
-      CALL CHKST2(ne, 73, 5, fn, 'in3')
-
-C     74: GDALSB check
+      CALL CHKOK2(ne, 105, 2, d)
+      CALL CHKIN2(ne, 105, 1, l, flen)
+      CALL CHKIN2(ne, 105, 2, n, 0)
+      CALL CHKIN2(ne, 105, 3, i, 2)
+      CALL CHKIN2(ne, 105, 4, m, 3)
+      CALL CHKST2(ne, 105, 5, fn, 'in3')
+
+C     106: GDALSB check
       CALL GDALSB(d, "new8", 4, "out", 3, 1, 22)
-      CALL CHKOK2(ne, 74, 1, d)
+      CALL CHKOK2(ne, 106, 1, d)
 
       l = flen
       CALL GDGESB(fn, l, m, i, n, d, 'new8', 4)
-      CALL CHKOK2(ne, 74, 2, d)
-      CALL CHKIN2(ne, 74, 1, l, flen)
-      CALL CHKIN2(ne, 74, 2, n, 0)
-      CALL CHKIN2(ne, 74, 3, i, 22)
-      CALL CHKIN2(ne, 74, 4, m, 1)
-      CALL CHKST2(ne, 74, 5, fn, 'out')
-
-C     75: GDALMT check
+      CALL CHKOK2(ne, 106, 2, d)
+      CALL CHKIN2(ne, 106, 1, l, flen)
+      CALL CHKIN2(ne, 106, 2, n, 0)
+      CALL CHKIN2(ne, 106, 3, i, 22)
+      CALL CHKIN2(ne, 106, 4, m, 1)
+      CALL CHKST2(ne, 106, 5, fn, 'out')
+
+C     107: GDALMT check
       CALL GDALMT(d, 'new9', 4, 'in6', 3, 'in4', 3)
-      CALL CHKOK2(ne, 75, 1, d)
+      CALL CHKOK2(ne, 107, 1, d)
 
       l = flen
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
-      CALL CHKOK2(ne, 75, 2, d)
-      CALL CHKIN2(ne, 75, 1, l, flen)
-      CALL CHKIN2(ne, 75, 2, n, 0)
-      CALL CHKST2(ne, 75, 3, fields(1), 'in6')
-      CALL CHKST2(ne, 75, 4, fields(2), 'in4')
+      CALL CHKOK2(ne, 107, 2, d)
+      CALL CHKIN2(ne, 107, 1, l, flen)
+      CALL CHKIN2(ne, 107, 2, n, 0)
+      CALL CHKST2(ne, 107, 3, fields(1), 'in6')
+      CALL CHKST2(ne, 107, 4, fields(2), 'in4')
 
-C     76: GDALPH check
+C     108: GDALPH check
       CALL GDALPH(d, 'new10', 5, 'in2', 3, 8)
-      CALL CHKOK2(ne, 76, 1, d)
+      CALL CHKOK2(ne, 108, 1, d)
 
       l = flen
       CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
-      CALL CHKOK2(ne, 76, 2, d)
-      CALL CHKIN2(ne, 76, 1, l, flen)
-      CALL CHKIN2(ne, 76, 2, n, 0)
-      CALL CHKIN2(ne, 76, 3, i, 8)
-      CALL CHKST2(ne, 76, 4, fn, 'in2')
+      CALL CHKOK2(ne, 108, 2, d)
+      CALL CHKIN2(ne, 108, 1, l, flen)
+      CALL CHKIN2(ne, 108, 2, n, 0)
+      CALL CHKIN2(ne, 108, 3, i, 8)
+      CALL CHKST2(ne, 108, 4, fn, 'in2')
 
-C     77: GDALCO check
+C     109: GDALCO check
       CALL GDALCO(d, 'new11', 5, GD_F32)
-      CALL CHKOK2(ne, 77, 2, d)
+      CALL CHKOK2(ne, 109, 2, d)
 
       CALL GDGECO(i, n, d, 'new11', 5)
-      CALL CHKOK2(ne, 77, 2, d)
-      CALL CHKIN2(ne, 77, 1, l, flen)
-      CALL CHKIN2(ne, 77, 2, n, 0)
-      CALL CHKIN2(ne, 77, 3, i, GD_F32)
+      CALL CHKOK2(ne, 109, 2, d)
+      CALL CHKIN2(ne, 109, 1, l, flen)
+      CALL CHKIN2(ne, 109, 2, n, 0)
+      CALL CHKIN2(ne, 109, 3, i, GD_F32)
 
       CALL GDGTCO(d, 'new11', 5, GD_F32, fl)
-      CALL CHKOK2(ne, 77, 3, d)
-      CALL CHKDBL(ne, 77, 1d0 * fl, -8.1d0)
+      CALL CHKOK2(ne, 109, 3, d)
+      CALL CHKDBL(ne, 109, 1d0 * fl, 1d0 * (-8.1))
 
-C     78: GDGENC check
+C     110: GDGENC check
       CALL GDGENC(n, d, 0)
-      CALL CHKEOK(ne, 78, d)
-      CALL CHKINT(ne, 78, n, GDE_UN)
+      CALL CHKEOK(ne, 110, d)
+      CALL CHKINT(ne, 110, n, GDE_UN)
 
-C     79: GDGEND check
+C     111: GDGEND check
       CALL GDGEND(n, d, 0)
-      CALL CHKEOK(ne, 79, d)
-      CALL CHKINT(ne, 79, n, GD_LE + GD_NA)
+      CALL CHKEOK(ne, 111, d)
+      CALL CHKINT(ne, 111, n, GD_LE + GD_NA)
 
-C     80: GDNAME check
+C     112: GDNAME check
       l = plen
       CALL GDNAME(path, l, d, 0)
-      CALL CHKEOK(ne, 80, d)
-      CALL CHKINT(ne, 80, l, plen)
-      CALL CHKEOS(ne, 80, path, fildir)
+      CALL CHKEOK(ne, 112, d)
+      CALL CHKINT(ne, 112, l, plen)
+      CALL CHKEOS(ne, 112, path, fildir)
 
-C     81: GDPFRG check
+C     113: GDPFRG check
       CALL GDPFRG(n, d, 1)
-      CALL CHKEOK(ne, 81, d)
-      CALL CHKINT(ne, 81, n, 0)
+      CALL CHKEOK(ne, 113, d)
+      CALL CHKINT(ne, 113, n, 0)
 
-C     82: GDAPRT check
+C     114: GDAPRT check
       CALL GDAPRT(d, GDPR_D, 1)
-      CALL CHKEOK(ne, 82, d)
+      CALL CHKEOK(ne, 114, d)
 
-C     83: GDGPRT check
+C     115: GDGPRT check
       CALL GDGPRT(n, d, 1)
-      CALL CHKEOK(ne, 83, d)
-      CALL CHKINT(ne, 83, n, GDPR_D)
+      CALL CHKEOK(ne, 115, d)
+      CALL CHKINT(ne, 115, n, GDPR_D)
 
-C     84: GDRWFN check
+C     116: GDRWFN check
       l = plen
       CALL GDRWFN(path, l, d, "data", 4)
-      CALL CHKEOK(ne, 84, d)
-      CALL CHKINT(ne, 84, l, plen)
-      CALL CHKEOS(ne, 84, path, fildir//DIRSEP//'data')
+      CALL CHKEOK(ne, 116, d)
+      CALL CHKINT(ne, 116, l, plen)
+      CALL CHKEOS(ne, 116, path, fildir//DIRSEP//'data')
 
-C     85: GDREFE check
+C     117: GDREFE check
       l = slen
       CALL GDREFE(str, l, d, "new1", 4)
-      CALL CHKEOK(ne, 85, d)
-      CALL CHKINT(ne, 85, l, slen)
-      CALL CHKSTR(ne, 85, str, 'new1')
+      CALL CHKEOK(ne, 117, d)
+      CALL CHKINT(ne, 117, l, slen)
+      CALL CHKSTR(ne, 117, str, 'new1')
+
+C     118: GDGEOF check
+      CALL GDGEOF(n, d, 'lincom', 6)
+      CALL CHKEOK(ne, 118, d)
+      CALL CHKINT(ne, 118, n, 80)
 
-C     87: GDAENC check
+C     119: GDAENC check
       CALL GDAENC(d, GDE_TX, 1, 0)
-      CALL CHKOK2(ne, 87, 1, d)
+      CALL CHKOK2(ne, 119, 1, d)
 
       CALL GDGENC(n, d, 1)
-      CALL CHKOK2(ne, 87, 2, d)
-      CALL CHKINT(ne, 87, n, GDE_TX)
+      CALL CHKOK2(ne, 119, 2, d)
+      CALL CHKINT(ne, 119, n, GDE_TX)
 
-C     88: GDAEND check
+C     120: GDAEND check
       CALL GDAEND(d, GD_BE, 1, 0)
-      CALL CHKOK2(ne, 88, 1, d)
+      CALL CHKOK2(ne, 120, 1, d)
 
       CALL GDGEND(n, d, 1)
-      CALL CHKOK2(ne, 88, 2, d)
-      CALL CHKINT(ne, 88, n, GD_BE)
+      CALL CHKOK2(ne, 120, 2, d)
+      CALL CHKINT(ne, 120, n, GD_BE)
 
-C     89: GDALSP check
+C     121: GDALSP check
       CALL GDALSP(d, 'new10 PHASE in1 3', 17, 0)
-      CALL CHKOK2(ne, 89, 1, d)
+      CALL CHKOK2(ne, 121, 1, d)
 
       l = flen
       CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
-      CALL CHKOK2(ne, 89, 2, d)
-      CALL CHKIN2(ne, 89, 1, l, flen)
-      CALL CHKIN2(ne, 89, 2, n, 0)
-      CALL CHKIN2(ne, 89, 3, i, 3)
-      CALL CHKST2(ne, 89, 4, fn, 'in1')
+      CALL CHKOK2(ne, 121, 2, d)
+      CALL CHKIN2(ne, 121, 1, l, flen)
+      CALL CHKIN2(ne, 121, 2, n, 0)
+      CALL CHKIN2(ne, 121, 3, i, 3)
+      CALL CHKST2(ne, 121, 4, fn, 'in1')
 
-C     90: GDDELE check
+C     122: GDDELE check
       CALL GDDELE(d, 'new10', 5, 0)
-      CALL CHKOK2(ne, 90, 1, d)
+      CALL CHKOK2(ne, 122, 1, d)
 
       l = flen
       CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
-      CALL CHKER2(ne, 90, 2, d, GD_EBC)
+      CALL CHKER2(ne, 122, 2, d, GD_EBC)
 
-C     91: GDMLSP check
+C     123: GDMLSP check
       CALL GDMLSP(d, 'mnew10 PHASE in4 11', 19, 'data', 4, 0)
-      CALL CHKOK2(ne, 91, 1, d)
+      CALL CHKOK2(ne, 123, 1, d)
 
       l = flen
       CALL GDGEPH(fn, l, i, n, d, 'data/mnew10', 11)
-      CALL CHKOK2(ne, 91, 2, d)
-      CALL CHKIN2(ne, 91, 1, l, flen)
-      CALL CHKIN2(ne, 91, 2, n, 0)
-      CALL CHKIN2(ne, 91, 3, i, 11)
-      CALL CHKST2(ne, 91, 4, fn, 'in4')
+      CALL CHKOK2(ne, 123, 2, d)
+      CALL CHKIN2(ne, 123, 1, l, flen)
+      CALL CHKIN2(ne, 123, 2, n, 0)
+      CALL CHKIN2(ne, 123, 3, i, 11)
+      CALL CHKST2(ne, 123, 4, fn, 'in4')
 
-C     92: GDMOVE check
+C     124: GDMOVE check
       CALL GDMOVE(d, 'new9', 4, 1, 0)
-      CALL CHKOK2(ne, 92, 1, d)
+      CALL CHKOK2(ne, 124, 1, d)
 
       l = flen
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
-      CALL CHKOK2(ne, 92, 2, d)
-      CALL CHKIN2(ne, 92, 1, l, flen)
-      CALL CHKIN2(ne, 92, 2, n, 1)
-      CALL CHKST2(ne, 92, 3, fields(1), 'in6')
-      CALL CHKST2(ne, 92, 4, fields(2), 'in4')
+      CALL CHKOK2(ne, 124, 2, d)
+      CALL CHKIN2(ne, 124, 1, l, flen)
+      CALL CHKIN2(ne, 124, 2, n, 1)
+      CALL CHKST2(ne, 124, 3, fields(1), 'in6')
+      CALL CHKST2(ne, 124, 4, fields(2), 'in4')
 
-C     93: GDRENM check
+C     125: GDRENM check
       CALL GDRENM(d, 'new9', 4, 'newer', 5, 0)
-      CALL CHKOK2(ne, 93, 1, d)
+      CALL CHKOK2(ne, 125, 1, d)
 
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
-      CALL CHKER2(ne, 93, 2, d, GD_EBC)
+      CALL CHKER2(ne, 125, 2, d, GD_EBC)
 
       l = flen
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'newer', 5)
-      CALL CHKOK2(ne, 93, 3, d)
-      CALL CHKIN2(ne, 93, 1, l, flen)
-      CALL CHKIN2(ne, 93, 2, n, 1)
-      CALL CHKST2(ne, 93, 3, fields(1), 'in6')
-      CALL CHKST2(ne, 93, 4, fields(2), 'in4')
+      CALL CHKOK2(ne, 125, 3, d)
+      CALL CHKIN2(ne, 125, 1, l, flen)
+      CALL CHKIN2(ne, 125, 2, n, 1)
+      CALL CHKST2(ne, 125, 3, fields(1), 'in6')
+      CALL CHKST2(ne, 125, 4, fields(2), 'in4')
 
-C     94: GDUINC check
+C     126: GDUINC check
       CALL GDUINC(d, 1, 0)
-      CALL CHKOK2(ne, 94, 1, d)
+      CALL CHKOK2(ne, 126, 1, d)
 
       CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'newer', 5)
-      CALL CHKER2(ne, 94, 2, d, GD_EBC)
+      CALL CHKER2(ne, 126, 2, d, GD_EBC)
 
-C     95: GDGFOF check
+C     127: GDGFOF check
       CALL GDGFOF(n, d, 0)
-      CALL CHKEOK(ne, 95, d)
-      CALL CHKINT(ne, 95, n, 0)
+      CALL CHKEOK(ne, 127, d)
+      CALL CHKINT(ne, 127, n, 0)
 
-C     96: GDAFOF check
+C     128: GDAFOF check
       CALL GDAFOF(d, 33, 0, 0)
-      CALL CHKOK2(ne, 96, 1, d)
+      CALL CHKOK2(ne, 128, 1, d)
 
       CALL GDGFOF(n, d, 0)
-      CALL CHKOK2(ne, 96, 2, d)
-      CALL CHKINT(ne, 96, n, 33)
+      CALL CHKOK2(ne, 128, 2, d)
+      CALL CHKINT(ne, 128, n, 33)
 
-C     97: GDNTYP check
+C     129: GDNTYP check
       CALL GDNTYP(n, d, 'data', 4)
-      CALL CHKEOK(ne, 97, d)
-      CALL CHKINT(ne, 97, n, GD_I8)
+      CALL CHKEOK(ne, 129, d)
+      CALL CHKINT(ne, 129, n, GD_I8)
 
-C     98: GDCSCL check
-      CALL GDCSCL(n, d, 'polynom', 7)
-      CALL CHKEOK(ne, 98, d)
-      CALL CHKINT(ne, 98, n, 1)
+C     130: GDENFL check
+      CALL GDENFL(n, d, 'polynom', 7)
+      CALL CHKEOK(ne, 130, d)
+      CALL CHKINT(ne, 130, n, GDE_CS + GDE_CA)
 
-C     99: GDVLDT check
+C     131: GDVLDT check
       CALL GDVLDT(n, d, 'new7', 4)
-      CALL CHKERR(ne, 99, d, GD_EBC)
-      CALL CHKINT(ne, 99, n, -1)
+      CALL CHKERR(ne, 131, d, GD_EBC)
+      CALL CHKINT(ne, 131, n, -1)
 
-C     100: GDFNUM check
+C     132: GDFNUM check
       l = slen
       CALL GDREFE(str, l, d, "data", 4)
       CALL GDFNUM(dp, d, 'INDEX', 5, 33.3d0)
-      CALL CHKEOK(ne, 100, d)
-      CALL CHKDBL(ne, 100, dp, 33.3D0)
+      CALL CHKEOK(ne, 132, d)
+      CALL CHKDBL(ne, 132, dp, 33.3D0)
 
-C     101: GDFNSS check
+C     133: GDFNSS check
       CALL GDFNSS(dp, d, 'data', 4, 33.3d0, 6, 0)
-      CALL CHKEOK(ne, 101, d)
-      CALL CHKDBL(ne, 101, dp, 37.0375D0)
+      CALL CHKEOK(ne, 133, d)
+      CALL CHKDBL(ne, 133, dp, 37.0375D0)
 
-C     138: GDGSCA check
+C     134: GDGSCA check
       l = slen
       CALL GDGSCA(str, l, n, d, 'lincom', 6, 6)
-      CALL CHKEOK(ne, 138, d)
-      CALL CHKINT(ne, 138, n, -1)
-      CALL CHKSTR(ne, 138, str, "const")
+      CALL CHKEOK(ne, 134, d)
+      CALL CHKINT(ne, 134, n, -1)
+      CALL CHKSTR(ne, 134, str, "const")
 
-C     139: GDASCA check
+C     135: GDASRW check
+      CALL GDASRW(d, 'new135', 6, GD_F32, 0, 'carray', 6, 2, 0)
+      CALL CHKOK2(ne, 135, 1, d)
+
+      CALL GDGERW(l, i, n, d, 'new135', 6)
+      CALL CHKOK2(ne, 135, 2, d)
+      CALL CHKIN2(ne, 135, 3, n, 0)
+      CALL CHKIN2(ne, 135, 4, l, 2)
+      CALL CHKIN2(ne, 135, 5, i, GD_F32)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new135', 6, 1)
+      CALL CHKOK2(ne, 135, 6, d)
+      CALL CHKST2(ne, 135, 7, str, "carray")
+      CALL CHKIN2(ne, 135, 8, n, 2)
+
+C     140: GDASCA check
       CALL GDASCA(d, 'lincom', 6, 6, 'new11', 5, -1, 0)
-      CALL CHKOK2(ne, 139, 1, d)
+      CALL CHKOK2(ne, 140, 1, d)
 
       l = slen
       CALL GDGSCA(str, l, n, d, 'lincom', 6, 6)
-      CALL CHKOK2(ne, 139, 2, d)
-      CALL CHKINT(ne, 139, n, -1)
-      CALL CHKSTR(ne, 139, str, "new11")
+      CALL CHKOK2(ne, 140, 2, d)
+      CALL CHKINT(ne, 140, n, -1)
+      CALL CHKSTR(ne, 140, str, "new11")
+
+C     141: GDLSRW check
+      CALL GDLSRW(d, 'new135', 6, GD_F64, 0, 'const', 5, -1, 0)
+      CALL CHKOK2(d, 141, 1, d)
+
+      CALL GDGERW(l, i, n, d, 'new135', 6)
+      CALL CHKOK2(ne, 135, 2, d)
+      CALL CHKIN2(ne, 135, 3, n, 0)
+      CALL CHKIN2(ne, 135, 4, l, 10)
+      CALL CHKIN2(ne, 135, 5, i, GD_F64)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new135', 6, 1)
+      CALL CHKOK2(ne, 135, 6, d)
+      CALL CHKST2(ne, 135, 7, str, "const")
+      CALL CHKIN2(ne, 135, 8, n, -1)
 
-C     86: GDGEOF check
-      CALL GDGEOF(n, d, 'lincom', 6)
-      CALL CHKEOK(ne, 86, d)
-      CALL CHKINT(ne, 86, n, 344)
 
 C     142: GDGBOF check
       CALL GDGBOF(n, d, 'lincom', 6)
@@ -1471,7 +1512,7 @@ C     145: GDGECR check
       CALL CHKIN2(ne, 145, 1, l, flen)
       CALL CHKIN2(ne, 145, 2, n, 0)
       CALL CHKST2(ne, 145, 3, fields(1), 'div')
-      CALL CHKCP2(ne, 145, 4, dc, dcmplx(6.5, 4.3))
+      CALL CHKCP2(ne, 145, 4, dc, dcmplx(6.5d0, 4.3d0))
 
 C     146: GDADDV check
       CALL GDADDV(d, 'new14', 5, 'in1', 3, 'in2', 3, 0)
@@ -1499,7 +1540,7 @@ C     147: GDADRC check
       CALL CHKDB2(ne, 147, 4, dp, p(1))
 
 C     148: GDADCR check
-      cp(1) = cmplx(31.9, 38.2)
+      cp(1) = dcmplx(31.9d0, 38.2d0)
       CALL GDADCR(d, 'new16', 5, 'in1', 3, cp(1), 0)
       CALL CHKOK2(ne, 148, 1, d)
 
@@ -1537,7 +1578,7 @@ C     150: GDMDRC check
       CALL CHKDB2(ne, 150, 4, dp, p(1))
 
 C     151: GDADCR check
-      cp(1) = cmplx(8.47, 6.22)
+      cp(1) = dcmplx(8.47d0, 6.22d0)
       CALL GDMDCR(d,'data', 4,  'new16', 5, 'in3', 3, cp(1))
       CALL CHKOK2(ne, 151, 1, d)
 
@@ -1575,7 +1616,7 @@ C     153: GDALRC check
       CALL CHKDB2(ne, 153, 4, dp, p(1))
 
 C     154: GDALCR check
-      cp(1) = cmplx(4.3, 81.81)
+      cp(1) = dcmplx(4.3d0, 81.81d0)
       CALL GDALCR(d, 'new16', 5, 'in6', 3, cp(1))
       CALL CHKOK2(ne, 154, 1, d)
 
@@ -1604,7 +1645,7 @@ C     157: GDSTDV check
       n = GDSV_C
       CALL GDSTDV(n, d)
       CALL CHKOK2(ne, 157, 1, d)
-      CALL CHKINT(ne, 157, n, 9)
+      CALL CHKINT(ne, 157, n, GD_DSV)
 
       n = 0
       CALL GDSTDV(n, d)
@@ -1627,12 +1668,12 @@ C     159: GDGCAS check
  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
+      p(1) = 9.6d0
+      p(2) = 8.5d0
+      p(3) = 7.4d0
+      p(4) = 6.3d0
+      p(5) = 5.2d0
+      p(6) = 4.1d0
       CALL GDPTCA(d, 'carray', 6, GD_F64, p)
       CALL CHKOK2(ne, 168, 1, d)
 
@@ -1644,12 +1685,12 @@ C     168: GDPTCA check
  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
+      p(1) = 5.5d0
+      p(2) = 5.6d0
+      p(3) = 5.7d0
+      p(4) = 5.8d0
+      p(5) = 5.9d0
+      p(6) = 6.0d0
       CALL GDPCAS(d, 'carray', 6, 3, 2, GD_F64, p)
       CALL CHKOK2(ne, 169, 1, d)
 
@@ -1658,15 +1699,15 @@ C     169: GDGCAS check
 
       DO 1690 i=1,6
       IF (i .eq. 3 .or. i .eq. 4) THEN
-        dp = 5.2 + 0.1 * i
+        dp = 5.2d0 + 0.1d0 * i
       ELSE
-        dp = 10.7 - 1.1 * i
+        dp = 10.7d0 - 1.1d0 * i
       ENDIF
       CALL CHKDB2(ne, 169, i, q(i), dp)
  1690 CONTINUE
 
-C     177: GDCALN check
-      CALL GDCALN(n, d, 'carray', 6)
+C     177: GDARLN check
+      CALL GDARLN(n, d, 'carray', 6)
       CALL CHKEOK(ne, 177, d)
       CALL CHKINT(ne, 177, n, 6)
 
@@ -1678,10 +1719,10 @@ C     178: GDGECA check
       CALL CHKIN2(ne, 178, 3, i, GD_F64)
 
 C     179: GDADCA check
-      p(1) = 1.2
-      p(2) = 3.4
-      p(3) = 5.6
-      p(4) = 7.8
+      p(1) = 1.2d0
+      p(2) = 3.4d0
+      p(3) = 5.6d0
+      p(4) = 7.8d0
       CALL GDADCA(d, 'new17', 5, GD_F64, 4, GD_F64, p, 0)
       CALL CHKOK2(ne, 179, 1, d)
 
@@ -1699,10 +1740,10 @@ C     179: GDADCA check
  1790 CONTINUE
 
 C     180: GDMDCA check
-      p(1) = 3.2
-      p(2) = 5.4
-      p(3) = 7.6
-      p(4) = 9.8
+      p(1) = 3.2d0
+      p(2) = 5.4d0
+      p(3) = 7.6d0
+      p(4) = 9.8d0
       CALL GDMDCA(d, 'data', 4, 'new17', 5, GD_F64, 4, GD_F64, p)
       CALL CHKOK2(ne, 180, 1, d)
 
@@ -1730,7 +1771,7 @@ C     181: GDALCA check
       CALL CHKIN2(ne, 181, 3, l, 3)
 
 C     183: GDCONS check
-      p(1) = 10.0
+      p(1) = 10.0d0
       p(2) = -8.1
       CALL GDNFDT(n, d, GD_COE)
 
@@ -1742,8 +1783,8 @@ C     183: GDCONS check
  1830 CONTINUE
 
 C     191: GDMCOS check
-      p(1) = 3.3
-      p(2) = -8.1
+      p(1) = 3.3d0
+      p(2) = -8.1 * 1d0
       CALL GDNMFT(n, d, "data", 4, GD_COE)
 
       DO 1910 i = 1, n
@@ -1956,22 +1997,6 @@ C     223: GDINCA check
       CALL GDINCA(d, 'format1', 7, 0, 'A', 1, 'Z', 1, GD_CR + GD_EX)
       CALL CHKEOK(ne, 223, d)
 
-C     224: GDMOVA check
-      CALL GDMOVA(d, 'new20', 5, 1)
-      CALL CHKOK2(ne, 224, 1, d)
-
-      CALL GDFRGI(n, d, 'Anew20Z', 7)
-      CALL CHKOK2(ne, 224, 2, d)
-      CALL CHKINT(ne, 224, n, 1)
-
-C     225: GDDELA check
-      CALL GDDELA(d, 'Anew20Z', 7, 0)
-      CALL CHKOK2(ne, 225, 1, d)
-
-      CALL GDFRGI(n, d, 'Anew20Z', 7)
-      CALL CHKER2(ne, 225, 2, d, GD_EBC)
-      CALL CHKINT(ne, 225, n, -1)
-
 C     226: GDFRAF check
       l = flen
       n = flen
@@ -2059,7 +2084,8 @@ C     231: GDALMX check
 
 C     232: GDTOKE check
       l = slen
-      CALL GDTOKE(str, l, d, '"test1 test2" test3\ test4 test5', 32)
+      CALL GDTOKE(str, l, d,
+     +'"test1 test2" test3' // backslash // ' test4 test5', 32)
       CALL CHKOK2(ne, 232, 1, d)
       CALL CHKIN2(ne, 232, 2, l, slen)
       CALL CHKST2(ne, 232, 3, str, 'test1 test2')
@@ -2094,7 +2120,7 @@ C     237: GDNENT check
       CALL CHKIN2(ne, 237, 1, n, 5)
       CALL GDNENT(n, d, "", -1, GDEN_V, GDEN_H + GDEN_N)
       CALL CHKOK2(ne, 237, 2, d)
-      CALL CHKIN2(ne, 237, 2, n, 26)
+      CALL CHKIN2(ne, 237, 2, n, 27)
 
 C     238: GDENTX check
       CALL GDENTX(l, d, "", -1, GDEN_V, GDEN_H + GDEN_N)
@@ -2102,32 +2128,33 @@ C     238: GDENTX check
       CALL CHKINT(ne, 238, l, 7)
 
 C     239: GDENTN check
-      fields(1)  = "INDEX"
-      fields(2)  = "bit"
-      fields(3)  = "data"
-      fields(4)  = "div"
-      fields(5)  = "lincom"
-      fields(6)  = "linterp"
-      fields(7)  = "mplex"
-      fields(8)  = "mult"
-      fields(9)  = "new1"
-      fields(10) = "new14"
-      fields(11) = "new15"
-      fields(12) = "new16"
-      fields(13) = "new18"
-      fields(14) = "new2"
-      fields(15) = "new21"
-      fields(16) = "new3"
-      fields(17) = "new4"
-      fields(18) = "new5"
-      fields(19) = "new6"
-      fields(20) = "new7"
-      fields(21) = "new8"
-      fields(22) = "phase"
-      fields(23) = "polynom"
-      fields(24) = "recip"
-      fields(25) = "sbit"
-      fields(26) = "window"
+      fields( 1) = "INDEX"
+      fields( 2) = "bit"
+      fields( 3) = "data"
+      fields( 4) = "div"
+      fields( 5) = "lincom"
+      fields( 6) = "linterp"
+      fields( 7) = "mplex"
+      fields( 8) = "mult"
+      fields( 9) = "new1"
+      fields(10) = "new135"
+      fields(11) = "new14"
+      fields(12) = "new15"
+      fields(13) = "new16"
+      fields(14) = "new18"
+      fields(15) = "new2"
+      fields(16) = "new21"
+      fields(17) = "new3"
+      fields(18) = "new4"
+      fields(19) = "new5"
+      fields(20) = "new6"
+      fields(21) = "new7"
+      fields(22) = "new8"
+      fields(23) = "phase"
+      fields(24) = "polynom"
+      fields(25) = "recip"
+      fields(26) = "sbit"
+      fields(27) = "window"
       DO 2390 i = 1, n
       l = flen
       CALL GDENTN(fn, l, d, "", -1, GDEN_V, GDEN_H + GDEN_N, i)
@@ -2147,15 +2174,814 @@ C     241: GDLTTN check
       CALL CHKINT(ne, 241, l, plen)
       CALL CHKEOS(ne, 241, path, fildir//DIRSEP//'lut')
 
-C     243: NULL return from gd_reference
+C     243: GDASLC check
+      CALL GDASLC(d, 'new243', 6, 3,
+     +'in1', 3, 1.1d0,      '', -1, -1, 0d0, 'carray', 6, 3,
+     +'in2', 3,   0d0, 'const',  5, -1, 0d0, 'carray', 6, 4,
+     +'in3', 3, 1.4d0,      '', -1, -1, 0d0, 'carray', 6, 5, 0)
+      CALL CHKOK2(ne, 243, 1, d)
+
+      CALL GDENFL(n, d, 'new243', 6)
+      CALL CHKOK2(ne, 243, 2, d)
+      CALL CHKIN2(ne, 243, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3),
+     +p(4), fields(3), l, p(5), p(6), n, d, 'new243', 6)
+      CALL CHKOK2(ne, 243,  4, d)
+      CALL CHKIN2(ne, 243,  5, l, flen)
+      CALL CHKIN2(ne, 243,  6, i, 3)
+      CALL CHKIN2(ne, 243,  7, n, 0)
+      CALL CHKST2(ne, 243,  8, fields(1), 'in1')
+      CALL CHKST2(ne, 243,  9, fields(2), 'in2')
+      CALL CHKST2(ne, 243, 10, fields(3), 'in3')
+
+      q(1) = 1.1d0
+      q(3) = 10d0
+      q(5) = 1.4d0
+      q(2) = 5.5
+      q(4) = 5.6d0
+      q(6) = 5.2d0
+      DO 2430 i=1,6
+      CALL CHKDB2(ne, 243, 10 + i, p(i), q(i))
+ 2430 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 1)
+      CALL CHKOK2(ne, 243, 17, d)
+      CALL CHKST2(ne, 243, 18, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 2)
+      CALL CHKOK2(ne, 243, 19, d)
+      CALL CHKST2(ne, 243, 20, str, "const")
+      CALL CHKIN2(ne, 243, 21, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 3)
+      CALL CHKOK2(ne, 243, 22, d)
+      CALL CHKST2(ne, 243, 23, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 4)
+      CALL CHKOK2(ne, 243, 24, d)
+      CALL CHKST2(ne, 243, 25, str, "carray")
+      CALL CHKIN2(ne, 243, 26, n, 3)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 5)
+      CALL CHKOK2(ne, 243, 27, d)
+      CALL CHKST2(ne, 243, 28, str, "carray")
+      CALL CHKIN2(ne, 243, 29, n, 4)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 6)
+      CALL CHKOK2(ne, 243, 30, d)
+      CALL CHKST2(ne, 243, 31, str, "carray")
+      CALL CHKIN2(ne, 243, 32, n, 5)
+
+C     244: GDASPN check
+      CALL GDASPN(d, 'new244', 6, 3, 'in1', 3, 33d0, '', -1, -1, 
+     +44d0, '', -1, -1, 66d0, '', -1, -1, 0d0,  'carray', 6, 1, 
+     +0d0,  '', -1, -1, 0d0,  '', -1, -1, 0)
+      CALL CHKOK2(ne, 244, 1, d)
+
+      CALL GDENFL(n, d, 'new244', 6)
+      CALL CHKOK2(ne, 244, 2, d)
+      CALL CHKIN2(ne, 244, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
+     +n, d, 'new244', 6)
+      CALL CHKOK2(ne, 244, 4, d)
+      CALL CHKIN2(ne, 244, 5, l, flen)
+      CALL CHKIN2(ne, 244, 6, i, 3)
+      CALL CHKIN2(ne, 244, 7, n, 0)
+      CALL CHKST2(ne, 244, 8, fn, 'in1')
+
+      q(1) = 33d0
+      q(2) = 44d0
+      q(3) = 66d0
+      q(4) = 9.6d0
+
+      DO 2440 i=1,4
+      CALL CHKDB2(ne, 244, 8 + i, p(i), q(i))
+ 2440 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 1)
+      CALL CHKOK2(ne, 244, 13, d)
+      CALL CHKST2(ne, 244, 14, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 2)
+      CALL CHKOK2(ne, 244, 15, d)
+      CALL CHKST2(ne, 244, 16, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 3)
+      CALL CHKOK2(ne, 244, 17, d)
+      CALL CHKST2(ne, 244, 18, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 4)
+      CALL CHKOK2(ne, 244, 19, d)
+      CALL CHKST2(ne, 244, 20, str, "carray")
+      CALL CHKIN2(ne, 244, 21, n, 1)
+
+C     246: GDASBT check
+      CALL GDASBT(d, 'new246', 6, 'in1', 3, 11, '', -1, -1, 0, 'const',
+     +5, 0, 0)
+      CALL CHKOK2(ne, 246, 1, d)
+
+      l = flen
+      CALL GDGEBT(fn, l, m, i, n, d, 'new246', 6)
+      CALL CHKOK2(ne, 246, 2, d)
+      CALL CHKIN2(ne, 246, 3, l, flen)
+      CALL CHKIN2(ne, 246, 4, n, 0)
+      CALL CHKIN2(ne, 246, 5, m, 11)
+      CALL CHKIN2(ne, 246, 6, i, 10)
+      CALL CHKST2(ne, 246, 7, fn, 'in1')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new246', 6, 1)
+      CALL CHKOK2(ne, 246, 8, d)
+      CALL CHKST2(ne, 246, 9, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new246', 6, 2)
+      CALL CHKOK2(ne, 246, 10, d)
+      CALL CHKST2(ne, 246, 11, str, "const")
+      CALL CHKIN2(ne, 246, 12, n, -1)
+
+C     248: GDASPH check
+      CALL GDASPH(d, 'new248', 6, 'in1', 3, 0, 'carray', 6, 3, 0)
+      CALL CHKOK2(ne, 248, 1, d)
+
+      l = flen
+      CALL GDGEPH(fn, l, i, n, d, 'new248', 6)
+      CALL CHKOK2(ne, 248, 2, d)
+      CALL CHKIN2(ne, 248, 3, l, flen)
+      CALL CHKIN2(ne, 248, 4, n, 0)
+      CALL CHKIN2(ne, 248, 5, i, 5)
+      CALL CHKST2(ne, 248, 6, fn, 'in1')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new248', 6, 1)
+      CALL CHKOK2(ne, 248, 7, d)
+      CALL CHKST2(ne, 248, 8, str, "carray")
+      CALL CHKIN2(ne, 248, 9, n, 3)
+
+C     251: GDASRC check
+      CALL GDASRC(d, 'new251', 6, 'in1', 3, 0d0, 'carray', 6, 4, 0)
+      CALL CHKOK2(ne, 251, 1, d)
+
+      CALL GDENFL(n, d, 'new251', 6)
+      CALL CHKOK2(ne, 251, 2, d)
+      CALL CHKIN2(ne, 251, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGERC(fn, l, dp, n, d, 'new251', 6)
+      CALL CHKOK2(ne, 251, 4, d)
+      CALL CHKIN2(ne, 251, 5, l, flen)
+      CALL CHKIN2(ne, 251, 6, n, 0)
+      CALL CHKDB2(ne, 251, 7, dp, 5.6d0)
+      CALL CHKST2(ne, 251, 8, fn, 'in1')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new251', 6, 1)
+      CALL CHKOK2(ne, 251, 9, d)
+      CALL CHKST2(ne, 251, 10, str, "carray")
+      CALL CHKIN2(ne, 251, 11, n, 4)
+
+C     253: GDASWD check
+      CALL GDASWD(d, 'new253', 6, 'in2', 3, 'in3', 3, GDW_EQ, 0,
+     +'const', 5, -1, 0)
+      CALL CHKOK2(ne, 253, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new253',
+     +6)
+      CALL CHKOK2(ne, 253, 2, d)
+      CALL CHKIN2(ne, 253, 3, i, flen)
+      CALL CHKIN2(ne, 253, 4, l, flen)
+      CALL CHKIN2(ne, 253, 5, n, 0)
+      CALL CHKIN2(ne, 253, 6, m, GDW_EQ)
+      CALL CHKST2(ne, 253, 7, fields(1), 'in2')
+      CALL CHKST2(ne, 253, 8, fields(2), 'in3')
+      CALL CHKIN2(ne, 253, 9, j, 10)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new253', 6, 1)
+      CALL CHKOK2(ne, 253, 10, d)
+      CALL CHKST2(ne, 253, 11, str, "const")
+      CALL CHKIN2(ne, 253, 12, n, -1)
+
+C     254: GDASMX check
+      CALL GDASMX(d, 'new254', 6, 'in1', 3, 'in2', 3, 0, 'carray', 6, 3,
+     +0, 'carray', 6, 4, 0)
+      CALL CHKOK2(ne, 254, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new254', 6)
+      CALL CHKOK2(ne, 254, 2, d)
+      CALL CHKIN2(ne, 254, 3, i, flen)
+      CALL CHKIN2(ne, 254, 4, l, flen)
+      CALL CHKIN2(ne, 254, 5, n, 0)
+      CALL CHKIN2(ne, 254, 6, m, 5)
+      CALL CHKST2(ne, 254, 7, fields(1), 'in1')
+      CALL CHKST2(ne, 254, 8, fields(2), 'in2')
+      CALL CHKIN2(ne, 254, 9, j, 5)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new254', 6, 1)
+      CALL CHKOK2(ne, 254, 10, d)
+      CALL CHKST2(ne, 254, 11, str, "carray")
+      CALL CHKIN2(ne, 254, 12, n, 3)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new254', 6, 2)
+      CALL CHKOK2(ne, 254, 13, d)
+      CALL CHKST2(ne, 254, 14, str, "carray")
+      CALL CHKIN2(ne, 254, 15, n, 4)
+
+C     255: GDASCL check
+      CALL GDASCL(d, 'new255', 6, 3, 'in1', 3, dcmplx(1.1d0, 1.2d0),
+     +'', -1, -1, dcmplx(0, 0), 'carray', 6, 3, 'in2', 3, 
+     +dcmplx(    0,     0), 'const',  5, -1, dcmplx(0, 0), 'carray', 6,
+     +4, 'in3', 3, dcmplx(1.3d0, 1.4d0),      '', -1, -1, dcmplx(0, 0),
+     +'carray', 6, 5, 0)
+      CALL CHKOK2(ne, 255, 1, d)
+
+      CALL GDENFL(n, d, 'new255', 6)
+      CALL CHKOK2(ne, 255, 2, d)
+      CALL CHKIN2(ne, 255, 3, n, GDE_CS + GDE_CA)
+
+      l = flen
+      CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3),
+     +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new255', 6)
+      CALL CHKOK2(ne, 255,  4, d)
+      CALL CHKIN2(ne, 255,  5, l, flen)
+      CALL CHKIN2(ne, 255,  6, i, 3)
+      CALL CHKIN2(ne, 255,  7, n, 0)
+      CALL CHKST2(ne, 255,  8, fields(1), 'in1')
+      CALL CHKST2(ne, 255,  9, fields(2), 'in2')
+      CALL CHKST2(ne, 255, 10, fields(3), 'in3')
+
+      cq(1) = dcmplx(1.1d0, 1.2d0)
+      cq(3) = dcmplx(10d0, 0d0)
+      cq(5) = dcmplx(1.3d0, 1.4d0)
+      cq(2) = dcmplx(5.5, 0d0)
+      cq(4) = dcmplx(5.6d0, 0d0)
+      cq(6) = dcmplx(5.2d0, 0d0)
+      DO 2550 i=1,6
+      CALL CHKCP2(ne, 255, 10 + i, cp(i), cq(i))
+ 2550 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new255', 6, 1)
+      CALL CHKOK2(ne, 255, 17, d)
+      CALL CHKST2(ne, 255, 18, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new255', 6, 2)
+      CALL CHKOK2(ne, 255, 19, d)
+      CALL CHKST2(ne, 255, 20, str, "const")
+      CALL CHKIN2(ne, 255, 21, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new255', 6, 3)
+      CALL CHKOK2(ne, 255, 22, d)
+      CALL CHKST2(ne, 255, 23, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new255', 6, 4)
+      CALL CHKOK2(ne, 255, 24, d)
+      CALL CHKST2(ne, 255, 25, str, "carray")
+      CALL CHKIN2(ne, 255, 26, n, 3)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new255', 6, 5)
+      CALL CHKOK2(ne, 255, 27, d)
+      CALL CHKST2(ne, 255, 28, str, "carray")
+      CALL CHKIN2(ne, 255, 29, n, 4)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new255', 6, 6)
+      CALL CHKOK2(ne, 255, 30, d)
+      CALL CHKST2(ne, 255, 31, str, "carray")
+      CALL CHKIN2(ne, 255, 32, n, 5)
+
+C     256: GDASCP check
+      CALL GDASCP(d, 'new256', 6, 3, 'in1', 3, dcmplx(22d0, 33d0), '',
+     +-1, -1, dcmplx(44d0, 55d0), '', -1, -1, dcmplx(66d0, 77d0), '',
+     +-1, -1, dcmplx(0, 0),  'carray', 6, 1, dcmplx(0, 0),  '', -1, -1,
+     +dcmplx(0, 0),  '', -1, -1, 0)
+      CALL CHKOK2(ne, 256, 1, d)
+
+      CALL GDENFL(n, d, 'new256', 6)
+      CALL CHKOK2(ne, 256, 2, d)
+      CALL CHKIN2(ne, 256, 3, n, GDE_CS + GDE_CA)
+
+      l = flen
+      CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
+     +n, d, 'new256', 6)
+      CALL CHKOK2(ne, 256, 4, d)
+      CALL CHKIN2(ne, 256, 5, l, flen)
+      CALL CHKIN2(ne, 256, 6, i, 3)
+      CALL CHKIN2(ne, 256, 7, n, 0)
+      CALL CHKST2(ne, 256, 8, fn, 'in1')
+
+      cq(1) = dcmplx(22d0, 33d0)
+      cq(2) = dcmplx(44d0, 55d0)
+      cq(3) = dcmplx(66d0, 77d0)
+      cq(4) = dcmplx(9.6d0, 0)
+
+      DO 2560 i=1,4
+      CALL CHKCP2(ne, 256, 8 + i, cp(i), cq(i))
+ 2560 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new256', 6, 1)
+      CALL CHKOK2(ne, 256, 13, d)
+      CALL CHKST2(ne, 256, 14, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new256', 6, 2)
+      CALL CHKOK2(ne, 256, 15, d)
+      CALL CHKST2(ne, 256, 16, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new256', 6, 3)
+      CALL CHKOK2(ne, 256, 17, d)
+      CALL CHKST2(ne, 256, 18, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new256', 6, 4)
+      CALL CHKOK2(ne, 256, 19, d)
+      CALL CHKST2(ne, 256, 20, str, "carray")
+      CALL CHKIN2(ne, 256, 21, n, 1)
+
+C     257: GDASCR check
+      CALL GDASCR(d, 'new257', 6, 'in1', 3, 0d0, 'carray', 6, 4, 0)
+      CALL CHKOK2(ne, 257, 1, d)
+
+      CALL GDENFL(n, d, 'new257', 6)
+      CALL CHKOK2(ne, 257, 2, d)
+      CALL CHKIN2(ne, 257, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGECR(fn, l, dc, n, d, 'new257', 6)
+      CALL CHKOK2(ne, 257, 4, d)
+      CALL CHKIN2(ne, 257, 5, l, flen)
+      CALL CHKIN2(ne, 257, 6, n, 0)
+      CALL CHKCP2(ne, 257, 7, dc, dcmplx(5.6d0, 0))
+      CALL CHKST2(ne, 257, 8, fn, 'in1')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new257', 6, 1)
+      CALL CHKOK2(ne, 257, 9, d)
+      CALL CHKST2(ne, 257, 10, str, "carray")
+      CALL CHKIN2(ne, 257, 11, n, 4)
+
+C     258: GDASSB check
+      CALL GDASSB(d, 'new258', 6, 'in1', 3, 11, '', -1, -1, 0, 'const',
+     +5, 0, 0)
+      CALL CHKOK2(ne, 258, 1, d)
+
+      l = flen
+      CALL GDGESB(fn, l, m, i, n, d, 'new258', 6)
+      CALL CHKOK2(ne, 258, 2, d)
+      CALL CHKIN2(ne, 258, 3, l, flen)
+      CALL CHKIN2(ne, 258, 4, n, 0)
+      CALL CHKIN2(ne, 258, 5, m, 11)
+      CALL CHKIN2(ne, 258, 6, i, 10)
+      CALL CHKST2(ne, 258, 7, fn, 'in1')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new258', 6, 1)
+      CALL CHKOK2(ne, 258, 8, d)
+      CALL CHKST2(ne, 258, 9, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new258', 6, 2)
+      CALL CHKOK2(ne, 258, 10, d)
+      CALL CHKST2(ne, 258, 11, str, "const")
+      CALL CHKIN2(ne, 258, 12, n, -1)
+
+C     259: GDLSLC check
+      CALL GDLSLC(d, 'new243', 6, 3,
+     +'', -1, 2.2d0, '', -1, 1, 0d0, 'carray', 6, 4,
+     +'in4', 3, 0d0, '', 0, 0, 259d0, '', -1, 0,
+     +'', -1, 0d0, 'const', 5, -1, 0d0, 'const', 5, -1)
+      CALL CHKOK2(ne, 259, 1, d)
+
+      CALL GDENFL(n, d, 'new243', 6)
+      CALL CHKOK2(ne, 259, 2, d)
+      CALL CHKIN2(ne, 259, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3),
+     +p(4), fields(3), l, p(5), p(6), n, d, 'new243', 6)
+      CALL CHKOK2(ne, 259,  4, d)
+      CALL CHKIN2(ne, 259,  5, l, flen)
+      CALL CHKIN2(ne, 259,  6, i, 3)
+      CALL CHKIN2(ne, 259,  7, n, 0)
+      CALL CHKST2(ne, 259,  8, fields(1), 'in1')
+      CALL CHKST2(ne, 259,  9, fields(2), 'in4')
+      CALL CHKST2(ne, 259, 10, fields(3), 'in3')
+
+      q(1) = 2.2d0
+      q(3) = 10d0
+      q(5) = 10d0
+      q(2) = 5.6d0
+      q(4) = 259d0
+      q(6) = 10d0
+      DO 2590 i=1,6
+      CALL CHKDB2(ne, 259, 10 + i, p(i), q(i))
+ 2590 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 1)
+      CALL CHKOK2(ne, 259, 17, d)
+      CALL CHKST2(ne, 259, 18, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 2)
+      CALL CHKOK2(ne, 259, 19, d)
+      CALL CHKST2(ne, 259, 20, str, "const")
+      CALL CHKIN2(ne, 259, 21, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 3)
+      CALL CHKOK2(ne, 259, 22, d)
+      CALL CHKST2(ne, 259, 23, str, "const")
+      CALL CHKIN2(ne, 259, 24, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 4)
+      CALL CHKOK2(ne, 259, 25, d)
+      CALL CHKST2(ne, 259, 26, str, "carray")
+      CALL CHKIN2(ne, 259, 27, n, 4)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 5)
+      CALL CHKOK2(ne, 259, 28, d)
+      CALL CHKST2(ne, 259, 29, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 6)
+      CALL CHKOK2(ne, 259, 30, d)
+      CALL CHKST2(ne, 259, 31, str, "const")
+      CALL CHKIN2(ne, 259, 32, n, -1)
+
+C     260: GDLSLC check
+      CALL GDLSCL(d, 'new243', 6, 3,
+     +'', -1, dcmplx(9d0, 8d0), '', -1, 1, dcmplx(0, 0), 'carray', 6, 3,
+     +'in4', 3, dcmplx(0, 0), '', 0, 0, dcmplx(260d0, 0), '', -1, 0,
+     +'', -1, dcmplx(0, 0), '', 0, -1, dcmplx(0, 0), '', 0, -1)
+      CALL CHKOK2(ne, 260, 1, d)
+
+      CALL GDENFL(n, d, 'new243', 6)
+      CALL CHKOK2(ne, 260, 2, d)
+      CALL CHKIN2(ne, 260, 3, n, GDE_CS + GDE_CA)
+
+      l = flen
+      CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3),
+     +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new243', 6)
+      CALL CHKOK2(ne, 260,  4, d)
+      CALL CHKIN2(ne, 260,  5, l, flen)
+      CALL CHKIN2(ne, 260,  6, i, 3)
+      CALL CHKIN2(ne, 260,  7, n, 0)
+      CALL CHKST2(ne, 260,  8, fields(1), 'in1')
+      CALL CHKST2(ne, 260,  9, fields(2), 'in4')
+      CALL CHKST2(ne, 260, 10, fields(3), 'in3')
+
+      cq(1) = dcmplx(9d0, 8d0)
+      cq(3) = dcmplx(10d0, 0)
+      cq(5) = dcmplx(10d0, 0)
+      cq(2) = dcmplx(5.5d0, 0)
+      cq(4) = dcmplx(260d0, 0)
+      cq(6) = dcmplx(10d0, 0)
+      DO 2600 i=1,6
+      CALL CHKCP2(ne, 260, 10 + i, cp(i), cq(i))
+ 2600 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 1)
+      CALL CHKOK2(ne, 260, 17, d)
+      CALL CHKST2(ne, 260, 18, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 2)
+      CALL CHKOK2(ne, 260, 19, d)
+      CALL CHKST2(ne, 260, 20, str, "const")
+      CALL CHKIN2(ne, 260, 21, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 3)
+      CALL CHKOK2(ne, 260, 22, d)
+      CALL CHKST2(ne, 260, 23, str, "const")
+      CALL CHKIN2(ne, 260, 24, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 4)
+      CALL CHKOK2(ne, 260, 25, d)
+      CALL CHKST2(ne, 260, 26, str, "carray")
+      CALL CHKIN2(ne, 260, 27, n, 3)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 5)
+      CALL CHKOK2(ne, 260, 28, d)
+      CALL CHKST2(ne, 260, 29, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new243', 6, 6)
+      CALL CHKOK2(ne, 260, 30, d)
+      CALL CHKST2(ne, 260, 31, str, "const")
+      CALL CHKIN2(ne, 260, 32, n, -1)
+
+C     261: GDLSPN check
+      CALL GDLSPN(d, 'new244', 6, 3, 'in3', 3, 2d0, '', 0, 0,
+     +6d0, '', 0, 0, 0d0, 'carray', 6, 5, 261d0, '', -1, 0,
+     +0d0, '', -1, 0, 0d0, '', -1, 0)
+      CALL CHKOK2(ne, 261, 1, d)
+
+      CALL GDENFL(n, d, 'new244', 6)
+      CALL CHKOK2(ne, 261, 2, d)
+      CALL CHKIN2(ne, 261, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6),
+     +n, d, 'new244', 6)
+      CALL CHKOK2(ne, 261, 4, d)
+      CALL CHKIN2(ne, 261, 5, l, flen)
+      CALL CHKIN2(ne, 261, 6, i, 3)
+      CALL CHKIN2(ne, 261, 7, n, 0)
+      CALL CHKST2(ne, 261, 8, fn, 'in3')
+
+      q(1) = 2d0
+      q(2) = 6d0
+      q(3) = 5.2d0
+      q(4) = 261d0
+
+      DO 2610 i=1,4
+      CALL CHKDB2(ne, 261, 8 + i, p(i), q(i))
+ 2610 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 1)
+      CALL CHKOK2(ne, 261, 13, d)
+      CALL CHKST2(ne, 261, 14, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 2)
+      CALL CHKOK2(ne, 261, 15, d)
+      CALL CHKST2(ne, 261, 16, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 3)
+      CALL CHKOK2(ne, 261, 17, d)
+      CALL CHKST2(ne, 261, 18, str, "carray")
+      CALL CHKIN2(ne, 261, 19, n, 5)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 4)
+      CALL CHKOK2(ne, 261, 20, d)
+      CALL CHKST2(ne, 261, 21, str, "")
+
+C     262: GDLSCP check
+      CALL GDLSCP(d, 'new244', 6, 3, '', -1,
+     +dcmplx(0, 0), 'const', 5, -1, dcmplx(0, 0), 'const', 5, -1,
+     +dcmplx(262d0, 0d0), '', -1, 5, dcmplx(262d0, 0d0), '', 0, 0,
+     +dcmplx(0d0, 0d0), '', -1, 0, dcmplx(0d0, 0d0), '', -1, 0)
+      CALL CHKOK2(ne, 262, 1, d)
+
+      CALL GDENFL(n, d, 'new244', 6)
+      CALL CHKOK2(ne, 262, 2, d)
+      CALL CHKIN2(ne, 262, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
+     +n, d, 'new244', 6)
+      CALL CHKOK2(ne, 262, 4, d)
+      CALL CHKIN2(ne, 262, 5, l, flen)
+      CALL CHKIN2(ne, 262, 6, i, 3)
+      CALL CHKIN2(ne, 262, 7, n, 0)
+      CALL CHKST2(ne, 262, 8, fn, 'in3')
+
+      cq(1) = dcmplx(10d0, 0)
+      cq(2) = dcmplx(10d0, 0)
+      cq(3) = dcmplx(262d0, 0)
+      cq(4) = dcmplx(262d0, 0)
+
+      DO 2620 i=1,4
+      CALL CHKCP2(ne, 262, 8 + i, cp(i), cq(i))
+ 2620 CONTINUE
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 1)
+      CALL CHKOK2(ne, 262, 13, d)
+      CALL CHKST2(ne, 262, 14, str, "const")
+      CALL CHKIN2(ne, 262, 15, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 2)
+      CALL CHKOK2(ne, 262, 16, d)
+      CALL CHKST2(ne, 262, 17, str, "const")
+      CALL CHKIN2(ne, 262, 18, n, -1)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 3)
+      CALL CHKOK2(ne, 262, 19, d)
+      CALL CHKST2(ne, 262, 20, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new244', 6, 4)
+      CALL CHKOK2(ne, 262, 21, d)
+      CALL CHKST2(ne, 262, 22, str, "")
+
+C     263: GDLSBT check
+      CALL GDLSBT(d, 'new246', 6, 'in0', 3, 0, 'carray', 6, 6, 0,
+     +'', -1, -1)
+      CALL CHKOK2(ne, 263, 1, d)
+
+      l = flen
+      CALL GDGEBT(fn, l, m, i, n, d, 'new246', 6)
+      CALL CHKOK2(ne, 263, 2, d)
+      CALL CHKIN2(ne, 263, 3, l, flen)
+      CALL CHKIN2(ne, 263, 4, n, 0)
+      CALL CHKIN2(ne, 263, 5, m, 4)
+      CALL CHKIN2(ne, 263, 6, i, 10)
+      CALL CHKST2(ne, 263, 7, fn, 'in0')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new246', 6, 1)
+      CALL CHKOK2(ne, 263, 8, d)
+      CALL CHKST2(ne, 263, 9, str, "carray")
+      CALL CHKIN2(ne, 263, 10, n, 6)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new246', 6, 2)
+      CALL CHKOK2(ne, 263, 11, d)
+      CALL CHKST2(ne, 263, 12, str, "")
+
+C     264: GDLSSB check
+      CALL GDLSSB(d, 'new258', 6, 'in2', 3, -1, '', -1, 0, 0,
+     +'carray', 6, 5)
+      CALL CHKOK2(ne, 264, 1, d)
+
+      l = flen
+      CALL GDGESB(fn, l, m, i, n, d, 'new258', 6)
+      CALL CHKOK2(ne, 264, 2, d)
+      CALL CHKIN2(ne, 264, 3, l, flen)
+      CALL CHKIN2(ne, 264, 4, n, 0)
+      CALL CHKIN2(ne, 264, 5, m, 11)
+      CALL CHKIN2(ne, 264, 6, i, 5)
+      CALL CHKST2(ne, 264, 7, fn, 'in2')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new258', 6, 1)
+      CALL CHKOK2(ne, 264, 8, d)
+      CALL CHKST2(ne, 264, 9, str, "")
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new258', 6, 2)
+      CALL CHKOK2(ne, 264, 10, d)
+      CALL CHKST2(ne, 264, 11, str, "carray")
+      CALL CHKIN2(ne, 264, 12, n, 5)
+
+C     265: GDLSPH check
+      CALL GDLSPH(d, 'new248', 6, '', -1, -265, '', -1, -1)
+      CALL CHKOK2(ne, 265, 1, d)
+
+      l = flen
+      CALL GDGEPH(fn, l, i, n, d, 'new248', 6)
+      CALL CHKOK2(ne, 265, 2, d)
+      CALL CHKIN2(ne, 265, 3, l, flen)
+      CALL CHKIN2(ne, 265, 4, n, 0)
+      CALL CHKIN2(ne, 265, 5, i, -265)
+      CALL CHKST2(ne, 265, 6, fn, 'in1')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new248', 6, 1)
+      CALL CHKOK2(ne, 265, 7, d)
+      CALL CHKST2(ne, 265, 8, str, "")
+
+C     266: GDLSRC check
+      CALL GDLSRC(d, 'new251', 6, 'in5', 3, 0d0, 'carray', 6, 2)
+      CALL CHKOK2(ne, 266, 1, d)
+
+      CALL GDENFL(n, d, 'new251', 6)
+      CALL CHKOK2(ne, 266, 2, d)
+      CALL CHKIN2(ne, 266, 3, n, GDE_CA)
+
+      l = flen
+      CALL GDGERC(fn, l, dp, n, d, 'new251', 6)
+      CALL CHKOK2(ne, 266, 4, d)
+      CALL CHKIN2(ne, 266, 5, l, flen)
+      CALL CHKIN2(ne, 266, 6, n, 0)
+      CALL CHKDB2(ne, 266, 7, dp, 8.5d0)
+      CALL CHKST2(ne, 266, 8, fn, 'in5')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new251', 6, 1)
+      CALL CHKOK2(ne, 266, 9, d)
+      CALL CHKST2(ne, 266, 10, str, "carray")
+      CALL CHKIN2(ne, 266, 11, n, 2)
+
+C     267: GDLSCR check
+      CALL GDLSCR(d, 'new251', 6, 'in5', 3, dcmplx(12d0, 14d0), '', -1,
+     +-1)
+      CALL CHKOK2(ne, 267, 1, d)
+
+      CALL GDENFL(n, d, 'new251', 6)
+      CALL CHKOK2(ne, 267, 2, d)
+      CALL CHKIN2(ne, 267, 3, n, GDE_CS + GDE_CA)
+
+      l = flen
+      CALL GDGECR(fn, l, dc, n, d, 'new251', 6)
+      CALL CHKOK2(ne, 267, 4, d)
+      CALL CHKIN2(ne, 267, 5, l, flen)
+      CALL CHKIN2(ne, 267, 6, n, 0)
+      CALL CHKCP2(ne, 267, 7, dc, dcmplx(12d0, 14d0))
+      CALL CHKST2(ne, 267, 8, fn, 'in5')
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new251', 6, 1)
+      CALL CHKOK2(ne, 267, 9, d)
+      CALL CHKST2(ne, 267, 10, str, "")
+
+C     268: GDLSWD check
+      CALL GDLSWD(d, 'new253', 6, '', -1, 'in4', 3, GDW_LT,
+     +0d0, 'carray', 6, 3)
+      CALL CHKOK2(ne, 268, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new253',
+     +6)
+      CALL CHKOK2(ne, 268, 2, d)
+      CALL CHKIN2(ne, 268, 3, i, flen)
+      CALL CHKIN2(ne, 268, 4, l, flen)
+      CALL CHKIN2(ne, 268, 5, n, 0)
+      CALL CHKIN2(ne, 268, 6, m, GDW_LT)
+      CALL CHKST2(ne, 268, 7, fields(1), 'in2')
+      CALL CHKST2(ne, 268, 8, fields(2), 'in4')
+      CALL CHKDB2(ne, 268, 9, dp, 5.5d0)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new253', 6, 1)
+      CALL CHKOK2(ne, 268, 10, d)
+      CALL CHKST2(ne, 268, 11, str, "carray")
+      CALL CHKIN2(ne, 268, 12, n, 3)
+
+C     269: GDLSMX check
+      CALL GDLSMX(d, 'new254', 6, 'in0', 3, '', -1, 0, '', 0, -1,
+     +-1, '', -1, -1)
+      CALL CHKOK2(ne, 269, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new254', 6)
+      CALL CHKOK2(ne, 269, 2, d)
+      CALL CHKIN2(ne, 269, 3, i, flen)
+      CALL CHKIN2(ne, 269, 4, l, flen)
+      CALL CHKIN2(ne, 269, 5, n, 0)
+      CALL CHKIN2(ne, 269, 6, m, 5)
+      CALL CHKST2(ne, 269, 7, fields(1), 'in0')
+      CALL CHKST2(ne, 269, 8, fields(2), 'in2')
+      CALL CHKIN2(ne, 269, 9, j, 5)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new254', 6, 1)
+      CALL CHKOK2(ne, 269, 10, d)
+      CALL CHKST2(ne, 269, 11, str, "carray")
+      CALL CHKIN2(ne, 269, 12, n, 3)
+
+      l = slen
+      CALL GDGSCA(str, l, n, d, 'new254', 6, 2)
+      CALL CHKOK2(ne, 269, 13, d)
+      CALL CHKST2(ne, 269, 14, str, "")
+
+C     271: GDENCS
+      CALL GDENCS(n, GDE_SI);
+      CALL CHKINT(ne, 271, n, GD_RW);
+
+C     272: NULL return from gd_reference
       CALL GDOPEN(m, fildir//DIRSEP//'empty', 18, GD_RW + GD_CR + GD_EX)
-      CALL CHKOK2(ne, 243, 1, m)
+      CALL CHKOK2(ne, 272, 1, m)
 
       CALL GDREFE(str, l, m, "", -1)
-      CALL CHKOK2(ne, 243, 2, m)
-      CALL CHKINT(ne, 243, l, 0);
+      CALL CHKOK2(ne, 272, 2, m)
+      CALL CHKINT(ne, 272, l, 0)
+
+      CALL GDDSCD(m)
+
+
 
-      CALL GDDSCD(m);
 
 
 
diff --git a/bindings/f77/test/big_test95.f90 b/bindings/f77/test/big_test95.f90
index 423a6c2..a1b01a2 100644
--- a/bindings/f77/test/big_test95.f90
+++ b/bindings/f77/test/big_test95.f90
@@ -1,4 +1,4 @@
-! Copyright (C) 2009-2012 D. V. Wiebe
+! Copyright (C) 2009-2015 D. V. Wiebe
 !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
@@ -28,32 +28,6 @@
 ! (although this last one is used)
 
 ! check functions
-subroutine check_err(ne, t, d, v)
-  use getdata
-  integer, intent(inout) :: ne
-  integer, intent(in) :: t, d, v
-  integer :: e
-
-  e = fgd_error(d)
-
-  if (e .ne. v) then
-    ne = ne + 1
-    write(*, 9001), t, e, v
-  end if
-9001 format('e[', i0, '] = ', i0, ', expected ', i0)
-end subroutine 
-
-subroutine check_int(ne, t, n, v)
-  integer, intent(inout) :: ne
-  integer, intent(in) :: t, n, v
-
-  if (n .ne. v) then
-    ne = ne + 1
-    write(*, 9002), t, n, v
-  end if
-9002 format('n[', i0, '] = ', i0, ', expected ', i0)
-end subroutine 
-
 subroutine check_err2(ne, t, i, d, v)
   use getdata
   integer, intent(inout) :: ne
@@ -69,6 +43,12 @@ subroutine check_err2(ne, t, i, d, v)
 9006 format('e(', i0, ')[', i0, '] = ', i0, ', expected ', i0)
 end subroutine 
 
+subroutine check_err(ne, t, d, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t, d, v
+  call check_err2(ne, t, 0, d, v)
+end subroutine 
+
 subroutine check_int2(ne, t, i, n, v)
   integer, intent(inout) :: ne
   integer, intent(in) :: t, i, n, v
@@ -80,6 +60,12 @@ subroutine check_int2(ne, t, i, n, v)
 9007 format('n(', i0, ')[', i0, '] = ', i0, ', expected ', i0)
 end subroutine 
 
+subroutine check_int(ne, t, n, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t, n, v
+  call check_int2(ne, t, 0, n, v)
+end subroutine 
+
 subroutine check_str2(ne, t, i, n, v)
   integer, intent(inout) :: ne
   integer, intent(in) :: t, i
@@ -96,12 +82,7 @@ subroutine check_str(ne, t, n, v)
   integer, intent(inout) :: ne
   integer, intent(in) :: t
   character (len=*), intent(in) :: n, v
-
-  if (n .ne. v) then
-    ne = ne + 1
-    write(*, 9009), t, n, v
-  end if
-9009 format('s[', i0, '] = "', a, '", expected "', a, '"')
+  call check_str2(ne, t, 0, n, v)
 end subroutine 
 
 subroutine check_dbl2(ne, t, i, n, v)
@@ -109,19 +90,28 @@ subroutine check_dbl2(ne, t, i, n, v)
   integer, intent(in) :: t, i
   double precision, intent(in) :: n, v
 
-  if (abs(n - v) .gt. 1e-5) then
+  ! this is good to single precision
+  if (abs(n - v) .gt. 1e-7) then
     ne = ne + 1
     write(*, 9010), i, t, n, v
   end if
 9010 format('r(', i0, ')[', i0, '] = ', d16.10, ', expected ', d16.10)
 end subroutine 
 
+subroutine check_dbl(ne, t, n, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t
+  double precision, intent(in) :: n, v
+  call check_dbl2(ne, t, 0, n, v)
+end subroutine 
+
 subroutine check_cpx2(ne, t, i, n, v)
   integer, intent(inout) :: ne
   integer, intent(in) :: t, i
   double complex, intent(in) :: n, v
 
-  if (abs(n - v) .gt. 1e-5) then
+  ! this is good to single precision
+  if (abs(n - v) .gt. 1e-7) then
     ne = ne + 1
     write(*, 9011), i, t, real(real(n)), real(aimag(n)), &
     real(real(v)), real(aimag(v))
@@ -130,43 +120,24 @@ subroutine check_cpx2(ne, t, i, n, v)
 d16.10, ';', d16.10)
 end subroutine 
 
-subroutine check_dbl(ne, t, n, v)
-  integer, intent(inout) :: ne
-  integer, intent(in) :: t
-  double precision, intent(in) :: n, v
-
-  if (abs(n - v) .gt. 1e-5) then
-    ne = ne + 1
-    write(*, 9012), t, n, d
-  end if
-9012 format('r[', i0, '] = ', d16.10, ', expected ', d16.10)
-end subroutine 
-
 subroutine check_cpx(ne, t, n, v)
   integer, intent(inout) :: ne
   integer, intent(in) :: t
   double complex, intent(in) :: n, v
-
-  if (abs(n - v) .gt. 1e-5) then
-    ne = ne + 1
-    write(*, 9013), t, n, d
-  end if
-9013 format('x[', i0, '] = ', d16.10, ';', d16.10, ', expected ', d16.10, &
-';', d16.10)
+  call check_cpx2(ne, t, 0, n, v)
 end subroutine 
 
-subroutine check_ok(ne, t, d)
+subroutine check_ok2(ne, t, i, d)
   use getdata
   integer, intent(inout) :: ne
-  integer, intent(in) :: t, d
-  call check_err(ne, t, d, GD_E_OK)
+  integer, intent(in) :: t, d, i
+  call check_err2(ne, t, i, d, GD_E_OK)
 end subroutine
 
-subroutine check_ok2(ne, t, i, d)
-  use getdata
+subroutine check_ok(ne, t, d)
   integer, intent(inout) :: ne
   integer, intent(in) :: t, d
-  call check_err2(ne, t, i, d, GD_E_OK)
+  call check_ok2(ne, t, 0, d)
 end subroutine
 
 subroutine check_eos(ne, t, n, v)
@@ -271,195 +242,195 @@ program big_test
 
   ne = 0
 
-! fgd_error check
+! 1: fgd_error check
   d = fgd_open('x', GD_RDONLY)
-  call check_err(ne, 0, d, GD_E_OPEN)
+  call check_err(ne, 1, d, GD_E_IO)
   call fgd_discard(d)
 
-! 1: fgd_open check
+! 2: fgd_open check
   d = fgd_open(fildir, GD_RDWR)
-  call check_ok(ne, 1, d)
+  call check_ok(ne, 2, d)
 
-! 2: fgd_getdata_i1 check
+! 3: fgd_getdata_i1 check
   n = fgd_getdata_i1(d, 'data', 5, 0, 1, 0, ci1)
-  call check_ok(ne, 2, d)
-  call check_int(ne, 2, n, 8)
+  call check_ok(ne, 3, d)
+  call check_int(ne, 3, n, 8)
 
   do i=1,8
-  call check_int2(ne, 2, i, int(ci1(i)), 40 + i)
+  call check_int2(ne, 3, i, int(ci1(i)), 40 + i)
   end do 
 
-! 102: fgd_getdata_i2 check
+! 4: fgd_getdata_i2 check
   n = fgd_getdata_i2(d, 'data', 5, 0, 1, 0, ci2)
-  call check_ok(ne, 102, d)
-  call check_int(ne, 102, n, 8)
+  call check_ok(ne, 4, d)
+  call check_int(ne, 4, n, 8)
 
   do i=1,8
-  call check_int2(ne, 102, i, int(ci2(i)), 40 + i)
+  call check_int2(ne, 4, i, int(ci2(i)), 40 + i)
   end do 
 
-! 103: fgd_getdata_i4 check
+! 5: fgd_getdata_i4 check
   n = fgd_getdata_i4(d, 'data', 5, 0, 1, 0, ci4)
-  call check_ok(ne, 103, d)
-  call check_int(ne, 103, n, 8)
+  call check_ok(ne, 5, d)
+  call check_int(ne, 5, n, 8)
 
   do i=1,8
-  call check_int2(ne, 103, i, int(ci4(i)), 40 + i)
+  call check_int2(ne, 5, i, int(ci4(i)), 40 + i)
   end do 
 
-! 104: fgd_getdata_i8 check
+! 6: fgd_getdata_i8 check
   n = fgd_getdata_i8(d, 'data', 5, 0, 1, 0, ci8)
-  call check_ok(ne, 104, d)
-  call check_int(ne, 104, n, 8)
+  call check_ok(ne, 6, d)
+  call check_int(ne, 6, n, 8)
 
   do i=1,8
-  call check_int2(ne, 104, i, int(ci8(i)), 40 + i)
+  call check_int2(ne, 6, i, int(ci8(i)), 40 + i)
   end do 
 
-! 105: fgd_getdata_r4 check
+! 7: fgd_getdata_r4 check
   n = fgd_getdata_r4(d, 'data', 5, 0, 1, 0, cr4)
-  call check_ok(ne, 105, d)
-  call check_int(ne, 105, n, 8)
+  call check_ok(ne, 7, d)
+  call check_int(ne, 7, n, 8)
 
   do i=1,8
-  call check_dbl2(ne, 105, i, 1d0 * cr4(i), 40d0 + i)
+  call check_dbl2(ne, 7, i, 1d0 * cr4(i), 40d0 + i)
   end do 
 
-! 106: fgd_getdata_r8 check
+! 8: fgd_getdata_r8 check
   n = fgd_getdata_r8(d, 'data', 5, 0, 1, 0, cr8)
-  call check_ok(ne, 106, d)
-  call check_int(ne, 106, n, 8)
+  call check_ok(ne, 8, d)
+  call check_int(ne, 8, n, 8)
 
   do i=1,8
-  call check_dbl2(ne, 106, i, cr8(i), 40d0 + i)
+  call check_dbl2(ne, 8, i, cr8(i), 40d0 + i)
   end do 
 
-! 107: fgd_getdata_c8 check
+! 9: fgd_getdata_c8 check
   n = fgd_getdata_c8(d, 'data', 5, 0, 1, 0, cc8)
-  call check_ok(ne, 107, d)
-  call check_int(ne, 107, n, 8)
+  call check_ok(ne, 9, d)
+  call check_int(ne, 9, n, 8)
 
   do i=1,8
-  call check_cpx2(ne, 107, i, 1d0 * cc8(i), dcmplx(40 + i, 0))
+  call check_cpx2(ne, 9, i, 1d0 * cc8(i), dcmplx(40 + i, 0))
   end do 
 
-! 108: fgd_getdata_c16 check
+! 10: fgd_getdata_c16 check
   n = fgd_getdata_c16(d, 'data', 5, 0, 1, 0, cc16)
-  call check_ok(ne, 108, d)
-  call check_int(ne, 108, n, 8)
+  call check_ok(ne, 10, d)
+  call check_int(ne, 10, n, 8)
 
   do i=1,8
-  call check_cpx2(ne, 108, i, cc16(i), dcmplx(40 + i, 0))
+  call check_cpx2(ne, 10, i, cc16(i), dcmplx(40 + i, 0))
   end do 
 
-! 109: fgd_getdata_n check
+! 11: fgd_getdata_n check
   n = fgd_getdata_n(d, 'data', 5, 0, 1, 0)
-  call check_ok(ne, 109, d)
-  call check_int(ne, 109, n, 8)
+  call check_ok(ne, 11, d)
+  call check_int(ne, 11, n, 8)
 
-! 3: fgd_get_constant_i1 check
+! 12: fgd_get_constant_i1 check
   call fgd_get_constant_i1(d, 'const', ci1(1))
-  call check_ok(ne, 3, d)
-  call check_int(ne, 3, int(ci1(1)), 5)
+  call check_ok(ne, 12, d)
+  call check_int(ne, 12, int(ci1(1)), 5)
 
-! 110: fgd_get_constant_i2 check
+! 13: fgd_get_constant_i2 check
   call fgd_get_constant_i2(d, 'const', ci2(1))
-  call check_ok(ne, 110, d)
-  call check_int(ne, 110, int(ci2(1)), 5)
+  call check_ok(ne, 13, d)
+  call check_int(ne, 13, int(ci2(1)), 5)
 
-! 111: fgd_get_constant_i4 check
+! 14: fgd_get_constant_i4 check
   call fgd_get_constant_i4(d, 'const', ci4(1))
-  call check_ok(ne, 111, d)
-  call check_int(ne, 111, ci4(1), 5)
+  call check_ok(ne, 14, d)
+  call check_int(ne, 14, ci4(1), 5)
 
-! 112: fgd_get_constant_i8 check
+! 15: fgd_get_constant_i8 check
   call fgd_get_constant_i8(d, 'const', ci8(1))
-  call check_ok(ne, 112, d)
-  call check_int(ne, 112, int(ci8(1)), 5)
+  call check_ok(ne, 15, d)
+  call check_int(ne, 15, int(ci8(1)), 5)
 
-! 113: fgd_get_constant_r4 check
+! 16: fgd_get_constant_r4 check
   call fgd_get_constant_r4(d, 'const', cr4(1))
-  call check_ok(ne, 113, d)
-  call check_dbl(ne, 113, 1d0 * cr4(1), 5.5d0)
+  call check_ok(ne, 16, d)
+  call check_dbl(ne, 16, 1d0 * cr4(1), 5.5d0)
 
-! 114: fgd_get_constant_r8 check
+! 17: fgd_get_constant_r8 check
   call fgd_get_constant_r8(d, 'const', cr8(1))
-  call check_ok(ne, 114, d)
-  call check_dbl(ne, 114, cr8(1), 5.5d0)
+  call check_ok(ne, 17, d)
+  call check_dbl(ne, 17, cr8(1), 5.5d0)
 
-! 115: fgd_get_constant_c8 check
+! 18: fgd_get_constant_c8 check
   call fgd_get_constant_c8(d, 'const', cc8(1))
-  call check_ok(ne, 115, d)
-  call check_cpx(ne, 115, 1d0 * cc8(1), dcmplx(5.5, 0))
+  call check_ok(ne, 18, d)
+  call check_cpx(ne, 18, 1d0 * cc8(1), dcmplx(5.5, 0))
 
-! 116: fgd_get_constant_c16 check
+! 19: fgd_get_constant_c16 check
   call fgd_get_constant_c16(d, 'const', cc16(1))
-  call check_ok(ne, 116, d)
-  call check_cpx(ne, 116, cc16(1), dcmplx(5.5, 0))
+  call check_ok(ne, 19, d)
+  call check_cpx(ne, 19, cc16(1), dcmplx(5.5, 0))
 
-! 117: fgd_get_constant_n check
+! 20: fgd_get_constant_n check
   call fgd_get_constant_n(d, 'const')
-  call check_ok(ne, 117, d)
+  call check_ok(ne, 20, d)
 
-! 4: fgd_field_name_max check
+! 21: fgd_field_name_max check
   i = fgd_field_name_max(d)
-  call check_ok(ne, 4, d)
-  call check_int(ne, 4, i, 7)
+  call check_ok(ne, 21, d)
+  call check_int(ne, 21, i, 7)
 
-! 5: fgd_mfield_name_max check
+! 22: fgd_mfield_name_max check
   i = fgd_mfield_name_max(d, 'data')
-  call check_ok(ne, 5, d)
-  call check_int(ne, 5, i, 6)
+  call check_ok(ne, 22, d)
+  call check_int(ne, 22, i, 6)
 
-! 6: fgd_nfields check
+! 23: fgd_nfields check
   n = fgd_nfields(d)
-  call check_ok(ne, 6, d)
-  call check_int(ne, 6, n, nfields)
+  call check_ok(ne, 23, d)
+  call check_int(ne, 23, n, nfields)
 
-! 8: fgd_field_list check
+! 25: fgd_field_list check
   l = flen
   call fgd_field_list(flist, d, l)
-  call check_ok(ne, 8, d)
-  call check_int(ne, 8, l, flen)
+  call check_ok(ne, 25, d)
+  call check_int(ne, 25, l, flen)
 
   do i = 1, n
-  call check_str2(ne, 8, i, flist(i), fields(i))
+  call check_str2(ne, 25, i, flist(i), fields(i))
   end do
 
-! 9: fgd_nmfields check
+! 26: fgd_nmfields check
   n = fgd_nmfields(d, 'data')
-  call check_ok(ne, 9, d)
-  call check_int(ne, 9, n, 3)
+  call check_ok(ne, 26, d)
+  call check_int(ne, 26, n, 3)
 
-! 10: fgd_mfield_list check
+! 27: fgd_mfield_list check
   fields(1) = 'mstr'
   fields(2) = 'mconst'
   fields(3) = 'mlut'
 
   l = flen
   call fgd_mfield_list(flist, d, 'data', l)
-  call check_ok2(ne, 10, i, d)
-  call check_int2(ne, 10, i, l, flen)
+  call check_ok2(ne, 27, i, d)
+  call check_int2(ne, 27, i, l, flen)
 
   DO i = 1, n
-  call check_str2(ne, 10, i, flist(i), fields(i))
+  call check_str2(ne, 27, i, flist(i), fields(i))
   end do
 
-! 11: fgd_nframes check
+! 28: fgd_nframes check
   n = fgd_nframes(d)
-  call check_ok(ne, 11, d)
-  call check_int(ne, 11, n, 10)
+  call check_ok(ne, 28, d)
+  call check_int(ne, 28, n, 10)
 
-! 12: fgd_spf check
+! 29: fgd_spf check
   n = fgd_spf(d, 'data')
-  call check_ok(ne, 12, d)
-  call check_int(ne, 12, n, 8)
+  call check_ok(ne, 29, d)
+  call check_int(ne, 29, n, 8)
 
-! 13: fgd_putdata_i1 check
+! 30: fgd_putdata_i1 check
   ci1 = (/ 13_1, 14_1, 15_1, 16_1, 17_1, 18_1, 19_1, 90_1 /)
   n = fgd_putdata_i1(d, 'data', 5, 1, 0, 4, ci1)
-  call check_ok(ne, 13, d)
-  call check_int(ne, 13, n, 4)
+  call check_ok(ne, 30, d)
+  call check_int(ne, 30, n, 4)
 
   n = fgd_getdata_i1(d, 'data', 5, 0, 1, 0, ci1)
 
@@ -469,14 +440,14 @@ program big_test
   else
     n = 11 + i
   endif
-  call check_int2(ne, 13, i, int(ci1(i)), n)
+  call check_int2(ne, 30, i, int(ci1(i)), n)
   end do
 
-! 118: fgd_putdata_i2 check
+! 31: fgd_putdata_i2 check
   ci2 = (/ 23_2, 24_2, 25_2, 26_2, 27_2, 28_2, 29_2, 30_2 /)
   n = fgd_putdata_i2(d, 'data', 5, 1, 0, 4, ci2)
-  call check_ok(ne, 118, d)
-  call check_int(ne, 118, n, 4)
+  call check_ok(ne, 31, d)
+  call check_int(ne, 31, n, 4)
 
   n = fgd_getdata_i2(d, 'data', 5, 0, 1, 0, ci2)
 
@@ -486,14 +457,14 @@ program big_test
   else
     n = 21 + i
   endif
-  call check_int2(ne, 118, i, int(ci2(i)), n)
+  call check_int2(ne, 31, i, int(ci2(i)), n)
   end do
 
-! 119: fgd_putdata_i4 check
+! 32: fgd_putdata_i4 check
   ci4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /)
   n = fgd_putdata_i4(d, 'data', 5, 1, 0, 4, ci4)
-  call check_ok(ne, 119, d)
-  call check_int(ne, 119, n, 4)
+  call check_ok(ne, 32, d)
+  call check_int(ne, 32, n, 4)
 
   n = fgd_getdata_i4(d, 'data', 5, 0, 1, 0, ci4)
 
@@ -503,14 +474,14 @@ program big_test
   else
     n = 31 + i
   endif
-  call check_int2(ne, 119, i, int(ci4(i)), n)
+  call check_int2(ne, 32, i, int(ci4(i)), n)
   end do
 
-! 120: fgd_putdata_i8 check
+! 33: fgd_putdata_i8 check
   ci8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /)
   n = fgd_putdata_i8(d, 'data', 5, 1, 0, 4, ci8)
-  call check_ok(ne, 120, d)
-  call check_int(ne, 120, n, 4)
+  call check_ok(ne, 33, d)
+  call check_int(ne, 33, n, 4)
 
   n = fgd_getdata_i8(d, 'data', 5, 0, 1, 0, ci8)
 
@@ -520,14 +491,14 @@ program big_test
   else
     n = 41 + i
   endif
-  call check_int2(ne, 120, i, int(ci8(i)), n)
+  call check_int2(ne, 33, i, int(ci8(i)), n)
   end do
 
-! 121: fgd_putdata_r4 check
+! 34: fgd_putdata_r4 check
   cr4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /)
   n = fgd_putdata_r4(d, 'data', 5, 1, 0, 4, cr4)
-  call check_ok(ne, 121, d)
-  call check_int(ne, 121, n, 4)
+  call check_ok(ne, 34, d)
+  call check_int(ne, 34, n, 4)
 
   n = fgd_getdata_r4(d, 'data', 5, 0, 1, 0, cr4)
 
@@ -537,14 +508,14 @@ program big_test
   else
     dp = 31. + i
   end if
-  call check_dbl2(ne, 121, i, 1d0 * cr4(i), dp)
+  call check_dbl2(ne, 34, i, 1d0 * cr4(i), dp)
   end do
 
-! 122: fgd_putdata_r8 check
+! 35: fgd_putdata_r8 check
   cr8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /)
   n = fgd_putdata_r8(d, 'data', 5, 1, 0, 4, cr8)
-  call check_ok(ne, 122, d)
-  call check_int(ne, 122, n, 4)
+  call check_ok(ne, 35, d)
+  call check_int(ne, 35, n, 4)
 
   n = fgd_getdata_r8(d, 'data', 5, 0, 1, 0, cr8)
 
@@ -554,14 +525,14 @@ program big_test
   else
     dp = 41. + i
   end if
-  call check_dbl2(ne, 122, i, cr8(i), dp)
+  call check_dbl2(ne, 35, i, cr8(i), dp)
   end do
 
-! 123: fgd_putdata_c8 check
+! 36: fgd_putdata_c8 check
   cc8 = (/ 53, 54, 55, 56, 57, 58, 59, 60 /)
   n = fgd_putdata_c8(d, 'data', 5, 1, 0, 4, cc8)
-  call check_ok(ne, 123, d)
-  call check_int(ne, 123, n, 4)
+  call check_ok(ne, 36, d)
+  call check_int(ne, 36, n, 4)
 
   n = fgd_getdata_c8(d, 'data', 5, 0, 1, 0, cc8)
 
@@ -571,14 +542,14 @@ program big_test
   else
     dc = dcmplx(51d0 + i, 0d0)
   end if
-  call check_cpx2(ne, 123, i, 1d0 * cc8(i), dc)
+  call check_cpx2(ne, 36, i, 1d0 * cc8(i), dc)
   end do
 
-! 124: fgd_putdata_c16 check
+! 37: fgd_putdata_c16 check
   cc16 = (/ 63, 64, 65, 66, 67, 68, 69, 70 /)
   n = fgd_putdata_c16(d, 'data', 5, 1, 0, 4, cc16)
-  call check_ok(ne, 124, d)
-  call check_int(ne, 124, n, 4)
+  call check_ok(ne, 37, d)
+  call check_int(ne, 37, n, 4)
 
   n = fgd_getdata_c16(d, 'data', 5, 0, 1, 0, cc16)
 
@@ -588,1025 +559,1054 @@ program big_test
   else
     dc = dcmplx(61d0 + i, 0d0)
   end if
-  call check_cpx2(ne, 124, i, cc16(i), dc)
+  call check_cpx2(ne, 37, i, cc16(i), dc)
   end do
 
-! 14: fgd_error_string check
+! 38: fgd_error_string check
   n = fgd_getdata_n(d, 'x', 5, 0, 1, 0)
   call fgd_error_string(d, str, GD_FIELD_LEN)
-  call check_str(ne, 14, str, 'Field not found: x')
+  call check_str(ne, 38, str, 'Field not found: x')
 
-! 15: fgd_entry_type check
+! 39: fgd_entry_type check
   n = fgd_entry_type(d, 'data')
-  call check_ok(ne, 15, d)
-  call check_int(ne, 15, n, GD_RAW_ENTRY)
+  call check_ok(ne, 39, d)
+  call check_int(ne, 39, n, GD_RAW_ENTRY)
 
-! 16: fgd_entry (raw) check
+! 40: fgd_entry (raw) check
   n = fgd_entry(d, 'data', ent)
-  call check_ok(ne, 16, d)
-  call check_int2(ne, 16, 1, n, GD_RAW_ENTRY)
-  call check_int2(ne, 16, 2, ent%fragment_index, 0)
-  call check_int2(ne, 16, 3, ent%spf, 8)
-  call check_int2(ne, 16, 4, ent%data_type, GD_INT8)
+  call check_ok(ne, 40, d)
+  call check_int2(ne, 40, 1, n, GD_RAW_ENTRY)
+  call check_int2(ne, 40, 2, ent%fragment_index, 0)
+  call check_int2(ne, 40, 3, ent%spf, 8)
+  call check_int2(ne, 40, 4, ent%data_type, GD_INT8)
 
-! 18: fgd_entry (lincom) check
+! 42: fgd_entry (lincom) check
   n = fgd_entry(d, 'lincom', ent)
-  call check_ok(ne, 18, d)
-  call check_int2(ne, 18, 1, n, GD_LINCOM_ENTRY)
-  call check_int2(ne, 18, 2, ent%n_fields, 3)
-  call check_int2(ne, 18, 3, ent%fragment_index, 0)
-  call check_str2(ne, 18, 4, ent%field(1), 'data')
-  call check_str2(ne, 18, 5, ent%field(2), 'INDEX')
-  call check_str2(ne, 18, 6, ent%field(3), 'linterp')
-  call check_int2(ne, 18, 7, ent%comp_scal, 1)
-  call check_str2(ne, 18, 8, ent%scalar(3), 'const')
-  call check_str2(ne, 18, 9, ent%scalar(6), 'const')
-
-  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)
+  call check_ok(ne, 42, d)
+  call check_int2(ne, 42,  1, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 42,  2, ent%n_fields, 3)
+  call check_int2(ne, 42,  3, ent%fragment_index, 0)
+  call check_str2(ne, 42,  4, ent%field(1), 'data')
+  call check_str2(ne, 42,  5 , ent%field(2), 'INDEX')
+  call check_str2(ne, 42,  6, ent%field(3), 'linterp')
+  call check_int2(ne, 42,  7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_str2(ne, 42,  8, ent%scalar(1), '')
+  call check_str2(ne, 42,  9, ent%scalar(2), '')
+  call check_str2(ne, 42, 10, ent%scalar(3), 'const')
+  call check_str2(ne, 42, 11, ent%scalar(4), '')
+  call check_str2(ne, 42, 12, ent%scalar(5), '')
+  call check_str2(ne, 42, 13, ent%scalar(6), 'const')
+  call check_int2(ne, 42, 14, ent%scalar_ind(1), 1)
+  call check_int2(ne, 42, 15, ent%scalar_ind(2), 1)
+  call check_int2(ne, 42, 16, ent%scalar_ind(3), -1)
+  call check_int2(ne, 42, 17, ent%scalar_ind(4), 1)
+  call check_int2(ne, 42, 18, ent%scalar_ind(5), 1)
+  call check_int2(ne, 42, 19, ent%scalar_ind(6), -1)
+
+  cq(1) = dcmplx(1.1d0, 0.0d0)
+  cq(2) = dcmplx(2.2d0, 0.0d0)
+  cq(3) = dcmplx(2.2d0, 0.0d0)
+  cq(4) = dcmplx(3.3d0, 4.4d0)
+  cq(5) = dcmplx(5.5d0, 0.0d0)
+  cq(6) = dcmplx(5.5d0, 0.0d0)
   DO i=1,3
-  call check_cpx2(ne, 18, i * 2 - 1, ent%cm(i), cq(i * 2 - 1))
-  call check_cpx2(ne, 18, i * 2, ent%cb(i), cq(i * 2))
+  call check_cpx2(ne, 42, i * 2 + 18, ent%cm(i), cq(i * 2 - 1))
+  call check_cpx2(ne, 42, i * 2 + 19, ent%cb(i), cq(i * 2))
   end do
 
-! 20: fgd_entry (polynom) check
+! 44: fgd_entry (polynom) check
   n = fgd_entry(d, 'polynom', ent)
-  call check_ok(ne, 20, d)
-  call check_int2(ne, 20, 1, n, GD_POLYNOM_ENTRY)
-  call check_int2(ne, 20, 2, ent%poly_ord, 5)
-  call check_int2(ne, 20, 3, ent%fragment_index, 0)
-  call check_str2(ne, 20, 4, ent%field(1), 'data')
-
-  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)
+  call check_ok(ne, 44, d)
+  call check_int2(ne, 44, 1, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 44, 2, ent%poly_ord, 5)
+  call check_int2(ne, 44, 3, ent%fragment_index, 0)
+  call check_str2(ne, 44, 4, ent%field(1), 'data')
+
+  cq(1) = dcmplx(1.1d0, 0.0d0)
+  cq(2) = dcmplx(2.2d0, 0.0d0)
+  cq(3) = dcmplx(2.2d0, 0.0d0)
+  cq(4) = dcmplx(3.3d0, 4.4d0)
+  cq(5) = dcmplx(5.5d0, 0.0d0)
+  cq(6) = dcmplx(5.5d0, 0.0d0)
   DO i=1,6
-  call check_cpx2(ne, 30, i, ent%ca(i), cq(i))
+  call check_cpx2(ne, 44, i, ent%ca(i), cq(i))
   end do
 
-! 21: fgd_entry (linterp) check
+! 45: fgd_entry (linterp) check
   n = fgd_entry(d, 'linterp', ent)
-  call check_ok(ne, 21, d)
-  call check_int2(ne, 21, 1, n, GD_LINTERP_ENTRY)
-  call check_int2(ne, 21, 2, ent%fragment_index, 0)
-  call check_str2(ne, 21, 3, ent%field(1), 'data')
-  call check_str2(ne, 21, 4, ent%field(2), './lut')
+  call check_ok(ne, 45, d)
+  call check_int2(ne, 45, 1, n, GD_LINTERP_ENTRY)
+  call check_int2(ne, 45, 2, ent%fragment_index, 0)
+  call check_str2(ne, 45, 3, ent%field(1), 'data')
+  call check_str2(ne, 45, 4, ent%field(2), './lut')
 
-! 22: fgd_entry (bit) check
+! 46: fgd_entry (bit) check
   n = fgd_entry(d, 'bit', ent)
-  call check_ok(ne, 22, d)
-  call check_int2(ne, 22, 1, n, GD_BIT_ENTRY)
-  call check_int2(ne, 22, 2, ent%fragment_index, 0)
-  call check_int2(ne, 22, 3, ent%bitnum, 3)
-  call check_int2(ne, 22, 4, ent%numbits, 4)
-  call check_str2(ne, 22, 5, ent%field(1), 'data')
-
-! 23: fgd_entry (Sbit) check
+  call check_ok(ne, 46, d)
+  call check_int2(ne, 46, 1, n, GD_BIT_ENTRY)
+  call check_int2(ne, 46, 2, ent%fragment_index, 0)
+  call check_int2(ne, 46, 3, ent%bitnum, 3)
+  call check_int2(ne, 46, 4, ent%numbits, 4)
+  call check_str2(ne, 46, 5, ent%field(1), 'data')
+
+! 47: fgd_entry (Sbit) check
   n = fgd_entry(d, 'sbit', ent)
-  call check_ok(ne, 23, d)
-  call check_int2(ne, 23, 1, n, GD_SBIT_ENTRY)
-  call check_int2(ne, 23, 2, ent%fragment_index, 0)
-  call check_int2(ne, 23, 3, ent%numbits, 6)
-  call check_int2(ne, 23, 4, ent%bitnum, 5)
-  call check_str2(ne, 23, 5, ent%field(1), 'data')
+  call check_ok(ne, 47, d)
+  call check_int2(ne, 47, 1, n, GD_SBIT_ENTRY)
+  call check_int2(ne, 47, 2, ent%fragment_index, 0)
+  call check_int2(ne, 47, 3, ent%numbits, 6)
+  call check_int2(ne, 47, 4, ent%bitnum, 5)
+  call check_str2(ne, 47, 5, ent%field(1), 'data')
 
-! 24: fgd_entry (multiply) check
+! 48: fgd_entry (multiply) check
   n = fgd_entry(d, 'mult', ent)
-  call check_ok(ne, 24, d)
-  call check_int2(ne, 24, 1, n, GD_MULTIPLY_ENTRY)
-  call check_int2(ne, 24, 2, ent%fragment_index, 0)
-  call check_str2(ne, 24, 3, ent%field(1), 'data')
-  call check_str2(ne, 24, 4, ent%field(2), 'sbit')
+  call check_ok(ne, 48, d)
+  call check_int2(ne, 48, 1, n, GD_MULTIPLY_ENTRY)
+  call check_int2(ne, 48, 2, ent%fragment_index, 0)
+  call check_str2(ne, 48, 3, ent%field(1), 'data')
+  call check_str2(ne, 48, 4, ent%field(2), 'sbit')
 
-! 25: fgd_entry (phase) check
+! 49: fgd_entry (phase) check
   n = fgd_entry(d, 'phase', ent)
-  call check_ok(ne, 25, d)
-  call check_int2(ne, 25, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 25, 2, ent%fragment_index, 0)
-  call check_int2(ne, 25, 3, ent%shift, 11)
-  call check_str2(ne, 25, 4, ent%field(1), 'data')
+  call check_ok(ne, 49, d)
+  call check_int2(ne, 49, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 49, 2, ent%fragment_index, 0)
+  call check_int2(ne, 49, 3, ent%shift, 11)
+  call check_str2(ne, 49, 4, ent%field(1), 'data')
 
-! 26: fgd_entry (const) check
+! 50: fgd_entry (const) check
   n = fgd_entry(d, 'const', ent)
-  call check_ok(ne, 26, d)
-  call check_int2(ne, 26, 1, n, GD_CONST_ENTRY)
-  call check_int2(ne, 26, 2, ent%fragment_index, 0)
-  call check_int2(ne, 26, 3, ent%data_type, GD_FLOAT64)
+  call check_ok(ne, 50, d)
+  call check_int2(ne, 50, 1, n, GD_CONST_ENTRY)
+  call check_int2(ne, 50, 2, ent%fragment_index, 0)
+  call check_int2(ne, 50, 3, ent%data_type, GD_FLOAT64)
 
-! 27: fgd_fragment_index check
+! 52: fgd_fragment_index check
   n = fgd_fragment_index(d, 'const')
-  call check_ok(ne, 27, d)
-  call check_int(ne, 27, n, 0)
+  call check_ok(ne, 52, d)
+  call check_int(ne, 52, n, 0)
 
-! 28: fgd_add_raw check
+! 53: fgd_add_raw check
   call fgd_add_raw(d, 'new1', GD_FLOAT64, 3, 0)
-  call check_ok2(ne, 28, 1, d)
+  call check_ok2(ne, 53, 1, d)
 
   n = fgd_entry(d, 'new1', ent)
-  call check_ok2(ne, 28, 2, d)
-  call check_int2(ne, 28, 3, ent%fragment_index, 0)
-  call check_int2(ne, 28, 4, ent%spf, 3)
-  call check_int2(ne, 28, 5, ent%data_type, GD_FLOAT64)
-  call check_int2(ne, 28, 6, n, GD_RAW_ENTRY)
+  call check_ok2(ne, 53, 2, d)
+  call check_int2(ne, 53, 3, ent%fragment_index, 0)
+  call check_int2(ne, 53, 4, ent%spf, 3)
+  call check_int2(ne, 53, 5, ent%data_type, GD_FLOAT64)
+  call check_int2(ne, 53, 6, n, GD_RAW_ENTRY)
 
-! 29: fgd_add_lincom check
+! 54: fgd_add_lincom check
   call fgd_add_lincom(d, 'new2', 2, 'in1', 9.9d0, 8.8d0, &
   'in2', 7.7d0, 6.6d0, '', 0d0, 0d0, 0)
-  call check_ok2(ne, 29, 1, d)
+  call check_ok2(ne, 54, 1, d)
 
   n = fgd_entry(d, 'new2', ent)
-  call check_ok2(ne, 29, 2, d)
-  call check_int2(ne, 29, 3, n, GD_LINCOM_ENTRY)
-  call check_int2(ne, 29, 4, ent%n_fields, 2)
-  call check_int2(ne, 29, 5, ent%fragment_index, 0)
-  call check_str2(ne, 29, 6, ent%field(1), 'in1')
-  call check_str2(ne, 29, 7, ent%field(2), 'in2')
-  call check_int2(ne, 29, 8, ent%comp_scal, 0)
-
-  q = (/ 9.9, 8.8, 7.7, 6.6, 5.5, 5.5 /)
+  call check_ok2(ne, 54, 2, d)
+  call check_int2(ne, 54, 3, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 54, 4, ent%n_fields, 2)
+  call check_int2(ne, 54, 5, ent%fragment_index, 0)
+  call check_str2(ne, 54, 6, ent%field(1), 'in1')
+  call check_str2(ne, 54, 7, ent%field(2), 'in2')
+  call check_int2(ne, 54, 8, ent%flags, GD_EN_CALC)
+
+  q = (/ 9.9d0, 8.8d0, 7.7d0, 6.6d0, 5.5d0, 5.5d0 /)
   do i=1,2
-  call check_dbl2(ne, 29, i * 2 - 1, ent%m(i), q(i * 2 - 1))
-  call check_dbl2(ne, 29, i * 2, ent%b(i), q(i * 2))
+  call check_dbl2(ne, 54, i * 2 - 1, ent%m(i), q(i * 2 - 1))
+  call check_dbl2(ne, 54, i * 2, ent%b(i), q(i * 2))
   end do
 
-! 30: fgd_add_clincom check
+! 55: fgd_add_clincom check
   cq(1) = dcmplx(1.1, 1.2)
   cq(2) = dcmplx(1.3, 1.4)
   cq(3) = dcmplx(1.4, 1.5)
   cq(4) = dcmplx(1.6, 1.7)
   call fgd_add_clincom(d, 'new3', 2, 'in1', cq(1), cq(2), &
   'in2', cq(3), cq(4), '', cq(5), cq(6), 0)
-  call check_ok2(ne, 30, 1, d)
+  call check_ok2(ne, 55, 1, d)
 
   n = fgd_entry(d, 'new3', ent)
-  call check_ok2(ne, 30, 2, d)
-  call check_int2(ne, 30, 1, ent%n_fields, 2)
-  call check_int2(ne, 30, 2, n, GD_LINCOM_ENTRY)
-  call check_int2(ne, 30, 3, ent%fragment_index, 0)
-  call check_str2(ne, 30, 4, ent%field(1), 'in1')
-  call check_str2(ne, 30, 5, ent%field(2), 'in2')
-  call check_int2(ne, 30, 6, ent%comp_scal, 1)
+  call check_ok2(ne, 55, 2, d)
+  call check_int2(ne, 55, 3, ent%n_fields, 2)
+  call check_int2(ne, 55, 4, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 55, 5, ent%fragment_index, 0)
+  call check_str2(ne, 55, 6, ent%field(1), 'in1')
+  call check_str2(ne, 55, 7, ent%field(2), 'in2')
+  call check_int2(ne, 55, 8, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
 
   cq(1) = dcmplx(1.1, 1.2)
   cq(2) = dcmplx(1.3, 1.4)
   cq(3) = dcmplx(1.4, 1.5)
   cq(4) = dcmplx(1.6, 1.7)
   do i=1,2
-  call check_cpx2(ne, 30, i * 2 - 1, ent%cm(i), cq(i * 2 - 1))
-  call check_cpx2(ne, 30, i * 2, ent%cb(i), cq(i * 2))
+  call check_cpx2(ne, 55, i * 2 + 7, ent%cm(i), cq(i * 2 - 1))
+  call check_cpx2(ne, 55, i * 2 + 8, ent%cb(i), cq(i * 2))
   end do
 
-! 31: fgd_add_polynom check
+! 56: fgd_add_polynom check
   call fgd_add_polynom(d, 'new4', 3, 'in1', 3d3, 4d4, 5d5, 6d6, 0d0, 0d0, &
   0)
-  call check_ok2(ne, 31, 1, d)
+  call check_ok2(ne, 56, 1, d)
 
   n = fgd_entry(d, 'new4', ent)
-  call check_ok2(ne, 31, 2, d)
-  call check_int2(ne, 31, 1, n, GD_POLYNOM_ENTRY)
-  call check_int2(ne, 31, 2, ent%poly_ord, 3)
-  call check_int2(ne, 31, 3, ent%fragment_index, 0)
-  call check_str2(ne, 31, 4, ent%field(1), 'in1')
-  call check_int2(ne, 31, 5, ent%comp_scal, 0)
+  call check_ok2(ne, 56, 2, d)
+  call check_int2(ne, 56, 1, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 56, 2, ent%poly_ord, 3)
+  call check_int2(ne, 56, 3, ent%fragment_index, 0)
+  call check_str2(ne, 56, 4, ent%field(1), 'in1')
+  call check_int2(ne, 56, 5, ent%flags, GD_EN_CALC)
 
   q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /)
   DO i=1,4
-  call check_dbl2(ne, 31, i, ent%a(i), q(i))
+  call check_dbl2(ne, 56, i, ent%a(i), q(i))
   end do
 
-! 32: fgd_add_cpolynom check
+! 57: fgd_add_cpolynom check
   cq(1) = dcmplx(3.1, 7.0)
   cq(2) = dcmplx(4.2, 8.0)
   cq(3) = dcmplx(5.2, 9.0)
   cq(4) = dcmplx(6.3, 4.4)
   call fgd_add_cpolynom(d, 'new5', 3, 'in1', cq(1), cq(2), cq(3), cq(4), &
   dcmplx(0d0,0d0), dcmplx(0d0,0d0), 0)
-  call check_ok2(ne, 32, 1, d)
+  call check_ok2(ne, 57, 1, d)
 
   n = fgd_entry(d, 'new5', ent)
-  call check_ok2(ne, 32, 2, d)
-  call check_int2(ne, 32, 1, n, GD_POLYNOM_ENTRY)
-  call check_int2(ne, 32, 2, ent%poly_ord, 3)
-  call check_int2(ne, 32, 3, ent%fragment_index, 0)
-  call check_str2(ne, 32, 4, ent%field(1), 'in1')
-  call check_int2(ne, 31, 5, ent%comp_scal, 1)
+  call check_ok2(ne, 57, 2, d)
+  call check_int2(ne, 57, 1, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 57, 2, ent%poly_ord, 3)
+  call check_int2(ne, 57, 3, ent%fragment_index, 0)
+  call check_str2(ne, 57, 4, ent%field(1), 'in1')
+  call check_int2(ne, 57, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
 
   cq(1) = dcmplx(3.1, 7.0)
   cq(2) = dcmplx(4.2, 8.0)
   cq(3) = dcmplx(5.2, 9.0)
   cq(4) = dcmplx(6.3, 4.4)
   DO i=1,4
-  call check_cpx2(ne, 32, i, ent%ca(i), cq(i))
+  call check_cpx2(ne, 57, i, ent%ca(i), cq(i))
   end do
 
-! 33: fgd_add_linterp check
+! 58: fgd_add_linterp check
   call fgd_add_linterp(d, "new6", "in", "./some/table", 0)
-  call check_ok2(ne, 33, 1, d)
+  call check_ok2(ne, 58, 1, d)
 
   n = fgd_entry(d, 'new6', ent)
-  call check_ok2(ne, 33, 2, d)
-  call check_int2(ne, 33, 1, n, GD_LINTERP_ENTRY)
-  call check_int2(ne, 33, 2, ent%fragment_index, 0)
-  call check_str2(ne, 33, 3, ent%field(1), 'in')
-  call check_str2(ne, 33, 4, ent%field(2), './some/table')
+  call check_ok2(ne, 58, 2, d)
+  call check_int2(ne, 58, 1, n, GD_LINTERP_ENTRY)
+  call check_int2(ne, 58, 2, ent%fragment_index, 0)
+  call check_str2(ne, 58, 3, ent%field(1), 'in')
+  call check_str2(ne, 58, 4, ent%field(2), './some/table')
 
-! 34: fgd_add_bit check
+! 59: fgd_add_bit check
   call fgd_add_bit(d, "new7", "in", 13, 12, 0)
-  call check_ok2(ne, 34, 1, d)
+  call check_ok2(ne, 59, 1, d)
 
   n = fgd_entry(d, 'new7', ent)
-  call check_ok2(ne, 34, 2, d)
-  call check_int2(ne, 34, 1, n, GD_BIT_ENTRY)
-  call check_int2(ne, 34, 2, ent%fragment_index, 0)
-  call check_int2(ne, 34, 3, ent%numbits, 12)
-  call check_int2(ne, 34, 4, ent%bitnum, 13)
-  call check_str2(ne, 34, 5, ent%field(1), 'in')
-
-! 35: fgd_add_sbit check
+  call check_ok2(ne, 59, 2, d)
+  call check_int2(ne, 59, 1, n, GD_BIT_ENTRY)
+  call check_int2(ne, 59, 2, ent%fragment_index, 0)
+  call check_int2(ne, 59, 3, ent%numbits, 12)
+  call check_int2(ne, 59, 4, ent%bitnum, 13)
+  call check_str2(ne, 59, 5, ent%field(1), 'in')
+
+! 60: fgd_add_sbit check
   call fgd_add_sbit(d, "new8", "in", 13, 12, 0)
-  call check_ok2(ne, 35, 1, d)
+  call check_ok2(ne, 60, 1, d)
 
   n = fgd_entry(d, "new8", ent)
-  call check_ok2(ne, 35, 2, d)
-  call check_int2(ne, 35, 1, n, GD_SBIT_ENTRY)
-  call check_int2(ne, 35, 2, ent%fragment_index, 0)
-  call check_int2(ne, 35, 3, ent%numbits, 12)
-  call check_int2(ne, 35, 4, ent%bitnum, 13)
-  call check_str2(ne, 35, 5, ent%field(1), 'in')
-
-! 36: fgd_add_multiply check
+  call check_ok2(ne, 60, 2, d)
+  call check_int2(ne, 60, 1, n, GD_SBIT_ENTRY)
+  call check_int2(ne, 60, 2, ent%fragment_index, 0)
+  call check_int2(ne, 60, 3, ent%numbits, 12)
+  call check_int2(ne, 60, 4, ent%bitnum, 13)
+  call check_str2(ne, 60, 5, ent%field(1), 'in')
+
+! 61: fgd_add_multiply check
   call fgd_add_multiply(d, 'new9', 'in1', 'in2', 0)
-  call check_ok2(ne, 36, 1, d)
+  call check_ok2(ne, 61, 1, d)
 
   n = fgd_entry(d, 'new9', ent)
-  call check_ok2(ne, 36, 2, d)
-  call check_int2(ne, 36, 1, n, GD_MULTIPLY_ENTRY)
-  call check_int2(ne, 36, 2, ent%fragment_index, 0)
-  call check_str2(ne, 36, 3, ent%field(1), 'in1')
-  call check_str2(ne, 36, 4, ent%field(2), 'in2')
+  call check_ok2(ne, 61, 2, d)
+  call check_int2(ne, 61, 1, n, GD_MULTIPLY_ENTRY)
+  call check_int2(ne, 61, 2, ent%fragment_index, 0)
+  call check_str2(ne, 61, 3, ent%field(1), 'in1')
+  call check_str2(ne, 61, 4, ent%field(2), 'in2')
 
-! 37: fgd_add_phase check
+! 62: fgd_add_phase check
   call fgd_add_phase(d, 'new10', 'in1', 22, 0)
-  call check_ok2(ne, 37, 1, d)
+  call check_ok2(ne, 62, 1, d)
 
   n = fgd_entry(d, 'new10', ent)
-  call check_ok2(ne, 37, 2, d)
-  call check_int2(ne, 37, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 37, 2, ent%fragment_index, 0)
-  call check_int2(ne, 37, 3, ent%shift, 22)
-  call check_str2(ne, 37, 4, ent%field(1), 'in1')
+  call check_ok2(ne, 62, 2, d)
+  call check_int2(ne, 62, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 62, 2, ent%fragment_index, 0)
+  call check_int2(ne, 62, 3, ent%shift, 22)
+  call check_str2(ne, 62, 4, ent%field(1), 'in1')
 
-! 38: fgd_add_const check
+! 63: fgd_add_const check
   call fgd_add_const(d, 'new11', GD_FLOAT64, 0)
-  call check_ok2(ne, 38, 1, d)
+  call check_ok2(ne, 63, 1, d)
 
   n = fgd_entry(d, 'new11', ent)
-  call check_ok2(ne, 38, 2, d)
-  call check_int2(ne, 38, 1, n, GD_CONST_ENTRY)
-  call check_int2(ne, 38, 2, ent%fragment_index, 0)
-  call check_int2(ne, 38, 3, ent%data_type, GD_FLOAT64)
+  call check_ok2(ne, 63, 2, d)
+  call check_int2(ne, 63, 1, n, GD_CONST_ENTRY)
+  call check_int2(ne, 63, 2, ent%fragment_index, 0)
+  call check_int2(ne, 63, 3, ent%data_type, GD_FLOAT64)
 
   call fgd_get_constant_r4(d, 'new11', fl)
-  call check_ok2(ne, 38, 3, d)
-  call check_dbl(ne, 38, 1d0 * fl, 0d0)
+  call check_ok2(ne, 63, 3, d)
+  call check_dbl(ne, 63, 1d0 * fl, 0d0)
 
-! 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)
-  call check_ok2(ne, 125, 1, d)
-
-  n = fgd_entry(d, 'new13', ent)
-  call check_ok2(ne, 125, 2, d)
-  call check_int2(ne, 125, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 125, 2, ent%fragment_index, 0)
-  call check_int2(ne, 125, 3, ent%shift, 33)
-  call check_str2(ne, 125, 4, ent%field(1), 'new9')
-
-! 39: fgd_fragmentname check
+! 64: fgd_fragmentname check
   str = fgd_fragmentname(d, 0)
-  call check_ok(ne, 39, d)
-  call check_eos(ne, 39, str, fildir//DIRSEP//'format')
+  call check_ok(ne, 64, d)
+  call check_eos(ne, 64, str, fildir//DIRSEP//'format')
 
-! 40: fgd_nfragments check
+! 65: fgd_nfragments check
   n = fgd_nfragments(d)
-  call check_ok(ne, 40, d)
-  call check_int(ne, 40, n, 1)
+  call check_ok(ne, 65, d)
+  call check_int(ne, 65, n, 1)
 
-! 41: fgd_include check
+! 66: fgd_include check
   call fgd_include(d, 'form2', 0, 0)
-  call check_ok2(ne, 41, 3, d)
+  call check_ok2(ne, 66, 3, d)
 
   call fgd_get_constant_i1(d, 'const2', ci1(1))
-  call check_ok2(ne, 41, 3, d)
-  call check_int2(ne, 1, 41, int(ci1(1)), -19)
+  call check_ok2(ne, 66, 3, d)
+  call check_int2(ne, 1, 66, int(ci1(1)), -19)
 
-! 42: fgd_nfields_by_type check
+! 67: fgd_nfields_by_type check
   n = fgd_nfields_by_type(d, GD_LINCOM_ENTRY)
-  call check_ok(ne, 42, d)
-  call check_int(ne, 42, n, 3)
+  call check_ok(ne, 67, d)
+  call check_int(ne, 67, n, 3)
 
-! 43: fgd_field_list_by_type check
+! 68: fgd_field_list_by_type check
   fields(1) = 'lincom'
   fields(2) = 'new2'
   fields(3) = 'new3'
   l = flen
   call fgd_field_list_by_type(flist, d, GD_LINCOM_ENTRY, l)
-  call check_ok(ne, 43, d)
-  call check_int(ne, 43, l, flen)
+  call check_ok(ne, 68, d)
+  call check_int(ne, 68, l, flen)
 
   do i = 1, n
-  call check_str2(ne, 43, i, flist(i), fields(i))
+  call check_str2(ne, 68, i, flist(i), fields(i))
   end do
 
-! 44: fgd_nvectors check
+! 69: fgd_nvectors check
   n = fgd_nvectors(d)
-  call check_ok(ne, 44, d)
-  call check_int(ne, 44, n, 25)
+  call check_ok(ne, 69, d)
+  call check_int(ne, 69, n, 24)
 
-! 45: fgd_vector_list check
+! 70: fgd_vector_list check
   fields = (/    'INDEX      ', 'alias      ', 'bit        ', 'data       ', &
   'div        ', 'lincom     ', 'linterp    ', 'mplex      ', 'mult       ', &
-  'new1       ', 'new10      ', 'new13      ', 'new2       ', 'new3       ', &
-  'new4       ', 'new5       ', 'new6       ', 'new7       ', 'new8       ', &
-  'new9       ', 'phase      ', 'polynom    ', 'recip      ', 'sbit       ', &
-  'window     ', '           ', '           ', '           ' /)
+  'new1       ', 'new10      ', 'new2       ', 'new3       ', 'new4       ', &
+  'new5       ', 'new6       ', 'new7       ', 'new8       ', 'new9       ', &
+  'phase      ', 'polynom    ', 'recip      ', 'sbit       ', 'window     ', &
+  '           ', '           ', '           ', '           ' /)
   l = flen
   call fgd_vector_list(flist, d, l)
-  call check_ok(ne, 45, d)
-  call check_int(ne, 45, l, flen)
+  call check_ok(ne, 70, d)
+  call check_int(ne, 70, l, flen)
  
   do i=1,n
-  call check_str2(ne, 45, i, flist(i), fields(i))
+  call check_str2(ne, 70, i, flist(i), fields(i))
   end do
 
-! 46: fgd_madd_lincom check
+! 71: fgd_madd_lincom check
   call fgd_madd_lincom(d, 'data', 'mnew1', 2, 'in1', 9.9d0, 8.8d0, &
   'in2', 7.7d0, 6.6d0, '', 0d0, 0d0)
-  call check_ok2(ne, 46, 1, d)
+  call check_ok2(ne, 71, 1, d)
 
   n = fgd_entry(d, 'data/mnew1', ent)
-  call check_ok2(ne, 46, 2, d)
-  call check_int2(ne, 46, 3, n, GD_LINCOM_ENTRY)
-  call check_int2(ne, 46, 4, ent%n_fields, 2)
-  call check_int2(ne, 46, 5, ent%fragment_index, 0)
-  call check_str2(ne, 46, 6, ent%field(1), 'in1')
-  call check_str2(ne, 46, 7, ent%field(2), 'in2')
-  call check_int2(ne, 46, 8, ent%comp_scal, 0)
-
-  q = (/ 9.9, 8.8, 7.7, 6.6, 5.5, 5.5 /)
+  call check_ok2(ne, 71, 2, d)
+  call check_int2(ne, 71, 3, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 71, 4, ent%n_fields, 2)
+  call check_int2(ne, 71, 5, ent%fragment_index, 0)
+  call check_str2(ne, 71, 6, ent%field(1), 'in1')
+  call check_str2(ne, 71, 7, ent%field(2), 'in2')
+  call check_int2(ne, 71, 8, ent%flags, GD_EN_CALC)
+
+  q = (/ 9.9d0, 8.8d0, 7.7d0, 6.6d0, 5.5d0, 5.5d0 /)
   DO i=1,2
-  call check_dbl2(ne, 46, i * 2 - 1, ent%m(i), q(i *  2 - 1))
-  call check_dbl2(ne, 46, i * 2, ent%b(i), q(i * 2))
+  call check_dbl2(ne, 71, i * 2 - 1, ent%m(i), q(i *  2 - 1))
+  call check_dbl2(ne, 71, i * 2, ent%b(i), q(i * 2))
   end do
 
-! 47: fgd_madd_clincom check
+! 72: fgd_madd_clincom check
   cq(1) = dcmplx(1.1, 1.2)
   cq(2) = dcmplx(1.3, 1.4)
   cq(3) = dcmplx(1.4, 1.5)
   cq(4) = dcmplx(1.6, 1.7)
   call fgd_madd_clincom(d, 'data', 'mnew2', 2, 'in1', cq(1), cq(2), &
   'in2', cq(3), cq(4), '', cq(5), cq(6))
-  call check_ok2(ne, 47, 1, d)
+  call check_ok2(ne, 72, 1, d)
 
   n = fgd_entry(d, 'data/mnew2', ent)
-  call check_ok(ne, 47, d)
-  call check_int2(ne, 47, 1, n, GD_LINCOM_ENTRY)
-  call check_int2(ne, 47, 2, ent%n_fields, 2)
-  call check_int2(ne, 47, 3, ent%fragment_index, 0)
-  call check_str2(ne, 47, 4, ent%field(1), 'in1')
-  call check_str2(ne, 47, 5, ent%field(2), 'in2')
-  call check_int2(ne, 47, 6, ent%comp_scal, 1)
+  call check_ok(ne, 72, d)
+  call check_int2(ne, 72, 1, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 72, 2, ent%n_fields, 2)
+  call check_int2(ne, 72, 3, ent%fragment_index, 0)
+  call check_str2(ne, 72, 4, ent%field(1), 'in1')
+  call check_str2(ne, 72, 5, ent%field(2), 'in2')
+  call check_int2(ne, 72, 6, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
 
   cq(1) = dcmplx(1.1, 1.2)
   cq(2) = dcmplx(1.3, 1.4)
   cq(3) = dcmplx(1.4, 1.5)
   cq(4) = dcmplx(1.6, 1.7)
   DO i=1,2
-  call check_cpx2(ne, 47, i * 2 - 1, ent%cm(i), cq(i * 2 - 1))
-  call check_cpx2(ne, 47, i * 2, ent%cb(i), cq(i * 2))
+  call check_cpx2(ne, 72, i * 2 - 1, ent%cm(i), cq(i * 2 - 1))
+  call check_cpx2(ne, 72, i * 2, ent%cb(i), cq(i * 2))
   end do
 
-! 48: fgd_madd_polynom check
+! 73: fgd_madd_polynom check
   call fgd_madd_polynom(d, 'data', 'mnew3', 3, 'in1', 3d3, 4d4, 5d5, &
      6d6, 0d0, 0d0)
-  call check_ok2(ne, 48, 1, d)
+  call check_ok2(ne, 73, 1, d)
 
   n = fgd_entry(d, 'data/mnew3', ent)
-  call check_ok2(ne, 48, 2, d)
-  call check_int2(ne, 48, 1, n, GD_POLYNOM_ENTRY)
-  call check_int2(ne, 48, 2, ent%poly_ord, 3)
-  call check_int2(ne, 48, 3, ent%fragment_index, 0)
-  call check_str2(ne, 48, 4, ent%field(1), 'in1')
+  call check_ok2(ne, 73, 2, d)
+  call check_int2(ne, 73, 1, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 73, 2, ent%poly_ord, 3)
+  call check_int2(ne, 73, 3, ent%fragment_index, 0)
+  call check_str2(ne, 73, 4, ent%field(1), 'in1')
 
   q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /)
   DO i=1,4
-  call check_dbl2(ne, 48, i, ent%a(i), q(i))
+  call check_dbl2(ne, 73, i, ent%a(i), q(i))
   end do
 
-! 49: fgd_madd_cpolynom check
+! 74: fgd_madd_cpolynom check
   cq(1) = dcmplx(1.1, 0.0)
   cq(2) = dcmplx(2.2, 0.0)
   cq(3) = dcmplx(2.2, 0.0)
   cq(4) = dcmplx(3.3, 4.4)
   call fgd_madd_cpolynom(d, 'data', 'mnew5', 3, 'in1', cq(1), cq(2), &
      cq(3), cq(4), dcmplx(0d0,0d0), dcmplx(0d0,0d0))
-  call check_ok2(ne, 49, 1, d)
+  call check_ok2(ne, 74, 1, d)
 
   n = fgd_entry(d, 'data/mnew5', ent)
-  call check_ok2(ne, 49, 2, d)
-  call check_int2(ne, 49, 1, n, GD_POLYNOM_ENTRY)
-  call check_int2(ne, 49, 2, ent%poly_ord, 3)
-  call check_int2(ne, 49, 3, ent%fragment_index, 0)
-  call check_str2(ne, 49, 4, ent%field(1), 'in1')
+  call check_ok2(ne, 74, 2, d)
+  call check_int2(ne, 74, 1, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 74, 2, ent%poly_ord, 3)
+  call check_int2(ne, 74, 3, ent%fragment_index, 0)
+  call check_str2(ne, 74, 4, ent%field(1), 'in1')
 
   cq(1) = dcmplx(1.1, 0.0)
   cq(2) = dcmplx(2.2, 0.0)
   cq(3) = dcmplx(2.2, 0.0)
   cq(4) = dcmplx(3.3, 4.4)
   DO i=1,4
-  call check_cpx2(ne, 49, i, ent%ca(i), cq(i))
+  call check_cpx2(ne, 74, i, ent%ca(i), cq(i))
   end do
 
-! 50: fgd_madd_linterp check
+! 75: fgd_madd_linterp check
   call fgd_madd_linterp(d, "data", "mnew6", "in", "./more/table")
-  call check_ok2(ne, 50, 1, d)
+  call check_ok2(ne, 75, 1, d)
 
   n = fgd_entry(d, 'data/mnew6', ent)
-  call check_ok2(ne, 50, 2, d)
-  call check_int2(ne, 50, 1, n, GD_LINTERP_ENTRY)
-  call check_int2(ne, 50, 2, ent%fragment_index, 0)
-  call check_str2(ne, 50, 3, ent%field(1), 'in')
-  call check_str2(ne, 50, 4, ent%field(2), './more/table')
+  call check_ok2(ne, 75, 2, d)
+  call check_int2(ne, 75, 1, n, GD_LINTERP_ENTRY)
+  call check_int2(ne, 75, 2, ent%fragment_index, 0)
+  call check_str2(ne, 75, 3, ent%field(1), 'in')
+  call check_str2(ne, 75, 4, ent%field(2), './more/table')
 
-! 51: fgd_madd_bit check
+! 76: fgd_madd_bit check
   call fgd_madd_bit(d, "data", "mnew7", "in", 13, 12)
-  call check_ok2(ne, 51, 1, d)
+  call check_ok2(ne, 76, 1, d)
 
   n = fgd_entry(d, 'data/mnew7', ent)
-  call check_ok2(ne, 51, 2, d)
-  call check_int2(ne, 51, 1, n, GD_BIT_ENTRY)
-  call check_int2(ne, 51, 2, ent%fragment_index, 0)
-  call check_int2(ne, 51, 3, ent%numbits, 12)
-  call check_int2(ne, 51, 4, ent%bitnum, 13)
-  call check_str2(ne, 51, 5, ent%field(1), 'in')
-
-! 52: fgd_madd_sbit check
+  call check_ok2(ne, 76, 2, d)
+  call check_int2(ne, 76, 1, n, GD_BIT_ENTRY)
+  call check_int2(ne, 76, 2, ent%fragment_index, 0)
+  call check_int2(ne, 76, 3, ent%numbits, 12)
+  call check_int2(ne, 76, 4, ent%bitnum, 13)
+  call check_str2(ne, 76, 5, ent%field(1), 'in')
+
+! 77: fgd_madd_sbit check
   call fgd_madd_sbit(d, "data", "mnew8", "in", 13, 12)
-  call check_ok2(ne, 52, 1, d)
+  call check_ok2(ne, 77, 1, d)
 
   n = fgd_entry(d, 'data/mnew8', ent)
-  call check_ok2(ne, 52, 2, d)
-  call check_int2(ne, 52, 1, n, GD_SBIT_ENTRY)
-  call check_int2(ne, 52, 2, ent%fragment_index, 0)
-  call check_int2(ne, 52, 3, ent%numbits, 12)
-  call check_int2(ne, 52, 4, ent%bitnum, 13)
-  call check_str2(ne, 52, 5, ent%field(1), 'in')
-
-! 53: fgd_madd_multiply check
+  call check_ok2(ne, 77, 2, d)
+  call check_int2(ne, 77, 1, n, GD_SBIT_ENTRY)
+  call check_int2(ne, 77, 2, ent%fragment_index, 0)
+  call check_int2(ne, 77, 3, ent%numbits, 12)
+  call check_int2(ne, 77, 4, ent%bitnum, 13)
+  call check_str2(ne, 77, 5, ent%field(1), 'in')
+
+! 78: fgd_madd_multiply check
   call fgd_madd_multiply(d, 'data', 'mnew9', 'in1', 'in2')
-  call check_ok2(ne, 53, 1, d)
+  call check_ok2(ne, 78, 1, d)
 
   n = fgd_entry(d, 'data/mnew9', ent)
-  call check_ok2(ne, 53, 2, d)
-  call check_int2(ne, 53, 1, n, GD_MULTIPLY_ENTRY)
-  call check_int2(ne, 53, 2, ent%fragment_index, 0)
-  call check_str2(ne, 53, 3, ent%field(1), 'in1')
-  call check_str2(ne, 53, 4, ent%field(2), 'in2')
+  call check_ok2(ne, 78, 2, d)
+  call check_int2(ne, 78, 1, n, GD_MULTIPLY_ENTRY)
+  call check_int2(ne, 78, 2, ent%fragment_index, 0)
+  call check_str2(ne, 78, 3, ent%field(1), 'in1')
+  call check_str2(ne, 78, 4, ent%field(2), 'in2')
 
-! 54: fgd_madd_phase check
+! 79: fgd_madd_phase check
   call fgd_madd_phase(d, 'data', 'mnew10', 'in1', 22)
-  call check_ok2(ne, 54, 1, d)
+  call check_ok2(ne, 79, 1, d)
 
   n = fgd_entry(d, 'data/mnew10', ent)
-  call check_ok2(ne, 54, 2, d)
-  call check_int2(ne, 54, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 54, 2, ent%fragment_index, 0)
-  call check_int2(ne, 54, 3, ent%shift, 22)
-  call check_str2(ne, 54, 4, ent%field(1), 'in1')
+  call check_ok2(ne, 79, 2, d)
+  call check_int2(ne, 79, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 79, 2, ent%fragment_index, 0)
+  call check_int2(ne, 79, 3, ent%shift, 22)
+  call check_str2(ne, 79, 4, ent%field(1), 'in1')
 
-! 55: fgd_madd_const check
+! 80: fgd_madd_const check
   call fgd_madd_const(d, 'data', 'mnew11', GD_FLOAT64)
-  call check_ok2(ne, 55, 1, d)
+  call check_ok2(ne, 80, 1, d)
 
   n = fgd_entry(d, 'data/mnew11', ent)
-  call check_ok2(ne, 55, 2, d)
-  call check_int2(ne, 55, 1, n, GD_CONST_ENTRY)
-  call check_int2(ne, 55, 2, ent%fragment_index, 0)
-  call check_int2(ne, 55, 3, ent%data_type, GD_FLOAT64)
+  call check_ok2(ne, 80, 2, d)
+  call check_int2(ne, 80, 1, n, GD_CONST_ENTRY)
+  call check_int2(ne, 80, 2, ent%fragment_index, 0)
+  call check_int2(ne, 80, 3, ent%data_type, GD_FLOAT64)
 
   call fgd_get_constant_r4(d, 'data/mnew11', fl)
-  call check_ok2(ne, 55, 3, d)
-  call check_dbl(ne, 55, 1d0 * fl, 0d0)
-
-! 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)
-  call check_ok2(ne, 126, 1, d)
-
-  n = fgd_entry(d, 'data/mnew4', ent)
-  call check_ok2(ne, 126, 2, d)
-  call check_int2(ne, 126, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 126, 2, ent%fragment_index, 0)
-  call check_int2(ne, 126, 3, ent%shift, 33)
-  call check_str2(ne, 126, 4, ent%field(1), 'data/mnew10')
+  call check_ok2(ne, 80, 3, d)
+  call check_dbl(ne, 80, 1d0 * fl, 0d0)
 
-! 56: fgd_get_string check
+! 81: fgd_get_string check
   n = fgd_get_string(d, 'string', GD_FIELD_LEN, str)
-  call check_ok(ne, 56, d)
-  call check_int(ne, 56, n, 17)
-  call check_str(ne, 56, str, "Zaphod Beeblebrox")
+  call check_ok(ne, 81, d)
+  call check_int(ne, 81, n, 17)
+  call check_str(ne, 81, str, "Zaphod Beeblebrox")
 
-! 57: fgd_add_string check
+! 82: fgd_add_string check
   call fgd_add_string(d, 'new12', 0)
-  call check_ok2(ne, 57, 1, d)
+  call check_ok2(ne, 82, 1, d)
 
   n = fgd_get_string(d, 'new12', GD_FIELD_LEN, str)
-  call check_ok2(ne, 57, 2, d)
-  call check_str(ne, 57, str, "")
+  call check_ok2(ne, 82, 2, d)
+  call check_str(ne, 82, str, "")
 
-! 58: fgd_madd_string check
+! 83: fgd_madd_string check
   call fgd_madd_string(d, "data", 'mnew12')
-  call check_ok2(ne, 58, 1, d)
+  call check_ok2(ne, 83, 1, d)
 
   n = fgd_get_string(d, 'data/mnew12', GD_FIELD_LEN, str)
-  call check_ok2(ne, 58, 2, d)
-  call check_str(ne, 58, str, "")
+  call check_ok2(ne, 83, 2, d)
+  call check_str(ne, 83, str, "")
 
-! 59: fgd_add_spec check
+! 84: fgd_add_spec check
   call fgd_add_spec(d, 'lorem STRING "Lorem ipsum"', 0)
-  call check_ok2(ne, 59, 1, d)
+  call check_ok2(ne, 84, 1, d)
 
   n = fgd_get_string(d, 'lorem', GD_FIELD_LEN, str)
-  call check_ok2(ne, 59, 2, d)
-  call check_str(ne, 59, str, "Lorem ipsum")
+  call check_ok2(ne, 84, 2, d)
+  call check_str(ne, 84, str, "Lorem ipsum")
 
-! 60: fgd_madd_spec check
+! 85: fgd_madd_spec check
   call fgd_madd_spec(d, 'ipsum STRING "dolor sit amet."', 'lorem')
-  call check_ok2(ne, 60, 1, d)
+  call check_ok2(ne, 85, 1, d)
 
   n = fgd_get_string(d, 'lorem/ipsum', GD_FIELD_LEN, str)
-  call check_ok2(ne, 60, 2, d)
-  call check_str(ne, 60, str, "dolor sit amet.")
+  call check_ok2(ne, 85, 2, d)
+  call check_str(ne, 85, str, "dolor sit amet.")
 
-! 61: fgd_put_constant_i1 check
-  ci1(1) = 61
+! 86: fgd_put_constant_i1 check
+  ci1(1) = 86
   call fgd_put_constant_i1(d, 'const', ci1(1))
-  call check_ok2(ne, 61, 1, d)
+  call check_ok2(ne, 86, 1, d)
 
   call fgd_get_constant_r4(d, 'const', fl)
-  call check_ok2(ne, 61, 2, d)
-  call check_dbl(ne, 61, 1d0 * fl, 61d0)
+  call check_ok2(ne, 86, 2, d)
+  call check_dbl(ne, 86, 1d0 * fl, 86d0)
 
-! 127: fgd_put_constant_i2 check
-  ci2(1) = 127
+! 87: fgd_put_constant_i2 check
+  ci2(1) = 87
   call fgd_put_constant_i2(d, 'const', ci2(1))
-  call check_ok2(ne, 127, 1, d)
+  call check_ok2(ne, 87, 1, d)
 
   call fgd_get_constant_r4(d, 'const', fl)
-  call check_ok2(ne, 127, 2, d)
-  call check_dbl(ne, 127, 1d0 * fl, 127d0)
+  call check_ok2(ne, 87, 2, d)
+  call check_dbl(ne, 87, 1d0 * fl, 87d0)
 
-! 128: fgd_put_constant_i4 check
-  ci4(1) = 128
+! 88: fgd_put_constant_i4 check
+  ci4(1) = 88
   call fgd_put_constant_i4(d, 'const', ci4(1))
-  call check_ok2(ne, 128, 1, d)
+  call check_ok2(ne, 88, 1, d)
 
   call fgd_get_constant_r4(d, 'const', fl)
-  call check_ok2(ne, 128, 2, d)
-  call check_dbl(ne, 128, 1d0 * fl, 128d0)
+  call check_ok2(ne, 88, 2, d)
+  call check_dbl(ne, 88, 1d0 * fl, 88d0)
 
-! 129: fgd_put_constant_i8 check
-  ci8(1) = 129
+! 89: fgd_put_constant_i8 check
+  ci8(1) = 89
   call fgd_put_constant_i8(d, 'const', ci8(1))
-  call check_ok2(ne, 129, 1, d)
+  call check_ok2(ne, 89, 1, d)
 
   call fgd_get_constant_r4(d, 'const', fl)
-  call check_ok2(ne, 129, 2, d)
-  call check_dbl(ne, 129, 1d0 * fl, 129d0)
+  call check_ok2(ne, 89, 2, d)
+  call check_dbl(ne, 89, 1d0 * fl, 89d0)
 
-! 130: fgd_put_constant_r4 check
+! 90: fgd_put_constant_r4 check
   cr4(1) = -8.1
   call fgd_put_constant_r4(d, 'new11', cr4(1))
-  call check_ok2(ne, 130, 1, d)
+  call check_ok2(ne, 90, 1, d)
 
   call fgd_get_constant_r4(d, 'new11', fl)
-  call check_ok2(ne, 130, 2, d)
-  call check_dbl(ne, 130, 1d0 * fl, -8.1d0)
+  call check_ok2(ne, 90, 2, d)
+  call check_dbl(ne, 90, 1d0 * fl, 1d0 * (-8.1))
 
-! 131: fgd_put_constant_r8 check
-  cr8(1) = 131
+! 91: fgd_put_constant_r8 check
+  cr8(1) = 91
   call fgd_put_constant_r8(d, 'const', cr8(1))
-  call check_ok2(ne, 131, 1, d)
+  call check_ok2(ne, 91, 1, d)
 
   call fgd_get_constant_r4(d, 'const', fl)
-  call check_ok2(ne, 131, 2, d)
-  call check_dbl(ne, 131, 1d0 * fl, 131d0)
+  call check_ok2(ne, 91, 2, d)
+  call check_dbl(ne, 91, 1d0 * fl, 1d0 * 91.)
 
-! 132: fgd_put_constant_c8 check
-  cc8(1) = 132
+! 92: fgd_put_constant_c8 check
+  cc8(1) = 92
   call fgd_put_constant_c8(d, 'const', cc8(1))
-  call check_ok2(ne, 132, 1, d)
+  call check_ok2(ne, 92, 1, d)
 
   call fgd_get_constant_r4(d, 'const', fl)
-  call check_ok2(ne, 132, 2, d)
-  call check_dbl(ne, 132, 1d0 * fl, 132d0)
+  call check_ok2(ne, 92, 2, d)
+  call check_dbl(ne, 92, 1d0 * fl, 92d0)
 
-! 133: fgd_put_constant_c16 check
-  cc16(1) = 133
+! 93: fgd_put_constant_c16 check
+  cc16(1) = 93
   call fgd_put_constant_c16(d, 'const', cc16(1))
-  call check_ok2(ne, 133, 1, d)
+  call check_ok2(ne, 93, 1, d)
 
   call fgd_get_constant_r4(d, 'const', fl)
-  call check_ok2(ne, 133, 2, d)
-  call check_dbl(ne, 133, 1d0 * fl, 133d0)
+  call check_ok2(ne, 93, 2, d)
+  call check_dbl(ne, 93, 1d0 * fl, 93d0)
 
-! 62: fgd_put_string check
+! 94: fgd_put_string check
   n = fgd_put_string(d, 'string', "Arthur Dent")
-  call check_ok2(ne, 62, 1, d)
-  call check_int(ne, 62, n, 11)
+  call check_ok2(ne, 94, 1, d)
+  call check_int(ne, 94, n, 11)
 
   n = fgd_get_string(d, 'string', GD_FIELD_LEN, str)
-  call check_ok2(ne, 62, 2, d)
-  call check_str(ne, 62, str, "Arthur Dent")
+  call check_ok2(ne, 94, 2, d)
+  call check_str(ne, 94, str, "Arthur Dent")
 
-! 63: fgd_nmfields_by_type check
+! 95: fgd_nmfields_by_type check
   n = fgd_nmfields_by_type(d, "data", GD_LINCOM_ENTRY)
-  call check_ok(ne, 63, d)
-  call check_int(ne, 63, n, 2)
+  call check_ok(ne, 95, d)
+  call check_int(ne, 95, n, 2)
 
-! 64: fgd_mfield_list_by_type check
+! 96: fgd_mfield_list_by_type check
   fields(1) = 'mnew1'
   fields(2) = 'mnew2'
   l = flen
   call fgd_mfield_list_by_type(flist, d, "data", GD_LINCOM_ENTRY, l)
-  call check_ok2(ne, 64, i, d)
-  call check_int2(ne, 64, i, l, flen)
+  call check_ok2(ne, 96, i, d)
+  call check_int2(ne, 96, i, l, flen)
 
   do i = 1, n
-  call check_str2(ne, 64, i, flist(i), fields(i))
+  call check_str2(ne, 96, i, flist(i), fields(i))
   end do
 
-! 65: fgd_nmvectors check
+! 97: fgd_nmvectors check
   n = fgd_nmvectors(d, "data")
-  call check_ok(ne, 65, d)
-  call check_int(ne, 65, n, 11)
+  call check_ok(ne, 97, d)
+  call check_int(ne, 97, n, 10)
 
-! 66: fgd_mvector_list check
+! 98: fgd_mvector_list check
   fields = (/    'mlut       ', 'mnew1      ', 'mnew2      ', 'mnew3      ', &
   'mnew5      ', 'mnew6      ', 'mnew7      ', 'mnew8      ', 'mnew9      ', &
-  'mnew10     ', 'mnew4      ', '           ', '           ', '           ', &
+  'mnew10     ', '           ', '           ', '           ', '           ', &
   '           ', '           ', '           ', '           ', '           ', &
   '           ', '           ', '           ', '           ', '           ', &
   '           ', '           ', '           ', '           ' /)
   l = flen
   call fgd_mvector_list(flist, d, "data", l)
-  call check_ok2(ne, 66, i, d)
-  call check_int2(ne, 66, i, l, flen)
+  call check_ok2(ne, 98, i, d)
+  call check_int2(ne, 98, i, l, flen)
 
   do i=1,n
-  call check_str2(ne, 66, i, flist(i), fields(i))
+  call check_str2(ne, 98, i, flist(i), fields(i))
   end do
 
-! 67: fgd_alter_raw check
+! 99: fgd_alter_raw check
   call fgd_alter_raw(d, 'new1', GD_INT32, 4, 0)
-  call check_ok2(ne, 67, 1, d)
+  call check_ok2(ne, 99, 1, d)
 
   n = fgd_entry(d, 'new1', ent)
-  call check_ok2(ne, 67, 2, d)
-  call check_int2(ne, 67, 3, ent%fragment_index, 0)
-  call check_int2(ne, 67, 4, ent%spf, 4)
-  call check_int2(ne, 67, 5, ent%data_type, GD_INT32)
-  call check_int2(ne, 67, 6, n, GD_RAW_ENTRY)
+  call check_ok2(ne, 99, 2, d)
+  call check_int2(ne, 99, 3, ent%fragment_index, 0)
+  call check_int2(ne, 99, 4, ent%spf, 4)
+  call check_int2(ne, 99, 5, ent%data_type, GD_INT32)
+  call check_int2(ne, 99, 6, n, GD_RAW_ENTRY)
 
-! 68: fgd_alter_lincom check
+! 100: fgd_alter_lincom check
   call fgd_alter_lincom(d, 'new2', 3, 'in4', 9.9d-1, 7.8d0, 'in5', &
      1.1d1, 2.2d-2, 'in6', 1.96d0, 0d0)
-  call check_ok2(ne, 68, 1, d)
+  call check_ok2(ne, 100, 1, d)
 
   n = fgd_entry(d, 'new2', ent)
-  call check_ok2(ne, 68, 2, d)
-  call check_int2(ne, 68, 3, n, GD_LINCOM_ENTRY)
-  call check_int2(ne, 68, 4, ent%n_fields, 3)
-  call check_int2(ne, 68, 5, ent%fragment_index, 0)
-  call check_str2(ne, 68, 6, ent%field(1), 'in4')
-  call check_str2(ne, 68, 7, ent%field(2), 'in5')
-  call check_str2(ne, 68, 8, ent%field(3), 'in6')
-  call check_int2(ne, 68, 5, ent%comp_scal, 0)
+  call check_ok2(ne, 100, 2, d)
+  call check_int2(ne, 100, 3, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 100, 4, ent%n_fields, 3)
+  call check_int2(ne, 100, 5, ent%fragment_index, 0)
+  call check_str2(ne, 100, 6, ent%field(1), 'in4')
+  call check_str2(ne, 100, 7, ent%field(2), 'in5')
+  call check_str2(ne, 100, 8, ent%field(3), 'in6')
+  call check_int2(ne, 100, 5, ent%flags, GD_EN_CALC)
 
   q = (/ 9.9d-1, 7.8d0, 1.1d1, 2.2d-2, 1.96d0, 0d0 /)
   DO i=1,3
-  call check_dbl2(ne, 68, i * 2 - 1, ent%m(i), q(i * 2 - 1))
-  call check_dbl2(ne, 68, i * 2, ent%b(i), q(i * 2))
+  call check_dbl2(ne, 100, i * 2 - 1, ent%m(i), q(i * 2 - 1))
+  call check_dbl2(ne, 100, i * 2, ent%b(i), q(i * 2))
   end do
 
-! 69: fgd_alter_clincom check
+! 101: fgd_alter_clincom check
   cq(1) = dcmplx(0.1, 0.2)
   cq(2) = dcmplx(0.3, 0.4)
   cq(3) = dcmplx(0.4, 0.5)
   cq(4) = dcmplx(0.6, 0.7)
   call fgd_alter_clincom(d, 'new3', 2, 'in4', cq(1), cq(2), 'in3', &
      cq(3), cq(4), '', cq(5), cq(6))
-  call check_ok2(ne, 69, 1, d)
+  call check_ok2(ne, 101, 1, d)
 
   n = fgd_entry(d, 'new3', ent)
-  call check_ok(ne, 69, d)
-  call check_int2(ne, 69, 1, n, GD_LINCOM_ENTRY)
-  call check_int2(ne, 69, 2, ent%n_fields, 2)
-  call check_int2(ne, 69, 3, ent%fragment_index, 0)
-  call check_str2(ne, 69, 4, ent%field(1), 'in4')
-  call check_str2(ne, 69, 5, ent%field(2), 'in3')
-  call check_int2(ne, 69, 6, ent%comp_scal, 1)
+  call check_ok(ne, 101, d)
+  call check_int2(ne, 101, 1, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 101, 2, ent%n_fields, 2)
+  call check_int2(ne, 101, 3, ent%fragment_index, 0)
+  call check_str2(ne, 101, 4, ent%field(1), 'in4')
+  call check_str2(ne, 101, 5, ent%field(2), 'in3')
+  call check_int2(ne, 101, 6, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
 
   cq(1) = dcmplx(0.1, 0.2)
   cq(2) = dcmplx(0.3, 0.4)
   cq(3) = dcmplx(0.4, 0.5)
   cq(4) = dcmplx(0.6, 0.7)
   DO i=1,2
-  call check_cpx2(ne, 69, i * 2 - 1, ent%cm(i), cq(i * 2 - 1))
-  call check_cpx2(ne, 69, i * 2, ent%cb(i), cq(i * 2))
+  call check_cpx2(ne, 101, i * 2 - 1, ent%cm(i), cq(i * 2 - 1))
+  call check_cpx2(ne, 101, i * 2, ent%cb(i), cq(i * 2))
   end do
 
-! 70: fgd_alter_polynom check
+! 102: fgd_alter_polynom check
   call fgd_alter_polynom(d, 'new4', 4, 'in1', 3d0, 4d0, 5d0, 6d0, 7d0, 0d0)
-  call check_ok2(ne, 70, 1, d)
+  call check_ok2(ne, 102, 1, d)
 
   n = fgd_entry(d, 'new4', ent)
-  call check_ok2(ne, 70, 2, d)
-  call check_int2(ne, 70, 1, n, GD_POLYNOM_ENTRY)
-  call check_int2(ne, 70, 2, ent%poly_ord, 4)
-  call check_int2(ne, 70, 3, ent%fragment_index, 0)
-  call check_str2(ne, 70, 4, ent%field(1), 'in1')
+  call check_ok2(ne, 102, 2, d)
+  call check_int2(ne, 102, 1, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 102, 2, ent%poly_ord, 4)
+  call check_int2(ne, 102, 3, ent%fragment_index, 0)
+  call check_str2(ne, 102, 4, ent%field(1), 'in1')
 
   q = (/ 3d0, 4d0, 5d0, 6d0, 7d0, 0d0 /)
   DO i=1,5
-  call check_dbl2(ne, 70, i, ent%a(i), q(i))
+  call check_dbl2(ne, 102, i, ent%a(i), q(i))
   end do
 
-! 71: fgd_alter_cpolynom check
+! 103: fgd_alter_cpolynom check
   cq(1) = dcmplx(1.1, 5.0)
   cq(2) = dcmplx(1.2, 4.0)
   cq(3) = dcmplx(1.2, 3.0)
   cq(4) = dcmplx(1.3, 2.4)
   call fgd_alter_cpolynom(d, 'new5', 3, 'in1', cq(1), cq(2), cq(3), &
   cq(4), dcmplx(0d0,0d0), dcmplx(0d0,0d0))
-  call check_ok2(ne, 71, 1, d)
+  call check_ok2(ne, 103, 1, d)
 
   n = fgd_entry(d, 'new5', ent)
-  call check_ok2(ne, 71, 2, d)
-  call check_int2(ne, 71, 1, n, GD_POLYNOM_ENTRY)
-  call check_int2(ne, 71, 2, ent%poly_ord, 3)
-  call check_int2(ne, 71, 3, ent%fragment_index, 0)
-  call check_str2(ne, 71, 4, ent%field(1), 'in1')
-  call check_int2(ne, 71, 5, ent%comp_scal, 1)
+  call check_ok2(ne, 103, 2, d)
+  call check_int2(ne, 103, 1, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 103, 2, ent%poly_ord, 3)
+  call check_int2(ne, 103, 3, ent%fragment_index, 0)
+  call check_str2(ne, 103, 4, ent%field(1), 'in1')
+  call check_int2(ne, 103, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
 
   cq(1) = dcmplx(1.1, 5.0)
   cq(2) = dcmplx(1.2, 4.0)
   cq(3) = dcmplx(1.2, 3.0)
   cq(4) = dcmplx(1.3, 2.4)
-  DO 710 i=1,4
-  call check_cpx2(ne, 71, i, ent%ca(i), cq(i))
-  710 CONTINUE
+  do i=1,4
+  call check_cpx2(ne, 103, i, ent%ca(i), cq(i))
+  end do
 
-! 72: fgd_alter_linterp check
+! 104: fgd_alter_linterp check
   call fgd_alter_linterp(d, "new6", "in3", "./other/table", 0)
-  call check_ok2(ne, 72, 1, d)
+  call check_ok2(ne, 104, 1, d)
 
   n = fgd_entry(d, 'new6', ent)
-  call check_ok2(ne, 72, 2, d)
-  call check_int2(ne, 72, 1, n, GD_LINTERP_ENTRY)
-  call check_int2(ne, 72, 2, ent%fragment_index, 0)
-  call check_str2(ne, 72, 3, ent%field(1), 'in3')
-  call check_str2(ne, 72, 4, ent%field(2), './other/table')
+  call check_ok2(ne, 104, 2, d)
+  call check_int2(ne, 104, 1, n, GD_LINTERP_ENTRY)
+  call check_int2(ne, 104, 2, ent%fragment_index, 0)
+  call check_str2(ne, 104, 3, ent%field(1), 'in3')
+  call check_str2(ne, 104, 4, ent%field(2), './other/table')
 
-! 73: fgd_alter_bit check
+! 105: fgd_alter_bit check
   call fgd_alter_bit(d, "new7", "in3", 3, 2)
-  call check_ok2(ne, 73, 1, d)
+  call check_ok2(ne, 105, 1, d)
 
   n = fgd_entry(d, 'new7', ent)
-  call check_ok2(ne, 73, 2, d)
-  call check_int2(ne, 73, 1, n, GD_BIT_ENTRY)
-  call check_int2(ne, 73, 2, ent%fragment_index, 0)
-  call check_int2(ne, 73, 3, ent%numbits, 2)
-  call check_int2(ne, 73, 4, ent%bitnum, 3)
-  call check_str2(ne, 73, 5, ent%field(1), 'in3')
-
-! 74: fgd_alter_sbit check
+  call check_ok2(ne, 105, 2, d)
+  call check_int2(ne, 105, 1, n, GD_BIT_ENTRY)
+  call check_int2(ne, 105, 2, ent%fragment_index, 0)
+  call check_int2(ne, 105, 3, ent%numbits, 2)
+  call check_int2(ne, 105, 4, ent%bitnum, 3)
+  call check_str2(ne, 105, 5, ent%field(1), 'in3')
+
+! 106: fgd_alter_sbit check
   call fgd_alter_sbit(d, "new8", "out", 1, 22)
-  call check_ok2(ne, 74, 1, d)
+  call check_ok2(ne, 106, 1, d)
 
   n = fgd_entry(d, 'new8', ent)
-  call check_ok2(ne, 74, 2, d)
-  call check_int2(ne, 74, 1, n, GD_SBIT_ENTRY)
-  call check_int2(ne, 74, 2, ent%fragment_index, 0)
-  call check_int2(ne, 74, 3, ent%numbits, 22)
-  call check_int2(ne, 74, 4, ent%bitnum, 1)
-  call check_str2(ne, 74, 5, ent%field(1), 'out')
-
-! 75: fgd_alter_multiply check
+  call check_ok2(ne, 106, 2, d)
+  call check_int2(ne, 106, 1, n, GD_SBIT_ENTRY)
+  call check_int2(ne, 106, 2, ent%fragment_index, 0)
+  call check_int2(ne, 106, 3, ent%numbits, 22)
+  call check_int2(ne, 106, 4, ent%bitnum, 1)
+  call check_str2(ne, 106, 5, ent%field(1), 'out')
+
+! 107: fgd_alter_multiply check
   call fgd_alter_multiply(d, 'new9', 'in6', 'in4')
-  call check_ok2(ne, 75, 1, d)
+  call check_ok2(ne, 107, 1, d)
 
   n = fgd_entry(d, 'new9', ent)
-  call check_ok2(ne, 75, 2, d)
-  call check_int2(ne, 75, 1, n, GD_MULTIPLY_ENTRY)
-  call check_int2(ne, 75, 2, ent%fragment_index, 0)
-  call check_str2(ne, 75, 3, ent%field(1), 'in6')
-  call check_str2(ne, 75, 4, ent%field(2), 'in4')
+  call check_ok2(ne, 107, 2, d)
+  call check_int2(ne, 107, 1, n, GD_MULTIPLY_ENTRY)
+  call check_int2(ne, 107, 2, ent%fragment_index, 0)
+  call check_str2(ne, 107, 3, ent%field(1), 'in6')
+  call check_str2(ne, 107, 4, ent%field(2), 'in4')
 
-! 76: fgd_alter_phase check
+! 108: fgd_alter_phase check
   call fgd_alter_phase(d, 'new10', 'in2', 8)
-  call check_ok2(ne, 76, 1, d)
+  call check_ok2(ne, 108, 1, d)
 
   n = fgd_entry(d, 'new10', ent)
-  call check_ok2(ne, 76, 2, d)
-  call check_int2(ne, 76, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 76, 2, ent%fragment_index, 0)
-  call check_int2(ne, 76, 3, ent%shift, 8)
-  call check_str2(ne, 76, 4, ent%field(1), 'in2')
+  call check_ok2(ne, 108, 2, d)
+  call check_int2(ne, 108, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 108, 2, ent%fragment_index, 0)
+  call check_int2(ne, 108, 3, ent%shift, 8)
+  call check_str2(ne, 108, 4, ent%field(1), 'in2')
 
-! 77: fgd_alter_const check
+! 109: fgd_alter_const check
   call fgd_alter_const(d, 'new11', GD_FLOAT32)
-  call check_ok2(ne, 77, 1, d)
+  call check_ok2(ne, 109, 1, d)
 
   n = fgd_entry(d, 'new11', ent)
-  call check_ok2(ne, 77, 2, d)
-  call check_int2(ne, 77, 1, n, GD_CONST_ENTRY)
-  call check_int2(ne, 77, 2, ent%fragment_index, 0)
-  call check_int2(ne, 77, 3, ent%data_type, GD_FLOAT32)
+  call check_ok2(ne, 109, 2, d)
+  call check_int2(ne, 109, 1, n, GD_CONST_ENTRY)
+  call check_int2(ne, 109, 2, ent%fragment_index, 0)
+  call check_int2(ne, 109, 3, ent%data_type, GD_FLOAT32)
 
   call fgd_get_constant_r4(d, 'new11', fl)
-  call check_ok2(ne, 77, 3, d)
-  call check_dbl(ne, 77, 1d0 * fl, -8.1d0)
+  call check_ok2(ne, 109, 3, d)
+  call check_dbl(ne, 109, 1d0 * fl, 1d0 * (-8.1))
 
-! 78: fgd_encoding check
+! 110: fgd_encoding check
   n = fgd_encoding(d, 0)
-  call check_ok(ne, 78, d)
-  call check_int(ne, 78, n, GD_UNENCODED)
+  call check_ok(ne, 110, d)
+  call check_int(ne, 110, n, GD_UNENCODED)
 
-! 79: fgd_endianness check
+! 111: fgd_endianness check
   n = fgd_endianness(d, 0)
-  call check_ok(ne, 79, d)
-  call check_int(ne, 79, n, (GD_LITTLE_ENDIAN + GD_NOT_ARM_ENDIAN))
+  call check_ok(ne, 111, d)
+  call check_int(ne, 111, n, (GD_LITTLE_ENDIAN + GD_NOT_ARM_ENDIAN))
 
-! 80: fgd_dirfilename check
+! 112: fgd_dirfilename check
   l = 4096
   call fgd_dirfilename(path, l, d, 0)
-  call check_ok(ne, 80, d)
-  call check_int(ne, 80, l, 4096)
-  call check_eos(ne, 80, path, fildir)
+  call check_ok(ne, 112, d)
+  call check_int(ne, 112, l, 4096)
+  call check_eos(ne, 112, path, fildir)
 
-! 81: fgd_parent_fragment check
+! 113: fgd_parent_fragment check
   n = fgd_parent_fragment(d, 1)
-  call check_ok(ne, 81, d)
-  call check_int(ne, 81, n, 0)
+  call check_ok(ne, 113, d)
+  call check_int(ne, 113, n, 0)
 
-! 82: fgd_alter_protection check
+! 114: fgd_alter_protection check
   call fgd_alter_protection(d, GD_PROTECT_DATA, 1)
-  call check_ok(ne, 82, d)
+  call check_ok(ne, 114, d)
 
-! 83: fgd_protection check
+! 115: fgd_protection check
   n = fgd_protection(d, 1)
-  call check_ok(ne, 83, d)
-  call check_int(ne, 83, n, GD_PROTECT_DATA)
+  call check_ok(ne, 115, d)
+  call check_int(ne, 115, n, GD_PROTECT_DATA)
 
-! 84: fgd_raw_filename check
+! 116: fgd_raw_filename check
   str = fgd_raw_filename(d, "data")
-  call check_ok(ne, 84, d)
-  call check_eos(ne, 84, str, fildir//DIRSEP//'data')
+  call check_ok(ne, 116, d)
+  call check_eos(ne, 116, str, fildir//DIRSEP//'data')
 
-! 85: fgd_reference check
+! 117: fgd_reference check
   str = fgd_reference(d, "new1")
-  call check_ok(ne, 85, d)
-  call check_str(ne, 85, str, 'new1')
+  call check_ok(ne, 117, d)
+  call check_str(ne, 117, str, 'new1')
 
-! 87: fgd_alter_encoding check
+! 118: fgd_eof check
+  n = fgd_eof(d, 'lincom')
+  call check_ok(ne, 118, d)
+  call check_int(ne, 118, n, 80)
+
+! 119: fgd_alter_encoding check
   call fgd_alter_encoding(d, GD_SLIM_ENCODED, 1, 0)
-  call check_ok2(ne, 87, 1, d)
+  call check_ok2(ne, 119, 1, d)
 
   n = fgd_encoding(d, 1)
-  call check_ok2(ne, 87, 2, d)
-  call check_int(ne, 87, n, GD_SLIM_ENCODED)
+  call check_ok2(ne, 119, 2, d)
+  call check_int(ne, 119, n, GD_SLIM_ENCODED)
 
-! 88: fgd_alter_endianness check
+! 120: fgd_alter_endianness check
   call fgd_alter_endianness(d, GD_BIG_ENDIAN, 1, 0)
-  call check_ok2(ne, 88, 1, d)
+  call check_ok2(ne, 120, 1, d)
 
   n = fgd_endianness(d, 1)
-  call check_ok2(ne, 88, 2, d)
-  call check_int(ne, 88, n, GD_BIG_ENDIAN)
+  call check_ok2(ne, 120, 2, d)
+  call check_int(ne, 120, n, GD_BIG_ENDIAN)
 
-! 89: fgd_alter_spec check
+! 121: fgd_alter_spec check
   call fgd_alter_spec(d, 'new10 PHASE in1 3', 0)
-  call check_ok2(ne, 89, 1, d)
+  call check_ok2(ne, 121, 1, d)
 
   n = fgd_entry(d, 'new10', ent)
-  call check_ok2(ne, 89, 2, d)
-  call check_int2(ne, 89, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 89, 2, ent%fragment_index, 0)
-  call check_int2(ne, 89, 3, ent%shift, 3)
-  call check_str2(ne, 89, 4, ent%field(1), 'in1')
+  call check_ok2(ne, 121, 2, d)
+  call check_int2(ne, 121, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 121, 2, ent%fragment_index, 0)
+  call check_int2(ne, 121, 3, ent%shift, 3)
+  call check_str2(ne, 121, 4, ent%field(1), 'in1')
 
-! 90: fgd_delete check
+! 122: fgd_delete check
   call fgd_delete(d, 'new10', 0)
-  call check_ok2(ne, 90, 1, d)
+  call check_ok2(ne, 122, 1, d)
 
   n = fgd_entry(d, 'new10', ent)
-  call check_err2(ne, 90, 2, d, GD_E_BAD_CODE)
+  call check_err2(ne, 122, 2, d, GD_E_BAD_CODE)
 
-! 91: fgd_malter_spec check
+! 123: fgd_malter_spec check
   call fgd_malter_spec(d, 'mnew10 PHASE in4 11', 'data', 0)
-  call check_ok2(ne, 91, 1, d)
+  call check_ok2(ne, 123, 1, d)
 
   n = fgd_entry(d, 'data/mnew10', ent)
-  call check_ok2(ne, 91, 2, d)
-  call check_int2(ne, 91, 1, n, GD_PHASE_ENTRY)
-  call check_int2(ne, 91, 2, ent%fragment_index, 0)
-  call check_int2(ne, 91, 3, ent%shift, 11)
-  call check_str2(ne, 91, 4, ent%field(1), 'in4')
+  call check_ok2(ne, 123, 2, d)
+  call check_int2(ne, 123, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 123, 2, ent%fragment_index, 0)
+  call check_int2(ne, 123, 3, ent%shift, 11)
+  call check_str2(ne, 123, 4, ent%field(1), 'in4')
 
-! 92: fgd_move check
+! 124: fgd_move check
   call fgd_move(d, 'new9', 1, 0)
-  call check_ok2(ne, 92, 1, d)
+  call check_ok2(ne, 124, 1, d)
 
   n = fgd_entry(d, 'new9', ent)
-  call check_ok2(ne, 92, 2, d)
-  call check_int2(ne, 92, 1, n, GD_MULTIPLY_ENTRY)
-  call check_int2(ne, 92, 2, ent%fragment_index, 1)
-  call check_str2(ne, 92, 3, ent%field(1), 'in6')
-  call check_str2(ne, 92, 4, ent%field(2), 'in4')
+  call check_ok2(ne, 124, 2, d)
+  call check_int2(ne, 124, 1, n, GD_MULTIPLY_ENTRY)
+  call check_int2(ne, 124, 2, ent%fragment_index, 1)
+  call check_str2(ne, 124, 3, ent%field(1), 'in6')
+  call check_str2(ne, 124, 4, ent%field(2), 'in4')
 
-! 93: fgd_rename check
+! 125: fgd_rename check
   call fgd_rename(d, 'new9', 'newer', 0)
-  call check_ok2(ne, 93, 1, d)
+  call check_ok2(ne, 125, 1, d)
 
   n = fgd_entry(d, 'new9', ent)
-  call check_err2(ne, 93, 2, d, GD_E_BAD_CODE)
+  call check_err2(ne, 125, 2, d, GD_E_BAD_CODE)
 
   n = fgd_entry(d, 'newer', ent)
-  call check_ok2(ne, 93, 3, d)
-  call check_int2(ne, 93, 1, n, GD_MULTIPLY_ENTRY)
-  call check_int2(ne, 92, 2, ent%fragment_index, 1)
-  call check_str2(ne, 92, 3, ent%field(1), 'in6')
-  call check_str2(ne, 92, 4, ent%field(2), 'in4')
+  call check_ok2(ne, 125, 3, d)
+  call check_int2(ne, 125, 1, n, GD_MULTIPLY_ENTRY)
+  call check_int2(ne, 125, 2, ent%fragment_index, 1)
+  call check_str2(ne, 125, 3, ent%field(1), 'in6')
+  call check_str2(ne, 125, 4, ent%field(2), 'in4')
 
-! 94: fgd_uninclude check
+! 126: fgd_uninclude check
   call fgd_uninclude(d, 1, 0)
-  call check_ok2(ne, 94, 1, d)
+  call check_ok2(ne, 126, 1, d)
 
   n = fgd_entry(d, 'newer', ent)
-  call check_err2(ne, 94, 2, d, GD_E_BAD_CODE)
+  call check_err2(ne, 126, 2, d, GD_E_BAD_CODE)
 
-! 95: fgd_frameoffset check
+! 127: fgd_frameoffset check
   n = fgd_frameoffset(d, 0)
-  call check_ok(ne, 95, d)
-  call check_int(ne, 95, n, 0)
+  call check_ok(ne, 127, d)
+  call check_int(ne, 127, n, 0)
 
-! 96: fgd_alter_frameoffset check
+! 128: fgd_alter_frameoffset check
   call fgd_alter_frameoffset(d, 33, 0, 0)
-  call check_ok2(ne, 96, 1, d)
+  call check_ok2(ne, 128, 1, d)
 
   n = fgd_frameoffset(d, 0)
-  call check_ok2(ne, 96, 2, d)
-  call check_int(ne, 96, n, 33)
+  call check_ok2(ne, 128, 2, d)
+  call check_int(ne, 128, n, 33)
 
-! 97: fgd_native_type check
+! 129: fgd_native_type check
   n = fgd_native_type(d, 'data')
-  call check_ok(ne, 97, d)
-  call check_int(ne, 97, n, GD_INT8)
+  call check_ok(ne, 129, d)
+  call check_int(ne, 129, n, GD_INT8)
 
-! 99: fgd_validate check
+! 131: fgd_validate check
   n = fgd_validate(d, 'new7')
-  call check_err(ne, 99, d, GD_E_BAD_CODE)
-  call check_int(ne, 99, n, -1)
+  call check_err(ne, 131, d, GD_E_BAD_CODE)
+  call check_int(ne, 131, n, -1)
 
-! 100: fgd_framenum check
+! 132: fgd_framenum check
   str = fgd_reference(d, "data")
   dp = fgd_framenum(d, 'INDEX', 33.3d0)
-  call check_ok(ne, 100, d)
-  call check_dbl(ne, 100, dp, 33.3d0)
+  call check_ok(ne, 132, d)
+  call check_dbl(ne, 132, dp, 33.3d0)
 
-! 101: fgd_framenum_subset check
+! 133: fgd_framenum_subset check
   dp = fgd_framenum_subset(d, 'data', 33.3d0, 6, 0)
-  call check_ok(ne, 101, d)
-  call check_dbl(ne, 101, dp, 37.0375d0)
+  call check_ok(ne, 133, d)
+  call check_dbl(ne, 133, dp, 37.0375d0)
 
-! 86: fgd_eof check
-  n = fgd_eof(d, 'lincom')
-  call check_ok(ne, 86, d)
-  call check_int(ne, 86, n, 344)
+! 135: fgd_add raw
+  ent%data_type = GD_FLOAT32
+  ent%fragment_index = 0
+  ent%spf = 0
+  ent%field_type = GD_RAW_ENTRY
+  ent%scalar(1) = 'carray'
+  ent%scalar_ind(1) = 2
+  call fgd_add(d, 'new135', ent)
+  call check_ok2(ne, 135, 1, d)
+
+  n = fgd_entry(d, 'new135', ent)
+  call check_ok2(ne, 135, 2, d)
+  call check_int2(ne, 135, 3, n, GD_RAW_ENTRY)
+  call check_int2(ne, 135, 4, ent%fragment_index, 0)
+  call check_int2(ne, 135, 5, ent%spf, 2)
+  call check_int2(ne, 135, 6, ent%data_type, GD_FLOAT32)
+
+! 136: fgd_madd check
+  ent%shift = 33
+  ent%field(1) = 'data/mnew4'
+  ent%fragment_index = 0
+  ent%field_type = GD_PHASE_ENTRY
+  call fgd_madd(d, 'data', 'mnew136', ent)
+  call check_ok2(ne, 136, 1, d)
+
+  n = fgd_entry(d, 'data/mnew136', ent)
+  call check_ok2(ne, 136, 2, d)
+  call check_int2(ne, 136, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 136, 2, ent%fragment_index, 0)
+  call check_int2(ne, 136, 3, ent%shift, 33)
+  call check_str2(ne, 136, 4, ent%field(1), 'data/mnew4')
+
+! 141: fgd_alter_entry RAW
+  ent%field_type = GD_RAW_ENTRY
+  ent%data_type = GD_FLOAT64
+  ent%scalar(1) = 'const'
+  ent%scalar_ind(1) = -1
+  call fgd_alter_entry(d, 'new135', ent, 0, 0)
+  call check_ok2(ne, 141, 1, d)
+
+  n = fgd_entry(d, 'new135', ent)
+  call check_ok2(ne, 141, 2, d)
+  call check_int2(ne, 141, 3, n, GD_RAW_ENTRY)
+  call check_int2(ne, 141, 4, ent%fragment_index, 0)
+  call check_int2(ne, 141, 5, ent%spf, 93)
+  call check_int2(ne, 141, 6, ent%data_type, GD_FLOAT64)
+  call check_str2(ne, 141, 7, ent%scalar(1), 'const')
+  call check_int2(ne, 141, 8, ent%scalar_ind(1), -1)
 
 ! 142: fgd_bof check
   n = fgd_bof(d, 'lincom')
@@ -1626,9 +1626,9 @@ program big_test
   call check_ok(ne, 145, d)
   call check_int2(ne, 145, 1, n, GD_RECIP_ENTRY)
   call check_int2(ne, 145, 2, ent%fragment_index, 0)
-  call check_int2(ne, 145, 3, ent%comp_scal, 1)
+  call check_int2(ne, 145, 3, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
   call check_str2(ne, 145, 4, ent%field(1), 'div')
-  call check_cpx2(ne, 145, 5, ent%cdividend, dcmplx(6.5, 4.3))
+  call check_cpx2(ne, 145, 5, ent%cdividend, dcmplx(6.5d0, 4.3d0))
 
 ! 146: fgd_add_divide check
   call fgd_add_divide(d, 'new14', 'in1', 'in2', 0)
@@ -1650,7 +1650,7 @@ program big_test
   call check_int2(ne, 147, 1, n, GD_RECIP_ENTRY)
   call check_int2(ne, 147, 2, ent%fragment_index, 0)
   call check_str2(ne, 147, 3, ent%field(1), 'in1')
-  call check_int2(ne, 147, 4, ent%comp_scal, 0)
+  call check_int2(ne, 147, 4, ent%flags, GD_EN_CALC)
   call check_dbl2(ne, 147, 5, ent%dividend, 31.9d0)
 
 ! 148: fgd_add_recip check
@@ -1662,8 +1662,8 @@ program big_test
   call check_int2(ne, 148, 1, n, GD_RECIP_ENTRY)
   call check_int2(ne, 148, 2, ent%fragment_index, 0)
   call check_str2(ne, 148, 3, ent%field(1), 'in1')
-  call check_int2(ne, 148, 4, ent%comp_scal, 1)
-  call check_cpx2(ne, 148, 5, ent%cdividend, dcmplx(31.9, 38.2))
+  call check_int2(ne, 148, 4, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_cpx2(ne, 148, 5, ent%cdividend, dcmplx(31.9d0, 38.2d0))
 
 ! 149: fgd_madd_divide check
   call fgd_madd_divide(d, 'data', 'new14', 'in3', 'in4')
@@ -1685,7 +1685,7 @@ program big_test
   call check_int2(ne, 150, 1, n, GD_RECIP_ENTRY)
   call check_int2(ne, 150, 2, ent%fragment_index, 0)
   call check_str2(ne, 150, 3, ent%field(1), 'in0')
-  call check_int2(ne, 150, 4, ent%comp_scal, 0)
+  call check_int2(ne, 150, 4, ent%flags, GD_EN_CALC)
   call check_dbl2(ne, 150, 5, ent%dividend, 95.5d0)
 
 ! 151: fgd_madd_recip check
@@ -1697,8 +1697,8 @@ program big_test
   call check_int2(ne, 151, 1, n, GD_RECIP_ENTRY)
   call check_int2(ne, 151, 2, ent%fragment_index, 0)
   call check_str2(ne, 151, 3, ent%field(1), 'in3')
-  call check_int2(ne, 151, 4, ent%comp_scal, 1)
-  call check_cpx2(ne, 151, 5, ent%cdividend, dcmplx(8.47, 6.22))
+  call check_int2(ne, 151, 4, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_cpx2(ne, 151, 5, ent%cdividend, dcmplx(8.47d0, 6.22d0))
 
 ! 152: fgd_alter_divide check
   call fgd_alter_divide(d, 'new14', 'in6', 'in4')
@@ -1749,7 +1749,7 @@ program big_test
 ! 157: fgd_dirfile_standards
   n = fgd_dirfile_standards(d, GD_VERSION_CURRENT)
   call check_ok2(ne, 157, 1, d)
-  call check_int(ne, 157, n, 9)
+  call check_int(ne, 157, n, GD_DIRFILE_STANDARDS_VERSION)
 
   n = fgd_dirfile_standards(d, 0)
   call check_err2(ne, 157, 2, d, GD_E_ARGUMENT)
@@ -1815,7 +1815,7 @@ program big_test
   call check_ok(ne, 165, d)
 
   do i=1,2
-  call check_cpx2(ne, 165, i, 1d0 * cc8(i), dcmplx((2 + i) * 1.1, 0))
+  call check_cpx2(ne, 165, i, 1d0 * cc8(i), dcmplx((2 + i) * 1.1d0, 0))
   end do
 
 ! 166: gd_get_carray_slice (COMPLEX128)
@@ -1823,7 +1823,7 @@ program big_test
   call check_ok(ne, 166, d)
 
   do i=1,2
-  call check_cpx2(ne, 166, i, cc16(i), dcmplx((2 + i) * 1.1, 0))
+  call check_cpx2(ne, 166, i, cc16(i), dcmplx((2 + i) * 1.1d0, 0))
   end do
 
 ! 168: gd_put_carray
@@ -1974,8 +1974,8 @@ program big_test
     call check_cpx2(ne, 175, i, cc16(i), dc)
   end do
 
-! 177: gd_carray_len
-  n = fgd_carray_len(d, 'carray')
+! 177: gd_array_len
+  n = fgd_array_len(d, 'carray')
   call check_ok(ne, 177, d)
   call check_int(ne, 177, n, 6)
 
@@ -1984,8 +1984,8 @@ program big_test
   call check_ok(ne, 178, d)
   call check_int2(ne, 178, 1, n, GD_CARRAY_ENTRY)
   call check_int2(ne, 178, 2, ent%fragment_index, 0)
-  call check_int2(ne, 178, 2, ent%array_len, 6)
-  call check_int2(ne, 178, 3, ent%data_type, GD_FLOAT64)
+  call check_int2(ne, 178, 3, ent%array_len, 6)
+  call check_int2(ne, 178, 4, ent%data_type, GD_FLOAT64)
 
 ! 179: gd_add_carray
   call fgd_add_carray(d, 'new17', GD_FLOAT64, 4, 0)
@@ -2034,15 +2034,8 @@ program big_test
   call check_int2(ne, 181, 3, ent%data_type, GD_FLOAT32)
   call check_int2(ne, 181, 4, ent%array_len, 3)
 
-  call fgd_get_carray_r4(d, 'new17', 0, 0, cr4)
-  call check_ok2(ne, 181, 3, d)
-
-  do i=1,4
-  call check_dbl2(ne, 181, i, 1d0 * cr4(i), 0d0)
-  end do
-
 ! 183: fgd_constants_i1 check
-  iq(1) = -123
+  iq(1) = 93
   iq(2) = -8
   n = fgd_nfields_by_type(d, GD_CONST_ENTRY)
   call fgd_constants_i1(ci1, d)
@@ -2053,7 +2046,7 @@ program big_test
   end do
 
 ! 184: fgd_constants_i2 check
-  iq(1) = 133
+  iq(1) = 93
   call fgd_constants_i2(ci2, d)
   call check_ok(ne, 184, d)
 
@@ -2078,7 +2071,7 @@ program big_test
   end do
 
 ! 187: fgd_constants_r4 check
-  q(1) = 133.
+  q(1) = 93.
   q(2) = -8.1
   call fgd_constants_r4(cr4, d)
   call check_ok(ne, 187, d)
@@ -2097,7 +2090,7 @@ program big_test
 
 
 ! 189: fgd_constants_c8 check
-  cq(1) = 133.
+  cq(1) = 93.
   cq(2) = -8.1
   call fgd_constants_c8(cc8, d)
   call check_ok(ne, 189, d)
@@ -2182,6 +2175,7 @@ program big_test
   call fgd_mconstants_c16(cc16, d, 'data')
   call check_ok(ne, 198, d)
 
+  cq(1) = dcmplx(3.3d0, 4.4d0)
   do i = 1, n
   call check_cpx2(ne, 198, i, cc16(i), cq(i))
   end do
@@ -2404,22 +2398,6 @@ program big_test
   call fgd_include_affix(d, 'format1', 0, 'A', 'Z', GD_CREAT + GD_EXCL)
   call check_ok(ne, 223, d)
 
-! 224: GDMOVA check
-  call fgd_move_alias(d, 'new20', 1)
-  call check_ok2(ne, 224, 1, d)
-
-  n = fgd_fragment_index(d, 'Anew20Z')
-  call check_ok2(ne, 224, 2, d)
-  call check_int(ne, 224, n, 1)
-
-! 225: fgd_delete_alias check
-  call fgd_delete_alias(d, 'Anew20Z', 0)
-  call check_ok2(ne, 225, 1, d)
-
-  n = fgd_fragment_index(d, 'Anew20Z')
-  call check_err2(ne, 225, 2, d, GD_E_BAD_CODE)
-  call check_int(ne, 225, n, -1)
-
 ! 226: fgd_fragment_affixes check
   l = flen
   n = flen
@@ -2542,7 +2520,7 @@ program big_test
 ! 239: fgd_field_list check
   fields = (/    'INDEX      ', 'bit        ', 'data       ', 'div        ', &
   'lincom     ', 'linterp    ', 'mplex      ', 'mult       ', 'new1       ', &
-  'new13      ', 'new14      ', 'new15      ', 'new16      ', 'new18      ', &
+  'new135     ', 'new14      ', 'new15      ', 'new16      ', 'new18      ', &
   'new19      ', 'new2       ', 'new21      ', 'new3       ', 'new4       ', &
   'new5       ', 'new6       ', 'new7       ', 'new8       ', 'phase      ', &
   'polynom    ', 'recip      ', 'sbit       ', 'window     ' /)
@@ -2565,18 +2543,600 @@ program big_test
   call check_ok(ne, 241, d)
   call check_eos(ne, 241, str, fildir//DIRSEP//'lut')
 
-! 243: NULL return from gd_reference
+! 243: fgd_add lincom
+  ent%field_type = GD_LINCOM_ENTRY
+  ent%fragment_index = 0
+  ent%n_fields = 3
+  ent%flags = 0
+  ent%field(1) = 'in1'
+  ent%field(2) = 'in2'
+  ent%field(3) = 'in3'
+  ent%m(1) = 1.1d0
+  ent%m(3) = 1.4d0
+  ent%scalar(1) = ''
+  ent%scalar(2) = 'const'
+  ent%scalar_ind(2) = -1
+  ent%scalar(3) = ''
+  ent%scalar(4) = 'carray'
+  ent%scalar_ind(4) = 3
+  ent%scalar(5) = 'carray'
+  ent%scalar_ind(5) = 4
+  ent%scalar(6) = 'carray'
+  ent%scalar_ind(6) = 5
+  call fgd_add(d, 'new243', ent)
+  call check_ok2(ne, 243, 1, d)
+  
+  n = fgd_entry(d, 'new243', ent)
+  call check_ok2(ne, 243, 2, d)
+  call check_int2(ne, 243,  3, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 243,  4, ent%n_fields, 3)
+  call check_int2(ne, 243,  5, ent%fragment_index, 0)
+  call check_str2(ne, 243,  6, ent%field(1), 'in1')
+  call check_str2(ne, 243,  7, ent%field(2), 'in2')
+  call check_str2(ne, 243,  8, ent%field(3), 'in3')
+  call check_int2(ne, 243,  9, ent%flags, GD_EN_CALC)
+  call check_str2(ne, 243, 10, ent%scalar(1), '')
+  call check_str2(ne, 243, 11, ent%scalar(2), 'const')
+  call check_str2(ne, 243, 12, ent%scalar(3), '')
+  call check_str2(ne, 243, 13, ent%scalar(4), 'carray')
+  call check_str2(ne, 243, 14, ent%scalar(5), 'carray')
+  call check_str2(ne, 243, 15, ent%scalar(6), 'carray')
+  call check_int2(ne, 243, 16, ent%scalar_ind(2), -1)
+  call check_int2(ne, 243, 17, ent%scalar_ind(4), 3)
+  call check_int2(ne, 243, 18, ent%scalar_ind(5), 4)
+  call check_int2(ne, 243, 19, ent%scalar_ind(6), 5)
+  call check_dbl2(ne, 243, 20, ent%m(1), 1.1d0)
+  call check_dbl2(ne, 243, 21, ent%m(2), 93d0)
+  call check_dbl2(ne, 243, 22, ent%m(3), 1.4d0)
+  call check_dbl2(ne, 243, 23, ent%b(1), 179d0)
+  call check_dbl2(ne, 243, 24, ent%b(2), 180d0)
+  call check_dbl2(ne, 243, 25, ent%b(3), 15d0)
+
+! 244: fgd_add polynom
+  ent%field_type = GD_POLYNOM_ENTRY
+  ent%fragment_index = 0
+  ent%field(1) = 'in1'
+  ent%flags = 0
+  ent%a(1) = 33d0
+  ent%a(2) = 44d0
+  ent%a(3) = 66d0
+  ent%poly_ord = 3
+  ent%scalar(1) = ''
+  ent%scalar(2) = ''
+  ent%scalar(3) = ''
+  ent%scalar(4) = 'carray'
+  ent%scalar_ind(4) = 1
+  call fgd_add(d, 'new244', ent)
+  call check_ok2(ne, 244, 1, d)
+  
+  n = fgd_entry(d, 'new244', ent)
+  call check_ok2(ne,  244,  2, d)
+  call check_int2(ne, 244,  3, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 244,  4, ent%poly_ord, 3)
+  call check_int2(ne, 244,  5, ent%fragment_index, 0)
+  call check_str2(ne, 244,  6, ent%field(1), 'in1')
+  call check_int2(ne, 244,  7, ent%flags, GD_EN_CALC)
+  call check_dbl2(ne, 244,  8, ent%a(1), 33d0)
+  call check_dbl2(ne, 244,  9, ent%a(2), 44d0)
+  call check_dbl2(ne, 244, 10, ent%a(3), 66d0)
+  call check_dbl2(ne, 244, 11, ent%a(4), 11d0)
+  call check_str2(ne, 244, 12, ent%scalar(1), '')
+  call check_str2(ne, 244, 13, ent%scalar(2), '')
+  call check_str2(ne, 244, 14, ent%scalar(3), '')
+  call check_str2(ne, 244, 15, ent%scalar(4), 'carray')
+  call check_int2(ne, 244, 16, ent%scalar_ind(4), 1)
+
+! 246: fgd_add bit
+  ent%field_type = GD_BIT_ENTRY
+  ent%fragment_index = 0
+  ent%field(1) = 'in1'
+  ent%bitnum = 11
+  ent%scalar(1) = ''
+  ent%scalar(2) = 'const'
+  ent%scalar_ind(2) = 0
+  call fgd_add(d, 'new246', ent)
+  call check_ok2(ne, 246, 1, d)
+
+  n = fgd_entry(d, 'new246', ent)
+  call check_ok2(ne, 246, 2, d)
+  call check_int2(ne, 246,  3, n, GD_BIT_ENTRY)
+  call check_int2(ne, 246,  4, ent%fragment_index, 0)
+  call check_int2(ne, 246,  5, ent%numbits, 93)
+  call check_int2(ne, 246,  6, ent%bitnum, 11)
+  call check_str2(ne, 246,  7, ent%field(1), 'in1')
+  call check_str2(ne, 246,  8, ent%scalar(1), '')
+  call check_str2(ne, 246,  9, ent%scalar(2), 'const')
+  call check_int2(ne, 246, 10, ent%scalar_ind(2), -1)
+
+! 248: fgd_add phase
+  ent%field(1) = 'new9'
+  ent%fragment_index = 0
+  ent%field_type = GD_PHASE_ENTRY
+  ent%scalar(1) = 'carray'
+  ent%scalar_ind(1) = 2
+  call fgd_add(d, 'new248', ent)
+  call check_ok2(ne, 248, 1, d)
+
+  n = fgd_entry(d, 'new248', ent)
+  call check_ok2(ne, 248, 2, d)
+  call check_int2(ne, 248, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 248, 2, ent%fragment_index, 0)
+  call check_int2(ne, 248, 3, ent%shift, 12)
+  call check_str2(ne, 248, 4, ent%field(1), 'new9')
+  call check_str2(ne, 248, 5, ent%scalar(1), 'carray')
+  call check_int2(ne, 248, 6, ent%scalar_ind(1), 2)
+
+! 251: fgd_add recip
+  ent%field(1) = 'in1'
+  ent%field_type = GD_RECIP_ENTRY
+  ent%fragment_index = 0
+  ent%scalar(1) = 'carray'
+  ent%flags = 0
+  ent%scalar_ind = 4
+  call fgd_add(d, 'new251', ent)
+  call check_ok2(ne, 251, 1, d)
+
+  n = fgd_entry(d, 'new251', ent)
+  call check_ok2(ne, 251, 2, d)
+  call check_int2(ne, 251, 3, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 251, 4, ent%fragment_index, 0)
+  call check_int2(ne, 251, 5, ent%flags, GD_EN_CALC)
+  call check_str2(ne, 251, 6, ent%field(1), 'in1')
+  call check_dbl2(ne, 251, 7, ent%dividend, 180d0)
+  call check_str2(ne, 251, 8, ent%scalar(1), 'carray')
+  call check_int2(ne, 251, 9, ent%scalar_ind(1), 4)
+
+! 253: fgd_add window
+  ent%field(1) = 'in2'
+  ent%field(2) = 'in3'
+  ent%field_type = GD_WINDOW_ENTRY
+  ent%windop = GD_WINDOP_NE
+  ent%fragment_index = 0
+  ent%scalar(1) = 'const'
+  ent%scalar_ind(1) = -1
+  call fgd_add(d, 'new253', ent)
+  call check_ok2(ne, 253, 1, d)
+
+  n = fgd_entry(d, 'new253', ent)
+  call check_ok2(ne, 253, 2, d)
+  call check_int2(ne, 253, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 253, 2, ent%fragment_index, 0)
+  call check_int2(ne, 253, 3, ent%windop, GD_WINDOP_NE)
+  call check_str2(ne, 253, 4, ent%field(1), 'in2')
+  call check_str2(ne, 253, 5, ent%field(2), 'in3')
+  call check_int2(ne, 253, 6, ent%ithreshold, 93)
+  call check_str2(ne, 253, 7, ent%scalar(1), 'const')
+  call check_int2(ne, 253, 8, ent%scalar_ind(1), -1)
+
+! 254: fgd_add mplex
+  ent%field(1) = 'in1'
+  ent%field(2) = 'in2'
+  ent%field_type = GD_MPLEX_ENTRY
+  ent%scalar(1) = 'carray'
+  ent%scalar(2) = 'carray'
+  ent%scalar_ind(1) = 3
+  ent%scalar_ind(2) = 4
+  call fgd_add(d, 'new254', ent)
+  call check_ok2(ne, 254, 1, d)
+
+  n = fgd_entry(d, 'new254', ent)
+  call check_ok2(ne,  254,  1, d)
+  call check_int2(ne, 254,  1, n, GD_MPLEX_ENTRY)
+  call check_int2(ne, 254,  2, ent%fragment_index, 0)
+  call check_int2(ne, 254,  3, ent%count_val, 179)
+  call check_int2(ne, 254,  4, ent%period, 180)
+  call check_str2(ne, 254,  5, ent%field(1), 'in1')
+  call check_str2(ne, 254,  6, ent%field(2), 'in2')
+  call check_str2(ne, 254,  7, ent%scalar(1), 'carray')
+  call check_int2(ne, 254,  8, ent%scalar_ind(1), 3)
+  call check_str2(ne, 254,  9, ent%scalar(2), 'carray')
+  call check_int2(ne, 254, 10, ent%scalar_ind(2), 4)
+
+! 255: fgd_add complex lincom
+  ent%field_type = GD_LINCOM_ENTRY
+  ent%fragment_index = 0
+  ent%n_fields = 3
+  ent%flags = GD_EN_COMPSCAL
+  ent%field(1) = 'in1'
+  ent%field(2) = 'in2'
+  ent%field(3) = 'in3'
+  ent%cm(1) = dcmplx(1.1d0, 1.2d0)
+  ent%cm(3) = dcmplx(1.3d0, 1.4d0)
+  ent%scalar(1) = ''
+  ent%scalar(2) = 'const'
+  ent%scalar_ind(2) = -1
+  ent%scalar(3) = ''
+  ent%scalar(4) = 'carray'
+  ent%scalar_ind(4) = 3
+  ent%scalar(5) = 'carray'
+  ent%scalar_ind(5) = 4
+  ent%scalar(6) = 'carray'
+  ent%scalar_ind(6) = 5
+  call fgd_add(d, 'new255', ent)
+  call check_ok2(ne, 255, 1, d)
+  
+  n = fgd_entry(d, 'new255', ent)
+  call check_ok2(ne, 255, 2, d)
+  call check_int2(ne, 255,  3, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 255,  4, ent%n_fields, 3)
+  call check_int2(ne, 255,  5, ent%fragment_index, 0)
+  call check_str2(ne, 255,  6, ent%field(1), 'in1')
+  call check_str2(ne, 255,  7, ent%field(2), 'in2')
+  call check_str2(ne, 255,  8, ent%field(3), 'in3')
+  call check_int2(ne, 255,  9, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_str2(ne, 255, 10, ent%scalar(1), '')
+  call check_str2(ne, 255, 11, ent%scalar(2), 'const')
+  call check_str2(ne, 255, 12, ent%scalar(3), '')
+  call check_str2(ne, 255, 13, ent%scalar(4), 'carray')
+  call check_str2(ne, 255, 14, ent%scalar(5), 'carray')
+  call check_str2(ne, 255, 15, ent%scalar(6), 'carray')
+  call check_int2(ne, 255, 16, ent%scalar_ind(2), -1)
+  call check_int2(ne, 255, 17, ent%scalar_ind(4), 3)
+  call check_int2(ne, 255, 18, ent%scalar_ind(5), 4)
+  call check_int2(ne, 255, 19, ent%scalar_ind(6), 5)
+  call check_cpx2(ne, 255, 20, ent%cm(1), dcmplx(1.1d0, 1.2d0))
+  call check_cpx2(ne, 255, 21, ent%cm(2), dcmplx(93d0, 0))
+  call check_cpx2(ne, 255, 22, ent%cm(3), dcmplx(1.3d0, 1.4d0))
+  call check_cpx2(ne, 255, 23, ent%cb(1), dcmplx(179d0, 0))
+  call check_cpx2(ne, 255, 24, ent%cb(2), dcmplx(180d0, 0))
+
+! 256: fgd_add polynom
+  ent%field_type = GD_POLYNOM_ENTRY
+  ent%fragment_index = 0
+  ent%field(1) = 'in1'
+  ent%flags = GD_EN_COMPSCAL
+  ent%ca(1) = dcmplx(22d0, 33d0)
+  ent%ca(2) = dcmplx(44d0, 55d0)
+  ent%ca(3) = dcmplx(66d0, 77d0)
+  ent%poly_ord = 3
+  ent%scalar(1) = ''
+  ent%scalar(2) = ''
+  ent%scalar(3) = ''
+  ent%scalar(4) = 'carray'
+  ent%scalar_ind(4) = 1
+  call fgd_add(d, 'new256', ent)
+  call check_ok2(ne, 256, 1, d)
+  
+  n = fgd_entry(d, 'new256', ent)
+  call check_ok2(ne,  256,  2, d)
+  call check_int2(ne, 256,  3, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 256,  4, ent%poly_ord, 3)
+  call check_int2(ne, 256,  5, ent%fragment_index, 0)
+  call check_str2(ne, 256,  6, ent%field(1), 'in1')
+  call check_int2(ne, 256,  7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_cpx2(ne, 256,  8, ent%ca(1), dcmplx(22d0, 33d0))
+  call check_cpx2(ne, 256,  9, ent%ca(2), dcmplx(44d0, 55d0))
+  call check_cpx2(ne, 256, 10, ent%ca(3), dcmplx(66d0, 77d0))
+  call check_cpx2(ne, 256, 11, ent%ca(4), dcmplx(11d0, 0))
+  call check_str2(ne, 256, 12, ent%scalar(1), '')
+  call check_str2(ne, 256, 13, ent%scalar(2), '')
+  call check_str2(ne, 256, 14, ent%scalar(3), '')
+  call check_str2(ne, 256, 15, ent%scalar(4), 'carray')
+  call check_int2(ne, 256, 16, ent%scalar_ind(4), 1)
+
+! 257: fgd_add recip
+  ent%field(1) = 'in1'
+  ent%field_type = GD_RECIP_ENTRY
+  ent%fragment_index = 0
+  ent%scalar(1) = 'carray'
+  ent%flags = GD_EN_COMPSCAL
+  ent%scalar_ind = 4
+  call fgd_add(d, 'new257', ent)
+  call check_ok2(ne, 257, 1, d)
+
+  n = fgd_entry(d, 'new257', ent)
+  call check_ok2(ne, 257, 2, d)
+  call check_int2(ne, 257, 3, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 257, 4, ent%fragment_index, 0)
+  call check_int2(ne, 257, 5, ent%flags, GD_EN_CALC)
+  call check_str2(ne, 257, 6, ent%field(1), 'in1')
+  call check_dbl2(ne, 257, 7, ent%dividend, 180d0)
+  call check_str2(ne, 257, 8, ent%scalar(1), 'carray')
+
+! 258: fgd_add sbit
+  ent%field_type = GD_SBIT_ENTRY
+  ent%fragment_index = 0
+  ent%field(1) = 'in1'
+  ent%bitnum = 11
+  ent%scalar(1) = ''
+  ent%scalar(2) = 'const'
+  ent%scalar_ind(2) = 0
+  call fgd_add(d, 'new258', ent)
+  call check_ok2(ne, 258, 1, d)
+
+  n = fgd_entry(d, 'new258', ent)
+  call check_ok2(ne, 258, 2, d)
+  call check_int2(ne, 258,  3, n, GD_SBIT_ENTRY)
+  call check_int2(ne, 258,  4, ent%fragment_index, 0)
+  call check_int2(ne, 258,  5, ent%numbits, 93)
+  call check_int2(ne, 258,  6, ent%bitnum, 11)
+  call check_str2(ne, 258,  7, ent%field(1), 'in1')
+  call check_str2(ne, 258,  8, ent%scalar(1), '')
+  call check_str2(ne, 258,  9, ent%scalar(2), 'const')
+
+! 259: fgd_alter_entry lincom
+  ent%field_type = GD_LINCOM_ENTRY
+  ent%field(2) = 'in4'
+  ent%flags = 0
+  ent%m(1) = 2.2d0
+  ent%scalar(2) = ''
+  ent%scalar(3) = 'const'
+  ent%scalar(4) = 'carray'
+  ent%scalar(6) = 'const'
+  ent%scalar_ind(3) = -1
+  ent%scalar_ind(4) =  4
+  call fgd_alter_entry(d, 'new243', ent, 17, 0)
+  call check_ok2(ne, 259, 1, d)
+  
+  n = fgd_entry(d, 'new243', ent)
+  call check_ok2(ne, 259, 2, d)
+  call check_int2(ne, 259,  3, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 259,  4, ent%n_fields, 3)
+  call check_int2(ne, 259,  5, ent%fragment_index, 0)
+  call check_str2(ne, 259,  6, ent%field(1), 'in1')
+  call check_str2(ne, 259,  7, ent%field(2), 'in4')
+  call check_str2(ne, 259,  8, ent%field(3), 'in3')
+  call check_int2(ne, 259,  9, ent%flags, GD_EN_CALC)
+  call check_str2(ne, 259, 10, ent%scalar(1), '')
+  call check_str2(ne, 259, 11, ent%scalar(2), 'const')
+  call check_str2(ne, 259, 12, ent%scalar(3), 'const')
+  call check_str2(ne, 259, 13, ent%scalar(4), 'carray')
+  call check_str2(ne, 259, 14, ent%scalar(5), '')
+  call check_str2(ne, 259, 15, ent%scalar(6), 'const')
+  call check_int2(ne, 259, 16, ent%scalar_ind(2), -1)
+  call check_int2(ne, 259, 16, ent%scalar_ind(3), -1)
+  call check_int2(ne, 259, 17, ent%scalar_ind(4), 4)
+  call check_int2(ne, 259, 19, ent%scalar_ind(6), -1)
+  call check_dbl2(ne, 259, 20, ent%m(1), 2.2d0)
+  call check_dbl2(ne, 259, 21, ent%m(2), 93d0)
+  call check_dbl2(ne, 259, 22, ent%m(3), 93d0)
+  call check_dbl2(ne, 259, 23, ent%b(1), 180d0)
+  call check_dbl2(ne, 259, 24, ent%b(2), 180d0)
+  call check_dbl2(ne, 259, 25, ent%b(3), 93d0)
+
+! 260: fgd_alter_entry CLINCOM
+  ent%field(1) = 'in1'
+  ent%field(2) = 'in4'
+  ent%field(3) = 'in3'
+  ent%field_type = GD_LINCOM_ENTRY
+  ent%flags = GD_EN_COMPSCAL
+  ent%cm(1) = dcmplx(9d0, 8d0)
+  ent%scalar(2) = ''
+  ent%scalar(3) = ''
+  ent%scalar(4) = 'carray'
+  ent%scalar(6) = ''
+  ent%scalar_ind(4) =  3
+  call fgd_alter_entry(d, 'new243', ent, 17, 0)
+  call check_ok2(ne, 260, 1, d)
+  
+  n = fgd_entry(d, 'new243', ent)
+  call check_ok2(ne, 260, 2, d)
+  call check_int2(ne, 260,  3, n, GD_LINCOM_ENTRY)
+  call check_int2(ne, 260,  4, ent%n_fields, 3)
+  call check_int2(ne, 260,  5, ent%fragment_index, 0)
+  call check_str2(ne, 260,  6, ent%field(1), 'in1')
+  call check_str2(ne, 260,  7, ent%field(2), 'in4')
+  call check_str2(ne, 260,  8, ent%field(3), 'in3')
+  call check_int2(ne, 260,  9, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_str2(ne, 260, 10, ent%scalar(1), '')
+  call check_str2(ne, 260, 11, ent%scalar(2), 'const')
+  call check_str2(ne, 260, 12, ent%scalar(3), 'const')
+  call check_str2(ne, 260, 13, ent%scalar(4), 'carray')
+  call check_str2(ne, 260, 14, ent%scalar(5), '')
+  call check_str2(ne, 260, 15, ent%scalar(6), 'const')
+  call check_int2(ne, 260, 16, ent%scalar_ind(2), -1)
+  call check_int2(ne, 260, 16, ent%scalar_ind(3), -1)
+  call check_int2(ne, 260, 17, ent%scalar_ind(4), 3)
+  call check_int2(ne, 260, 19, ent%scalar_ind(6), -1)
+  call check_cpx2(ne, 260, 20, ent%cm(1), dcmplx(9d0, 8d0))
+  call check_cpx2(ne, 260, 21, ent%cm(2), dcmplx(93d0, 0))
+  call check_cpx2(ne, 260, 22, ent%cm(3), dcmplx(93d0, 0))
+  call check_cpx2(ne, 260, 23, ent%cb(1), dcmplx(179d0, 0))
+  call check_cpx2(ne, 260, 24, ent%cb(2), dcmplx(180d0, 0))
+  call check_cpx2(ne, 260, 25, ent%cb(3), dcmplx(93d0, 0))
+
+! 261: fgd_alter_entry POLYNOM
+  ent%field(1) = 'in3'
+  ent%field_type = GD_POLYNOM_ENTRY
+  ent%flags = 0
+  ent%a(1) = 2d0
+  ent%a(2) = 6d0
+  ent%scalar(1) = ''
+  ent%scalar(2) = ''
+  ent%scalar(3) = 'carray'
+  ent%scalar_ind(3) = 5
+  call fgd_alter_entry(d, 'new244', ent, 8, 0)
+  call check_ok2(ne, 261, 1, d)
+
+  n = fgd_entry(d, 'new244', ent)
+  call check_ok2(ne,  261,  2, d)
+  call check_int2(ne, 261,  3, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 261,  4, ent%poly_ord, 3)
+  call check_int2(ne, 261,  5, ent%fragment_index, 0)
+  call check_str2(ne, 261,  6, ent%field(1), 'in3')
+  call check_int2(ne, 261,  7, ent%flags, GD_EN_CALC)
+  call check_dbl2(ne, 261,  8, ent%a(1), 2d0)
+  call check_dbl2(ne, 261,  9, ent%a(2), 6d0)
+  call check_dbl2(ne, 261, 10, ent%a(3), 15d0)
+  call check_dbl2(ne, 261, 11, ent%a(4), 11d0)
+  call check_str2(ne, 261, 12, ent%scalar(1), '')
+  call check_str2(ne, 261, 13, ent%scalar(2), '')
+  call check_str2(ne, 261, 14, ent%scalar(3), 'carray')
+  call check_str2(ne, 261, 15, ent%scalar(4), '')
+  call check_int2(ne, 261, 16, ent%scalar_ind(3), 5)
+
+! 262: fgd_alter_entry CPOLYNOM
+  ent%field_type = GD_POLYNOM_ENTRY
+  ent%flags = GD_EN_COMPSCAL
+  ent%ca(3) = dcmplx(26d0, 2d0)
+  ent%scalar(1) = 'const'
+  ent%scalar(2) = 'const'
+  ent%scalar_ind(1) = -1
+  ent%scalar_ind(2) = -1
+  call fgd_alter_entry(d, 'new244', ent, 4, 0)
+  call check_ok2(ne, 262, 1, d)
+
+  n = fgd_entry(d, 'new244', ent)
+  call check_ok2(ne,  262,  2, d)
+  call check_int2(ne, 262,  3, n, GD_POLYNOM_ENTRY)
+  call check_int2(ne, 262,  4, ent%poly_ord, 3)
+  call check_int2(ne, 262,  5, ent%fragment_index, 0)
+  call check_str2(ne, 262,  6, ent%field(1), 'in3')
+  call check_int2(ne, 262,  7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_cpx2(ne, 262,  8, ent%ca(1), dcmplx(93d0, 0))
+  call check_cpx2(ne, 262,  9, ent%ca(2), dcmplx(93d0, 0))
+  call check_cpx2(ne, 262, 10, ent%ca(3), dcmplx(26d0, 2d0))
+  call check_cpx2(ne, 262, 11, ent%ca(4), dcmplx(11d0, 0))
+  call check_str2(ne, 262, 12, ent%scalar(1), 'const')
+  call check_str2(ne, 262, 13, ent%scalar(2), 'const')
+  call check_str2(ne, 262, 14, ent%scalar(3), '')
+  call check_str2(ne, 262, 15, ent%scalar(4), '')
+  call check_int2(ne, 262, 16, ent%scalar_ind(1), -1)
+
+! 263: fgd_alter_entry BIT
+  ent%field_type = GD_BIT_ENTRY
+  ent%scalar(1) = 'carray'
+  ent%scalar_ind(1) = 6
+  call fgd_alter_entry(d, 'new246', ent, 2, 0)
+  call check_ok2(ne, 263, 1, d)
+
+  n = fgd_entry(d, 'new246', ent)
+  call check_ok2(ne, 263, 2, d)
+  call check_int2(ne, 263,  3, n, GD_BIT_ENTRY)
+  call check_int2(ne, 263,  4, ent%fragment_index, 0)
+  call check_int2(ne, 263,  5, ent%numbits, 93)
+  call check_int2(ne, 263,  6, ent%bitnum, 16)
+  call check_str2(ne, 263,  7, ent%field(1), 'in3')
+  call check_str2(ne, 263,  8, ent%scalar(1), 'carray')
+  call check_str2(ne, 263,  9, ent%scalar(2), '')
+
+! 264: fgd_alter_entry SBIT
+  ent%field_type = GD_SBIT_ENTRY
+  ent%scalar(1) = 'carray'
+  ent%scalar_ind(1) = 5
+  ent%numbits = 0
+  call fgd_alter_entry(d, 'new258', ent, 1, 0)
+  call check_ok2(ne, 264, 1, d)
+
+  n = fgd_entry(d, 'new258', ent)
+  call check_ok2(ne, 264, 2, d)
+  call check_int2(ne, 264,  3, n, GD_SBIT_ENTRY)
+  call check_int2(ne, 264,  4, ent%fragment_index, 0)
+  call check_int2(ne, 264,  5, ent%numbits, 93)
+  call check_int2(ne, 264,  6, ent%bitnum, 16)
+  call check_str2(ne, 264,  7, ent%field(1), 'in3')
+  call check_str2(ne, 264,  8, ent%scalar(1), '')
+  call check_str2(ne, 264,  9, ent%scalar(2), 'const')
+  call check_int2(ne, 264, 10, ent%scalar_ind(2), -1)
+
+! 265: fgd_alter_entry PHASE
+  ent%field_type = GD_PHASE_ENTRY
+  ent%field(1) = 'in2'
+  ent%shift = -265
+  call fgd_alter_entry(d, 'new248', ent, 1, 0)
+  call check_ok2(ne,  265, 1, d)
+
+  n = fgd_entry(d, 'new248', ent)
+  call check_ok2(ne,  265, 2, d)
+  call check_int2(ne, 265, 1, n, GD_PHASE_ENTRY)
+  call check_int2(ne, 265, 2, ent%fragment_index, 0)
+  call check_int2(ne, 265, 3, ent%shift, -265)
+  call check_str2(ne, 265, 4, ent%field(1), 'in2')
+  call check_str2(ne, 265, 5, ent%scalar(1), '')
+ 
+! 266: fgd_alter_entry RECIP
+  ent%field_type = GD_RECIP_ENTRY
+  ent%flags = 0
+  ent%field(1) = 'in5'
+  ent%scalar(1) = 'carray'
+  ent%scalar_ind(1) = 2
+  call fgd_alter_entry(d, 'new251', ent, 0, 0)
+  call check_ok2(ne, 266, 1, d)
+
+  n = fgd_entry(d, 'new251', ent)
+  call check_ok2(ne, 266, 2, d)
+  call check_int2(ne, 266, 3, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 266, 4, ent%fragment_index, 0)
+  call check_int2(ne, 266, 5, ent%flags, GD_EN_CALC)
+  call check_str2(ne, 266, 6, ent%field(1), 'in5')
+  call check_dbl2(ne, 266, 7, ent%dividend, 12d0)
+  call check_str2(ne, 266, 8, ent%scalar(1), 'carray')
+  call check_int2(ne, 266, 9, ent%scalar_ind(1), 2)
+
+! 267: fgd_alter_entry CRECIP
+  ent%field_type = GD_RECIP_ENTRY
+  ent%field(1) = 'in4'
+  ent%flags = GD_EN_COMPSCAL
+  ent%cdividend = dcmplx(12d0, 14d0)
+  call fgd_alter_entry(d, 'new251', ent, 15, 0)
+  call check_ok2(ne, 267, 1, d)
+
+  n = fgd_entry(d, 'new251', ent)
+  call check_ok2(ne, 267, 2, d)
+  call check_int2(ne, 267, 3, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 267, 4, ent%fragment_index, 0)
+  call check_int2(ne, 267, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL)
+  call check_str2(ne, 267, 6, ent%field(1), 'in4')
+  call check_cpx2(ne, 267, 7, ent%cdividend, dcmplx(12d0, 14d0))
+  call check_str2(ne, 267, 8, ent%scalar(1), '')
+
+! 268: fgd_alter_entry WINDOW
+  ent%field_type = GD_WINDOW_ENTRY
+  ent%field(1) = ''
+  ent%field(2) = 'in4'
+  ent%windop = GD_WINDOP_LT
+  ent%scalar(1) = 'carray'
+  ent%scalar_ind(1) = 3
+  call fgd_alter_entry(d, 'new253', ent, 0, 0)
+  call check_ok2(ne, 268, 1, d)
+
+  n = fgd_entry(d, 'new253', ent)
+  call check_ok2(ne,  268,  2, d)
+  call check_int2(ne, 268,  3, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 268,  4, ent%fragment_index, 0)
+  call check_int2(ne, 268,  5, ent%windop, GD_WINDOP_LT)
+  call check_str2(ne, 268,  6, ent%field(1), 'in2')
+  call check_str2(ne, 268,  7, ent%field(2), 'in4')
+  call check_dbl2(ne, 268,  8, ent%rthreshold, 179d0)
+  call check_str2(ne, 268,  9, ent%scalar(1), 'carray')
+  call check_int2(ne, 268, 10, ent%scalar_ind(1), 3)
+
+! 269: fgd_alter MPLEX
+  ent%field_type = GD_MPLEX_ENTRY
+  ent%field(1) = 'in0'
+  ent%field(2) = ''
+  ent%scalar(1) = ''
+  ent%period = -1
+  call fgd_alter_entry(d, 'new254', ent, 2, 0)
+  call check_ok2(ne, 269, 1, d)
+
+  n = fgd_entry(d, 'new254', ent)
+  call check_ok2(ne,  269,  2, d)
+  call check_int2(ne, 269,  3, n, GD_MPLEX_ENTRY)
+  call check_int2(ne, 269,  4, ent%fragment_index, 0)
+  call check_int2(ne, 269,  5, ent%count_val, 179)
+  call check_int2(ne, 269,  6, ent%period, 180)
+  call check_str2(ne, 269,  7, ent%field(1), 'in0')
+  call check_str2(ne, 269,  8, ent%field(2), 'in2')
+  call check_str2(ne, 269,  9, ent%scalar(1), 'carray')
+  call check_int2(ne, 269, 10, ent%scalar_ind(1), 3)
+  call check_str2(ne, 269, 11, ent%scalar(2), '')
+
+! 271: fgd_encoding_support
+  n = fgd_encoding_support(GD_SIE_ENCODED)
+  call check_int(ne, 271, n, GD_RDWR)
+
+! 272: NULL return from gd_reference
   l = fgd_open(fildir//DIRSEP//'empty', GD_RDWR + GD_CREAT + GD_EXCL)
-  call check_ok2(ne, 243, 1, l)
+  call check_ok2(ne, 272, 1, l)
 
   str = fgd_reference(l, "")
-  call check_ok2(ne, 243, 2, l)
-  call check_str(ne, 243, str, '')
+  call check_ok2(ne, 272, 2, l)
+  call check_str(ne, 272, str, '')
 
-  call fgd_discard(l);
+  call fgd_discard(l)
 
 
- 
 
 
   
diff --git a/bindings/f77/test/gdcopn.f b/bindings/f77/test/gdcopn.f
index 299a042..c411ff3 100644
--- a/bindings/f77/test/gdcopn.f
+++ b/bindings/f77/test/gdcopn.f
@@ -1,3 +1,23 @@
+C     Copyright (C) 2008, 2012, 2015 D. V. Wiebe
+C
+C     CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+C
+C     This file is part of the GetData project.
+C
+C     GetData is free software; you can redistribute it and/or modify it under
+C     the terms of the GNU Lesser General Public License as published by the
+C     Free Software Foundation; either version 2.1 of the License, or (at your
+C     option) any later version.
+C
+C     GetData is distributed in the hope that it will be useful, but WITHOUT
+C     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+C     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+C     License for more details.
+C
+C     You should have received a copy of the GNU Lesser General Public License
+C     along with GetData; if not, write to the Free Software Foundation, Inc.,
+C     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+C
 C     Callback test
 
       SUBROUTINE CALBCK(R, DUNIT, SUBERROR, LINE)
@@ -70,39 +90,40 @@ C     An invalid response
 
       CALL GDCOPN(d, fildir, 12, GD_RW, CALBCK)
       CALL GDEROR(e1, d)
-      CALL GDINCL(d, "format2", 7, 0, 0)
-      CALL GDEROR(e2, d)
-
-C     Change callback
-      CALL GDCLBK(d, CALBK2)
-      CALL GDINCL(d, "format3", 7, 0, 0)
-      CALL GDEROR(e3, d)
-
-C     Delete callback
-      CALL GDNOCB(d)
-      CALL GDINCL(d, "format3", 7, 0, 0)
-      CALL GDEROR(e4, d)
-      CALL GDDSCD(d)
-
-      CALL SYSTEM ( 'rm -rf ' // fildir )
-
       IF (e1 .NE. GD_EOK) THEN
         r = 1
         WRITE(*, 9001) 1, e1, GD_EOK
       ENDIF
+
+      CALL GDINCL(d, "format2", 7, 0, 0)
+      CALL GDEROR(e2, d)
       IF (e2 .NE. GD_EOK) THEN
         r = 1
         WRITE(*, 9001) 2, e2, GD_EOK
       ENDIF
+
+C     Change callback
+      CALL GDCLBK(d, CALBK2)
+      CALL GDINCL(d, "format3", 7, 0, 0)
+      CALL GDEROR(e3, d)
       IF (e3 .NE. GD_ECB) THEN
         r = 1
         WRITE(*, 9001) 3, e3, GD_ECB
       ENDIF
+
+C     Delete callback
+      CALL GDNOCB(d)
+      CALL GDINCL(d, "format3", 7, 0, 0)
+      CALL GDEROR(e4, d)
       IF (e4 .NE. GD_EFO) THEN
         r = 1
         WRITE(*, 9001) 3, e4, GD_EFO
       ENDIF
 
+      CALL GDDSCD(d)
+
+      CALL SYSTEM ( 'rm -rf ' // fildir )
+
       IF (r .GT. 0) CALL ExIT(1)
 
  9001 FORMAT('e[', i3, '] = ', i4, ', expected ', i4)
diff --git a/bindings/idl/Makefile.am b/bindings/idl/Makefile.am
index f7182bc..d22c410 100644
--- a/bindings/idl/Makefile.am
+++ b/bindings/idl/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009, 2011 D. V. Wiebe
+# Copyright (C) 2009, 2010, 2011, 2013 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -20,10 +20,6 @@
 #
 AUTOMAKE_OPTIONS = foreign
 
-if CC_WALL
-WALL=-Wall
-endif
-
 SUBDIRS=test
 
 if GD_EXTERNAL
@@ -36,7 +32,7 @@ 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)
+AM_CFLAGS = ${GD_CC_WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS)
 AM_CPPFLAGS = -I$(top_srcdir)/src
 BUILT_SOURCES=sublist.c constants.c
 idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \
diff --git a/bindings/idl/Makefile.in b/bindings/idl/Makefile.in
index 28fd6b6..41b65fc 100644
--- a/bindings/idl/Makefile.in
+++ b/bindings/idl/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -272,6 +270,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -297,8 +297,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -346,7 +357,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -361,12 +371,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -430,9 +444,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -440,6 +455,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -453,7 +469,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2009, 2011 D. V. Wiebe
+# Copyright (C) 2009, 2010, 2011, 2013 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -474,7 +490,6 @@ top_srcdir = @top_srcdir@
 # 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 AUTOMAKE_OPTIONS = foreign
- at CC_WALL_TRUE@WALL = -Wall
 SUBDIRS = test
 @GD_EXTERNAL_FALSE at GDIDL_GETDATA_LIBS = ../../src/libgetdata.la
 @GD_EXTERNAL_TRUE at GDIDL_GETDATA_LIBS = $(GETDATA_LIBS)
@@ -482,7 +497,7 @@ 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)
+AM_CFLAGS = ${GD_CC_WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS)
 AM_CPPFLAGS = -I$(top_srcdir)/src
 BUILT_SOURCES = sublist.c constants.c
 idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \
diff --git a/bindings/idl/getdata.c b/bindings/idl/getdata.c
index f6f9024..94418f1 100644
--- a/bindings/idl/getdata.c
+++ b/bindings/idl/getdata.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2012 D. V. Wiebe
+/* Copyright (C) 2009-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -41,6 +41,10 @@
 # define dreturnvoid()
 # define dreturn(...)
 # define dwatch(...)
+# define gd_colclear()
+# define GD_INT_TYPE ((gd_type_t)(SIZEOF_INT | GD_SIGNED))
+# define GD_UINT_TYPE ((gd_type_t)(SIZEOF_UNSIGNED_INT))
+# define gd_static_inline_ static inline
 #else
 # include "../../src/internal.h"
 #endif
@@ -52,11 +56,17 @@ 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 GDIDL_ABORT(s) do { \
+  gd_colclear(); \
+  IDL_Message(IDL_M_GENERIC, IDL_MSG_LONGJMP, s); \
+} while(0)
+#define GDIDL_ABORT2(fmt, ...) do { \
+  char gdidl_abort_buffer[1024]; \
+  sprintf(gdidl_abort_buffer, fmt, __VA_ARGS__); \
+  GDIDL_ABORT(gdidl_abort_buffer); \
+} while(0)
+#define GDIDL_KW_ABORT(s) \
+  do { IDL_KW_FREE; GDIDL_ABORT(s); } while(0)
 #define dtraceidl() dtrace("%i, %p, %p", argc, argv, argk)
 
 /* Error reporting stuff */
@@ -130,7 +140,7 @@ static long gdidl_set_dirfile(DIRFILE* D)
     }
 
   /* out of idldirfiles space: complain and abort */
-  idl_abort("DIRFILE space exhausted.");
+  GDIDL_ABORT("DIRFILE space exhausted.");
   return 0; /* can't get here */
 }
 
@@ -163,42 +173,57 @@ static void gdidl_clear_dirfile(IDL_LONG d)
 }
 
 /* convert a GetData type code to an IDL type code */
-static inline UCHAR gdidl_idl_type(gd_type_t t) {
+gd_static_inline_ UCHAR gdidl_idl_type(gd_type_t t)
+{
+  UCHAR it;
+  dtrace("0x%X", t);
+
   switch (t) {
     case GD_UINT8:
-      return IDL_TYP_BYTE;
+      it = IDL_TYP_BYTE;
+      break;
     case GD_UINT16:
-      return IDL_TYP_UINT;
+      it = IDL_TYP_UINT;
+      break;
     case GD_INT8: /* there is no signed 8-bit type in IDL
                      - we type promote to INT */
     case GD_INT16:
-      return IDL_TYP_INT;
+      it = IDL_TYP_INT;
+      break;
     case GD_UINT32:
-      return IDL_TYP_ULONG;
+      it = IDL_TYP_ULONG;
+      break;
     case GD_INT32:
-      return IDL_TYP_LONG;
+      it = IDL_TYP_LONG;
+      break;
     case GD_UINT64:
-      return IDL_TYP_ULONG64;
+      it = IDL_TYP_ULONG64;
+      break;
     case GD_INT64:
-      return IDL_TYP_LONG64;
+      it = IDL_TYP_LONG64;
+      break;
     case GD_FLOAT32:
-      return IDL_TYP_FLOAT;
+      it = IDL_TYP_FLOAT;
+      break;
     case GD_FLOAT64:
-      return IDL_TYP_DOUBLE;
+      it = IDL_TYP_DOUBLE;
+      break;
     case GD_COMPLEX64:
-      return IDL_TYP_COMPLEX;
+      it = IDL_TYP_COMPLEX;
+      break;
     case GD_COMPLEX128:
-      return IDL_TYP_DCOMPLEX;
-    case GD_NULL:
-    case GD_UNKNOWN:
-      ;
+      it = IDL_TYP_DCOMPLEX;
+      break;
+    default:
+      it = IDL_TYP_UNDEF;
   }
 
-  return IDL_TYP_UNDEF;
+  dreturn("%u", it);
+  return it;
 }
 
 /* convert an IDL type code to a GetData type code */
-static inline gd_type_t gdidl_gd_type(int t) {
+gd_static_inline_ gd_type_t gdidl_gd_type(int t) {
   switch (t) {
     case IDL_TYP_BYTE:
       return GD_UINT8;
@@ -228,7 +253,7 @@ static inline gd_type_t gdidl_gd_type(int t) {
 }
 
 /* convert a datum (from a void*) to an IDL_ALLTYPES union */
-static inline IDL_ALLTYPES gdidl_to_alltypes(gd_type_t t, void* d)
+gd_static_inline_ IDL_ALLTYPES gdidl_to_alltypes(gd_type_t t, void* d)
 {
   dtrace("%x, %p", t, d);
 
@@ -290,7 +315,7 @@ static inline IDL_ALLTYPES gdidl_to_alltypes(gd_type_t t, void* d)
 
 /* 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)
+gd_static_inline_ const void* gdidl_from_alltypes(UCHAR t, IDL_ALLTYPES* v)
 {
   static float complex fc;
   static double complex dc;
@@ -327,7 +352,7 @@ static inline const void* gdidl_from_alltypes(UCHAR t, IDL_ALLTYPES* v)
 }
 
 /* copy (and convert) an array of complex values */
-static inline void gdidl_cmp_to_c99(double complex* dest, IDL_COMPLEX* src,
+gd_static_inline_ void gdidl_cmp_to_c99(double complex* dest, IDL_COMPLEX* src,
     size_t n)
 {
   dtrace("%p, %p, %zi", dest, src, n);
@@ -341,8 +366,8 @@ static inline void gdidl_cmp_to_c99(double complex* dest, IDL_COMPLEX* src,
 }
 
 /* copy (and convert) an array of complex values */
-static inline void gdidl_dcmp_to_c99(double complex* dest, IDL_DCOMPLEX* src,
-    size_t n)
+gd_static_inline_ void gdidl_dcmp_to_c99(double complex* dest,
+    IDL_DCOMPLEX* src, size_t n)
 {
   dtrace("%p, %p, %zi", dest, src, n);
 
@@ -355,7 +380,7 @@ static inline void gdidl_dcmp_to_c99(double complex* dest, IDL_DCOMPLEX* src,
 }
 
 /* copy (and convert) an array of complex values */
-static inline void gdidl_c99_to_dcmp(IDL_DCOMPLEX* dest,
+gd_static_inline_ void gdidl_c99_to_dcmp(IDL_DCOMPLEX* dest,
     const double complex* src, size_t n)
 {
   dtrace("%p, %p, %zi", dest, src, n);
@@ -373,10 +398,12 @@ static double complex gdidl_dcomplexScalar(IDL_VPTR obj)
 {
   double r = 0, i = 0;
 
+  dtrace("%p", obj);
+
   /* accept either a scalar or a single element array */
   if (obj->flags & IDL_V_ARR) {
     if (obj->value.arr->n_dim != 1 || obj->value.arr->dim[0] != 1)
-      idl_abort("Scalar or single element array expected where multiple "
+      GDIDL_ABORT("Scalar or single element array expected where multiple "
           "element array found");
 
     if (obj->type == IDL_TYP_DCOMPLEX) {
@@ -386,7 +413,7 @@ static double complex gdidl_dcomplexScalar(IDL_VPTR obj)
       r = ((IDL_COMPLEX *)obj->value.arr->data)[0].r;
       i = ((IDL_COMPLEX *)obj->value.arr->data)[0].i;
     } else
-      idl_abort("complex value expected");
+      GDIDL_ABORT("complex value expected");
   } else {
     IDL_ENSURE_SCALAR(obj);
 
@@ -397,9 +424,10 @@ static double complex gdidl_dcomplexScalar(IDL_VPTR obj)
       r = obj->value.cmp.r;
       i = obj->value.cmp.i;
     } else
-      idl_abort("complex value expected");
+      GDIDL_ABORT("complex value expected");
   }
 
+  dreturn("%g; %g", r, i);
   return r + _Complex_I * i;
 }
 
@@ -434,6 +462,9 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
             "IN_FIELDS", IDL_MSG_LONGJMP, NULL)), E->in_fields[0]);
   }
 
+  *(IDL_UINT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+        "FLAGS", IDL_MSG_LONGJMP, NULL)) = E->flags;
+
   switch (E->field_type)
   {
     case GD_RAW_ENTRY:
@@ -449,8 +480,6 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
     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",
@@ -469,21 +498,18 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
             "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 +
+      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 +
+      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));
-      }
+      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,
@@ -510,20 +536,16 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
               "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",
+      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;
+      *(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",
@@ -535,8 +557,6 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
       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) {
@@ -548,14 +568,11 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
           (int16_t)E->scalar_ind[i];
       }
 
-      if (E->comp_scal)
-        gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
+      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));
+      memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "A",
+            IDL_MSG_LONGJMP, NULL), E->a, (E->poly_ord + 1) * sizeof(double));
       break;
     case GD_WINDOW_ENTRY:
       *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
@@ -607,7 +624,9 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
     case GD_CARRAY_ENTRY:
       *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "ARRAY_LEN",
             IDL_MSG_LONGJMP, NULL)) = E->array_len;
-      /* fallthrough */
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE",
+            IDL_MSG_LONGJMP, NULL)) = E->const_type;
+      break;
     case GD_CONST_ENTRY:
       *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE",
             IDL_MSG_LONGJMP, NULL)) = E->const_type;
@@ -623,183 +642,362 @@ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
   return r;
 }
 
+#define GDIDL_GET_TAG(v,tag,miss_ok,d) \
+  IDL_StructTagInfoByName((v)->value.s.sdef, tag, \
+      (miss_ok) ? IDL_MSG_RET | IDL_MSG_ATTR_NOPRINT : IDL_MSG_LONGJMP, &(d))
+
+#define GDIDL_CCONVERT_ENTRY_ELEMENT(dstp,src,key,offset,type) \
+  do { \
+    switch (type) { \
+      case IDL_TYP_BYTE:     (dstp)[0] = ((  int8_t*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_UINT:     (dstp)[0] = ((uint16_t*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_INT:      (dstp)[0] = (( int16_t*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_ULONG:    (dstp)[0] = ((uint32_t*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_LONG:     (dstp)[0] = (( int32_t*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_ULONG64:  (dstp)[0] = ((uint64_t*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_LONG64:   (dstp)[0] = (( int64_t*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_FLOAT:    (dstp)[0] = ((   float*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_DOUBLE:   (dstp)[0] = ((  double*)(src))[offset]; \
+                             (dstp)[1] = 0; break; \
+      case IDL_TYP_COMPLEX:  (dstp)[0] = (( IDL_COMPLEX*)(src))[offset].r; \
+                             (dstp)[1] = (( IDL_COMPLEX*)(src))[offset].i; \
+      break; \
+      case IDL_TYP_DCOMPLEX: (dstp)[0] = ((IDL_DCOMPLEX*)(src))[offset].r; \
+                             (dstp)[1] = ((IDL_DCOMPLEX*)(src))[offset].i; \
+      break; \
+      default: GDIDL_ABORT2("GD_ENTRY element %s must be of numeric type", \
+                   key); \
+    } \
+  } while(0)
+
+#define GDIDL_CONVERT_ENTRY_ELEMENT(dst,src,key,offset,type) \
+  do { \
+    switch (type) { \
+      case IDL_TYP_BYTE:     (dst) = ((  int8_t*)(src))[offset]; break; \
+      case IDL_TYP_UINT:     (dst) = ((uint16_t*)(src))[offset]; break; \
+      case IDL_TYP_INT:      (dst) = (( int16_t*)(src))[offset]; break; \
+      case IDL_TYP_ULONG:    (dst) = ((uint32_t*)(src))[offset]; break; \
+      case IDL_TYP_LONG:     (dst) = (( int32_t*)(src))[offset]; break; \
+      case IDL_TYP_ULONG64:  (dst) = ((uint64_t*)(src))[offset]; break; \
+      case IDL_TYP_LONG64:   (dst) = (( int64_t*)(src))[offset]; break; \
+      case IDL_TYP_FLOAT:    (dst) = ((   float*)(src))[offset]; break; \
+      case IDL_TYP_DOUBLE:   (dst) = ((  double*)(src))[offset]; break; \
+      case IDL_TYP_COMPLEX:  (dst) = (( IDL_COMPLEX*)(src))[offset].r; break; \
+      case IDL_TYP_DCOMPLEX: (dst) = ((IDL_DCOMPLEX*)(src))[offset].r; break; \
+      default: GDIDL_ABORT2("GD_ENTRY element %s must be of numeric type",key);\
+    } \
+  } while(0)
+
+/* convert structure data */
+static void gdidl_convert_entry_num(void *dst, gd_type_t dtype, const char *key,
+    const unsigned char *src, int offset, int stype)
+{
+  dtrace("%p, 0x%X, \"%s\", %p, %i, %i", dst, dtype, key, src, offset, stype);
+
+  switch (dtype) {
+    case GD_NULL:
+    case GD_UNKNOWN:
+      break;
+    case GD_UINT8:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*(( uint8_t*)dst), src, key, offset, stype);
+      break;
+    case GD_INT8:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*((  int8_t*)dst), src, key, offset, stype);
+      break;
+    case GD_UINT16:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*((uint16_t*)dst), src, key, offset, stype);
+      break;
+    case GD_INT16:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*(( int16_t*)dst), src, key, offset, stype);
+      break;
+    case GD_UINT32:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*((uint32_t*)dst), src, key, offset, stype);
+      break;
+    case GD_INT32:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*(( int32_t*)dst), src, key, offset, stype);
+      break;
+    case GD_UINT64:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*((uint64_t*)dst), src, key, offset, stype);
+      break;
+    case GD_INT64:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*(( int64_t*)dst), src, key, offset, stype);
+      break;
+    case GD_FLOAT32:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*((   float*)dst), src, key, offset, stype);
+      break;
+    case GD_FLOAT64:
+      GDIDL_CONVERT_ENTRY_ELEMENT(*((  double*)dst), src, key, offset, stype);
+      break;
+    case GD_COMPLEX64:
+      GDIDL_CCONVERT_ENTRY_ELEMENT(     (float*)dst, src, key, offset, stype);
+      break;
+    case GD_COMPLEX128:
+      GDIDL_CCONVERT_ENTRY_ELEMENT(    (double*)dst, src, key, offset, stype);
+      break;
+  }
+
+  dreturnvoid();
+}
+
+/* get a scalar */
+static int gdidl_get_entry_num(void *dst, gd_type_t type, IDL_VPTR v, char *key,
+    int miss_ok)
+{
+  IDL_VPTR d;
+
+  dtrace("%p, 0x%X, %p, \"%s\", %i", dst, type, v, key, miss_ok);
+
+  const unsigned char* data = v->value.s.arr->data;
+  IDL_MEMINT o = GDIDL_GET_TAG(v, key, miss_ok, d);
+
+  if (o == -1) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* filter out bad things */
+  if (d->flags & IDL_V_ARR) {
+    IDL_ARRAY* arr = (IDL_ARRAY*)(data + o);
+    if (arr->n_elts > 1)
+      GDIDL_ABORT2("GD_ENTRY element %s must be of scalar type", key);
+  }
+
+  gdidl_convert_entry_num(dst, type, key, data + o, 0, d->type);
+
+  dreturn("%i", 1);
+  return 1;
+}
+
+/* convert the entry scalar and scalar_ind arrays */
+static unsigned gdidl_get_entry_scalars(gd_entry_t *E, unsigned mask,
+    IDL_VPTR v)
+{
+  int i, n_scalar, n_scalar_ind;
+  unsigned mask_out = 0;
+  IDL_MEMINT o_scalar, o_scalar_ind;
+  IDL_VPTR d_scalar, d_scalar_ind;
+
+  unsigned char* data = v->value.s.arr->data;
+
+  dtrace("%p, 0x%X, %p", E, mask, v);
+
+  /* find the data */
+  o_scalar = GDIDL_GET_TAG(v, "SCALAR", 1, d_scalar);
+  if (o_scalar == -1) {
+    dreturn("%i", 0);
+    return 0;
+  } else if (d_scalar->type != IDL_TYP_STRING)
+    GDIDL_ABORT("GD_ENTRY element SCALAR must be an array of strings");
+ 
+  if (d_scalar->flags & IDL_V_ARR) {
+    n_scalar = d_scalar->value.arr->n_elts;
+
+    if (n_scalar > GD_MAX_POLYORD + 1)
+      n_scalar = GD_MAX_POLYORD + 1;
+  } else
+    n_scalar = 1;
+
+  o_scalar_ind = GDIDL_GET_TAG(v, "SCALAR_IND", 1, d_scalar_ind);
+
+  if (o_scalar_ind != -1) {
+    if (d_scalar_ind->flags & IDL_V_ARR)
+      n_scalar_ind = d_scalar_ind->value.arr->n_elts;
+    else
+      n_scalar_ind = 1;
+  } else
+    n_scalar_ind = 0;
+
+  for (i = 0; i < n_scalar; ++i) {
+    if (!(mask & (1 << i)))
+      continue;
+
+    E->scalar[i] = IDL_STRING_STR((IDL_STRING*)(data + o_scalar) + i);
+
+    if (E->scalar[i] && E->scalar[i][0] == '\0') {
+      E->scalar[i] = NULL;
+      continue;
+    }
+
+    if (i < n_scalar_ind)
+      gdidl_convert_entry_num(E->scalar_ind + i, GD_INT_TYPE, "SCALAR_IND",
+          data + o_scalar_ind, i, d_scalar_ind->type);
+
+    mask_out |= (1 << i);
+  }
+
+  dreturn("0x%X", mask_out);
+  return mask_out;
+}
+
+static int gdidl_get_in_fields(char **in_fields, IDL_VPTR v, int min, int max,
+    int miss_ok)
+{
+  int i, n;
+  IDL_MEMINT o;
+  IDL_VPTR d;
+  unsigned char* data = v->value.s.arr->data;
+
+  dtrace("%p, %p, %i, %i, %i", in_fields, v, min, max, miss_ok);
+
+  o = GDIDL_GET_TAG(v, "IN_FIELDS", miss_ok, d);
+
+  if (o == -1) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  IDL_ENSURE_STRING(d);
+
+  if (d->flags & IDL_V_ARR)
+    n = d->value.arr->n_elts;
+  else
+    n = 1;
+
+  if (n < min || n > max)
+    GDIDL_ABORT2("Bad length (%i) for IN_FIELDS in GD_ENTRY", n);
+
+  for (i = 0; i < n; ++i)
+    in_fields[i] = IDL_STRING_STR((IDL_STRING*)(data + o) + i);
+
+  dreturn("%i", n);
+  return n;
+}
+
+static int gdidl_get_entry_cmparr(double complex *c, IDL_VPTR v, char key,
+    int min, int max, unsigned mask, int miss_ok)
+{
+  int n, i;
+  IDL_MEMINT o;
+  IDL_VPTR d;
+  unsigned char* data = v->value.s.arr->data;
+  char ckey[3] = { 'C', key, 0 };
+
+  dtrace("%p, %p, '%c', %i, %i, 0x%X, %i", c, v, key, min, max, mask, miss_ok);
+
+  /* try key "<c>" before key "C<c>" */
+  o = GDIDL_GET_TAG(v, ckey + 1, 1, d);
+  if (o == -1) {
+    o = GDIDL_GET_TAG(v, ckey, miss_ok, d);
+
+    if (o == -1) {
+      dreturn("%i", 0);
+      return 0;
+    }
+  }
+
+  if (d->flags & IDL_V_ARR)
+    n = d->value.arr->n_elts;
+  else
+    n = 1;
+
+  for (i = 0; i < n; ++i)
+    gdidl_convert_entry_num(c + i, GD_COMPLEX128, ckey + 1, data + o, i,
+        d->type);
+
+  /* add trailing named scalars */
+  for (; n < GD_MAX_POLYORD + 1; ++n)
+    if (!(mask & (1 << n)))
+      break;
+
+  if (n < min || n > max)
+    GDIDL_ABORT2("Bad length (%i) for %c in GD_ENTRY", n, key);
+
+  dreturn("%i", n);
+  return n;
+}
+
 /* convert an IDL structure into an gd_entry_t */
-void gdidl_read_idl_entry(gd_entry_t *E, IDL_VPTR v, int alter)
+static void gdidl_read_idl_entry(gd_entry_t *E, IDL_VPTR v, int no_fragment,
+    const gd_entry_t *old_E)
 {
   /* this function is fairly agnostic about the structure it's given: so
    * long as it gets a structure with the fields it wants (of the right type)
    * it's happy */
 
-  dtrace("%p, %p, %i", E, v, alter);
+  dtrace("%p, %p, %i, %p", E, v, no_fragment, old_E);
 
   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;
+  int n = 0, min, max;
+  const int miss_ok = (old_E != NULL);
+  unsigned mask, tmask;
 
-  memset(copy_scalar, 0, sizeof(int) * (GD_MAX_POLYORD + 1));
-  memset(E, 0, sizeof(gd_entry_t));
+  if (old_E)
+    memcpy(E, old_E, sizeof(gd_entry_t));
+  else
+    memset(E, 0, sizeof(gd_entry_t));
 
   unsigned char* data = v->value.s.arr->data;
 
-  if (!alter) {
+  if (!miss_ok) {
     /* field */
-    o = IDL_StructTagInfoByName(v->value.s.sdef, "FIELD", IDL_MSG_LONGJMP, &d);
+    o = GDIDL_GET_TAG(v, "FIELD", 0, 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);
+  if (!no_fragment) /* fragment_index */
+    gdidl_get_entry_num(&E->fragment_index, GD_INT_TYPE, v, "FRAGMENT", 0);
 
-  /* 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
-      || E->field_type == GD_MPLEX_ENTRY || E->field_type == GD_WINDOW_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));
-    }
-  }
+  /* field_type */
+  gdidl_get_entry_num(&E->field_type, GD_INT_TYPE, v, "FIELD_TYPE", 0);
 
   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);
-      }
+      gdidl_get_entry_num(&E->data_type, GD_INT_TYPE, v, "DATA_TYPE", miss_ok);
 
-      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;
+      mask = gdidl_get_entry_scalars(E, 1, v);
 
-      copy_scalar[0] = 1;
+      if (!(mask & 1))
+        gdidl_get_entry_num(&E->spf, GD_UINT_TYPE, v, "SPF", miss_ok);
 
       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);
+      if (gdidl_get_entry_num(&n, GD_INT_TYPE, v, "N_FIELDS", 1))
+        min = max = n;
+      else {
+        min = 1;
+        max = GD_MAX_LINCOM;
       }
 
-      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);
-      }
+      E->n_fields = gdidl_get_in_fields((char**)E->in_fields, v, min, max,
+          miss_ok);
 
-      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);
-      }
+      if (E->n_fields > 0)
+        min = max = E->n_fields;
 
-      for (i = 0 ; i < n; ++i) {
-        copy_scalar[i] = 1;
-        copy_scalar[i + GD_MAX_LINCOM] = 1;
-      }
+      E->flags |= GD_EN_COMPSCAL;
 
-      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");
-        }
-      }
+      tmask = (1 << max) - 1;
+      mask = gdidl_get_entry_scalars(E, 9 * tmask, v);
 
-      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");
-        }
+      if ((mask & tmask) != tmask) {
+        E->n_fields = gdidl_get_entry_cmparr(E->cm, v, 'M', min, max,
+            mask & tmask, miss_ok);
+
+        if (E->n_fields > 0)
+          min = max = E->n_fields;
       }
+
+      if (((mask >> GD_MAX_LINCOM) & tmask) != tmask)
+        E->n_fields = gdidl_get_entry_cmparr(E->cb, v, 'B', min, max,
+            (mask >> GD_MAX_LINCOM) & tmask, miss_ok);
+      else
+        E->n_fields = max;
+
       break;
     case GD_LINTERP_ENTRY:
-      o = IDL_StructTagInfoByName(v->value.s.sdef, "TABLE", action, &d);
+      gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok);
+      o = GDIDL_GET_TAG(v, "TABLE", miss_ok, d);
       if (o != -1) {
         IDL_ENSURE_STRING(d);
         E->table = IDL_STRING_STR((IDL_STRING*)(data + o));
@@ -807,204 +1005,121 @@ void gdidl_read_idl_entry(gd_entry_t *E, IDL_VPTR v, int alter)
       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;
+      gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok);
 
-      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);
+      mask = gdidl_get_entry_scalars(E, 0x3, v);
+
+      if (!(mask & 0x1))
+        gdidl_get_entry_num(&E->bitnum, GD_INT_TYPE, v, "BITNUM", miss_ok);
+
+      if (!(mask & 0x3)) {
+        if (!gdidl_get_entry_num(&E->numbits, GD_INT_TYPE, v, "NUMBITS", 1))
+          if (!miss_ok)
+            E->numbits = 1;
       }
 
-      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);
-      }
+      gdidl_get_in_fields((char**)E->in_fields, v, 2, 2, miss_ok);
       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);
-      }
+      gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok);
+      E->flags |= GD_EN_COMPSCAL;
 
-      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");
+      mask = gdidl_get_entry_scalars(E, 0x1, v);
+
+      if (!(mask & 1))
+        if (gdidl_get_entry_num(&E->cdividend, GD_COMPLEX128, v, "CDIVIDEND",
+              1) == 0)
+        {
+          gdidl_get_entry_num(&E->cdividend, GD_COMPLEX128, v, "DIVIDEND",
+              miss_ok);
         }
-      }
-      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;
+      gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok);
+
+      mask = gdidl_get_entry_scalars(E, 0x1, v);
+
+      if (!(mask & 1))
+        gdidl_get_entry_num(&E->shift, GD_INT64, v, "SHIFT", miss_ok);
       break;
     case GD_POLYNOM_ENTRY:
-      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;
+      if (gdidl_get_entry_num(&n, GD_INT_TYPE, v, "POLY_ORD", 1))
+        min = max = n + 1;
+      else {
+        min = 2;
+        max = GD_MAX_POLYORD + 1;
       }
 
-      for (i = 0 ; i < n; ++i)
-        copy_scalar[i] = 1;
+      gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok);
 
-      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);
-      }
+      tmask = (1 << max) - 1;
+      mask = gdidl_get_entry_scalars(E, tmask, v);
 
-      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");
-        }
-      }
+      E->flags |= GD_EN_COMPSCAL;
+
+      if ((mask & tmask) != tmask)
+        E->poly_ord = gdidl_get_entry_cmparr(E->ca, v, 'A', min, max, mask,
+            miss_ok) - 1;
+      else
+        E->poly_ord = max - 1;
       break;
     case GD_WINDOW_ENTRY:
-      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);
-      }
-
-      o = IDL_StructTagInfoByName(v->value.s.sdef, "WINDOP", action, &d);
-      if (o != -1) {
-        if (d->type != IDL_TYP_INT)
-          idl_abort("GD_ENTRY element WINDOP must be of type INT");
-        E->windop = *(int16_t*)(data + o);
-      } else
-        E->windop = GD_WINDOP_UNK;
-
-      switch (E->windop) {
-        case GD_WINDOP_EQ:
-        case GD_WINDOP_NE:
-          o = IDL_StructTagInfoByName(v->value.s.sdef, "ITHRESHOLD", action,
-              &d);
-          if (o != -1) {
-            if (d->type != IDL_TYP_LONG)
-              idl_abort("GD_ENTRY element ITHRESHOLD must be of type LONG");
-            E->threshold.i = *(IDL_LONG*)(data + o);
-          }
-          break;
-        case GD_WINDOP_SET:
-        case GD_WINDOP_CLR:
-          o = IDL_StructTagInfoByName(v->value.s.sdef, "UTHRESHOLD", action,
-              &d);
-          if (o != -1) {
-            if (d->type != IDL_TYP_ULONG)
-              idl_abort("GD_ENTRY element UTHRESHOLD must be of type ULONG");
-            E->threshold.u = *(IDL_ULONG*)(data + o);
-          }
-          break;
-        default:
-          o = IDL_StructTagInfoByName(v->value.s.sdef, "RTHRESHOLD", action,
-              &d);
-          if (o != -1) {
-            if (d->type != IDL_TYP_DOUBLE)
-              idl_abort("GD_ENTRY element RTHRESHOLD must be of type DOUBLE");
-            E->threshold.u = *(double*)(data + o);
-          }
-          break;
-      }
+      gdidl_get_in_fields((char**)E->in_fields, v, 2, 2, miss_ok);
+      gdidl_get_entry_num(&E->windop, GD_INT_TYPE, v, "WINDOP", miss_ok);
+
+      mask = gdidl_get_entry_scalars(E, 0x1, v);
+
+      if (!(mask & 1))
+        switch (E->windop) {
+          case GD_WINDOP_EQ:
+          case GD_WINDOP_NE:
+            if (gdidl_get_entry_num(&E->threshold.i, GD_INT64, v, "ITHRESHOLD",
+                  1) == 0)
+            {
+              gdidl_get_entry_num(&E->threshold.i, GD_INT64, v, "THRESHOLD",
+                  miss_ok);
+            }
+            break;
+          case GD_WINDOP_SET:
+          case GD_WINDOP_CLR:
+            if (gdidl_get_entry_num(&E->threshold.u, GD_UINT64, v, "UTHRESHOLD",
+                  1) == 0)
+            {
+              gdidl_get_entry_num(&E->threshold.u, GD_UINT64, v, "THRESHOLD",
+                  miss_ok);
+            }
+            break;
+          default:
+            if (gdidl_get_entry_num(&E->threshold.r, GD_FLOAT64, v,
+                  "RTHRESHOLD", 1) == 0)
+            {
+              gdidl_get_entry_num(&E->threshold.r, GD_FLOAT64, v, "THRESHOLD",
+                  miss_ok);
+            }
+            break;
+        }
       break;
     case GD_MPLEX_ENTRY:
-      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);
-      }
+      gdidl_get_in_fields((char**)E->in_fields, v, 2, 2, miss_ok);
 
-      o = IDL_StructTagInfoByName(v->value.s.sdef, "COUNT_VAL", action, &d);
-      if (o != -1) {
-        if (d->type != IDL_TYP_INT)
-          idl_abort("GD_ENTRY element COUNT_VAL must be of type INT");
-        E->count_val = *(int16_t*)(data + o);
-      }
+      mask = gdidl_get_entry_scalars(E, 0x3, v);
 
-      o = IDL_StructTagInfoByName(v->value.s.sdef, "PERIOD", action, &d);
-      if (o != -1) {
-        if (d->type != IDL_TYP_INT)
-          idl_abort("GD_ENTRY element PERIOD must be of type INT");
-        E->period = *(int16_t*)(data + o);
-      } else
-        E->period = -1;
+      if (!(mask & 1))
+        gdidl_get_entry_num(&E->count_val, GD_INT_TYPE, v, "COUNT_VAL",
+            miss_ok);
 
-      copy_scalar[0] = copy_scalar[1] = 1;
+      if (!(mask & 3))
+        gdidl_get_entry_num(&E->period, GD_INT_TYPE, v, "PERIOD", 1);
       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 */
+      gdidl_get_entry_num(&E->array_len, GD_INT_TYPE, v, "ARRAY_LEN", miss_ok);
+      gdidl_get_entry_num(&E->const_type, GD_INT_TYPE, v, "DATA_TYPE", miss_ok);
+      break;
     case GD_CONST_ENTRY:
-      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;
+      gdidl_get_entry_num(&E->const_type, GD_INT_TYPE, v, "DATA_TYPE", miss_ok);
       break;
     case GD_NO_ENTRY:
     case GD_ALIAS_ENTRY:
@@ -1013,26 +1128,6 @@ void gdidl_read_idl_entry(gd_entry_t *E, IDL_VPTR v, int alter)
       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();
 }
 
@@ -1050,6 +1145,8 @@ unsigned long gdidl_convert_encoding(IDL_VPTR idl_enc)
       encoding = GD_BZIP2_ENCODED;
     else if (strcasecmp(enc, "GZIP"))
       encoding = GD_GZIP_ENCODED;
+    else if (strcasecmp(enc, "FLAC"))
+      encoding = GD_FLAC_ENCODED;
     else if (strcasecmp(enc, "LZMA"))
       encoding = GD_LZMA_ENCODED;
     else if (strcasecmp(enc, "SLIM"))
@@ -1071,7 +1168,7 @@ unsigned long gdidl_convert_encoding(IDL_VPTR idl_enc)
     else if (strcasecmp(enc, "AUTO"))
       encoding = GD_AUTO_ENCODED;
     else
-      idl_abort("Unknown encoding type.");
+      GDIDL_ABORT("Unknown encoding type.");
   } else
     encoding = IDL_LongScalar(idl_enc);
 
@@ -1132,7 +1229,7 @@ void gdidl_add(int argc, IDL_VPTR argv[], char *argk)
 
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
   IDL_ENSURE_STRUCTURE(argv[1]);
-  gdidl_read_idl_entry(&E, argv[1], 0);
+  gdidl_read_idl_entry(&E, argv[1], kw.parent_x, NULL);
 
   if (kw.parent_x) {
     const char* parent = IDL_STRING_STR(&kw.parent);
@@ -1304,7 +1401,7 @@ void gdidl_add_carray(int argc, IDL_VPTR argv[], char *argk)
   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");
+      GDIDL_KW_ABORT("VALUE must be a vector, not a multidimensional array");
     data = (void *)kw.value->value.arr->data;
     data_type = gdidl_gd_type(kw.value->type);
     kw.n = kw.value->value.arr->n_elts;
@@ -1312,7 +1409,7 @@ void gdidl_add_carray(int argc, IDL_VPTR argv[], char *argk)
     data = malloc(kw.n);
     memset(data, 0, kw.n);
   } else
-    idl_kw_abort("either LENGTH or VALUE must be specified");
+    GDIDL_KW_ABORT("either LENGTH or VALUE must be specified");
 
   if (kw.parent_x) {
     const char* parent = IDL_STRING_STR(&kw.parent);
@@ -1458,10 +1555,13 @@ void gdidl_add_linterp(int argc, IDL_VPTR argv[], char *argk)
   dreturnvoid();
 }
 
-/* @@DLM: P gdidl_add_multiply GD_ADD_MULTIPLY 4 4 KEYWORDS */
-void gdidl_add_multiply(int argc, IDL_VPTR argv[], char *argk)
+static void gdidl_add_yoke_(gd_type_t type, int argc, IDL_VPTR argv[],
+    char *argk)
 {
-  dtraceidl();
+  dtrace("0x%X, %i, %p, %p", type, argc, argv, argk);
+
+  gd_entry_t E;
+  memset(&E, 0, sizeof(E));
 
   typedef struct {
     IDL_KW_RESULT_FIRST_FIELD;
@@ -1488,15 +1588,17 @@ void gdidl_add_multiply(int argc, IDL_VPTR argv[], char *argk)
   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]);
+  E.field = IDL_VarGetString(argv[1]);
+  E.field_type = type;
+  E.in_fields[0] = IDL_VarGetString(argv[2]);
+  E.in_fields[1] = IDL_VarGetString(argv[3]);
+  E.fragment_index = kw.fragment_index;
 
   if (kw.parent_x) {
     const char* parent = IDL_STRING_STR(&kw.parent);
-    gd_madd_multiply(D, parent, field_code, in_field1, in_field2);
+    gd_madd(D, &E, parent);
   } else
-    gd_add_multiply(D, field_code, in_field1, in_field2, kw.fragment_index);
+    gd_add(D, &E);
 
   GDIDL_SET_ERROR(D);
 
@@ -1505,49 +1607,22 @@ void gdidl_add_multiply(int argc, IDL_VPTR argv[], char *argk)
   dreturnvoid();
 }
 
-/* @@DLM: P gdidl_add_divide GD_ADD_DIVIDE 4 4 KEYWORDS */
-void gdidl_add_divide(int argc, IDL_VPTR argv[], char *argk)
+/* @@DLM: P gdidl_add_multiply GD_ADD_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;
+  gdidl_add_yoke_(GD_MULTIPLY_ENTRY, argc, argv, argk);
 
-  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);
+  dreturnvoid();
+}
 
-  GDIDL_SET_ERROR(D);
+/* @@DLM: P gdidl_add_divide GD_ADD_DIVIDE 4 4 KEYWORDS */
+void gdidl_add_divide(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
 
-  IDL_KW_FREE;
+  gdidl_add_yoke_(GD_DIVIDE_ENTRY, argc, argv, argk);
 
   dreturnvoid();
 }
@@ -1709,12 +1784,13 @@ void gdidl_add_polynom(int argc, IDL_VPTR argv[], char *argk)
   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 "
+      GDIDL_KW_ABORT("The array of coeffecients may only have a single "
           "dimension");
 
     poly_ord = argv[3]->value.arr->dim[0] - 1;
     if (poly_ord < 1)
-      idl_kw_abort("The array of coeffecients must have at least two elements");
+      GDIDL_KW_ABORT("The array of coeffecients must have at least two "
+          "elements");
     if (poly_ord > GD_MAX_POLYORD)
       poly_ord = GD_MAX_POLYORD;
 
@@ -1759,7 +1835,7 @@ void gdidl_add_polynom(int argc, IDL_VPTR argv[], char *argk)
             + _Complex_I * ((IDL_DCOMPLEX*)(argv[3]->value.arr->data))[i].i;
           break;
         default:
-          idl_kw_abort("The coeffecients must be of scalar type");
+          GDIDL_KW_ABORT("The coeffecients must be of scalar type");
       }
     }
   } else {
@@ -2231,7 +2307,7 @@ void gdidl_alter_entry(int argc, IDL_VPTR argv[], char *argk)
   } KW_RESULT;
   KW_RESULT kw;
 
-  gd_entry_t E;
+  gd_entry_t E, old_E;
 
   kw.recode = 0;
   GDIDL_KW_INIT_ERROR;
@@ -2248,7 +2324,13 @@ void gdidl_alter_entry(int argc, IDL_VPTR argv[], char *argk)
   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_entry(D, field_code, &old_E);
+  gd_free_entry_strings(&old_E);
+
+  GDIDL_SET_ERROR(D);
+
+  gdidl_read_idl_entry(&E, argv[2], 1, &old_E);
 
   gd_alter_entry(D, field_code, &E, kw.recode);
 
@@ -2358,14 +2440,14 @@ void gdidl_alter_lincom(int argc, IDL_VPTR argv[], char *argk)
     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");
+      GDIDL_KW_ABORT("IN_FIELDS must be a vector");
 
     if (kw.n_fields == 0) {
       kw.n_fields = kw.in_field->value.arr->dim[0];
       if (kw.n_fields > GD_MAX_LINCOM)
         kw.n_fields = GD_MAX_LINCOM;
     } else if (kw.in_field->value.arr->dim[0] < kw.n_fields) 
-      idl_kw_abort("Insufficient number of elements in IN_FIELDS");
+      GDIDL_KW_ABORT("Insufficient number of elements in IN_FIELDS");
 
     for (i = 0; i < kw.n_fields; ++i)
       local_in_field[i] =
@@ -2380,7 +2462,7 @@ void gdidl_alter_lincom(int argc, IDL_VPTR argv[], char *argk)
       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");
+      GDIDL_KW_ABORT("Insufficient number of elements in M");
 
     if (kw.m->type == IDL_TYP_COMPLEX || kw.m->type == IDL_TYP_DCOMPLEX) {
       comp_scal = 1;
@@ -2403,7 +2485,7 @@ void gdidl_alter_lincom(int argc, IDL_VPTR argv[], char *argk)
       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");
+      GDIDL_KW_ABORT("Insufficient number of elements in B");
 
     if (kw.b->type == IDL_TYP_COMPLEX || kw.b->type == IDL_TYP_DCOMPLEX) {
       comp_scal = 1;
@@ -2493,13 +2575,12 @@ void gdidl_alter_linterp(int argc, IDL_VPTR argv[], char *argk)
   dreturnvoid();
 }
 
-/* @@DLM: P gdidl_alter_multiply GD_ALTER_MULTIPLY 2 2 KEYWORDS */
-void gdidl_alter_multiply(int argc, IDL_VPTR argv[], char *argk)
+void gdidl_alter_yoke_(gd_type_t type, int argc, IDL_VPTR argv[], char *argk)
 {
-  dtraceidl();
+  dtrace("0x%X, %i, %p, %p", type, argc, argv, argk);
 
-  const char* in_field1 = NULL;
-  const char* in_field2 = NULL;
+  gd_entry_t E;
+  E.in_fields[0] = E.in_fields[1] = NULL;
 
   typedef struct {
     IDL_KW_RESULT_FIRST_FIELD;
@@ -2528,14 +2609,15 @@ void gdidl_alter_multiply(int argc, IDL_VPTR argv[], char *argk)
   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]);
+  E.field = IDL_VarGetString(argv[1]);
+  E.field_type = type;
 
   if (kw.in_field1_x)
-    in_field1 = IDL_STRING_STR(&kw.in_field1);
+    E.in_fields[0] = IDL_STRING_STR(&kw.in_field1);
   if (kw.in_field2_x)
-    in_field2 = IDL_STRING_STR(&kw.in_field2);
+    E.in_fields[1] = IDL_STRING_STR(&kw.in_field2);
 
-  gd_alter_multiply(D, field_code, in_field1, in_field2);
+  gd_alter_entry(D, E.field, &E, 0);
 
   GDIDL_SET_ERROR(D);
 
@@ -2544,57 +2626,25 @@ void gdidl_alter_multiply(int argc, IDL_VPTR argv[], char *argk)
   dreturnvoid();
 }
 
-/* @@DLM: P gdidl_alter_divide GD_ALTER_DIVIDE 2 2 KEYWORDS */
-void gdidl_alter_divide(int argc, IDL_VPTR argv[], char *argk)
+/* @@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);
+  gdidl_alter_yoke_(GD_MULTIPLY_ENTRY, argc, argv, argk);
 
-  gd_alter_divide(D, field_code, in_field1, in_field2);
+  dreturnvoid();
+}
 
-  GDIDL_SET_ERROR(D);
+/* @@DLM: P gdidl_alter_divide GD_ALTER_DIVIDE 2 2 KEYWORDS */
+void gdidl_alter_divide(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
 
-  IDL_KW_FREE;
+  gdidl_alter_yoke_(GD_DIVIDE_ENTRY, argc, argv, argk);
 
   dreturnvoid();
 }
-
 /* @@DLM: P gdidl_alter_recip GD_ALTER_RECIP 2 2 KEYWORDS */
 void gdidl_alter_recip(int argc, IDL_VPTR argv[], char *argk)
 {
@@ -2750,7 +2800,7 @@ void gdidl_alter_polynom(int argc, IDL_VPTR argv[], char *argk)
       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");
+      GDIDL_KW_ABORT("Insufficient number of elements in A");
 
     if (kw.a->type == IDL_TYP_COMPLEX || kw.a->type == IDL_TYP_DCOMPLEX) {
       comp_scal = 1;
@@ -2995,23 +3045,23 @@ void gdidl_delete(int argc, IDL_VPTR argv[], char *argk)
   typedef struct {
     IDL_KW_RESULT_FIRST_FIELD;
     GDIDL_KW_RESULT_ERROR;
-    int alias;
     int data;
     int deref;
     int force;
+    int meta;
   } KW_RESULT;
   KW_RESULT kw;
 
-  kw.alias = kw.data = kw.deref = kw.force = 0;
+  kw.data = kw.deref = kw.force = kw.meta = 0;
   GDIDL_KW_INIT_ERROR;
 
   static IDL_KW_PAR kw_pars[] = {
-    { "ALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(alias) },
     { "DEL_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(data) },
     { "DEREF", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(deref) },
     GDIDL_KW_PAR_ERROR,
     GDIDL_KW_PAR_ESTRING,
     { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) },
+    { "META", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(meta) },
     { NULL }
   };
 
@@ -3020,12 +3070,9 @@ void gdidl_delete(int argc, IDL_VPTR argv[], char *argk)
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
   const char* field_code = IDL_VarGetString(argv[1]);
 
-  if (kw.alias)
-    gd_delete_alias(D, field_code, (kw.deref ? GD_DEL_DEREF : 0) | 
-        (kw.force) ? GD_DEL_FORCE : 0);
-  else
-    gd_delete(D, field_code, (kw.data ? GD_DEL_DATA : 0) |
-        (kw.deref ? GD_DEL_DEREF : 0) | (kw.force) ? GD_DEL_FORCE : 0);
+  gd_delete(D, field_code, (kw.data ? GD_DEL_DATA : 0) |
+      (kw.deref ? GD_DEL_DEREF : 0) | (kw.force ? GD_DEL_FORCE : 0) |
+      (kw.meta ? GD_DEL_META : 0));
 
   GDIDL_SET_ERROR(D);
 
@@ -3073,7 +3120,7 @@ void gdidl_flush(int argc, IDL_VPTR argv[], char *argk)
     field_code = IDL_STRING_STR(&kw.field_code);
 
   if (kw.noclose && kw.nosync)
-    idl_kw_abort("nothing to do");
+    GDIDL_KW_ABORT("nothing to do");
   else if (kw.noclose)
     gd_sync(D, field_code);
   else if (kw.nosync)
@@ -3269,19 +3316,20 @@ void gdidl_move(int argc, IDL_VPTR argv[], char *argk)
   typedef struct {
     IDL_KW_RESULT_FIRST_FIELD;
     GDIDL_KW_RESULT_ERROR;
-    int move_data;
-    int alias;
+    int dangle, force, move_data, updatedb;
   } KW_RESULT;
   KW_RESULT kw;
 
-  kw.move_data = kw.alias = 0;
+  kw.dangle = kw.force = kw.move_data = kw.updatedb = 0;
   GDIDL_KW_INIT_ERROR;
 
   static IDL_KW_PAR kw_pars[] = {
-    { "ALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(alias) },
+    { "DANGLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(dangle) },
     GDIDL_KW_PAR_ERROR,
     GDIDL_KW_PAR_ESTRING,
+    { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) },
     { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
+    { "UPDATEDB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(updatedb) },
     { NULL }
   };
 
@@ -3290,10 +3338,11 @@ void gdidl_move(int argc, IDL_VPTR argv[], char *argk)
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
   const char* field_code = IDL_VarGetString(argv[1]);
 
-  if (kw.alias)
-    gd_move_alias(D, field_code, IDL_LongScalar(argv[2]));
-  else
-    gd_move(D, field_code, IDL_LongScalar(argv[2]), kw.move_data);
+  gd_move(D, field_code, IDL_LongScalar(argv[2]),
+      (kw.dangle ? GD_REN_DANGLE : 0) |
+      (kw.force ? GD_REN_FORCE : 0) |
+      (kw.move_data ? GD_REN_DATA : 0) |
+      (kw.updatedb ? GD_REN_UPDB : 0));
 
   GDIDL_SET_ERROR(D);
 
@@ -3437,23 +3486,33 @@ void gdidl_alter_protection(int argc, IDL_VPTR argv[], char *argk)
   dreturnvoid();
 }
 
-/* @@DLM: P gdidl_reference GD_REFERENCE 2 2 KEYWORDS */
-void gdidl_reference(int argc, IDL_VPTR argv[], char *argk)
+/* @@DLM: F gdidl_reference GD_REFERENCE 1 2 KEYWORDS */
+IDL_VPTR gdidl_reference(int argc, IDL_VPTR argv[], char *argk)
 {
   dtraceidl();
 
+  const char *field_code = NULL;
+  IDL_VPTR r;
+
   GDIDL_KW_ONLY_ERROR;
 
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
-  const char* field_code = IDL_VarGetString(argv[1]);
+  if (argc > 1)
+    field_code = IDL_VarGetString(argv[1]);
 
-  gd_reference(D, field_code);
+  field_code = gd_reference(D, field_code);
 
   GDIDL_SET_ERROR(D);
 
   IDL_KW_FREE;
 
-  dreturnvoid();
+  if (field_code)
+    r = IDL_StrToSTRING((char*)field_code);
+  else
+    r = IDL_StrToSTRING("");
+
+  dreturn("%p", r);
+  return r;
 }
 
 /* @@DLM: P gdidl_rename GD_RENAME 3 3 KEYWORDS */
@@ -3464,17 +3523,18 @@ void gdidl_rename(int argc, IDL_VPTR argv[], char *argk)
   typedef struct {
     IDL_KW_RESULT_FIRST_FIELD;
     GDIDL_KW_RESULT_ERROR;
-    int updatedb;
-    int move_data;
+    int dangle, force, move_data, updatedb;
   } KW_RESULT;
   KW_RESULT kw;
 
-  kw.move_data = kw.updatedb = 0;
+  kw.dangle = kw.force = kw.move_data = kw.updatedb = 0;
   GDIDL_KW_INIT_ERROR;
 
   static IDL_KW_PAR kw_pars[] = {
+    { "DANGLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(dangle) },
     GDIDL_KW_PAR_ERROR,
     GDIDL_KW_PAR_ESTRING,
+    { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) },
     { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
     { "UPDATEDB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(updatedb) },
     { NULL }
@@ -3486,7 +3546,10 @@ void gdidl_rename(int argc, IDL_VPTR argv[], char *argk)
   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 ? GD_REN_DATA : 0) |
+  gd_rename(D, field_code, new_code,
+      (kw.dangle ? GD_REN_DANGLE : 0) |
+      (kw.force ? GD_REN_FORCE : 0) |
+      (kw.move_data ? GD_REN_DATA : 0) |
       (kw.updatedb ? GD_REN_UPDB : 0));
 
   GDIDL_SET_ERROR(D);
@@ -3569,6 +3632,7 @@ IDL_VPTR gdidl_getdata(int argc, IDL_VPTR argv[], char *argk)
   } KW_RESULT;
   KW_RESULT kw;
 
+  size_t n;
   IDL_VPTR r;
 
   kw.first_frame = kw.first_sample = kw.n_frames = kw.n_samples = 0;
@@ -3591,34 +3655,37 @@ IDL_VPTR gdidl_getdata(int argc, IDL_VPTR argv[], char *argk)
 
   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]);
 
-  if (kw.first_frame_x == 0 && kw.first_sample_x == 0) {
-    kw.first_frame = GD_HERE;
-    kw.first_sample = 0;
-  }
-
-  unsigned int spf = gd_spf(D, field_code);
+  /* check for metadata */
+  unsigned int spf = 1;
+  if (!gd_error(D) && kw.n_frames > 0)
+    spf = gd_spf(D, field_code);
 
-  if (gd_error(D) || (kw.n_frames == 0 && kw.n_samples == 0))
+  if (gd_error(D) || (kw.n_frames == 0 && kw.n_samples == 0)) {
     r = IDL_GettmpInt(0);
-  else {
-    void* data = malloc((kw.n_frames * spf + kw.n_samples) *
-        GD_SIZE(kw.return_type));
+  } else {
+    if (kw.first_frame_x == 0 && kw.first_sample_x == 0) {
+      kw.first_frame = GD_HERE;
+      kw.first_sample = 0;
+    }
+    kw.n_samples += kw.n_frames * spf;
+
+    /* no signed 8-bit type in IDL */
+    if (kw.return_type == GD_INT8)
+      GDIDL_KW_ABORT("Cannot return data as a signed 8-bit integer.");
+
+    void* data = malloc(kw.n_samples * GD_SIZE(kw.return_type));
 
-    gd_getdata64(D, field_code, kw.first_frame, kw.first_sample, kw.n_frames,
+    n = gd_getdata64(D, field_code, kw.first_frame, kw.first_sample, 0,
         kw.n_samples, kw.return_type, data);
 
-    if (gd_error(D)) {
+    if (n == 0) {
       free(data);
       r = IDL_GettmpInt(0);
     } else {
-      IDL_MEMINT dim[] = { kw.n_frames * spf + kw.n_samples };
+      IDL_MEMINT dim[] = { n };
       r = IDL_ImportArray(1, dim, gdidl_idl_type(kw.return_type), data,
           (IDL_ARRAY_FREE_CB)free, NULL);
     }
@@ -3642,7 +3709,7 @@ IDL_VPTR gdidl_get_bof(int argc, IDL_VPTR argv[], char *argk)
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
   const char *field_code = IDL_VarGetString(argv[1]);
 
-  off64_t bof = gd_bof64(D, field_code);
+  gd_off64_t bof = gd_bof64(D, field_code);
 
   GDIDL_SET_ERROR(D);
 
@@ -3737,7 +3804,7 @@ IDL_VPTR gdidl_get_carray(int argc, IDL_VPTR argv[], char *argk)
   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);
+    kw.n = gd_array_len(D, field_code);
     if (kw.n > kw.start)
       kw.n -= kw.start;
     else
@@ -3801,7 +3868,7 @@ IDL_VPTR gdidl_get_constants(int argc, IDL_VPTR argv[], char *argk)
 
   /* 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.");
+    GDIDL_KW_ABORT("Cannot return data as a signed 8-bit integer.");
 
   if (kw.parent_x) {
     const char* parent = IDL_STRING_STR(&kw.parent);
@@ -4002,7 +4069,7 @@ IDL_VPTR gdidl_get_eof(int argc, IDL_VPTR argv[], char *argk)
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
   const char *field_code = IDL_VarGetString(argv[1]);
 
-  off64_t eof = gd_eof64(D, field_code);
+  gd_off64_t eof = gd_eof64(D, field_code);
 
   GDIDL_SET_ERROR(D);
 
@@ -4207,7 +4274,7 @@ IDL_VPTR gdidl_get_frameoffset(int argc, IDL_VPTR argv[], char *argk)
 
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
 
-  off64_t foffs = gd_frameoffset64(D, kw.fragment_index);
+  gd_off64_t foffs = gd_frameoffset64(D, kw.fragment_index);
 
   GDIDL_SET_ERROR(D);
 
@@ -4343,7 +4410,7 @@ IDL_VPTR gdidl_get_nframes(int argc, IDL_VPTR argv[], char *argk)
 
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
 
-  off64_t nframes = gd_nframes64(D);
+  gd_off64_t nframes = gd_nframes64(D);
 
   GDIDL_SET_ERROR(D);
 
@@ -4517,8 +4584,10 @@ IDL_VPTR gdidl_get_spf(int argc, IDL_VPTR argv[], char *argk)
   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)
+/* GD_CARRAY_LEN is a deprecated alias */
+/* @@DLM: F gdidl_array_len GD_CARRAY_LEN 2 2 KEYWORDS */
+/* @@DLM: F gdidl_array_len GD_ARRAY_LEN 2 2 KEYWORDS */
+IDL_VPTR gdidl_array_len(int argc, IDL_VPTR argv[], char *argk)
 {
   dtraceidl();
 
@@ -4527,7 +4596,7 @@ IDL_VPTR gdidl_carray_len(int argc, IDL_VPTR argv[], char *argk)
   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);
+  size_t len = gd_array_len(D, field_code);
 
   GDIDL_SET_ERROR(D);
 
@@ -4717,9 +4786,9 @@ void gdidl_putdata(int argc, IDL_VPTR argv[], char *argk)
 
   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");
+    GDIDL_KW_ABORT("data must be a vector, not a multidimensional array");
 
-  off64_t n_samples = argv[2]->value.arr->n_elts;
+  gd_off64_t n_samples = argv[2]->value.arr->n_elts;
 
   gd_putdata64(D, field_code, kw.first_frame, kw.first_sample, 0, n_samples,
       gdidl_gd_type(argv[2]->type), argv[2]->value.arr->data);
@@ -4780,7 +4849,7 @@ void gdidl_put_carray(int argc, IDL_VPTR argv[], char *argk)
 
   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");
+    GDIDL_KW_ABORT("data must be a vector, not a multidimensional array");
 
   int length = argv[2]->value.arr->n_elts;
 
@@ -4879,8 +4948,8 @@ IDL_VPTR gdidl_seek(int argc, IDL_VPTR argv[], char *argk)
   typedef struct {
     IDL_KW_RESULT_FIRST_FIELD;
     GDIDL_KW_RESULT_ERROR;
-    off64_t frame_num;
-    off64_t sample_num;
+    gd_off64_t frame_num;
+    gd_off64_t sample_num;
     int whence;
     int write;
   } KW_RESULT;
@@ -4906,7 +4975,7 @@ IDL_VPTR gdidl_seek(int argc, IDL_VPTR argv[], char *argk)
   DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
   const char* field_code = IDL_VarGetString(argv[1]);
 
-  off64_t pos = gd_seek64(D, field_code, kw.frame_num, kw.sample_num,
+  gd_off64_t pos = gd_seek64(D, field_code, kw.frame_num, kw.sample_num,
       (kw.whence & (GD_SEEK_SET | GD_SEEK_CUR | GD_SEEK_END)) |
       (kw.write ? GD_SEEK_WRITE : 0));
 
@@ -4931,7 +5000,7 @@ IDL_VPTR gdidl_tell(int argc, IDL_VPTR argv[], char *argk)
   DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
   const char* field_code = IDL_VarGetString(argv[1]);
 
-  off64_t pos = gd_tell64(D, field_code);
+  gd_off64_t pos = gd_tell64(D, field_code);
 
   GDIDL_SET_ERROR(D);
 
@@ -5084,9 +5153,9 @@ void gdidl_add_window(int argc, IDL_VPTR argv[], char *argk)
   }
 
   if (nop > 1)
-    idl_kw_abort("Multiple operations specified");
+    GDIDL_KW_ABORT("Multiple operations specified");
   else if (nop == 0)
-    idl_kw_abort("No operation specified");
+    GDIDL_KW_ABORT("No operation specified");
 
   switch (windop) {
     case GD_WINDOP_EQ:
@@ -5255,7 +5324,7 @@ void gdidl_alter_window(int argc, IDL_VPTR argv[], char *argk)
   }
 
   if (nop > 1)
-    idl_kw_abort("Multiple operations specified");
+    GDIDL_KW_ABORT("Multiple operations specified");
 
   /* Need the current windop and/or threshold */
   if (nop == 0 || !kw.threshold_x) {
@@ -5377,7 +5446,7 @@ IDL_VPTR gdidl_naliases(int argc, IDL_VPTR argv[], char *argk)
 {
   dtraceidl();
 
-  int nalias;
+  unsigned int nalias;
 
   GDIDL_KW_ONLY_ERROR;
 
@@ -5390,7 +5459,7 @@ IDL_VPTR gdidl_naliases(int argc, IDL_VPTR argv[], char *argk)
 
   IDL_KW_FREE;
 
-  IDL_VPTR r = IDL_GettmpLong(nalias);
+  IDL_VPTR r = IDL_GettmpUInt(nalias);
   dreturn("%p", r);
   return r;
 }
@@ -5835,6 +5904,15 @@ IDL_VPTR gdidl_get_linterp_tablename(int argc, IDL_VPTR argv[], char *argk)
   return r;
 }
 
+/* @@DLM: F gdidl_encoding_support GD_ENCODING_SUPPORT 1 1 */
+IDL_VPTR gdidl_encoding_support(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  IDL_VPTR r = IDL_GettmpInt(gd_encoding_support(IDL_LongScalar(argv[0])));
+  dreturn("%p", r);
+  return r;
+}
 
 /**** Module initialisation ****/
 
@@ -5855,6 +5933,7 @@ static IDL_MEMINT polynom_dims[] = { 1, GD_MAX_POLYORD + 1 };
 static IDL_STRUCT_TAG_DEF gdidl_entry[] = {
   { "FIELD",      0, (void*)IDL_TYP_STRING },
   { "FIELD_TYPE", 0, (void*)IDL_TYP_INT },
+  { "FLAGS",      0, (void*)IDL_TYP_UINT },
   { "FRAGMENT",   0, (void*)IDL_TYP_INT },
 
   { "IN_FIELDS",  lincom_dims, (void*)IDL_TYP_STRING },
@@ -5864,7 +5943,6 @@ static IDL_STRUCT_TAG_DEF gdidl_entry[] = {
   { "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 */
   { "COUNT_VAL",  0, (void*)IDL_TYP_INT }, /* MPLEX */
   { "DATA_TYPE",  0, (void*)IDL_TYP_INT }, /* RAW / CONST / CARRAY */
   { "DIVIDEND",   0, (void*)IDL_TYP_DOUBLE }, /* RECIP */
diff --git a/bindings/idl/makedlm.sh.in b/bindings/idl/makedlm.sh.in
index 3e75fc1..1738b86 100644
--- a/bindings/idl/makedlm.sh.in
+++ b/bindings/idl/makedlm.sh.in
@@ -45,7 +45,7 @@ MODULE GETDATA
 DESCRIPTION IDL GetData bindings
 VERSION @VERSION@
 BUILD_DATE $BUILD_DATE
-SOURCE The GetData Project <@PACKAGE_BUGREPORT@>
+SOURCE The GetData Project <@PACKAGE_URL@>
 
 STRUCTURE GD_ENTRY
 EOF
diff --git a/bindings/idl/test/Makefile.am b/bindings/idl/test/Makefile.am
index 7592109..9ed802c 100644
--- a/bindings/idl/test/Makefile.am
+++ b/bindings/idl/test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2010, 2015 D. V. Wiebe
+# Copyright (C) 2009, 2010, 2014, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/bindings/idl/test/Makefile.in b/bindings/idl/test/Makefile.in
index 789bf80..db6f7b6 100644
--- a/bindings/idl/test/Makefile.in
+++ b/bindings/idl/test/Makefile.in
@@ -83,10 +83,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -165,6 +163,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -190,8 +190,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -239,7 +250,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -254,12 +264,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -323,9 +337,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -333,6 +348,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -346,7 +362,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2009-2010, 2015 D. V. Wiebe
+# Copyright (C) 2009, 2010, 2014, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/bindings/idl/test/big_test.pro b/bindings/idl/test/big_test.pro
index 2937e29..c60880e 100644
--- a/bindings/idl/test/big_test.pro
+++ b/bindings/idl/test/big_test.pro
@@ -1,6 +1,6 @@
 ; vim: ft=idlang
 ;
-; Copyright (C) 2009-2012 D. V. Wiebe
+; Copyright (C) 2009-2015 D. V. Wiebe
 ;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;
@@ -43,9 +43,9 @@ file_mkdir, filedir
 
 datadata = bindgen(80) + 1
 
-fields = [ 'INDEX', 'alias', 'bit', 'carray', 'const', 'data', 'div', 'lincom',$
-  'linterp', 'mplex', 'mult', 'phase', 'polynom', 'recip', 'sbit', 'string',$
-  'window' ]
+fields = [ 'INDEX', 'alias', 'bit', 'carray', 'const', 'data', 'div', $
+  'lincom', 'linterp', 'mplex', 'mult', 'phase', 'polynom', 'recip', 'sbit', $
+  'string', 'window' ]
 
 ; Write the test dirfile
 openw,1,format
@@ -79,865 +79,867 @@ openw,1,data
 writeu,1,byte(datadata)
 close,1
 
-;  140: getdata_constants check
+;  0: getdata_constants check
 defsysv, "!GD", getdata_constants()
-nume += check_simple(140, !GD.E_OPEN, 1)
+nume += check_simple(0, !GD.E_OK, 0)
 
-;  0: gd_error check
+;  1: 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)
+nume += check_error(1, d, !GD.E_IO)
+nume += check_simple(1, error, !GD.E_IO)
 gd_close, d, /DISCARD
 
-;  1: gd_open check
+;  2: gd_open check
 d = gd_open(filedir, /RDWR)
-nume += check_ok(1, d)
-nume += check_simple(1, d, 1)
+nume += check_ok(2, d)
+nume += check_simple(2, d, 1)
 
-;  2: gd_getdata check
+;  3: 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)
+nume += check_ok(3, d)
+nume += check_simple(3, n, INDGEN(8) + 41)
 
-;  3: gd_get_constant check
+;  12: 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)
+nume += check_ok(12, d)
+nume += check_simple(12, n, 5.5)
 
-;  6: gd_nfields check
+;  23: gd_nfields check
 n = gd_nfields(d)
-nume += check_ok(6, d)
-nume += check_simple(6, n, nfields)
+nume += check_ok(23, d)
+nume += check_simple(23, n, nfields)
 
-;  8: gd_field_list check
+;  25: gd_field_list check
 n = gd_field_list(d)
-nume += check_ok(8, d)
-nume += check_simple(8, n, fields)
+nume += check_ok(25, d)
+nume += check_simple(25, n, fields)
 
-;  9: gd_nmfields_check
+;  26: gd_nmfields_check
 n = gd_nfields(d, parent="data")
-nume += check_ok(9, d)
-nume += check_simple(9, n, 3)
+nume += check_ok(26, d)
+nume += check_simple(26, n, 3)
 
-;  10: gd_mfield_list check
+;  27: gd_mfield_list check
 n = gd_field_list(d, parent="data")
-nume += check_ok(10, d)
-nume += check_simple(10, n, [ "mstr", "mconst", "mlut" ])
+nume += check_ok(27, d)
+nume += check_simple(27, n, [ "mstr", "mconst", "mlut" ])
 
-;  11: gd_nframes check
+;  28: gd_nframes check
 n = gd_nframes(d)
-nume += check_ok(11, d)
-nume += check_simple(11, n, 10)
+nume += check_ok(28, d)
+nume += check_simple(28, n, 10)
 
-;  12: gd_spf check
+;  29: gd_spf check
 n = gd_spf(d, "data")
-nume += check_ok(12, d)
-nume += check_simple(12, n, 8)
+nume += check_ok(29, d)
+nume += check_simple(29, n, 8)
 
-;  13: gd_putdata check
+;  30: gd_putdata check
 gd_putdata, d, "data", [13, 14, 15, 16], first_frame=5, first_sample=1
-nume += check_ok2(13, 1, d)
+nume += check_ok2(30, 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])
+nume += check_ok2(30, 2, d)
+nume += check_simple(30, n, [ 41, 13, 14, 15, 16, 46, 47, 48])
 
-;  122: gd_putdata (float) check
+;  35: gd_putdata (float) check
 gd_putdata, d, "data", [23., 24., 25., 26.], first_frame=5, first_sample=1
-nume += check_ok2(122, 1, d)
+nume += check_ok2(35, 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])
+nume += check_ok2(35, 2, d)
+nume += check_simple(35, n, [ 41, 23, 24, 25, 26, 46, 47, 48])
 
-;  124: gd_putdata (complex) check
+;  37: gd_putdata (complex) check
 gd_putdata, d, "data", [COMPLEX(33,0), COMPLEX(34,0), COMPLEX(35,0), $
   COMPLEX(36,0)], first_frame=5, first_sample=1
-nume += check_ok2(124, 1, d)
+nume += check_ok2(37, 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])
+nume += check_ok2(37, 2, d)
+nume += check_simple(37, n, [ 41, 33, 34, 35, 36, 46, 47, 48])
 
-;  14: gd_error_string check
+;  38: 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")
+nume += check_error(38, d, !GD.E_BAD_CODE)
+nume += check_simple2(38, 1, gd_error_string(d), "Field not found: x")
+nume += check_simple2(38, 2, estring, "Field not found: x")
 
-;  15: gd_entry_type check
+;  39: gd_entry_type check
 n = gd_entry_type(d, "data")
-nume += check_ok(15, d)
-nume += check_simple(15, n, !GD.RAW_ENTRY)
+nume += check_ok(39, d)
+nume += check_simple(39, n, !GD.RAW_ENTRY)
 
-;  16: gd_entry (raw)
+;  40: 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)
+nume += check_ok(40, d)
+nume += check_simple2(40, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(40, 2, n.field, "data")
+nume += check_simple2(40, 3, n.fragment, 0)
+nume += check_simple2(40, 4, n.data_type, !GD.INT8)
+nume += check_simple2(40, 5, n.spf, 8)
+
+;  42: gd_entry (lincom)
 n = gd_entry(d, "lincom")
-nume += check_ok(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), $
+nume += check_ok(42, d)
+nume += check_simple2(42, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(42, 2, n.field, "lincom")
+nume += check_simple2(42, 3, n.fragment, 0)
+nume += check_simple2(42, 4, n.n_fields, 3)
+nume += check_simple2(42, 5, n.in_fields, [ "data", "INDEX", "linterp" ])
+nume += check_simple2(42, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(42, 7, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $
   DCOMPLEX(5.5D,0) ])
-nume += check_simple2(18, 8, n.cb, [ DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), $
+nume += check_simple2(42, 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" ])
+nume += check_simple2(42, 9, n.scalar, [ "", "", "const", "", "", "const" ])
 
-;  20: gd_entry (polynom)
+;  44: 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), $
+nume += check_ok(44, d)
+nume += check_simple2(44, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(44, 2, n.field, "polynom")
+nume += check_simple2(44, 3, n.fragment, 0)
+nume += check_simple2(44, 4, n.poly_ord, 5)
+nume += check_simple2(44, 5, n.in_fields, [ "data" ])
+nume += check_simple2(44, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(44, 7, n.ca, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $
   DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), DCOMPLEX(5.5D,0), DCOMPLEX(5.5D,0) ])
-nume += check_simple2(20, 8, n.scalar, [ "", "", "", "", "const", "const" ])
+nume += check_simple2(44, 8, n.scalar, [ "", "", "", "", "const", "const" ])
 
-;  21: gd_entry (linterp)
+;  45: 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, "./lut")
-
-;  22: gd_entry (bit)
+nume += check_ok(45, d)
+nume += check_simple2(45, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(45, 2, n.field, "linterp")
+nume += check_simple2(45, 3, n.fragment, 0)
+nume += check_simple2(45, 4, n.in_fields, [ "data" ])
+nume += check_simple2(45, 5, n.table, "./lut")
+
+;  46: gd_entry (bit)
 n = gd_entry(d, "bit")
-nume += check_ok(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)
+nume += check_ok(46, d)
+nume += check_simple2(46, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(46, 2, n.field, "bit")
+nume += check_simple2(46, 3, n.fragment, 0)
+nume += check_simple2(46, 4, n.in_fields, [ "data" ])
+nume += check_simple2(46, 5, n.numbits, 4)
+nume += check_simple2(46, 6, n.bitnum, 3)
+
+;  47: gd_entry (sbit)
 n = gd_entry(d, "sbit")
-nume += check_ok(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)
+nume += check_ok(47, d)
+nume += check_simple2(47, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(47, 2, n.field, "sbit")
+nume += check_simple2(47, 3, n.fragment, 0)
+nume += check_simple2(47, 4, n.in_fields, [ "data" ])
+nume += check_simple2(47, 5, n.numbits, 6)
+nume += check_simple2(47, 6, n.bitnum, 5)
+
+;  48: gd_entry (multiply)
 n = gd_entry(d, "mult")
-nume += check_ok(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" ])
+nume += check_ok(48, d)
+nume += check_simple2(48, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(48, 2, n.field, "mult")
+nume += check_simple2(48, 3, n.fragment, 0)
+nume += check_simple2(48, 4, n.in_fields, [ "data", "sbit" ])
 
-;  25: gd_entry (phase)
+;  49: 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)
+nume += check_ok(49, d)
+nume += check_simple2(49, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(49, 2, n.field, "phase")
+nume += check_simple2(49, 3, n.fragment, 0)
+nume += check_simple2(49, 4, n.in_fields, [ "data" ])
+nume += check_simple2(49, 5, n.shift, 11)
+
+;  50: gd_entry (const)
 n = gd_entry(d, "const")
-nume += check_ok(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)
+nume += check_ok(50, d)
+nume += check_simple2(50, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(50, 2, n.field, "const")
+nume += check_simple2(50, 3, n.fragment, 0)
+nume += check_simple2(50, 4, n.data_type, !GD.FLOAT64)
 
-;  134: gd_entry (string)
+;  51: 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)
+nume += check_ok(51, d)
+nume += check_simple2(51, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(51, 2, n.field, "string")
+nume += check_simple2(51, 3, n.fragment, 0)
 
-;  27: gd_fragment_index check
+;  52: gd_fragment_index check
 n = gd_fragment_index(d, "data")
-nume += check_ok(27, d)
-nume += check_simple(27, n, 0)
+nume += check_ok(52, d)
+nume += check_simple(52, n, 0)
 
-;  28: gd_add_raw check
+;  53: gd_add_raw check
 gd_add_raw, d, "new1", !GD.FLOAT64, spf=3
-nume += check_ok2(28, 1, d)
+nume += check_ok2(53, 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
+nume += check_ok2(53, 2, d)
+nume += check_simple2(53, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(53, 2, n.field, "new1")
+nume += check_simple2(53, 3, n.fragment, 0)
+nume += check_simple2(53, 4, n.data_type, !GD.FLOAT64)
+nume += check_simple2(53, 5, n.spf, 3)
+
+;  55: gd_add_lincom
 gd_add_lincom, d, "new2", "in1", COMPLEX(1.1, 1.2), COMPLEX(1.3, 1.4), $
   "in2", COMPLEX(1.4, 1.5), COMPLEX(1.6, 1.7)
-nume += check_ok2(30, 1, d)
+nume += check_ok2(55, 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
+nume += check_ok2(55, 2, d)
+nume += check_simple2(55, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(55, 2, n.field, "new2")
+nume += check_simple2(55, 3, n.fragment, 0)
+nume += check_simple2(55, 4, n.n_fields, 2)
+nume += check_simple2(55, 5, n.in_fields, [ "in1", "in2" ])
+nume += check_simple2(55, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(55, 7, n.cm, [ DCOMPLEX(1.1,1.2), DCOMPLEX(1.4,1.5) ])
+nume += check_simple2(55, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ])
+
+;  57: gd_add_polynom
 gd_add_polynom, d, "new4", "in1", DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $
   DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4)
-nume += check_ok2(32, 1, d)
+nume += check_ok2(57, 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), $
+nume += check_ok2(57, 2, d)
+nume += check_simple2(57, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(57, 2, n.field, "new4")
+nume += check_simple2(57, 3, n.fragment, 0)
+nume += check_simple2(57, 4, n.poly_ord, 3)
+nume += check_simple2(57, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(57, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(57, 7, n.ca, [ DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $
   DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4) ])
 
-;  33: gd_add_linterp
+;  58: gd_add_linterp
 gd_add_linterp, d, "new6", "in", "./some/table"
-nume += check_ok2(33, 1, d)
+nume += check_ok2(58, 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
+nume += check_ok2(58, 2, d)
+nume += check_simple2(58, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(58, 2, n.field, "new6")
+nume += check_simple2(58, 3, n.fragment, 0)
+nume += check_simple2(58, 4, n.in_fields, [ "in" ])
+nume += check_simple2(58, 5, n.table, "./some/table")
+
+;  59: gd_add_bit
 gd_add_bit, d, "new7", "in1", bitnum=11, numbits=22
-nume += check_ok2(34, 1, d)
+nume += check_ok2(59, 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
+nume += check_ok2(59, 2, d)
+nume += check_simple2(59, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(59, 2, n.field, "new7")
+nume += check_simple2(59, 3, n.fragment, 0)
+nume += check_simple2(59, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(59, 5, n.numbits, 22)
+nume += check_simple2(59, 6, n.bitnum, 11)
+
+;  60: gd_add_sbit
 gd_add_sbit, d, "new8", "in2", bitnum=5, numbits=10
-nume += check_ok2(35, 1, d)
+nume += check_ok2(60, 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
+nume += check_ok2(60, 2, d)
+nume += check_simple2(60, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(60, 2, n.field, "new8")
+nume += check_simple2(60, 3, n.fragment, 0)
+nume += check_simple2(60, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(60, 5, n.numbits, 10)
+nume += check_simple2(60, 6, n.bitnum, 5)
+
+;  61: gd_add_multiply
 gd_add_multiply, d, "new9", "in2", "in3"
-nume += check_ok2(36, 1, d)
+nume += check_ok2(61, 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" ])
+nume += check_ok(61, d)
+nume += check_simple2(61, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(61, 2, n.field, "new9")
+nume += check_simple2(61, 3, n.fragment, 0)
+nume += check_simple2(61, 4, n.in_fields, [ "in2", "in3" ])
 
-;  37: gd_add_phase
+;  62: gd_add_phase
 gd_add_phase, d, "new10", "in6", 42
-nume += check_ok2(37, 1, d)
+nume += check_ok2(62, 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)
+nume += check_ok2(62, 2, d)
+nume += check_simple2(62, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(62, 2, n.field, "new10")
+nume += check_simple2(62, 3, n.fragment, 0)
+nume += check_simple2(62, 4, n.in_fields, [ "in6" ])
+nume += check_simple2(62, 5, n.shift, 42)
 
-;  38: gd_add_const
+;  63: gd_add_const
 gd_add_const, d, "new11", type=!GD.FLOAT64, value=4.3D
-nume += check_ok2(38, 1, d)
+nume += check_ok2(63, 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)
+nume += check_ok2(63, 2, d)
+nume += check_simple2(63, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(63, 2, n.field, "new11")
+nume += check_simple2(63, 3, n.fragment, 0)
+nume += check_simple2(63, 4, n.data_type, !GD.FLOAT64)
 
 n = gd_get_constant(d, "new11")
-nume += check_ok2(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)
+nume += check_ok2(63, 3, d)
+nume += check_simple2(63, 5, n, 4.3D)
 
-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
+;  64: gd_fragmentname
 n = gd_fragmentname(d, 0)
-nume += check_ok(39, d)
-nume += check_eostring(39, n, "test_dirfile/format")
+nume += check_ok(64, d)
+nume += check_eostring(64, n, "test_dirfile/format")
 
-;  40: gd_nfragments
+;  65: gd_nfragments
 n = gd_nfragments(d)
-nume += check_ok(40, d)
-nume += check_simple(40, n, 1)
+nume += check_ok(65, d)
+nume += check_simple(65, n, 1)
 
-;  41: gd_include
+;  66: gd_include
 gd_include, d, "form2"
-nume += check_ok2(41, 1, d)
+nume += check_ok2(66, 1, d)
 
 n = gd_get_constant(d, "const2", type=!GD.INT16)
-nume += check_ok2(41, 2, d)
-nume += check_simple(41, n, -19)
+nume += check_ok2(66, 2, d)
+nume += check_simple(66, n, -19)
 
-;  42: gd_nfields_by_type check
+;  67: gd_nfields_by_type check
 n = gd_nfields(d,type=!GD.LINCOM_ENTRY)
-nume += check_ok(42, d)
-nume += check_simple(42, n, 2)
+nume += check_ok(67, d)
+nume += check_simple(67, n, 2)
 
-;  43: gd_field_list_by_type check
+;  68: 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"  ])
+nume += check_ok(68, d)
+nume += check_simple(68, n, [ "lincom", "new2"  ])
 
-;  44: gd_nvectors check
+;  69: gd_nvectors check
 n = gd_nvectors(d)
-nume += check_ok(44, d)
-nume += check_simple(44, n, 23)
+nume += check_ok(69, d)
+nume += check_simple(69, n, 22)
 
-;  45: gd_vector_list check
+;  70: gd_vector_list check
 n = gd_vector_list(d)
-nume += check_ok(45, d)
-nume += check_simple(45, n, [ 'INDEX', 'alias', 'bit', 'data', 'div', 'lincom',$
-  'linterp', 'mplex', 'mult', 'new1', 'new10', 'new13', 'new2', 'new4', 'new6',$
-  'new7', 'new8', 'new9', 'phase', 'polynom', 'recip', 'sbit', 'window' ])
+nume += check_ok(70, d)
+nume += check_simple(70, n, [ 'INDEX', 'alias', 'bit', 'data', 'div', $
+  'lincom', 'linterp', 'mplex', 'mult', 'new1', 'new10', 'new2', 'new4', $
+  'new6', 'new7', 'new8', 'new9', 'phase', 'polynom', 'recip', 'sbit', $
+  'window' ])
 
-;  46: gd_madd_lincom
+;  71: 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)
+nume += check_ok2(71, 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 ])
+nume += check_ok2(71, 2, d)
+nume += check_simple2(71, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(71, 2, n.field, "data/mnew2")
+nume += check_simple2(71, 3, n.fragment, 0)
+nume += check_simple2(71, 4, n.n_fields, 2)
+nume += check_simple2(71, 5, n.in_fields, [ "in1", "in2" ])
+nume += check_simple2(71, 6, n.flags, !GD.EN_CALC)
+nume += check_simple2(71, 7, n.m, [ 9.9D, 7.7D ])
+nume += check_simple2(71, 8, n.b, [ 8.8D, 6.6D ])
 
-;  48: gd_madd_polynom
+;  73: 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)
+nume += check_ok2(73, 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 ])
+nume += check_ok2(73, 2, d)
+nume += check_simple2(73, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(73, 2, n.field, "data/mnew4")
+nume += check_simple2(73, 3, n.fragment, 0)
+nume += check_simple2(73, 4, n.poly_ord, 3)
+nume += check_simple2(73, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(73, 6, n.flags, !GD.EN_CALC)
+nume += check_simple2(73, 7, n.a, [ 3.3D, 4.4D, 5.5D, 6.6D ])
 
-;  50: gd_madd_linterp
+;  75: gd_madd_linterp
 gd_add_linterp, d, "mnew6", "in", "./more/table", parent="data"
-nume += check_ok2(50, 1, d)
+nume += check_ok2(75, 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")
+nume += check_ok2(75, 2, d)
+nume += check_simple2(75, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(75, 2, n.field, "data/mnew6")
+nume += check_simple2(75, 3, n.fragment, 0)
+nume += check_simple2(75, 4, n.in_fields, [ "in" ])
+nume += check_simple2(75, 5, n.table, "./more/table")
 
-;  51: gd_madd_bit
+;  76: gd_madd_bit
 gd_add_bit, d, "mnew7", "in1", bitnum=21, numbits=12, parent="data"
-nume += check_ok2(51, 1, d)
+nume += check_ok2(76, 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)
+nume += check_ok2(76, 2, d)
+nume += check_simple2(76, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(76, 2, n.field, "data/mnew7")
+nume += check_simple2(76, 3, n.fragment, 0)
+nume += check_simple2(76, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(76, 5, n.numbits, 12)
+nume += check_simple2(76, 6, n.bitnum, 21)
 
-;  52: gd_madd_sbit
+;  77: gd_madd_sbit
 gd_add_sbit, d, "mnew8", "in3", bitnum=2, numbits=14, parent="data"
-nume += check_ok2(52, 1, d)
+nume += check_ok2(77, 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
+nume += check_ok2(77, 2, d)
+nume += check_simple2(77, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(77, 2, n.field, "data/mnew8")
+nume += check_simple2(77, 3, n.fragment, 0)
+nume += check_simple2(77, 4, n.in_fields, [ "in3" ])
+nume += check_simple2(77, 5, n.numbits, 14)
+nume += check_simple2(77, 6, n.bitnum, 2)
+
+;  78: gd_madd_multiply
 gd_add_multiply, d, "mnew9", "in4", "in1", parent="data"
-nume += check_ok2(53, 1, d)
+nume += check_ok2(78, 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" ])
+nume += check_ok2(78, 2, d)
+nume += check_simple2(78, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(78, 2, n.field, "data/mnew9")
+nume += check_simple2(78, 3, n.fragment, 0)
+nume += check_simple2(78, 4, n.in_fields, [ "in4", "in1" ])
 
-;  54: gd_madd_phase
+;  79: gd_madd_phase
 gd_add_phase, d, "mnew10", "in1", -4, parent="data"
-nume += check_ok2(54, 1, d)
+nume += check_ok2(79, 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
+nume += check_ok2(79, 2, d)
+nume += check_simple2(79, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(79, 2, n.field, "data/mnew10")
+nume += check_simple2(79, 3, n.fragment, 0)
+nume += check_simple2(79, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(79, 5, n.shift, -4)
+
+;  80: gd_madd_const
 gd_add_const, d, "mnew11", type=!GD.UINT64, parent="data"
-nume += check_ok2(55, 1, d)
+nume += check_ok2(80, 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)
+nume += check_ok2(80, 2, d)
+nume += check_simple2(80, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(80, 2, n.field, "data/mnew11")
+nume += check_simple2(80, 3, n.fragment, 0)
+nume += check_simple2(80, 4, n.data_type, !GD.UINT64)
 
-;  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
+;  81: gd_get_string
 n = gd_get_string(d, "string")
-nume += check_ok(56, d)
-nume += check_simple(56, n, "Zaphod Beeblebrox")
+nume += check_ok(81, d)
+nume += check_simple(81, n, "Zaphod Beeblebrox")
 
-;  57: gd_add_string
+;  82: gd_add_string
 gd_add_string, d, "new12", value="a string"
-nume += check_ok2(57, 1, d)
+nume += check_ok2(82, 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)
+nume += check_ok2(82, 2, d)
+nume += check_simple2(82, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(82, 2, n.field, "new12")
+nume += check_simple2(82, 3, n.fragment, 0)
 
 n = gd_get_string(d, "new12")
-nume += check_ok2(57, 3, d)
-nume += check_simple2(57, 4, n, "a string")
+nume += check_ok2(82, 3, d)
+nume += check_simple2(82, 4, n, "a string")
 
-;  58: gd_madd_string
+;  83: gd_madd_string
 gd_add_string, d, "mnew12", value="another string", parent="data"
-nume += check_ok2(58, 1, d)
+nume += check_ok2(83, 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)
+nume += check_ok2(83, 2, d)
+nume += check_simple2(83, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(83, 2, n.field, "data/mnew12")
+nume += check_simple2(83, 3, n.fragment, 0)
 
 n = gd_get_string(d, "data/mnew12")
-nume += check_ok2(58, 3, d)
-nume += check_simple2(58, 4, n, "another string")
+nume += check_ok2(83, 3, d)
+nume += check_simple2(83, 4, n, "another string")
 
-;  59: gd_add_spec
+;  84: gd_add_spec
 gd_add_spec, d, 'lorem STRING "Lorem ipsum"'
-nume += check_ok2(59, 1, d)
+nume += check_ok2(84, 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)
+nume += check_ok2(84, 2, d)
+nume += check_simple2(84, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(84, 2, n.field, "lorem")
+nume += check_simple2(84, 3, n.fragment, 0)
 
 n = gd_get_string(d, "lorem")
-nume += check_ok2(59, 3, d)
-nume += check_simple2(59, 4, n, "Lorem ipsum")
+nume += check_ok2(84, 3, d)
+nume += check_simple2(84, 4, n, "Lorem ipsum")
 
-;  60: gd_madd_string
+;  85: gd_madd_string
 gd_add_spec, d, 'ipsum STRING "dolor sit amet."', parent="lorem"
-nume += check_ok2(60, 1, d)
+nume += check_ok2(85, 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)
+nume += check_ok2(85, 2, d)
+nume += check_simple2(85, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(85, 2, n.field, "lorem/ipsum")
+nume += check_simple2(85, 3, n.fragment, 0)
 
 n = gd_get_string(d, "lorem/ipsum")
-nume += check_ok2(60, 3, d)
-nume += check_simple2(60, 4, n, "dolor sit amet.")
+nume += check_ok2(85, 3, d)
+nume += check_simple2(85, 4, n, "dolor sit amet.")
 
-;  61: gd_put_constant
-gd_put_constant, d, "const", 61
-nume += check_ok2(61, 1, d)
+;  86: gd_put_constant
+gd_put_constant, d, "const", 86
+nume += check_ok2(86, 1, d)
 
 n = gd_get_constant(d, "const", type=!GD.INT32)
-nume += check_ok2(61, 2, d)
-nume += check_simple(61, n, 61)
+nume += check_ok2(86, 2, d)
+nume += check_simple(86, n, 86)
 
-;  62: gd_put_string
+;  94: gd_put_string
 gd_put_string, d, "string", "Arthur Dent"
-nume += check_ok2(62, 1, d)
+nume += check_ok2(94, 1, d)
 
 n = gd_get_string(d, "string")
-nume += check_ok2(62, 2, d)
-nume += check_simple(62, n, "Arthur Dent")
+nume += check_ok2(94, 2, d)
+nume += check_simple(94, n, "Arthur Dent")
 
-;  63: gd_nmfields_by_type
+;  95: 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)
+nume += check_ok(95, d)
+nume += check_simple(95, n, 1)
 
-;  64: gd_mfield_list_by_type
+;  96: 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" ])
+nume += check_ok(96, d)
+nume += check_simple(96, n, [ "mnew2" ])
 
-;  65: gd_nmvectors
+;  97: gd_nmvectors
 n = gd_nvectors(d, parent="data")
-nume += check_ok(65, d)
-nume += check_simple(65, n, 9)
+nume += check_ok(97, d)
+nume += check_simple(97, n, 8)
 
-;  66: gd_mvector_list check
+;  98: 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' ])
+nume += check_ok(98, d)
+nume += check_simple(98, n, [ 'mlut', 'mnew2', 'mnew4', 'mnew6', $
+  'mnew7', 'mnew8', 'mnew9', 'mnew10' ])
 
-;  67: gd_alter_raw check
+;  99: gd_alter_raw check
 gd_alter_raw, d, "new1", type=!GD.INT32
-nume += check_ok2(67, 1, d)
+nume += check_ok2(99, 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
+nume += check_ok2(99, 2, d)
+nume += check_simple2(99, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(99, 2, n.field, "new1")
+nume += check_simple2(99, 3, n.fragment, 0)
+nume += check_simple2(99, 4, n.data_type, !GD.INT32)
+nume += check_simple2(99, 5, n.spf, 3)
+
+;  101: gd_alter_lincom
 gd_alter_lincom, d, "new2", in_fields=[ "in3", "in4" ], $
   m=[ COMPLEX(2.3, 4.5), COMPLEX(6.7, 8.9) ]
-nume += check_ok2(69, 1, d)
+nume += check_ok2(101, 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
+nume += check_ok2(101, 2, d)
+nume += check_simple2(101, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(101, 2, n.field, "new2")
+nume += check_simple2(101, 3, n.fragment, 0)
+nume += check_simple2(101, 4, n.n_fields, 2)
+nume += check_simple2(101, 5, n.in_fields, [ "in3", "in4" ])
+nume += check_simple2(101, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(101, 7, n.cm, [ DCOMPLEX(2.3,4.5), DCOMPLEX(6.7,8.9) ])
+nume += check_simple2(101, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ])
+
+;  103: gd_alter_polynom
 gd_alter_polynom, d, "new4", poly_ord=4, a=[ DCOMPLEX(1.2,3.4), $
   DCOMPLEX(5.6,7.8), DCOMPLEX(9.0,1.2), DCOMPLEX(3.4,5.6), DCOMPLEX(7.8,9.0) ]
-nume += check_ok2(71, 1, d)
+nume += check_ok2(103, 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), $
+nume += check_ok2(103, 2, d)
+nume += check_simple2(103, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(103, 2, n.field, "new4")
+nume += check_simple2(103, 3, n.fragment, 0)
+nume += check_simple2(103, 4, n.poly_ord, 4)
+nume += check_simple2(103, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(103, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(103, 7, n.ca, [ DCOMPLEX(1.2,3.4), DCOMPLEX(5.6,7.8), $
   DCOMPLEX(9.0,1.2), DCOMPLEX(3.4,5.6), DCOMPLEX(7.8,9.0) ])
 
-;  72: gd_alter_linterp
+;  104: gd_alter_linterp
 gd_alter_linterp, d, "new6", table="./other/table"
-nume += check_ok2(72, 1, d)
+nume += check_ok2(104, 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
+nume += check_ok2(104, 2, d)
+nume += check_simple2(104, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(104, 2, n.field, "new6")
+nume += check_simple2(104, 3, n.fragment, 0)
+nume += check_simple2(104, 4, n.in_fields, [ "in" ])
+nume += check_simple2(104, 5, n.table, "./other/table")
+
+;  105: gd_alter_bit
 gd_alter_bit, d, "new7", in_field="in3",  numbits=8
-nume += check_ok2(73, 1, d)
+nume += check_ok2(105, 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
+nume += check_ok2(105, 2, d)
+nume += check_simple2(105, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(105, 2, n.field, "new7")
+nume += check_simple2(105, 3, n.fragment, 0)
+nume += check_simple2(105, 4, n.in_fields, [ "in3" ])
+nume += check_simple2(105, 5, n.numbits, 8)
+nume += check_simple2(105, 6, n.bitnum, 11)
+
+;  106: gd_alter_sbit
 gd_alter_sbit, d, "new8", bitnum=15, numbits=1
-nume += check_ok2(74, 1, d)
+nume += check_ok2(106, 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
+nume += check_ok2(106, 2, d)
+nume += check_simple2(106, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(106, 2, n.field, "new8")
+nume += check_simple2(106, 3, n.fragment, 0)
+nume += check_simple2(106, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(106, 5, n.numbits, 1)
+nume += check_simple2(106, 6, n.bitnum, 15)
+
+;  107: gd_alter_multiply
 gd_alter_multiply, d, "new9", in_field1="in6"
-nume += check_ok2(75, 1, d)
+nume += check_ok2(107, 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" ])
+nume += check_ok(107, d)
+nume += check_simple2(107, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(107, 2, n.field, "new9")
+nume += check_simple2(107, 3, n.fragment, 0)
+nume += check_simple2(107, 4, n.in_fields, [ "in6", "in3" ])
 
-;  76: gd_alter_phase
-gd_alter_phase, d, "new10", shift=76
-nume += check_ok2(76, 1, d)
+;  108: gd_alter_phase
+gd_alter_phase, d, "new10", shift=108
+nume += check_ok2(108, 1, d)
 
 n = gd_entry(d, "new10")
-nume += check_ok2(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
+nume += check_ok2(108, 2, d)
+nume += check_simple2(108, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(108, 2, n.field, "new10")
+nume += check_simple2(108, 3, n.fragment, 0)
+nume += check_simple2(108, 4, n.in_fields, [ "in6" ])
+nume += check_simple2(108, 5, n.shift, 108)
+
+;  109: gd_alter_const
 gd_alter_const, d, "new11", type=!GD.FLOAT32
-nume += check_ok2(77, 1, d)
+nume += check_ok2(109, 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)
+nume += check_ok2(109, 2, d)
+nume += check_simple2(109, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(109, 2, n.field, "new11")
+nume += check_simple2(109, 3, n.fragment, 0)
+nume += check_simple2(109, 4, n.data_type, !GD.FLOAT32)
 
-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
+;  110: gd_encoding
 n = gd_encoding(d, fragment=0)
-nume += check_ok(78, d)
-nume += check_simple(78, n, !GD.UNENCODED)
+nume += check_ok(110, d)
+nume += check_simple(110, n, !GD.UNENCODED)
 
-;  79: gd_endianness
+;  111: 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))
+nume += check_ok(111, d)
+nume += check_simple(111, n, (!GD.LITTLE_ENDIAN + !GD.NOT_ARM_ENDIAN))
 
-;  80: dirfilename
+;  112: dirfilename
 n = gd_dirfilename(d)
-nume += check_ok(80, d)
-nume += check_eostring(80, n, "test_dirfile")
+nume += check_ok(112, d)
+nume += check_eostring(112, n, "test_dirfile")
 
-;  81: gd_parent_fragment
+;  113: gd_parent_fragment
 n = gd_parent_fragment(d, fragment=1)
-nume += check_ok(81, d)
-nume += check_simple(80, n, 0)
+nume += check_ok(113, d)
+nume += check_simple(113, n, 0)
 
-;  82: gd_alter_protection
+;  114: gd_alter_protection
 gd_alter_protection, d, !GD.PROTECT_DATA, fragment=1
-nume += check_ok(82, d)
+nume += check_ok(114, d)
 
-;  83: gd_protection
+;  115: gd_protection
 n = gd_protection(d, fragment=1)
-nume += check_ok(83, d)
-nume += check_simple(83, n, !GD.PROTECT_DATA)
+nume += check_ok(115, d)
+nume += check_simple(115, n, !GD.PROTECT_DATA)
 
-;  84: gd_raw_filename
+;  116: gd_raw_filename
 n = gd_raw_filename(d, 'data')
-nume += check_ok(84, d)
-nume += check_eostring(84, n, "test_dirfile/data")
+nume += check_ok(116, d)
+nume += check_eostring(116, n, "test_dirfile/data")
 
-;  85: gd_reference
-gd_reference, d, "new1"
-nume += check_ok(85, d)
+;  117: gd_reference
+n = gd_reference(d, "new1")
+nume += check_ok(117, d)
+nume += check_simple(117, n, "new1");
 
-;  87: gd_alter_encoding
+;  118: gd_eof
+n = gd_eof(d, "lincom")
+nume += check_ok(118,d)
+nume += check_simple(118,n,80)
+
+;  119: gd_alter_encoding
 gd_alter_encoding, d, !GD.SLIM_ENCODED, fragment=1
-nume += check_ok2(87, 1, d)
+nume += check_ok2(119, 1, d)
 
 n = gd_encoding(d, fragment=1)
-nume += check_ok2(87, 2, d)
-nume += check_simple(87, n, !GD.SLIM_ENCODED)
+nume += check_ok2(119, 2, d)
+nume += check_simple(119, n, !GD.SLIM_ENCODED)
 
-;  88: gd_alter_endianness
+;  120: gd_alter_endianness
 gd_alter_endianness, d, /big_endian, fragment=1
-nume += check_ok2(88, 1, d)
+nume += check_ok2(120, 1, d)
 
 n = gd_endianness(d, fragment=1)
-nume += check_ok2(88, 2, d)
-nume += check_simple(88, n, !GD.BIG_ENDIAN)
+nume += check_ok2(120, 2, d)
+nume += check_simple(120, n, !GD.BIG_ENDIAN)
 
-;  89: gd_alter_spec
+;  121: gd_alter_spec
 gd_alter_spec, d, "new10 PHASE in 3"
-nume += check_ok2(89, 1, d)
+nume += check_ok2(121, 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
+nume += check_ok2(121, 2, d)
+nume += check_simple2(121, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(121, 2, n.field, "new10")
+nume += check_simple2(121, 3, n.fragment, 0)
+nume += check_simple2(121, 4, n.in_fields, [ "in" ])
+nume += check_simple2(121, 5, n.shift, 3)
+
+;  122: gd_delete
 gd_delete, d, "new10"
-nume += check_ok2(90, 1, d)
+nume += check_ok2(122, 1, d)
 
 n = gd_entry(d, "new10")
-nume += check_error2(90, 2, d, !GD.E_BAD_CODE)
+nume += check_error2(122, 2, d, !GD.E_BAD_CODE)
 
-;  91: gd_malter_spec
+;  123: gd_malter_spec
 gd_alter_spec, d, "mnew10 PHASE in4 11", parent="data"
-nume += check_ok2(91, 1, d)
+nume += check_ok2(123, 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
+nume += check_ok2(123, 2, d)
+nume += check_simple2(123, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(123, 2, n.field, "data/mnew10")
+nume += check_simple2(123, 3, n.fragment, 0)
+nume += check_simple2(123, 4, n.in_fields, [ "in4" ])
+nume += check_simple2(123, 5, n.shift, 11)
+
+;  124: gd_move
 gd_move, d, "new9", 1
-nume += check_ok2(92, 1, d)
+nume += check_ok2(124, 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)
+nume += check_ok2(124, 2, d)
+nume += check_simple2(124, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(124, 2, n.field, "new9")
+nume += check_simple2(124, 3, n.fragment, 1)
 
-;  93: gd_rename
+;  125: gd_rename
 gd_rename, d, "new9", "newer"
-nume += check_ok2(93, 1, d)
+nume += check_ok2(125, 1, d)
 
 n = gd_entry(d, "new9")
-nume += check_error2(93, 2, d, !GD.E_BAD_CODE)
+nume += check_error2(125, 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)
+nume += check_ok2(125, 3, d)
+nume += check_simple2(125, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(125, 2, n.field, "newer")
+nume += check_simple2(125, 3, n.fragment, 1)
 
-;  94: gd_uninclude
+;  126: gd_uninclude
 gd_uninclude, d, 1
-nume += check_ok2(94, 1, d)
+nume += check_ok2(126, 1, d)
 
 n = gd_entry(d, "newer")
-nume += check_error2(94, 2, d, !GD.E_BAD_CODE)
+nume += check_error2(126, 2, d, !GD.E_BAD_CODE)
 
-;  95: gd_frameoffset
+;  127: gd_frameoffset
 n = gd_frameoffset(d,fragment=0)
-nume += check_ok(95,d)
-nume += check_simple(95,n,0)
+nume += check_ok(127,d)
+nume += check_simple(127,n,0)
 
-;  96: gd_alter_frameoffset
+;  128: gd_alter_frameoffset
 gd_alter_frameoffset, d, 33, fragment=0
-nume += check_ok2(96,1,d)
+nume += check_ok2(128,1,d)
 
 n = gd_frameoffset(d,fragment=0)
-nume += check_ok(96,d)
-nume += check_simple(96,n,33)
+nume += check_ok(128,d)
+nume += check_simple(128,n,33)
 
-;  97: gd_native_type
+;  129: gd_native_type
 n = gd_native_type(d, "data")
-nume += check_ok(97, d)
-nume += check_simple(97,n,!GD.INT8)
+nume += check_ok(129, d)
+nume += check_simple(129,n,!GD.INT8)
 
-;  99: gd_validate
+;  131: gd_validate
 n =  gd_validate(d, "new7")
-nume += check_error(99,d,!GD.E_BAD_CODE)
-nume += check_simple(99,n,-1)
+nume += check_error(131,d,!GD.E_BAD_CODE)
+nume += check_simple(131,n,-1)
 
-;  101: gd_framenum
+;  133: gd_framenum
 n = gd_framenum(d, "data", 33.3, field_start=6)
-nume += check_ok(101,d)
-nume += check_float(101, n, 37.037500D)
+nume += check_ok(133,d)
+nume += check_float(133, n, 37.037500D)
 
-;  86: gd_eof
-n = gd_eof(d, "lincom")
-nume += check_ok(86,d)
-nume += check_simple(86,n,344)
+;  135: gd_add
+n = {field: "new135", field_type: !GD.RAW_ENTRY, fragment: 0, $
+  spf: 5U, data_type: !GD.FLOAT32}
+gd_add, d, n
+nume += check_ok2(135, 1, d)
+
+n = gd_entry(d, "new135")
+nume += check_ok2(135, 2, d)
+nume += check_simple2(135, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(135, 2, n.field, "new135")
+nume += check_simple2(135, 3, n.fragment, 0)
+nume += check_simple2(135, 4, n.data_type, !GD.FLOAT32)
+nume += check_simple2(135, 5, n.spf, 5)
+
+;  136: gd_madd
+n = {field: "mnew136", field_type: !GD.PHASE_ENTRY, $
+  shift: 2L, in_fields: [ "in1" ], scalar: [ "" ], scalar_ind: [ 0 ]}
+gd_add, d, n, parent="data"
+nume += check_ok2(136, 1, d)
+
+n = gd_entry(d, "data/mnew136")
+nume += check_ok2(136, 2, d)
+nume += check_simple2(136, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(136, 2, n.field, "data/mnew136")
+nume += check_simple2(136, 3, n.fragment, 0)
+nume += check_simple2(136, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(136, 5, n.shift, 2)
+
+;  141: gd_alter
+n = {field_type: !GD.RAW_ENTRY, data_type: !GD.FLOAT64}
+gd_alter_entry, d, "new135", n
+nume += check_ok2(141, 1, d)
+
+n = gd_entry(d, "new135")
+nume += check_ok2(141, 2, d)
+nume += check_simple2(141, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(141, 2, n.field, "new135")
+nume += check_simple2(141, 3, n.fragment, 0)
+nume += check_simple2(141, 4, n.data_type, !GD.FLOAT64)
+nume += check_simple2(141, 5, n.spf, 5)
 
 ;  142: gd_bof
 n = gd_bof(d, "lincom")
@@ -959,7 +961,7 @@ 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, 5, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
 nume += check_simple2(145, 6, n.cdividend, DCOMPLEX(6.5D,4.3D))
 
 ;  146: gd_add_divide
@@ -983,7 +985,7 @@ 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, 5, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
 nume += check_simple2(148, 6, n.cdividend, DCOMPLEX(33.3, 44.4))
 
 ;  152: gd_alter_divide
@@ -1006,7 +1008,7 @@ 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, 5, n.flags, !GD.EN_CALC)
 nume += check_simple2(153, 4, n.in_fields, [ "in2" ])
 nume += check_simple2(153, 6, n.dividend, 1.01)
 
@@ -1024,7 +1026,7 @@ gd_close, m
 ;  157: gd_dirfile_standards
 n = gd_dirfile_standards(d, /CURRENT)
 nume += check_ok2(157, 1, d)
-nume += check_simple(157, n, 9)
+nume += check_simple(157, n, !GD.DIRFILE_STANDARDS_VERSION)
 n = gd_dirfile_standards(d, 0)
 nume += check_error2(157, 2, d, !GD.E_ARGUMENT)
 
@@ -1038,7 +1040,6 @@ 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
@@ -1056,10 +1057,10 @@ 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)
+;  177: gd_array_len
+n = gd_array_len(d, "carray")
+nume += check_ok(177, d)
+nume += check_simple(177, n, 6)
 
 ;  178: gd_entry (CARRAY)
 n = gd_entry(d, "carray")
@@ -1259,22 +1260,6 @@ nume += check_simple(222, n, [ 'data', 'alias', 'data/mnew20', 'new20' ])
 gd_include, d, 'format1', prefix='A', suffix='Z', /CREAT, /EXCL
 nume += check_ok(223, d)
 
-; 224: GDMOVA check
-gd_move, d, 'new20', 1, /ALIAS
-nume += check_ok2(224, 1, d)
-
-n = gd_fragment_index(d, 'Anew20Z')
-nume += check_ok2(224, 2, d)
-nume += check_simple(224, n, 1)
-
-; 225: gd_delete_alias check
-gd_delete, d, 'Anew20Z', /ALIAS
-nume += check_ok2(225, 1, d)
-
-n = gd_fragment_index(d, 'Anew20Z')
-nume += check_error2(225, 2, d, !GD.E_BAD_CODE)
-nume += check_simple(225, n, -1)
-
 ; 226: gd_fragment_affixes check
 n = gd_fragment_affixes(d, fragment=1)
 nume += check_ok(226, d)
@@ -1372,8 +1357,8 @@ nume += check_simple2(237, 2, n, 24)
 ; 239: gd_entry_list check
 n = gd_entry_list(d, /VECTORS, /HIDDEN, /NOALIAS)
 nume += check_ok(239, d)
-nume += check_simple(239, n, ["INDEX", "bit", "data", "div", "lincom", $
-  "linterp", "mplex", "mult", "new1", "new13", "new14", "new16", "new18", $
+nume += check_simple(239, n, ["INDEX", "bit", "data", "div", "lincom",$
+  "linterp", "mplex", "mult", "new1", "new135", "new14", "new16", "new18", $
   "new2", "new21", "new4", "new6", "new7", "new8", "phase", "polynom", $
   "recip", "sbit", "window"])
 
@@ -1386,6 +1371,233 @@ n = gd_linterp_tablename(d, 'linterp')
 nume += check_ok(241, d)
 nume += check_eostring(241, n, "test_dirfile/lut")
 
+; 243: add lincom
+n = {field: 'new243', field_type: !GD.LINCOM_ENTRY, in_fields: [ "in1", "in2", $
+  "in3" ], m: [ DCOMPLEX(1.1D,0), DCOMPLEX(0,0), DCOMPLEX(1.4D,0) ], $
+  scalar: [ '', 'const', '', 'carray', 'carray', 'carray' ], $
+  scalar_ind: [ 0, -1, 0, 3, 4, 5 ], fragment: 0}
+gd_add, d, n
+nume += check_ok2(243, 1, d)
+
+n = gd_entry(d, "new243")
+nume += check_ok2(243, 2, d)
+nume += check_simple2(243, 3, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(243, 4, n.field, "new243")
+nume += check_simple2(243, 5, n.fragment, 0)
+nume += check_simple2(243, 6, n.n_fields, 3)
+nume += check_simple2(243, 7, n.in_fields, [ "in1", "in2", "in3" ])
+nume += check_simple2(243, 8, n.flags, !GD.EN_CALC)
+nume += check_simple2(243, 9, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(86D,0), $
+  DCOMPLEX(1.4D,0) ])
+nume += check_simple2(243, 10, n.m, [ 1.1D, 86D, 1.4D ])
+nume += check_simple2(243, 11, n.cb, [ DCOMPLEX(34D,0), DCOMPLEX(5.4,0), $
+  DCOMPLEX(4.3,0) ])
+nume += check_simple2(243, 12, n.b, [ 34D, 5.4, 4.3 ])
+nume += check_simple2(243, 13, n.scalar, [ "", "const", "", "carray", $
+  "carray", "carray" ])
+nume += check_simple2(243, 14, n.scalar_ind, [ 0, -1, 0, 3, 4, 5 ])
+
+;  244: gd_add polynom
+n = {field: 'new244', field_type: !GD.POLYNOM_ENTRY, in_fields: 'in2', $
+  a: [ DCOMPLEX(33D, 0), DCOMPLEX(44D, 55D), DCOMPLEX(66D, 0) ], $
+  scalar: [ "", "", "", "carray" ], scalar_ind: [ 0, 0, 0 ], fragment: 0}
+gd_add, d, n
+nume += check_ok2(244, 1, d)
+
+n = gd_entry(d, "new244")
+nume += check_ok2(244, 2, d)
+nume += check_simple2(244, 3, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(244, 4, n.field, "new244")
+nume += check_simple2(244, 5, n.fragment, 0)
+nume += check_simple2(244, 6, n.poly_ord, 3)
+nume += check_simple2(244, 7, n.in_fields, [ "in2" ])
+nume += check_simple2(244, 8, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(244, 9, n.ca, [ DCOMPLEX(33D, 0), DCOMPLEX(44D, 55D), $
+  DCOMPLEX(66D, 0) ])
+nume += check_simple2(244, 10, n.a, [ 33D, 44D, 66D ])
+nume += check_simple2(244, 11, n.scalar, [ "", "", "", "carray" ])
+nume += check_simple2(244, 12, n.scalar_ind, [ 0, 0, 0, 0 ])
+
+;  245: gd_add linterp
+n = {field: "new245", field_type: !GD.LINTERP_ENTRY, fragment: 0, $
+  in_fields: "in", table: "./some/table"};
+gd_add, d, n
+nume += check_ok2(245, 1, d)
+
+n = gd_entry(d, "new245")
+nume += check_ok2(21, 2, d)
+nume += check_simple2(21, 3, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(21, 4, n.field, "new245")
+nume += check_simple2(21, 5, n.fragment, 0)
+nume += check_simple2(21, 6, n.in_fields, [ "in" ])
+nume += check_simple2(21, 7, n.table, "./some/table")
+
+;  246: gd_add bit
+n = {field: "new246", field_type: !GD.BIT_ENTRY, fragment: 0, bitnum: 11, $
+  in_fields: [ "in1" ]}
+gd_add, d, n
+nume += check_ok2(245, 1, d)
+
+n = gd_entry(d, "new246")
+nume += check_ok2(22, 2, d)
+nume += check_simple2(22, 3, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(22, 4, n.field, "new246")
+nume += check_simple2(22, 5, n.fragment, 0)
+nume += check_simple2(22, 6, n.in_fields, [ "in1" ])
+nume += check_simple2(22, 7, n.numbits, 1)
+nume += check_simple2(22, 8, n.bitnum, 11)
+
+;  247: gd_add multiply
+n = {field: 'new247', field_type: !GD.MULTIPLY_ENTRY, fragment: 0, $
+  in_fields: [ "in2", "in3"]};
+gd_add, d, n
+nume += check_ok2(247, 1, d)
+
+n = gd_entry(d, "new247")
+nume += check_ok2(247, 2, d)
+nume += check_simple2(247, 3, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(247, 4, n.field, "new247")
+nume += check_simple2(247, 5, n.fragment, 0)
+nume += check_simple2(247, 6, n.in_fields, [ "in2", "in3" ])
+
+;  248: gd_add phase
+n = {field: "new248", field_type: !GD.PHASE_ENTRY, fragment: 0, $
+  shift: -88L, in_fields: [ "new9" ], scalar: [ "" ], scalar_ind: [ 0 ]}
+gd_add, d, n
+nume += check_ok2(248, 1, d)
+
+n = gd_entry(d, "new248")
+nume += check_ok2(248, 2, d)
+nume += check_simple2(248, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(248, 2, n.field, "new248")
+nume += check_simple2(248, 3, n.fragment, 0)
+nume += check_simple2(248, 4, n.in_fields, [ "new9" ])
+nume += check_simple2(248, 5, n.shift, -88)
+
+;  249: gd_add const
+n = {field: 'new249', field_type: !GD.CONST_ENTRY, fragment: 0, $
+  data_type: !GD.FLOAT32}
+gd_add, d, n
+nume += check_ok2(249, 1, d)
+
+n = gd_entry(d, "new249")
+nume += check_ok2(249, 2, d)
+nume += check_simple2(249, 3, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(249, 4, n.field, "new249")
+nume += check_simple2(249, 5, n.fragment, 0)
+nume += check_simple2(249, 6, n.data_type, !GD.FLOAT32)
+
+n = gd_get_constant(d, "new249")
+nume += check_ok2(249, 7, d)
+nume += check_simple2(249, 8, n, 0)
+
+;  250: gd_add string
+n = {field: 'new250', field_type: !GD.STRING_ENTRY, fragment: 0, $
+  data_type: !GD.FLOAT32}
+gd_add, d, n
+nume += check_ok2(250, 1, d)
+
+n = gd_entry(d, "new250")
+nume += check_ok2(250, 2, d)
+nume += check_simple2(250, 3, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(250, 4, n.field, "new250")
+nume += check_simple2(250, 5, n.fragment, 0)
+
+n = gd_get_string(d, "new250")
+nume += check_ok2(250, 6, d)
+nume += check_simple2(250, 7, n, 0)
+
+;  251: gd_add recip
+n = {field: 'Bnew251', field_type: !GD.RECIP_ENTRY, fragment: 1, $
+  in_fields: 'Bin1', dividend: COMPLEX(33.3, 44.4)}
+gd_add, d, n
+nume += check_ok2(251, 1, d)
+
+n = gd_entry(d, "Bnew251")
+nume += check_ok2(145, 2, d)
+nume += check_simple2(145, 3, n.field_type, !GD.RECIP_ENTRY)
+nume += check_simple2(145, 4, n.field, "Bnew251")
+nume += check_simple2(145, 5, n.fragment, 1)
+nume += check_simple2(145, 6, n.in_fields, [ "Bin1" ])
+nume += check_simple2(145, 7, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC)
+nume += check_simple2(145, 8, n.cdividend, DCOMPLEX(33.3, 44.4))
+nume += check_simple2(145, 9, n.dividend, 33.3)
+
+;  252: gd_add carray
+n = {field: 'new252', field_type: !GD.CARRAY_ENTRY, fragment: 0, $
+  data_type: !GD.FLOAT32, array_len: 5}
+gd_add, d, n
+nume += check_ok2(252, 1, d)
+
+n = gd_entry(d, "new252")
+nume += check_ok2(252, 2, d)
+nume += check_simple2(252, 3, n.field_type, !GD.CARRAY_ENTRY)
+nume += check_simple2(252, 4, n.field, "new252")
+nume += check_simple2(252, 5, n.fragment, 0)
+nume += check_simple2(252, 6, n.data_type, !GD.FLOAT32)
+nume += check_simple2(252, 7, n.array_len, 5)
+
+n = gd_get_constant(d, "new252")
+nume += check_ok2(252, 8, d)
+nume += check_simple2(252, 9, n, [0, 0, 0, 0, 0])
+
+;  253: gd_add window
+n = {field: 'new253', field_type: !GD.WINDOW_ENTRY, fragment: 0, $
+  windop: !GD.WINDOP_NE, threshold: 32, in_fields: [ "in1", "in2" ]}
+gd_add, d, n
+nume += check_ok2(253, 1, d)
+
+n = gd_entry(d, 'new253')
+nume += check_ok2(253, 2, d)
+nume += check_simple2(253, 3, n.field, "new253")
+nume += check_simple2(253, 4, n.field_type, !GD.WINDOW_ENTRY)
+nume += check_simple2(253, 5, n.fragment, 0)
+nume += check_simple2(253, 6, n.windop, !GD.WINDOP_NE)
+nume += check_simple2(253, 7, n.in_fields, [ 'in1', 'in2' ])
+nume += check_simple2(253, 8, n.ithreshold, 32)
+
+;  254: gd_add mplex
+n = {field: 'new254', field_type: !GD.MPLEX_ENTRY, fragment: 0, $
+  count_val: 5, in_fields: [ "in1", "in2" ]}
+gd_add, d, n
+nume += check_ok2(254, 1, d)
+
+n = gd_entry(d, 'new254')
+nume += check_ok2(229, 2, d)
+nume += check_simple2(253, 3, n.field, "new254")
+nume += check_simple2(229, 4, n.field_type, !GD.MPLEX_ENTRY)
+nume += check_simple2(229, 5, n.fragment, 0)
+nume += check_simple2(229, 6, n.count_val, 5)
+nume += check_simple2(229, 7, n.in_fields, [ 'in1', 'in2' ])
+nume += check_simple2(229, 8, n.period, 0)
+
+;  259: gd_alter_entry with scalar
+n = {field_type: !GD.LINCOM_ENTRY, scalar: [ "", "const", "const", "carray", $
+  "", "const" ], scalar_ind: [ 0, 0, 0, 4, 0, -1 ]}
+gd_alter_entry, d, 'new243', n
+
+n = gd_entry(d, "new243")
+nume += check_ok2(259, 2, d)
+nume += check_simple2(259, 3, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(259, 4, n.field, "new243")
+nume += check_simple2(259, 5, n.fragment, 0)
+nume += check_simple2(259, 6, n.n_fields, 3)
+nume += check_simple2(259, 7, n.in_fields, [ "in1", "in2", "in3" ])
+nume += check_simple2(259, 8, n.flags, !GD.EN_CALC)
+nume += check_simple2(259, 9, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(86D,0), $
+  DCOMPLEX(86D,0) ])
+nume += check_simple2(259, 10, n.m, [ 1.1D, 86D, 86D ])
+nume += check_simple2(259, 11, n.cb, [ DCOMPLEX(5.4,0), DCOMPLEX(5.4,0), $
+  DCOMPLEX(86D,0) ])
+nume += check_simple2(259, 12, n.b, [ 5.4, 5.4, 86D ])
+nume += check_simple2(259, 13, n.scalar, [ "", "const", "const", "carray", $
+  "", "const" ])
+
+;  271: gd_encoding_support
+n = gd_encoding_support(!GD.SIE_ENCODED)
+nume += check_simple(271, n, !GD.RDWR)
+
+
 
 
 
diff --git a/bindings/idl/test/getdata_idl_test_routines.pro b/bindings/idl/test/getdata_idl_test_routines.pro
index ba7a844..840858c 100644
--- a/bindings/idl/test/getdata_idl_test_routines.pro
+++ b/bindings/idl/test/getdata_idl_test_routines.pro
@@ -1,3 +1,25 @@
+; vim: ft=idlang
+;
+; Copyright (C) 2009-2011 D. V. Wiebe
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; This file is part of the GetData project.
+;
+; GetData is free software; you can redistribute it and/or modify it under
+; the terms of the GNU Lesser General Public License as published by the
+; Free Software Foundation; either version 2.1 of the License, or (at your
+; option) any later version.
+;
+; GetData is distributed in the hope that it will be useful, but WITHOUT
+; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+; License for more details.
+;
+; You should have received a copy of the GNU Lesser General Public License
+; along with GetData; if not, write to the Free Software Foundation, Inc.,
+; 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
 pro timed_demo_mode
   print,""
   print,"**********************************************"
diff --git a/bindings/make_parameters.c b/bindings/make_parameters.c
index ad92d24..6c06eaf 100644
--- a/bindings/make_parameters.c
+++ b/bindings/make_parameters.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2013 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -29,213 +29,224 @@
 #define GD_NO_LEGACY_API
 #include "getdata.h"
 
-/* The type parameter:
- *   0: error codes
- *   1: open flags not in IDL
- *   2: open flags represented as LONG in IDL
- *   3: entry types
- *   4: data types
- *   5: delete/rename flags (not in IDL)
- *   6: protection levels
- *   7: callback actions (not in IDL)
- *   8: GD_E_FORMAT suberrors (not in IDL)
- *   9: special version codes
- *  10: gd_seek whence values
- *  11: gd_seek flags (not in IDL)
- *  12: window operations
- *  13: desynced flags (not in IDL)
- *  14: entry_list constants (not in IDL)
- *  98: miscellaneous constants not in IDL
- *  99: miscellaneous constants
- */
+/* parameter types (used by Fortran, IDL, and PHP) */
+#define GDMP_ERR     0x00000001 /* error code */
+#define GDMP_DEPERR  0x00000002 /* deprecated error codes not in PHP */
+#define GDMP_OFLAG   0x00000004 /* open flags not in IDL */
+#define GDMP_OFLAG_L 0x00000008 /* open flags represented as LONG in IDL */
+#define GDMP_ENTYPE  0x00000010 /* entry types */
+#define GDMP_DTYPE   0x00000020 /* data types */
+#define GDMP_RFLAG   0x00000040 /* delete and rename flags (not in IDL) */
+#define GDMP_PROT    0x00000080 /* protection levels */
+#define GDMP_CALLBAK 0x00000100 /* callback actions (not in IDL) */
+#define GDMP_FORMAT  0x00000200 /* GD_E_FORMAT suberrors (not in IDL) */
+#define GDMP_VERS    0x00000400 /* special version codes */
+#define GDMP_WHENCE  0x00000800 /* gd_seek whence values */
+#define GDMP_SEEK    0x00001000 /* gd_seek flags (not in IDL) */
+#define GDMP_WINDOP  0x00002000 /* window operations */
+#define GDMP_DESYNC  0x00004000 /* desync flags (not in IDL) */
+#define GDMP_ENLIST  0x00008000 /* entry_list constants (not in IDL) */
+#define GDMP_EFLAG   0x00010000 /* entry flags */
+#define GDMP_MISC_I  0x00020000 /* miscellaneous constants not in IDL */
+#define GDMP_MISC    0x00040000 /* miscellaneous constants */
+
 #define CONSTANT(s,f,t) { "GD_" #s, #s, f, GD_ ## s, t }
 static struct {
   const char* lname; /* Long name */
   const char* sname; /* Short name */
   const char* fname; /* F77 name */
   long int value;
-  int type;
+  unsigned 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_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_UNKNOWN_ENCODING,"GD_EUE",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_ARGUMENT,       "GD_EAR", 0),
-  CONSTANT(E_CALLBACK,       "GD_ECB", 0),
-  CONSTANT(E_EXISTS,         "GD_EEX", 0),
-  CONSTANT(E_UNCLEAN_DB,     "GD_UCL", 0),
-  CONSTANT(E_DOMAIN,         "GD_EDO", 0),
-  CONSTANT(E_BAD_REPR,       "GD_ERP", 0),
-  CONSTANT(E_FLUSH,          "GD_EFL", 0),
-  CONSTANT(E_BOUNDS,         "GD_EBO", 0),
-  CONSTANT(E_LINE_TOO_LONG,  "GD_ETL", 0),
-
-  CONSTANT(E_OPEN_INCLUDE,   "GD_EOI", 0), /* deprecated */
-  CONSTANT(E_BAD_ENDIANNESS, "GD_EEN", 0), /* deprecated */
-  CONSTANT(E_BAD_PROTECTION, "GD_EBP", 0), /* deprecated */
-  CONSTANT(E_BAD_VERSION,    "GD_EVR", 0), /* deprecated */
-
-  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",  2),
-  CONSTANT(IGNORE_DUPS,      "GD_ID",  1),
-  CONSTANT(IGNORE_REFS,      "GD_IR",  1),
-  CONSTANT(PRETTY_PRINT,     "GD_PP",  2),
-  CONSTANT(ARM_ENDIAN,       "GD_AE",  2),
-  CONSTANT(NOT_ARM_ENDIAN,   "GD_NA",  2),
-  CONSTANT(PERMISSIVE,       "GD_PM",  1),
-  CONSTANT(TRUNCSUB,         "GD_TS",  1),
-
-  CONSTANT(AUTO_ENCODED,     "GDE_AU", 1),
-  CONSTANT(BZIP2_ENCODED,    "GDE_BZ", 2),
-  CONSTANT(GZIP_ENCODED,     "GDE_GZ", 2),
-  CONSTANT(LZMA_ENCODED,     "GDE_LZ", 2),
-  CONSTANT(SIE_ENCODED,      "GDE_SI", 2),
-  CONSTANT(SLIM_ENCODED,     "GDE_SL", 2),
-  CONSTANT(TEXT_ENCODED,     "GDE_TX", 2),
-  CONSTANT(UNENCODED,        "GDE_UN", 2),
-  CONSTANT(ZZSLIM_ENCODED,   "GDE_ZS", 2),
-  CONSTANT(ZZIP_ENCODED,     "GDE_ZZ", 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(WINDOW_ENTRY,     "GD_WDE", 3),
-  CONSTANT(MPLEX_ENTRY,      "GD_MXE", 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(REN_DATA,         "GDR_DT", 5),
-  CONSTANT(REN_UPDB,         "GDR_UP", 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(E_FORMAT_WINDOP,  "GDF_WO", 8),
-  CONSTANT(E_FORMAT_META_META,"GDF_MM", 8),
-  CONSTANT(E_FORMAT_ALIAS,   "GDF_AL", 8),
-  CONSTANT(E_FORMAT_MPLEXVAL,"GDF_MV", 8),
-
-  CONSTANT(VERSION_CURRENT,  "GDSV_C", 9),
-  CONSTANT(VERSION_LATEST,   "GDSV_L", 9),
-  CONSTANT(VERSION_EARLIEST, "GDSV_E", 9),
-
-  CONSTANT(SEEK_SET,         "GDSK_S", 10),
-  CONSTANT(SEEK_CUR,         "GDSK_C", 10),
-  CONSTANT(SEEK_END,         "GDSK_E", 10),
-  CONSTANT(SEEK_WRITE,       "GDSK_W", 11),
-
-  CONSTANT(WINDOP_UNK,       "GDW_UN", 12),
-  CONSTANT(WINDOP_EQ,        "GDW_EQ", 12),
-  CONSTANT(WINDOP_GE,        "GDW_GE", 12),
-  CONSTANT(WINDOP_GT,        "GDW_GT", 12),
-  CONSTANT(WINDOP_LE,        "GDW_LE", 12),
-  CONSTANT(WINDOP_LT,        "GDW_LT", 12),
-  CONSTANT(WINDOP_NE,        "GDW_NE", 12),
-  CONSTANT(WINDOP_SET,       "GDW_ST", 12),
-  CONSTANT(WINDOP_CLR,       "GDW_CL", 12),
-
-  CONSTANT(DESYNC_PATHCHECK, "GDDS_P", 13),
-  CONSTANT(DESYNC_REOPEN,    "GDDS_O", 13),
-
-  CONSTANT(ALL_ENTRIES,      "GDEN_X", 14),
-  CONSTANT(VECTOR_ENTRIES,   "GDEN_V", 14),
-  CONSTANT(SCALAR_ENTRIES,   "GDEN_S", 14),
-  CONSTANT(ALIAS_ENTRIES,    "GDEN_A", 14),
-  CONSTANT(ENTRIES_HIDDEN,   "GDEN_H", 14),
-  CONSTANT(ENTRIES_NOALIAS,  "GDEN_N", 14),
-
-  CONSTANT(ALL_FRAGMENTS,    "GD_ALL", 99),
-  CONSTANT(DEFAULT_LOOKBACK, "GDLB_D", 99),
-  CONSTANT(DIRFILE_STANDARDS_VERSION, "GD_DSV", 99),
-  CONSTANT(HERE,             "GD_HER", 98),
-  CONSTANT(LOOKBACK_ALL,     "GDLB_A", 98),
-  CONSTANT(MAX_LINE_LENGTH,  "GD_MLL", 99),
+  CONSTANT(E_OK,             "GD_EOK", GDMP_ERR),
+  CONSTANT(E_FORMAT,         "GD_EFO", GDMP_ERR),
+  CONSTANT(E_CREAT,          "GD_ECR", GDMP_ERR),
+  CONSTANT(E_BAD_CODE,       "GD_EBC", GDMP_ERR),
+  CONSTANT(E_BAD_TYPE,       "GD_EBT", GDMP_ERR),
+  CONSTANT(E_IO,             "GD_EIO", GDMP_ERR),
+  CONSTANT(E_INTERNAL_ERROR, "GD_EIE", GDMP_ERR),
+  CONSTANT(E_ALLOC,          "GD_EAL", GDMP_ERR),
+  CONSTANT(E_RANGE,          "GD_ERA", GDMP_ERR),
+  CONSTANT(E_LUT,            "GD_ELT", GDMP_ERR),
+  CONSTANT(E_RECURSE_LEVEL,  "GD_ERL", GDMP_ERR),
+  CONSTANT(E_BAD_DIRFILE,    "GD_EBD", GDMP_ERR),
+  CONSTANT(E_BAD_FIELD_TYPE, "GD_EBF", GDMP_ERR),
+  CONSTANT(E_ACCMODE,        "GD_EAC", GDMP_ERR),
+  CONSTANT(E_UNSUPPORTED,    "GD_UNS", GDMP_ERR),
+  CONSTANT(E_UNKNOWN_ENCODING,"GD_EUE",GDMP_ERR),
+  CONSTANT(E_BAD_ENTRY,      "GD_EBE", GDMP_ERR),
+  CONSTANT(E_DUPLICATE,      "GD_EDU", GDMP_ERR),
+  CONSTANT(E_DIMENSION,      "GD_EDM", GDMP_ERR),
+  CONSTANT(E_BAD_INDEX,      "GD_EBI", GDMP_ERR),
+  CONSTANT(E_BAD_SCALAR,     "GD_EBS", GDMP_ERR),
+  CONSTANT(E_BAD_REFERENCE,  "GD_EBR", GDMP_ERR),
+  CONSTANT(E_PROTECTED,      "GD_EPT", GDMP_ERR),
+  CONSTANT(E_DELETE,         "GD_EDL", GDMP_ERR),
+  CONSTANT(E_ARGUMENT,       "GD_EAR", GDMP_ERR),
+  CONSTANT(E_CALLBACK,       "GD_ECB", GDMP_ERR),
+  CONSTANT(E_EXISTS,         "GD_EEX", GDMP_ERR),
+  CONSTANT(E_UNCLEAN_DB,     "GD_UCL", GDMP_ERR),
+  CONSTANT(E_DOMAIN,         "GD_EDO", GDMP_ERR),
+  CONSTANT(E_BAD_REPR,       "GD_ERP", GDMP_ERR),
+  CONSTANT(E_BOUNDS,         "GD_EBO", GDMP_ERR),
+  CONSTANT(E_LINE_TOO_LONG,  "GD_ETL", GDMP_ERR),
+
+  CONSTANT(E_BAD_ENDIANNESS, "GD_EEN", GDMP_DEPERR),
+  CONSTANT(E_BAD_PROTECTION, "GD_EBP", GDMP_DEPERR),
+  CONSTANT(E_BAD_VERSION,    "GD_EVR", GDMP_DEPERR),
+  CONSTANT(E_OPEN_LINFILE,   "GD_EOL", GDMP_DEPERR),
+  CONSTANT(E_FLUSH,          "GD_EFL", GDMP_DEPERR),
+  CONSTANT(E_OPEN,           "GD_EOP", GDMP_DEPERR),
+  CONSTANT(E_OPEN_FRAGMENT,  "GD_EOF", GDMP_DEPERR),
+  CONSTANT(E_OPEN_INCLUDE,   "GD_EOI", GDMP_DEPERR),
+  CONSTANT(E_RAW_IO,         "GD_ERW", GDMP_DEPERR),
+  CONSTANT(E_TRUNC,          "GD_ETR", GDMP_DEPERR),
+
+  CONSTANT(RDONLY,           "GD_RO", GDMP_OFLAG_L),
+  CONSTANT(RDWR,             "GD_RW", GDMP_OFLAG_L),
+  CONSTANT(FORCE_ENDIAN,     "GD_FE", GDMP_OFLAG),
+  CONSTANT(BIG_ENDIAN,       "GD_BE", GDMP_OFLAG_L),
+  CONSTANT(LITTLE_ENDIAN,    "GD_LE", GDMP_OFLAG_L),
+  CONSTANT(CREAT,            "GD_CR", GDMP_OFLAG),
+  CONSTANT(EXCL,             "GD_EX", GDMP_OFLAG),
+  CONSTANT(TRUNC,            "GD_TR", GDMP_OFLAG),
+  CONSTANT(PEDANTIC,         "GD_PE", GDMP_OFLAG),
+  CONSTANT(FORCE_ENCODING,   "GD_FC", GDMP_OFLAG),
+  CONSTANT(VERBOSE,          "GD_VB", GDMP_OFLAG_L),
+  CONSTANT(IGNORE_DUPS,      "GD_ID", GDMP_OFLAG),
+  CONSTANT(IGNORE_REFS,      "GD_IR", GDMP_OFLAG),
+  CONSTANT(PRETTY_PRINT,     "GD_PP", GDMP_OFLAG_L),
+  CONSTANT(ARM_ENDIAN,       "GD_AE", GDMP_OFLAG_L),
+  CONSTANT(NOT_ARM_ENDIAN,   "GD_NA", GDMP_OFLAG_L),
+  CONSTANT(PERMISSIVE,       "GD_PM", GDMP_OFLAG),
+  CONSTANT(TRUNCSUB,         "GD_TS", GDMP_OFLAG),
+
+  CONSTANT(AUTO_ENCODED,     "GDE_AU", GDMP_OFLAG),
+  CONSTANT(BZIP2_ENCODED,    "GDE_BZ", GDMP_OFLAG_L),
+  CONSTANT(FLAC_ENCODED,     "GDE_FL", GDMP_OFLAG_L),
+  CONSTANT(GZIP_ENCODED,     "GDE_GZ", GDMP_OFLAG_L),
+  CONSTANT(LZMA_ENCODED,     "GDE_LZ", GDMP_OFLAG_L),
+  CONSTANT(SIE_ENCODED,      "GDE_SI", GDMP_OFLAG_L),
+  CONSTANT(SLIM_ENCODED,     "GDE_SL", GDMP_OFLAG_L),
+  CONSTANT(TEXT_ENCODED,     "GDE_TX", GDMP_OFLAG_L),
+  CONSTANT(UNENCODED,        "GDE_UN", GDMP_OFLAG_L),
+  CONSTANT(ZZSLIM_ENCODED,   "GDE_ZS", GDMP_OFLAG_L),
+  CONSTANT(ZZIP_ENCODED,     "GDE_ZZ", GDMP_OFLAG_L),
+
+  CONSTANT(NO_ENTRY,         "GD_NOE", GDMP_ENTYPE),
+  CONSTANT(RAW_ENTRY,        "GD_RWE", GDMP_ENTYPE),
+  CONSTANT(LINCOM_ENTRY,     "GD_LCE", GDMP_ENTYPE),
+  CONSTANT(LINTERP_ENTRY,    "GD_LTE", GDMP_ENTYPE),
+  CONSTANT(BIT_ENTRY,        "GD_BTE", GDMP_ENTYPE),
+  CONSTANT(MULTIPLY_ENTRY,   "GD_MTE", GDMP_ENTYPE),
+  CONSTANT(PHASE_ENTRY,      "GD_PHE", GDMP_ENTYPE),
+  CONSTANT(INDEX_ENTRY,      "GD_IXE", GDMP_ENTYPE),
+  CONSTANT(POLYNOM_ENTRY,    "GD_PNE", GDMP_ENTYPE),
+  CONSTANT(SBIT_ENTRY,       "GD_SBE", GDMP_ENTYPE),
+  CONSTANT(DIVIDE_ENTRY,     "GD_DVE", GDMP_ENTYPE),
+  CONSTANT(RECIP_ENTRY,      "GD_RCE", GDMP_ENTYPE),
+  CONSTANT(WINDOW_ENTRY,     "GD_WDE", GDMP_ENTYPE),
+  CONSTANT(MPLEX_ENTRY,      "GD_MXE", GDMP_ENTYPE),
+  CONSTANT(CONST_ENTRY,      "GD_COE", GDMP_ENTYPE),
+  CONSTANT(CARRAY_ENTRY,     "GD_CAE", GDMP_ENTYPE),
+  CONSTANT(STRING_ENTRY,     "GD_STE", GDMP_ENTYPE),
+
+  CONSTANT(NULL,             "GD_NUL", GDMP_DTYPE),
+  CONSTANT(UINT8,            "GD_U8",  GDMP_DTYPE),
+  CONSTANT(INT8,             "GD_I8",  GDMP_DTYPE),
+  CONSTANT(UINT16,           "GD_U16", GDMP_DTYPE),
+  CONSTANT(INT16,            "GD_I16", GDMP_DTYPE),
+  CONSTANT(UINT32,           "GD_U32", GDMP_DTYPE),
+  CONSTANT(INT32,            "GD_I32", GDMP_DTYPE),
+  CONSTANT(UINT64,           "GD_U64", GDMP_DTYPE),
+  CONSTANT(INT64,            "GD_I64", GDMP_DTYPE),
+  CONSTANT(FLOAT32,          "GD_F32", GDMP_DTYPE),
+  CONSTANT(FLOAT64,          "GD_F64", GDMP_DTYPE),
+  CONSTANT(COMPLEX64,        "GD_C64", GDMP_DTYPE),
+  CONSTANT(COMPLEX128,       "GDC128", GDMP_DTYPE),
+
+  CONSTANT(DEL_META,         "GDD_MT", GDMP_RFLAG),
+  CONSTANT(DEL_DATA,         "GDD_DT", GDMP_RFLAG),
+  CONSTANT(DEL_DEREF,        "GDD_DR", GDMP_RFLAG),
+  CONSTANT(DEL_FORCE,        "GDD_FO", GDMP_RFLAG),
+  CONSTANT(REN_DATA,         "GDR_DT", GDMP_RFLAG),
+  CONSTANT(REN_UPDB,         "GDR_UP", GDMP_RFLAG),
+  CONSTANT(REN_DANGLE,       "GDR_DL", GDMP_RFLAG),
+  CONSTANT(REN_FORCE,        "GDR_FO", GDMP_RFLAG),
+
+  CONSTANT(PROTECT_NONE,     "GDPR_N", GDMP_PROT),
+  CONSTANT(PROTECT_FORMAT,   "GDPR_F", GDMP_PROT),
+  CONSTANT(PROTECT_DATA,     "GDPR_D", GDMP_PROT),
+  CONSTANT(PROTECT_ALL,      "GDPR_A", GDMP_PROT),
+
+  CONSTANT(SYNTAX_ABORT,     "GDSX_A", GDMP_CALLBAK),
+  CONSTANT(SYNTAX_RESCAN,    "GDSX_S", GDMP_CALLBAK),
+  CONSTANT(SYNTAX_IGNORE,    "GDSX_I", GDMP_CALLBAK),
+  CONSTANT(SYNTAX_CONTINUE,  "GDSX_C", GDMP_CALLBAK),
+
+  CONSTANT(E_FORMAT_BAD_SPF,  "GDF_SF", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_N_FIELDS, "GDF_NF", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_N_TOK,    "GDF_NT", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_NUMBITS,  "GDF_NB", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_BITNUM,   "GDF_BN", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_BITSIZE,  "GDF_SZ", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_CHARACTER,"GDF_CH", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_BAD_LINE, "GDF_LI", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_RES_NAME, "GDF_RN", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_ENDIAN,   "GDF_EN", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_BAD_TYPE, "GDF_TY", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_BAD_NAME, "GDF_NA", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_UNTERM,   "GDF_UM", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_METARAW,  "GDF_MR", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_NO_PARENT,"GDF_PA", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_DUPLICATE,"GDF_DU", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_LOCATION, "GDF_LO", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_PROTECT,  "GDF_PR", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_LITERAL,  "GDF_LT", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_WINDOP,   "GDF_WO", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_META_META,"GDF_MM", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_ALIAS,    "GDF_AL", GDMP_FORMAT),
+  CONSTANT(E_FORMAT_MPLEXVAL, "GDF_MV", GDMP_FORMAT),
+
+  CONSTANT(VERSION_CURRENT,  "GDSV_C", GDMP_VERS),
+  CONSTANT(VERSION_LATEST,   "GDSV_L", GDMP_VERS),
+  CONSTANT(VERSION_EARLIEST, "GDSV_E", GDMP_VERS),
+
+  CONSTANT(SEEK_SET,         "GDSK_S", GDMP_WHENCE),
+  CONSTANT(SEEK_CUR,         "GDSK_C", GDMP_WHENCE),
+  CONSTANT(SEEK_END,         "GDSK_E", GDMP_WHENCE),
+  CONSTANT(SEEK_WRITE,       "GDSK_W", GDMP_SEEK),
+
+  CONSTANT(WINDOP_UNK,       "GDW_UN", GDMP_WINDOP),
+  CONSTANT(WINDOP_EQ,        "GDW_EQ", GDMP_WINDOP),
+  CONSTANT(WINDOP_GE,        "GDW_GE", GDMP_WINDOP),
+  CONSTANT(WINDOP_GT,        "GDW_GT", GDMP_WINDOP),
+  CONSTANT(WINDOP_LE,        "GDW_LE", GDMP_WINDOP),
+  CONSTANT(WINDOP_LT,        "GDW_LT", GDMP_WINDOP),
+  CONSTANT(WINDOP_NE,        "GDW_NE", GDMP_WINDOP),
+  CONSTANT(WINDOP_SET,       "GDW_ST", GDMP_WINDOP),
+  CONSTANT(WINDOP_CLR,       "GDW_CL", GDMP_WINDOP),
+
+  CONSTANT(DESYNC_PATHCHECK, "GDDS_P", GDMP_DESYNC),
+  CONSTANT(DESYNC_REOPEN,    "GDDS_O", GDMP_DESYNC),
+
+  CONSTANT(ALL_ENTRIES,      "GDEN_X", GDMP_ENLIST),
+  CONSTANT(VECTOR_ENTRIES,   "GDEN_V", GDMP_ENLIST),
+  CONSTANT(SCALAR_ENTRIES,   "GDEN_S", GDMP_ENLIST),
+  CONSTANT(ALIAS_ENTRIES,    "GDEN_A", GDMP_ENLIST),
+  CONSTANT(ENTRIES_HIDDEN,   "GDEN_H", GDMP_ENLIST),
+  CONSTANT(ENTRIES_NOALIAS,  "GDEN_N", GDMP_ENLIST),
+
+  CONSTANT(EN_CALC,          "GDE_CA", GDMP_EFLAG),
+  CONSTANT(EN_HIDDEN,        "GDE_HI", GDMP_EFLAG),
+  CONSTANT(EN_COMPSCAL,      "GDE_CS", GDMP_EFLAG),
+
+  CONSTANT(ALL_FRAGMENTS,    "GD_ALL", GDMP_MISC),
+  CONSTANT(DEFAULT_LOOKBACK, "GDLB_D", GDMP_MISC),
+  CONSTANT(DIRFILE_STANDARDS_VERSION, "GD_DSV", GDMP_MISC),
+  CONSTANT(HERE,             "GD_HER", GDMP_MISC_I),
+  CONSTANT(LOOKBACK_ALL,     "GDLB_A", GDMP_MISC_I),
+  CONSTANT(MAX_LINE_LENGTH,  "GD_MLL", GDMP_MISC),
   { NULL }
 };
 
@@ -264,102 +275,117 @@ void Fortran(void)
       printf("s/@PARAMETERS95@/\\\n! Error codes\\\n");
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 0)
+      if (constant_list[j].type == GDMP_ERR)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Deprecated error codes\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == GDMP_DEPERR)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Open flags\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 1 || constant_list[j].type == 2)
+      if (constant_list[j].type & (GDMP_OFLAG | GDMP_OFLAG_L))
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
-    printf("\\\n%c Field types\\\n", c);
+    printf("\\\n%c Entry types\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 3)
+      if (constant_list[j].type == GDMP_ENTYPE)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf(
         "\\\n%c Data types -- the unsigned types won't work when passed as\\\n"
-        "%c               a return type, 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");
+        "%c               a return type; they are defined because they\\\n"
+        "%c               may be returned by %s or %s\\\n", c, c, c,
+        (i == 0) ? "GDGERW" : "fget_entry",
+        (i == 0) ? "GDNTYP" : "fget_native_type");
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 4)
+      if (constant_list[j].type == GDMP_DTYPE)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
-    printf("\\\n%c Delete flags\\\n", c);
+    printf("\\\n%c Delete and Rename flags\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 5)
+      if (constant_list[j].type == GDMP_RFLAG)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Protection levels\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 6)
+      if (constant_list[j].type == GDMP_PROT)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Callback actions\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 7)
+      if (constant_list[j].type == GDMP_CALLBAK)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Syntax suberrors\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 8)
+      if (constant_list[j].type == GDMP_FORMAT)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Special version codes\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 9)
+      if (constant_list[j].type == GDMP_VERS)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Seek flags\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 10 || constant_list[j].type == 11)
+      if (constant_list[j].type & (GDMP_WHENCE | GDMP_SEEK))
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Window operations\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 12)
+      if (constant_list[j].type == GDMP_WINDOP)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Desync flags\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 13)
+      if (constant_list[j].type == GDMP_DESYNC)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Entry List codes and flags\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 14)
+      if (constant_list[j].type == GDMP_ENLIST)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Entry object flags\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == GDMP_EFLAG)
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
     printf("\\\n%c Miscellaneous parameters\\\n", c);
 
     for (j = 0; constant_list[j].lname != NULL; ++j)
-      if (constant_list[j].type == 98 || constant_list[j].type == 99)
+      if (constant_list[j].type & (GDMP_MISC | GDMP_MISC_I))
         parameter(constant_list[j].lname, constant_list[j].fname,
             constant_list[j].value, i);
 
@@ -405,13 +431,12 @@ void IDL(void)
       );
 
   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) &&
-        (constant_list[i].type != 11) && (constant_list[i].type != 13) &&
-        (constant_list[i].type != 14) && (constant_list[i].type != 98))
+    if (constant_list[i].type & (GDMP_ERR | GDMP_DEPERR | GDMP_OFLAG_L |
+          GDMP_ENTYPE | GDMP_DTYPE | GDMP_PROT | GDMP_VERS | GDMP_WHENCE |
+          GDMP_WINDOP | GDMP_EFLAG | GDMP_MISC))
     {
       printf("{ \"%s\", 0, (void*)IDL_TYP_%s }, ", constant_list[i].sname,
-          (constant_list[i].type == 2) ? "LONG" : "INT"); 
+          (constant_list[i].type == GDMP_OFLAG_L) ? "LONG" : "INT"); 
     }
 
   printf("{ NULL }};\n");
@@ -427,14 +452,14 @@ void IDL(void)
       "\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) &&
-        (constant_list[i].type != 11) && (constant_list[i].type != 13) &&
-        (constant_list[i].type != 14) && (constant_list[i].type != 98))
+    if (constant_list[i].type & (GDMP_ERR | GDMP_DEPERR | GDMP_OFLAG_L |
+          GDMP_ENTYPE | GDMP_DTYPE | GDMP_PROT | GDMP_VERS | GDMP_WHENCE |
+          GDMP_WINDOP | GDMP_EFLAG | GDMP_MISC))
     {
       printf("*(IDL_%s*)(data + IDL_StructTagInfoByIndex(gdidl_const_def, %i, "
-          "IDL_MSG_LONGJMP, NULL)) = %li;\n", (constant_list[i].type == 2) ?
-          "LONG" : "INT", n++, constant_list[i].value);
+          "IDL_MSG_LONGJMP, NULL)) = %li;\n",
+          (constant_list[i].type == GDMP_OFLAG_L) ?  "LONG" : "INT",
+          n++, constant_list[i].value);
     }
 
   printf("return r; }\n");
@@ -537,6 +562,27 @@ void MatLab(void)
       "% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n", stdout);
 }
 
+void PHP(void)
+{
+  int i;
+
+  puts(
+      "/* This code is automatically generated.  "
+      "Changes made here will be lost. */\n"
+      "#include \"php_getdata.h\"\n"
+      "void gdphp_register_constants(int module_number) {"
+      "dtrace(\"%i\", module_number); TSRMLS_FETCH();"
+      );
+  
+  for (i = 0; constant_list[i].lname != NULL; ++i)
+    if (constant_list[i].type != GDMP_DEPERR)
+      printf("zend_register_long_constant(ZEND_STRS(\"%s\"), %li, CONST_CS, "
+          "module_number TSRMLS_CC);", constant_list[i].lname,
+          constant_list[i].value);
+
+  puts("dreturnvoid();}");
+}
+
 int main(int argc, char* argv[])
 {
   if (argv[1][0] == 'f')
@@ -549,6 +595,8 @@ int main(int argc, char* argv[])
     Perl();
   else if (argv[1][0] == 'm')
     MatLab();
+  else if (argv[1][0] == 'h')
+    PHP();
   else
     return 1;
 
diff --git a/bindings/matlab/Contents.m.head b/bindings/matlab/Contents.m.head
index 7960b0a..8945601 100644
--- a/bindings/matlab/Contents.m.head
+++ b/bindings/matlab/Contents.m.head
@@ -67,8 +67,7 @@
 %
 %   * A distinction is not made between real and complex data.  As a result,
 %     the entry struct for, say, a POLYNOM, stores co-efficients in the .A
-%     member, regardless of whether they are complex or purely real.  As a side
-%     effect, the structure does not contain a .COMP_SCAL member.
+%     member, regardless of whether they are complex or purely real.
 %
 %   * LINCOM entries don't provide a .N_FIELDS member, nor do POLYNOM entries
 %     provide a .POLY_ORD member; these values should be determined by
diff --git a/bindings/matlab/Makefile.am b/bindings/matlab/Makefile.am
index eb5c14f..b95953f 100644
--- a/bindings/matlab/Makefile.am
+++ b/bindings/matlab/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2013 D. V. Wiebe
+# Copyright (C) 2013-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -32,33 +32,35 @@ matlabfiles=gd_add_bit.m gd_add_divide.m gd_add_lincom.m gd_add_linterp.m \
 						gd_alter_mplex.m gd_alter_multiply.m gd_alter_phase.m \
 						gd_alter_polynom.m gd_alter_raw.m gd_alter_recip.m gd_alter_sbit.m \
 						gd_alter_window.m gd_field_list_by_type.m gd_field_list.m \
-						gd_get_constant.m gd_madd_bit.m gd_madd_divide.m \
-						gd_madd_lincom.m gd_madd_linterp.m gd_madd_mplex.m \
-						gd_madd_multiply.m gd_madd_phase.m gd_madd_polynom.m \
-						gd_madd_recip.m gd_madd_sbit.m gd_madd_window.m \
-						gd_mfield_list_by_type.m gd_mfield_list.m gd_mvector_list.m \
-						gd_nfields_by_type.m gd_nfields.m gd_nmfields_by_type.m \
-						gd_nmfields.m gd_nmvectors.m gd_nvectors.m gd_put_carray.m \
-						gd_put_constant.m gd_vector_list.m getdata_constants.m
+						gd_get_constant.m gd_madd_bit.m gd_madd_divide.m gd_madd_lincom.m \
+						gd_madd_linterp.m gd_madd_mplex.m gd_madd_multiply.m \
+						gd_madd_phase.m gd_madd_polynom.m gd_madd_recip.m gd_madd_sbit.m \
+						gd_madd_window.m gd_mfield_list_by_type.m gd_mfield_list.m \
+						gd_mvector_list.m gd_nfields_by_type.m gd_nfields.m \
+						gd_nmfields_by_type.m gd_nmfields.m gd_nmvectors.m gd_nvectors.m \
+						gd_put_carray.m gd_put_constant.m gd_vector_list.m \
+						getdata_constants.m
 mexfiles=gd_add gd_add_alias \
-				 gd_add_carray gd_add_const gd_add_spec gd_add_string gd_aliases \
+				 gd_add_carray gd_add_const \
+				 gd_add_spec gd_add_string gd_aliases \
 				 gd_alias_target gd_alter_affixes \
 				 gd_alter_encoding gd_alter_endianness gd_alter_entry \
 				 gd_alter_frameoffset \
-				 gd_alter_protection gd_alter_spec gd_bof gd_carray_len gd_carrays \
-				 gd_close gd_constants gd_delete gd_delete_alias gd_desync \
+				 gd_alter_protection gd_alter_spec gd_bof gd_array_len gd_carrays \
+				 gd_close gd_constants gd_delete gd_desync \
 				 gd_dirfilename gd_dirfile_standards \
-				 gd_discard gd_encoding gd_endianness \
+				 gd_discard gd_encoding gd_encoding_support gd_endianness \
 				 gd_entry gd_entry_list gd_entry_type gd_eof \
 				 gd_error gd_error_string gd_flags gd_flush gd_fragment_affixes \
 				 gd_fragment_index gd_fragmentname \
 				 gd_framenum gd_frameoffset gd_get_carray gd_get_carray_slice \
-				 gd_getdata gd_get_string \
-				 gd_hidden gd_hide gd_include gd_invalid_dirfile \
+				 gd_getdata \
+				 gd_get_string gd_hidden gd_hide gd_include gd_invalid_dirfile \
 				 gd_linterp_tablename gd_madd gd_madd_alias \
-				 gd_madd_carray gd_madd_const gd_madd_spec gd_madd_string \
+				 gd_madd_carray gd_madd_const \
+				 gd_madd_spec gd_madd_string \
 				 gd_malter_spec gd_mcarrays \
-				 gd_mconstants gd_metaflush gd_move gd_move_alias gd_mplex_lookback \
+				 gd_mconstants gd_metaflush gd_move gd_mplex_lookback \
 				 gd_mstrings gd_naliases gd_native_type gd_nentries gd_nfragments \
 				 gd_nframes gd_open gd_parent_fragment gd_protection \
 				 gd_put_carray_slice \
@@ -79,10 +81,6 @@ nodist_matlab_SCRIPTS=Contents.m getdata_constants.m $(matlabmexfiles) \
 
 lib_LTLIBRARIES=libgetdata-matlab.la
 
-libgetdata_matlab_la_SOURCES=matlab.c gd_matlab.h
-libgetdata_matlab_la_CPPFLAGS=${MATLAB_CPPFLAGS} ${AM_CPPFLAGS}
-libgetdata_matlab_la_LDFLAGS=-version-info @MATLABGETDATA_VERSION@
-
 if GD_EXTERNAL
 libgetdata_matlab_la_LIBADD=$(GETDATA_LIBS)
 AM_CPPFLAGS=$(GETDATA_CFLAGS)
@@ -93,6 +91,10 @@ AM_CPPFLAGS=-I${top_srcdir}/src -I../../src
 GDMX_LIBS=-L../../src/.libs -lgetdata
 endif
 
+libgetdata_matlab_la_SOURCES=matlab.c gd_matlab.h
+libgetdata_matlab_la_CPPFLAGS=${MATLAB_CPPFLAGS} ${AM_CPPFLAGS}
+libgetdata_matlab_la_LDFLAGS=-version-info @MATLABGETDATA_VERSION@
+
 %.m: %.c ${srcdir}/doc.tail
 	${GREP} '^ %' $< | ${SED} -e 's/^ //' > $@
 	cat ${srcdir}/doc.tail >> $@
diff --git a/bindings/matlab/Makefile.in b/bindings/matlab/Makefile.in
index d324034..9f2f5be 100644
--- a/bindings/matlab/Makefile.in
+++ b/bindings/matlab/Makefile.in
@@ -87,10 +87,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -272,6 +270,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -297,8 +297,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -346,7 +357,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -361,12 +371,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -430,9 +444,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -440,6 +455,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -453,7 +469,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2013 D. V. Wiebe
+# Copyright (C) 2013-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -484,34 +500,36 @@ matlabfiles = gd_add_bit.m gd_add_divide.m gd_add_lincom.m gd_add_linterp.m \
 						gd_alter_mplex.m gd_alter_multiply.m gd_alter_phase.m \
 						gd_alter_polynom.m gd_alter_raw.m gd_alter_recip.m gd_alter_sbit.m \
 						gd_alter_window.m gd_field_list_by_type.m gd_field_list.m \
-						gd_get_constant.m gd_madd_bit.m gd_madd_divide.m \
-						gd_madd_lincom.m gd_madd_linterp.m gd_madd_mplex.m \
-						gd_madd_multiply.m gd_madd_phase.m gd_madd_polynom.m \
-						gd_madd_recip.m gd_madd_sbit.m gd_madd_window.m \
-						gd_mfield_list_by_type.m gd_mfield_list.m gd_mvector_list.m \
-						gd_nfields_by_type.m gd_nfields.m gd_nmfields_by_type.m \
-						gd_nmfields.m gd_nmvectors.m gd_nvectors.m gd_put_carray.m \
-						gd_put_constant.m gd_vector_list.m getdata_constants.m
+						gd_get_constant.m gd_madd_bit.m gd_madd_divide.m gd_madd_lincom.m \
+						gd_madd_linterp.m gd_madd_mplex.m gd_madd_multiply.m \
+						gd_madd_phase.m gd_madd_polynom.m gd_madd_recip.m gd_madd_sbit.m \
+						gd_madd_window.m gd_mfield_list_by_type.m gd_mfield_list.m \
+						gd_mvector_list.m gd_nfields_by_type.m gd_nfields.m \
+						gd_nmfields_by_type.m gd_nmfields.m gd_nmvectors.m gd_nvectors.m \
+						gd_put_carray.m gd_put_constant.m gd_vector_list.m \
+						getdata_constants.m
 
 mexfiles = gd_add gd_add_alias \
-				 gd_add_carray gd_add_const gd_add_spec gd_add_string gd_aliases \
+				 gd_add_carray gd_add_const \
+				 gd_add_spec gd_add_string gd_aliases \
 				 gd_alias_target gd_alter_affixes \
 				 gd_alter_encoding gd_alter_endianness gd_alter_entry \
 				 gd_alter_frameoffset \
-				 gd_alter_protection gd_alter_spec gd_bof gd_carray_len gd_carrays \
-				 gd_close gd_constants gd_delete gd_delete_alias gd_desync \
+				 gd_alter_protection gd_alter_spec gd_bof gd_array_len gd_carrays \
+				 gd_close gd_constants gd_delete gd_desync \
 				 gd_dirfilename gd_dirfile_standards \
-				 gd_discard gd_encoding gd_endianness \
+				 gd_discard gd_encoding gd_encoding_support gd_endianness \
 				 gd_entry gd_entry_list gd_entry_type gd_eof \
 				 gd_error gd_error_string gd_flags gd_flush gd_fragment_affixes \
 				 gd_fragment_index gd_fragmentname \
 				 gd_framenum gd_frameoffset gd_get_carray gd_get_carray_slice \
-				 gd_getdata gd_get_string \
-				 gd_hidden gd_hide gd_include gd_invalid_dirfile \
+				 gd_getdata \
+				 gd_get_string gd_hidden gd_hide gd_include gd_invalid_dirfile \
 				 gd_linterp_tablename gd_madd gd_madd_alias \
-				 gd_madd_carray gd_madd_const gd_madd_spec gd_madd_string \
+				 gd_madd_carray gd_madd_const \
+				 gd_madd_spec gd_madd_string \
 				 gd_malter_spec gd_mcarrays \
-				 gd_mconstants gd_metaflush gd_move gd_move_alias gd_mplex_lookback \
+				 gd_mconstants gd_metaflush gd_move gd_mplex_lookback \
 				 gd_mstrings gd_naliases gd_native_type gd_nentries gd_nfragments \
 				 gd_nframes gd_open gd_parent_fragment gd_protection \
 				 gd_put_carray_slice \
@@ -529,15 +547,15 @@ nodist_matlab_SCRIPTS = Contents.m getdata_constants.m $(matlabmexfiles) \
 											$(matlabdocfiles)
 
 lib_LTLIBRARIES = libgetdata-matlab.la
-libgetdata_matlab_la_SOURCES = matlab.c gd_matlab.h
-libgetdata_matlab_la_CPPFLAGS = ${MATLAB_CPPFLAGS} ${AM_CPPFLAGS}
-libgetdata_matlab_la_LDFLAGS = -version-info @MATLABGETDATA_VERSION@
 @GD_EXTERNAL_FALSE at libgetdata_matlab_la_LIBADD = ../../src/libgetdata.la
 @GD_EXTERNAL_TRUE at libgetdata_matlab_la_LIBADD = $(GETDATA_LIBS)
 @GD_EXTERNAL_FALSE at AM_CPPFLAGS = -I${top_srcdir}/src -I../../src
 @GD_EXTERNAL_TRUE at AM_CPPFLAGS = $(GETDATA_CFLAGS)
 @GD_EXTERNAL_FALSE at GDMX_LIBS = -L../../src/.libs -lgetdata
 @GD_EXTERNAL_TRUE at GDMX_LIBS = $(GETDATA_LIBS)
+libgetdata_matlab_la_SOURCES = matlab.c gd_matlab.h
+libgetdata_matlab_la_CPPFLAGS = ${MATLAB_CPPFLAGS} ${AM_CPPFLAGS}
+libgetdata_matlab_la_LDFLAGS = -version-info @MATLABGETDATA_VERSION@
 all: all-recursive
 
 .SUFFIXES:
diff --git a/bindings/matlab/gd_add_carray.c b/bindings/matlab/gd_add_carray.c
index 8f4a4c4..93c876a 100644
--- a/bindings/matlab/gd_add_carray.c
+++ b/bindings/matlab/gd_add_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
   D = gdmx_to_dirfile(prhs[0]);
   field_name = gdmx_to_string(prhs, 1, 0);
   const_type = gdmx_to_gd_type(prhs, 2);
-  gdmx_to_data(&data, &data_type, &n, prhs, 3);
+  gdmx_to_data(&data, &data_type, &n, prhs[3], 3);
   fragment_index = gdmx_to_int(prhs, 4);
 
   gd_add_carray(D, field_name, const_type, n, data_type, data, fragment_index);
diff --git a/bindings/matlab/gd_add_const.c b/bindings/matlab/gd_add_const.c
index 60e7943..a77efb3 100644
--- a/bindings/matlab/gd_add_const.c
+++ b/bindings/matlab/gd_add_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
   D = gdmx_to_dirfile(prhs[0]);
   field_name = gdmx_to_string(prhs, 1, 0);
   const_type = gdmx_to_gd_type(prhs, 2);
-  gdmx_to_data(&data, &data_type, &n, prhs, 3);
+  gdmx_to_data(&data, &data_type, &n, prhs[3], 3);
   fragment_index = gdmx_to_int(prhs, 4);
 
   gd_add_const(D, field_name, const_type, data_type, data, fragment_index);
diff --git a/bindings/matlab/gd_array_len.c b/bindings/matlab/gd_array_len.c
new file mode 100644
index 0000000..c9e5dbd
--- /dev/null
+++ b/bindings/matlab/gd_array_len.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2013-2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ARRAY_LEN  Report the length of a CARRAY field
+ %
+ %   L = GD_ARRAY_LEN(DIRFILE,FIELD_CODE)
+ %             reports the length, L, of the CARRAY field specified by
+ %             FIELD_CODE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alter_endianness(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ENDIANNESS, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  size_t n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_array_len(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_size_t(n);
+}
diff --git a/bindings/matlab/gd_carray_len.c b/bindings/matlab/gd_carray_len.c
deleted file mode 100644
index 275ccb1..0000000
--- a/bindings/matlab/gd_carray_len.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 2013 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#include "gd_matlab.h"
-
-/*
- % GD_CARRAY_LEN  Report the length of a CARRAY field
- %
- %   L = GD_CARRAY_LEN(DIRFILE,FIELD_CODE)
- %             reports the length, L, of the CARRAY field specified by
- %             FIELD_CODE.
- %
- %   The DIRFILE object should have previously been created with GD_OPEN.
- %
- %   See the documentation on the C API function gd_alter_endianness(3) in
- %   section 3 of the UNIX manual for more details.
- %
- %   See also GD_ENDIANNESS, GD_OPEN, GETDATA_CONSTANTS
- */
-
-void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
-{
-  DIRFILE *D;
-  void *data;
-  char *field_code;
-  size_t n;
-
-  GDMX_CHECK_RHS(2);
-
-  D = gdmx_to_dirfile(prhs[0]);
-  field_code = gdmx_to_string(prhs, 1, 0);
-
-  n = gd_carray_len(D, field_code);
-
-  mxFree(field_code);
-  gdmx_err(D, 0);
-
-  plhs[0] = gdmx_from_size_t(n);
-}
diff --git a/bindings/matlab/gd_delete_alias.c b/bindings/matlab/gd_delete_alias.c
deleted file mode 100644
index 4c1ec1d..0000000
--- a/bindings/matlab/gd_delete_alias.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 2013 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#include "gd_matlab.h"
-
-/*
- % GD_DELETE_ALIAS  Delete an alias from a dirfile
- %
- %   GD_DELETE_ALIAS(DIRFILE,NAME[,FLAGS])
- %             deletes the alias called NAME from the dirfile DIRFILE.  If
- %             given, FLAGS should be a bitwise or'd collection of zero or more
- %             of the GD.DEL_... flags provided by GETDATA_CONSTANTS.
- %
- %   The DIRFILE object should have previously been created with GD_OPEN.
- %
- %   See the documentation on the C API function gd_delete_alias(3) in
- %   section 3 of the UNIX manual for more details.
- %
- %   See also GD_DELETE, GD_OPEN, GETDATA_CONSTANTS
- */
-
-void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
-{
-  DIRFILE *D;
-  char *field_code;
-  unsigned int flags = 0;
-
-  GDMX_NO_LHS;
-  GDMX_CHECK_RHS2(2, 3);
-
-  D = gdmx_to_dirfile(prhs[0]);
-  field_code = gdmx_to_string(prhs, 1, 0);
-  if (nrhs > 2)
-    flags = gdmx_to_uint(prhs, 2);
-
-  gd_delete_alias(D, field_code, flags);
-
-  mxFree(field_code);
-  gdmx_err(D, 0);
-}
diff --git a/bindings/matlab/gd_encoding_support.c b/bindings/matlab/gd_encoding_support.c
new file mode 100644
index 0000000..576344c
--- /dev/null
+++ b/bindings/matlab/gd_encoding_support.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ENCODING_SUPPORT  Run-time detection of supported GetData encodings
+ %
+ %   N = GD_ENCODING_SUPPORT(ENCODING)
+ %             returns GD.RDWR if the ENCODING specified can be both read and
+ %             written by the library, GD.RDONLY if it can only be read, or
+ %             -1 if neither is supported, or if the specified ENCODING was
+ %             invalid.
+ %
+ %   GD.RDWR and GD.RDONLY are provided by the GETDATA_CONSTANTS() function,
+ %   and the ENCODING should be specified using one one of the GD.xxx_ENCODED
+ %   symbols provided by that function.
+ %
+ %   See the documentation on the C API function gd_encoding_support(3) in
+ %   section of the UNIX manual for more details.
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code = NULL;
+  int n;
+  unsigned long e;
+
+  GDMX_CHECK_RHS(1);
+
+  e = gdmx_to_ulong(prhs, 0);
+  n = gd_encoding_support(e);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_get_carray.c b/bindings/matlab/gd_get_carray.c
index 4a5fdb5..ce500e3 100644
--- a/bindings/matlab/gd_get_carray.c
+++ b/bindings/matlab/gd_get_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
     gdmx_err(D, 0);
   }
 
-  len = gd_carray_len(D, field_code);
+  len = gd_array_len(D, field_code);
   gdmx_err(D, 0);
 
   plhs[0] = gdmx_vector(type, len, &data);
diff --git a/bindings/matlab/gd_getdata.c b/bindings/matlab/gd_getdata.c
index 176e4a6..997c0fd 100644
--- a/bindings/matlab/gd_getdata.c
+++ b/bindings/matlab/gd_getdata.c
@@ -43,11 +43,11 @@
 void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
 {
   DIRFILE *D;
-  void *data;
   char *field_code;
   long long first_frame, first_samp;
   size_t nsamp;
   gd_type_t type;
+  void *data;
 
   GDMX_CHECK_RHS2(6,7);
 
@@ -65,8 +65,8 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
 
   plhs[0] = gdmx_vector(type, nsamp, &data);
 
-  gd_getdata64(D, field_code, (gd_off64_t)first_frame, (gd_off64_t)first_samp,
-      0, nsamp, type, data);
+  nsamp = gd_getdata64(D, field_code, (gd_off64_t)first_frame,
+      (gd_off64_t)first_samp, 0, nsamp, type, data);
 
   mxFree(field_code);
   gdmx_err(D, 0);
diff --git a/bindings/matlab/gd_madd_carray.c b/bindings/matlab/gd_madd_carray.c
index a72a75b..37b8d8f 100644
--- a/bindings/matlab/gd_madd_carray.c
+++ b/bindings/matlab/gd_madd_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
   parent = gdmx_to_string(prhs, 1, 0);
   field_name = gdmx_to_string(prhs, 2, 0);
   const_type = gdmx_to_gd_type(prhs, 3);
-  gdmx_to_data(&data, &data_type, &n, prhs, 4);
+  gdmx_to_data(&data, &data_type, &n, prhs[4], 4);
 
   gd_madd_carray(D, parent, field_name, const_type, n, data_type, data);
 
diff --git a/bindings/matlab/gd_madd_const.c b/bindings/matlab/gd_madd_const.c
index 480e824..d1851e4 100644
--- a/bindings/matlab/gd_madd_const.c
+++ b/bindings/matlab/gd_madd_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
   parent = gdmx_to_string(prhs, 1, 0);
   field_name = gdmx_to_string(prhs, 2, 0);
   const_type = gdmx_to_gd_type(prhs, 3);
-  gdmx_to_data(&data, &data_type, &n, prhs, 4);
+  gdmx_to_data(&data, &data_type, &n, prhs[4], 4);
 
   n = gd_madd_const(D, parent, field_name, const_type, data_type, data);
 
diff --git a/bindings/matlab/gd_matlab.h b/bindings/matlab/gd_matlab.h
index f3f0b83..8ba5e2e 100644
--- a/bindings/matlab/gd_matlab.h
+++ b/bindings/matlab/gd_matlab.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,6 +67,10 @@
 #define gdmx_from_entype gdmx_from_int
 #define gdmx_from_windop gdmx_from_int
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void gdmx_err(DIRFILE *, int);
 mxClassID gdmx_classid(gd_type_t);
 void gdmx_free_entry(gd_entry_t *);
@@ -76,6 +80,7 @@ void gdmx_free_entry(gd_entry_t *);
 mxArray *gdmx_from_dirfile(const DIRFILE*);
 mxArray *gdmx_from_data(const void *, gd_type_t, size_t);
 mxArray *gdmx_from_entry(const gd_entry_t*);
+mxArray *gdmx_from_nstring_list(const char **, size_t);
 mxArray *gdmx_from_string_list(const char **);
 
 #define gdmx_from_int gdmx_from_long
@@ -88,7 +93,9 @@ mxArray *gdmx_from_ulong(unsigned long);
 mxArray *gdmx_from_ullong(unsigned long long);
 
 mxArray *gdmx_from_carrays(const gd_carray_t *, gd_type_t);
+mxArray *gdmx_from_sarrays(const char ***);
 mxArray *gdmx_vector(gd_type_t, size_t, void**);
+void gdmx_fix_vector(mxArray *, gd_type_t, size_t, void*);
 
 /* convert from MATLAB type */
 DIRFILE *gdmx_to_dirfile(const mxArray *);
@@ -107,7 +114,14 @@ unsigned long gdmx_to_ulong(const mxArray **, int);
 unsigned long long gdmx_to_ullong(const mxArray **, int);
 
 size_t gdmx_to_nsamp(DIRFILE*, const char*, const mxArray**, int, int);
-void gdmx_to_data(void**, gd_type_t*, size_t*, const mxArray**, int);
+void gdmx_to_data(void**, gd_type_t*, size_t*, const mxArray*, int);
 void gdmx_free_data(void*, gd_type_t);
 
+void gdmx_to_sdata(const char***, size_t*, const mxArray*, int);
+void gdmx_free_sdata(const char**, size_t);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/bindings/matlab/gd_move.c b/bindings/matlab/gd_move.c
index b6a3ee5..8a9969d 100644
--- a/bindings/matlab/gd_move.c
+++ b/bindings/matlab/gd_move.c
@@ -23,11 +23,10 @@
 /*
  % GD_MOVE  Move a field between fragments
  %
- %   GD_MOVE(DIRFILE,FIELD_CODE,NEW_FRAGMENT[,MOVE_DATA])
+ %   GD_MOVE(DIRFILE,FIELD_CODE,NEW_FRAGMENT[,FLAGS])
  %             moves the field called FIELD_CODE to the new fragment indexed by
- %             NEW_FRAGMENT.  If MOVE_DATA is given and non-zero, and the field
- %             is a RAW field, the binary file associated with it will also be
- %             moved, if necessary.
+ %             NEW_FRAGMENT.  FLAGS should be zero or more of the GD.REN_...
+ %             symbols provided by GETDATA_CONSTANTS.
  %
  %   The DIRFILE object should have previously been created with GD_OPEN.
  %
diff --git a/bindings/matlab/gd_move_alias.c b/bindings/matlab/gd_move_alias.c
deleted file mode 100644
index ba3ad6c..0000000
--- a/bindings/matlab/gd_move_alias.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (C) 2013 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#include "gd_matlab.h"
-
-/*
- % GD_MOVE_ALIAS  Move an alias between fragments
- %
- %   GD_MOVE_ALIAS(DIRFILE,NAME,NEW_FRAGMENT)
- %             moves the alias called NAME to the fragment indexed by
- %             NEW_FRAGMENT.
- %
- %   The DIRFILE object should have previously been created with GD_OPEN.
- %
- %   See the documentation on the C API function gd_move_alias(3) in
- %   section 3 of the UNIX manual for more details.
- %
- %   See also GD_MOVE, GD_OPEN
- */
-
-void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
-{
-  DIRFILE *D;
-  char *field_code;
-  int new_frag;
-
-  GDMX_NO_LHS;
-  GDMX_CHECK_RHS(3);
-
-  D = gdmx_to_dirfile(prhs[0]);
-  field_code = gdmx_to_string(prhs, 1, 0);
-  new_frag = gdmx_to_int(prhs, 2);
-
-  gd_move_alias(D, field_code, new_frag);
-
-  mxFree(field_code);
-  gdmx_err(D, 0);
-}
diff --git a/bindings/matlab/gd_put_carray.m b/bindings/matlab/gd_put_carray.m
index bc28e49..225e6db 100644
--- a/bindings/matlab/gd_put_carray.m
+++ b/bindings/matlab/gd_put_carray.m
@@ -2,10 +2,10 @@ function gd_put_carray(D, field_code, data)
 % GD_PUT_CARRAY  Modify CARRAY values
 %
 %   GD_PUT_CARRAY(DIRFILE,FIELD_CODE,DATA)
-%             is equivalent to calling GD_PUT_ARRAY_SLICE(DIRFILE, ...
+%             is equivalent to calling GD_PUT_CARRAY_SLICE(DIRFILE, ...
 %                                                             FIELD_CODE,0,DATA)
 %
-%   See also GD_PUT_ARRAY_SLICE
+%   See also GD_PUT_CARRAY_SLICE
 
   gd_put_carray_slice(D, field_code, 0, data);
 end
diff --git a/bindings/matlab/gd_put_carray_slice.c b/bindings/matlab/gd_put_carray_slice.c
index ff6463d..b9b2e74 100644
--- a/bindings/matlab/gd_put_carray_slice.c
+++ b/bindings/matlab/gd_put_carray_slice.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
   D = gdmx_to_dirfile(prhs[0]);
   field_code = gdmx_to_string(prhs, 1, 0);
   start = gdmx_to_uint(prhs, 2);
-  gdmx_to_data(&data, &type, &nsamp, prhs, 3);
+  gdmx_to_data(&data, &type, &nsamp, prhs[3], 3);
 
   gd_put_carray_slice(D, field_code, start, nsamp, type, data);
 
diff --git a/bindings/matlab/gd_putdata.c b/bindings/matlab/gd_putdata.c
index 623b2af..171ef94 100644
--- a/bindings/matlab/gd_putdata.c
+++ b/bindings/matlab/gd_putdata.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
   field_code = gdmx_to_string(prhs, 1, 0);
   first_frame = gdmx_to_llong(prhs, 2);
   first_samp = gdmx_to_llong(prhs, 3);
-  gdmx_to_data(&data, &type, &nsamp, prhs, 4);
+  gdmx_to_data(&data, &type, &nsamp, prhs[4], 4);
 
   n = gd_putdata64(D, field_code, (gd_off64_t)first_frame,
       (gd_off64_t)first_samp, 0, nsamp, type, data);
diff --git a/bindings/matlab/getdata_constants.m b/bindings/matlab/getdata_constants.m
index aef0cbf..2020ef0 100644
--- a/bindings/matlab/getdata_constants.m
+++ b/bindings/matlab/getdata_constants.m
@@ -31,20 +31,17 @@ function GD = getdata_constants()
 %   See also GETDATA
 
   GD = struct(...
-    'VERSION', '0.8.9', ...
+    'VERSION', '0.9.0', ...
     'E_OK', int32(0), ...
-    'E_OPEN', int32(1), ...
     'E_FORMAT', int32(2), ...
-    'E_TRUNC', int32(3), ...
     'E_CREAT', int32(4), ...
     'E_BAD_CODE', int32(5), ...
     'E_BAD_TYPE', int32(6), ...
-    'E_RAW_IO', int32(7), ...
-    'E_OPEN_FRAGMENT', int32(8), ...
+    'E_IO', int32(7), ...
     'E_INTERNAL_ERROR', int32(9), ...
     'E_ALLOC', int32(10), ...
     'E_RANGE', int32(11), ...
-    'E_OPEN_LINFILE', int32(12), ...
+    'E_LUT', int32(12), ...
     'E_RECURSE_LEVEL', int32(13), ...
     'E_BAD_DIRFILE', int32(14), ...
     'E_BAD_FIELD_TYPE', int32(15), ...
@@ -64,14 +61,19 @@ function GD = getdata_constants()
     'E_EXISTS', int32(29), ...
     'E_UNCLEAN_DB', int32(30), ...
     'E_DOMAIN', int32(31), ...
-    'E_BAD_REPR', int32(32), ...
-    'E_FLUSH', int32(34), ...
+    'E_BAD_REPR', int32(5), ...
     'E_BOUNDS', int32(35), ...
     'E_LINE_TOO_LONG', int32(36), ...
-    'E_OPEN_INCLUDE', int32(8), ...
     'E_BAD_ENDIANNESS', int32(27), ...
     'E_BAD_PROTECTION', int32(27), ...
     'E_BAD_VERSION', int32(27), ...
+    'E_OPEN_LINFILE', int32(12), ...
+    'E_FLUSH', int32(7), ...
+    'E_OPEN', int32(7), ...
+    'E_OPEN_FRAGMENT', int32(7), ...
+    'E_OPEN_INCLUDE', int32(7), ...
+    'E_RAW_IO', int32(7), ...
+    'E_TRUNC', int32(7), ...
     'RDONLY', int32(0), ...
     'RDWR', int32(1), ...
     'FORCE_ENDIAN', int32(2), ...
@@ -92,6 +94,7 @@ function GD = getdata_constants()
     'TRUNCSUB', int32(32768), ...
     'AUTO_ENCODED', int32(0), ...
     'BZIP2_ENCODED', int32(83886080), ...
+    'FLAC_ENCODED', int32(167772160), ...
     'GZIP_ENCODED', int32(67108864), ...
     'LZMA_ENCODED', int32(100663296), ...
     'SIE_ENCODED', int32(117440512), ...
@@ -136,6 +139,8 @@ function GD = getdata_constants()
     'DEL_FORCE', int32(8), ...
     'REN_DATA', int32(1), ...
     'REN_UPDB', int32(2), ...
+    'REN_DANGLE', int32(4), ...
+    'REN_FORCE', int32(8), ...
     'PROTECT_NONE', int32(0), ...
     'PROTECT_FORMAT', int32(1), ...
     'PROTECT_DATA', int32(2), ...
@@ -191,6 +196,9 @@ function GD = getdata_constants()
     'ALIAS_ENTRIES', int32(-1), ...
     'ENTRIES_HIDDEN', int32(1), ...
     'ENTRIES_NOALIAS', int32(2), ...
+    'EN_CALC', int32(2), ...
+    'EN_HIDDEN', int32(4), ...
+    'EN_COMPSCAL', int32(1), ...
     'ALL_FRAGMENTS', int32(-1), ...
     'DEFAULT_LOOKBACK', int32(10), ...
     'DIRFILE_STANDARDS_VERSION', int32(9), ...
diff --git a/bindings/matlab/matlab.c b/bindings/matlab/matlab.c
index 16f0404..869aacb 100644
--- a/bindings/matlab/matlab.c
+++ b/bindings/matlab/matlab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,18 +55,18 @@
 static const char *gdmx_msgid[GD_N_ERROR_CODES] =
 {
   NULL, /* GD_E_OK */
-  GD_LIBCOMP "Open",
+  GD_LIBCOMP "Error01", /* unused */
   GD_LIBCOMP "Format",
-  GD_LIBCOMP "Trunc",
+  GD_LIBCOMP "Error03", /* unused */
   GD_LIBCOMP "Creat",
   GD_LIBCOMP "BadCode",
   GD_LIBCOMP "BadType",
-  GD_LIBCOMP "RawIO",
-  GD_LIBCOMP "OpenFragment",
+  GD_LIBCOMP "IO",
+  GD_LIBCOMP "Error08", /* unused */
   GD_LIBCOMP "InternalError",
   GD_LIBCOMP "Alloc",
   GD_LIBCOMP "Range",
-  GD_LIBCOMP "OpenLinfile",
+  GD_LIBCOMP "LUT",
   GD_LIBCOMP "RecurseLevel",
   GD_LIBCOMP "BadDirfile",
   GD_LIBCOMP "BadFieldType",
@@ -88,7 +88,7 @@ static const char *gdmx_msgid[GD_N_ERROR_CODES] =
   GD_LIBCOMP "Domain",
   GD_LIBCOMP "BadRepr",
   GD_LIBCOMP "Error33", /* unused */
-  GD_LIBCOMP "Flush",
+  GD_LIBCOMP "Error34", /* unused */
   GD_LIBCOMP "Bounds",
   GD_LIBCOMP "LineTooLong"
 };
@@ -773,7 +773,7 @@ mxArray *gdmx_from_nstring_list(const char **l, size_t n)
   mxArray *lhs;
   size_t i;
 
-  dtrace("%p", l);
+  dtrace("%p, %zu", l, n);
 
   /* create and populate cell array */
   lhs = mxCreateCellMatrix(1, n);
@@ -799,7 +799,7 @@ mxArray *gdmx_from_string_list(const char **l)
   for (i = 0; l[i]; ++i) {
     ptr = (mxArray **)mxRealloc(s, sizeof(mxArray*) * (i + 1));
     if (ptr == NULL) {
-      free(s);
+      mxFree(s);
       mexErrMsgIdAndTxt("GetData:GDMX:Alloc", "Out of memory.");
     }
     s = ptr;
@@ -954,7 +954,7 @@ mxArray *gdmx_from_entry(const gd_entry_t *E)
       mxSetField(lhs, 0, "in_fields",
           gdmx_from_nstring_list((const char**)E->in_fields,
             E->EN(lincom,n_fields)));
-      if (E->comp_scal) {
+      if (E->flags & GD_EN_COMPSCAL) {
         mxSetField(lhs, 0, "m", gdmx_from_data(E->EN(lincom,cm), GD_COMPLEX128,
               E->EN(lincom,n_fields)));
         mxSetField(lhs, 0, "b", gdmx_from_data(E->EN(lincom,cb), GD_COMPLEX128,
@@ -990,7 +990,7 @@ mxArray *gdmx_from_entry(const gd_entry_t *E)
       break;
     case GD_POLYNOM_ENTRY:
       mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0]));
-      if (E->comp_scal) {
+      if (E->flags & GD_EN_COMPSCAL) {
         mxSetField(lhs, 0, "a", gdmx_from_data(E->EN(polynom,ca), GD_COMPLEX128,
               E->EN(polynom,poly_ord) + 1));
       } else {
@@ -1006,7 +1006,7 @@ mxArray *gdmx_from_entry(const gd_entry_t *E)
       break;
     case GD_RECIP_ENTRY:
       mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0]));
-      if (E->comp_scal)
+      if (E->flags & GD_EN_COMPSCAL)
         mxSetField(lhs, 0, "dividend",
             gdmx_from_cdouble((double*)&E->EN(recip,cdividend)));
       else
@@ -1285,7 +1285,7 @@ gd_entry_t *gdmx_to_entry(const mxArray **rhs, int n, unsigned flags)
       break;
     case GD_LINCOM_ENTRY:
       E->EN(lincom,n_fields) = gdmx_convert_in_fields(rhs[n], &ctx, E);
-      E->comp_scal = 1;
+      E->flags |= GD_EN_COMPSCAL;
       gdmx_convert_entry_array(rhs[n], &ctx, "m", E->EN(lincom,cm),
           E->EN(lincom,n_fields));
       gdmx_convert_entry_array(rhs[n], &ctx, "b", E->EN(lincom,cb),
@@ -1309,7 +1309,7 @@ gd_entry_t *gdmx_to_entry(const mxArray **rhs, int n, unsigned flags)
       break;
     case GD_POLYNOM_ENTRY:
       gdmx_convert_in_fields(rhs[n], &ctx, E);
-      E->comp_scal = 1;
+      E->flags |= GD_EN_COMPSCAL;
       E->EN(polynom,poly_ord) = gdmx_convert_entry_array(rhs[n], &ctx, "a",
           E->EN(polynom,ca), GD_MAX_POLYORD + 1) - 1;
       break;
@@ -1322,7 +1322,7 @@ gd_entry_t *gdmx_to_entry(const mxArray **rhs, int n, unsigned flags)
       break;
     case GD_RECIP_ENTRY:
       gdmx_convert_in_fields(rhs[n], &ctx, E);
-      E->comp_scal = 1;
+      E->flags |= GD_EN_COMPSCAL;
       gdmx_convert_struct_scalar(rhs[n], &ctx, "dividend", GD_COMPLEX128,
           &E->EN(recip,cdividend));
       break;
@@ -1376,8 +1376,7 @@ gd_entry_t *gdmx_to_entry(const mxArray **rhs, int n, unsigned flags)
           E->scalar_ind[0] = -1;
       } else if (!mxIsCell(scalar))
         mexErrMsgIdAndTxt("GetData:GDMX:BadEntryScalars",
-            "Field 'scalar' must be a string or cell array in parameter %i", n,
-            mxGetClassName(scalar));
+            "Field 'scalar' must be a string or cell array in parameter %i", n);
       else {
         abort();
       }
@@ -1473,7 +1472,7 @@ void gdmx_fix_vector(mxArray *lhs, gd_type_t type, size_t nsamp, void *data)
 }
 
 void gdmx_to_data(void **data, gd_type_t *type, size_t *nsamp,
-    const mxArray **rhs, int n)
+    const mxArray *rhs, int n)
 {
   int cflag = 0;
   size_t i, ndims, ns = 1;
@@ -1484,16 +1483,16 @@ void gdmx_to_data(void **data, gd_type_t *type, size_t *nsamp,
   dtrace("%p, %p, %p, %p, %i", data, type, nsamp, rhs, n);
 
   /* check for complex data */
-  if (mxIsComplex(rhs[n]))
+  if (mxIsComplex(rhs))
     cflag = 1;
 
   /* datatype */
-  *type = t = gdmx_type(rhs[n], &ctx, cflag);
+  *type = t = gdmx_type(rhs, &ctx, cflag);
 
   /* length */
-  ndims = mxGetNumberOfDimensions(rhs[n]);
+  ndims = mxGetNumberOfDimensions(rhs);
 
-  dims = mxGetDimensions(rhs[n]);
+  dims = mxGetDimensions(rhs);
   for (i = 0; i < ndims; ++i)
     ns *= dims[i];
 
@@ -1505,8 +1504,8 @@ void gdmx_to_data(void **data, gd_type_t *type, size_t *nsamp,
     *data = mxMalloc(sizeof(float) * 2 * ns);
     d = (float*)*data;
 
-    pr = (float*)mxGetData(rhs[n]);
-    pi = (float*)mxGetImagData(rhs[n]);
+    pr = (float*)mxGetData(rhs);
+    pi = (float*)mxGetImagData(rhs);
 
     for (i = 0; i < ns; ++i) {
       d[i * 2] = pr[i];
@@ -1517,15 +1516,15 @@ void gdmx_to_data(void **data, gd_type_t *type, size_t *nsamp,
     *data = mxMalloc(sizeof(double) * 2 * ns);
     d = (double*)*data;
 
-    pr = (double*)mxGetData(rhs[n]);
-    pi = (double*)mxGetImagData(rhs[n]);
+    pr = (double*)mxGetData(rhs);
+    pi = (double*)mxGetImagData(rhs);
 
     for (i = 0; i < ns; ++i) {
       d[i * 2] = pr[i];
       d[i * 2 + 1] = pi[i];
     }
   } else
-    *data = mxGetData(rhs[n]);
+    *data = mxGetData(rhs);
 
   dreturn("%p; 0x%X, %zu", *data, *type, *nsamp);
 }
@@ -1539,3 +1538,40 @@ void gdmx_free_data(void *data, gd_type_t type)
 
   dreturnvoid();
 }
+
+void gdmx_to_sdata(const char ***data, size_t *nsamp, const mxArray *rhs, int n)
+{
+  size_t i, ndims, ns;
+  const mwSize *dims;
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+
+  dtrace("%p, %p, %p, %i", data, nsamp, rhs, n);
+
+  if (!mxIsCell(rhs))
+    mexErrMsgIdAndTxt("GetData:GDMX:BadData",
+        "Expected cell array of strings in %s, %i.",
+        gdmx_context(&ctx, 0), (int)mxGetClassID(rhs));
+  
+  *nsamp = ns = gdmx_get_length(rhs);
+
+  /* create the string list */
+  *data = mxMalloc(sizeof(**data) * ns);
+
+  for (i = 0; i < ns; ++i)
+    (*data)[i] = gdmx_to_string_(mxGetCell(rhs, i), &ctx, 1);
+
+  dreturn("%p; %zu", *data, *nsamp);
+}
+
+void gdmx_free_sdata(const char **data, size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %zu", data, n);
+
+  for (i = 0; i < n; ++i)
+    mxFree((char*)data[i]);
+  mxFree(data);
+
+  dreturnvoid();
+}
diff --git a/bindings/matlab/test/Makefile.am b/bindings/matlab/test/Makefile.am
index bdd3c05..97992d3 100644
--- a/bindings/matlab/test/Makefile.am
+++ b/bindings/matlab/test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2013, 2015 D. V. Wiebe
+# Copyright (C) 2013, 2014, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/bindings/matlab/test/Makefile.in b/bindings/matlab/test/Makefile.in
index ccab349..b086184 100644
--- a/bindings/matlab/test/Makefile.in
+++ b/bindings/matlab/test/Makefile.in
@@ -83,10 +83,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -165,6 +163,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -190,8 +190,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -239,7 +250,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -254,12 +264,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -323,9 +337,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -333,6 +348,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -346,7 +362,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2013, 2015 D. V. Wiebe
+# Copyright (C) 2013, 2014, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/bindings/matlab/test/big_test.m b/bindings/matlab/test/big_test.m
index 631f146..51f71d6 100644
--- a/bindings/matlab/test/big_test.m
+++ b/bindings/matlab/test/big_test.m
@@ -48,12 +48,13 @@ try
   'phase PHASE data 11\n'...
   'window WINDOW linterp mult LT 4.1\n'...
   '/ALIAS alias data\n'...
-  'string STRING "Zaphod Beeblebrox"\n'];
+  'string STRING "Zaphod Beeblebrox"\n'...
+  ];
   form2_data = 'const2 CONST INT8 -19\n';
 
   fields = {'INDEX'; 'alias'; 'bit'; 'carray'; 'const'; 'data'; 'div'; ...
-  'lincom'; 'linterp'; 'mplex'; 'mult'; 'phase'; 'polynom'; 'recip'; 'sbit'; ...
-  'string'; 'window'};
+  'lincom'; 'linterp'; 'mplex'; 'mult'; 'phase'; 'polynom'; 'recip'; ...
+  'sbit'; 'string'; 'window'};
   nfields = 17;
 
   % Create the dirfile
@@ -72,1223 +73,1224 @@ try
   fwrite(fid, data_data);
   fclose(fid);
 
-  % 140: getdata_constants check
+  % 0: getdata_constants check
   GD = getdata_constants();
-  ne = ne + check_num(140, GD.RDWR, 1);
+  ne = ne + check_num(0, GD.RDWR, 1);
 
-  % 0: gd_error check
+  % 1: gd_error check
   try
     D = gd_open('x');
   catch exc
-    ne = ne + check_exc(exc, 0, 'Open');
+    ne = ne + check_exc(exc, 1, 'IO');
   end
 
-  % 1: gd_open check
+  % 2: gd_open check
   try
     D = gd_open(filedir, GD.RDWR);
   catch exc
-    ne = ne + check_ok(exc, 1);
+    ne = ne + check_ok(exc, 2);
   end
 
-  % 2: getdata check
+  % 3: getdata check
   try
     d = gd_getdata(D, 'data', 5, 0, 1, 0);
-    ne = ne + check_array(2, d, [40:47]);
+    ne = ne + check_array(3, d, [40:47]);
   catch exc
-    ne = ne + check_ok(exc, 2);
+    ne = ne + check_ok(exc, 3);
   end
 
-  % 108: getdata check (complex128)
+  % 10: getdata check (complex128)
   try
     d = gd_getdata(D, 'data', 5, 0, 1, 0, GD.COMPLEX128);
     ne = ne + check_array(2, d, [ complex(40,0), complex(41,0), ...
     complex(42,0), complex(43,0), complex(44,0), complex(45,0), ...
     complex(46,0), complex(47,0) ]);
   catch exc
-    ne = ne + check_ok(exc, 108);
+    ne = ne + check_ok(exc, 10);
   end
 
-  % 3: gd_get_constant check
+  % 12: gd_get_constant check
   try
     d = gd_get_constant(D, 'const');
-    ne = ne + check_num(3, d, 5.5);
+    ne = ne + check_num(12, d, 5.5);
   catch exc
-    ne = ne + check_ok(exc, 3);
+    ne = ne + check_ok(exc, 12);
   end
 
-  % 6: gd_nfields check
+  % 23: gd_nfields check
   try
     d = gd_nfields(D);
-    ne = ne + check_num(6, d, nfields);
+    ne = ne + check_num(23, d, nfields);
   catch exc
-    ne = ne + check_ok(exc, 6);
+    ne = ne + check_ok(exc, 23);
   end
 
-  % 8: gd_field_list check
+  % 25: gd_field_list check
   try
     d = gd_field_list(D);
-    ne = ne + check_sarray(8, d, fields);
+    ne = ne + check_sarray(25, d, fields);
   catch exc
-    ne = ne + check_ok(exc, 8);
+    ne = ne + check_ok(exc, 25);
   end
 
-  % 9: gd_nmfields check
+  % 26: gd_nmfields check
   try
     d = gd_nmfields(D, 'data');
-    ne = ne + check_num(9, d, 4);
+    ne = ne + check_num(26, d, 4);
   catch exc
-    ne = ne + check_ok(exc, 9);
+    ne = ne + check_ok(exc, 26);
   end
 
-  % 10: gd_mfield_list check
+  % 27: gd_mfield_list check
   try
     d = gd_mfield_list(D, 'data');
-    ne = ne + check_sarray(10, d, { 'mstr'; 'mconst'; 'mcarray'; 'mlut' });
+    ne = ne + check_sarray(27, d, ...
+    { 'mstr'; 'mconst'; 'mcarray'; 'mlut'; });
   catch exc
-    ne = ne + check_ok(exc, 10);
+    ne = ne + check_ok(exc, 27);
   end
 
-  % 11: gd_nframes check
+  % 28: gd_nframes check
   try
     d = gd_nframes(D);
-    ne = ne + check_num(11, d, 10);
+    ne = ne + check_num(28, d, 10);
   catch exc
-    ne = ne + check_ok(exc, 11);
+    ne = ne + check_ok(exc, 28);
   end
 
-  % 12: gd_spf check
+  % 29: gd_spf check
   try
     d = gd_spf(D, 'data');
-    ne = ne + check_num(12, d, 8);
+    ne = ne + check_num(29, d, 8);
   catch exc
-    ne = ne + check_ok(exc, 12);
+    ne = ne + check_ok(exc, 29);
   end
 
-  % 13: gd_putdata check
+  % 30: gd_putdata check
   p = [ 13, 14, 15, 16 ];
   try
     d = gd_putdata(D, 'data', 5, 1, p);
-    ne = ne + check_num(13, d, 4);
+    ne = ne + check_num(30, d, 4);
   catch exc
-    ne = ne + check_ok2(exc, 13, 1);
+    ne = ne + check_ok2(exc, 30, 1);
   end
 
   try
     d = gd_getdata(D, 'data', 5, 0, 1, 0);
   catch exc
-    ne = ne + check_ok2(exc, 13, 2);
+    ne = ne + check_ok2(exc, 30, 2);
   end
 
-  % 124: gd_putdata check (complex)
+  % 37: gd_putdata check (complex)
   p = [ complex(33,0), complex(34,0), complex(35,0), complex(36,0) ];
   try
     d = gd_putdata(D, 'data', 5, 1, p);
-    ne = ne + check_num(124, d, 4);
+    ne = ne + check_num(37, d, 4);
   catch exc
-    ne = ne + check_ok2(exc, 124, 1);
+    ne = ne + check_ok2(exc, 37, 1);
   end
 
   try
     d = gd_getdata(D, 'data', 5, 0, 1, 0);
-    ne = ne + check_array(124, d, [40, 33, 34, 35, 36, 45, 46, 47]);
+    ne = ne + check_array(37, d, [40, 33, 34, 35, 36, 45, 46, 47]);
   catch exc
-    ne = ne + check_ok2(exc, 124, 2);
+    ne = ne + check_ok2(exc, 37, 2);
   end
 
-  % 14: error_string
+  % 38: error_string
   try
     gd_getdata(D, 'x', 1, 0, 1, 0);
   catch exc
-    ne = ne + check_exc(exc, 14, 'BadCode');
+    ne = ne + check_exc(exc, 38, 'BadCode');
   end
-  ne = ne + check_num(14, gd_error(D), GD.E_BAD_CODE);
-  ne = ne + check_string(14, gd_error_string(D), 'Field not found: x');
+  ne = ne + check_num(38, gd_error(D), GD.E_BAD_CODE);
+  ne = ne + check_string(38, gd_error_string(D), 'Field not found: x');
 
-  % 15: entry_type
+  % 39: entry_type
   try
     d = gd_entry_type(D, 'data');
-    ne = ne + check_num(15, d, GD.RAW_ENTRY);
+    ne = ne + check_num(39, d, GD.RAW_ENTRY);
   catch exc
-    ne = ne + check_ok(exc, 15);
+    ne = ne + check_ok(exc, 39);
   end
 
-  % 16: entry (raw) check
+  % 40: entry (raw) check
   try
     d = gd_entry(D, 'data');
-    ne = ne + check_string2(16, 1, d.field, 'data');
-    ne = ne + check_num2(16, 2, d.field_type, GD.RAW_ENTRY);
-    ne = ne + check_num2(16, 3, d.fragment_index, 0);
-    ne = ne + check_num2(16, 4, d.data_type, GD.INT8);
+    ne = ne + check_string2(40, 1, d.field, 'data');
+    ne = ne + check_num2(40, 2, d.field_type, GD.RAW_ENTRY);
+    ne = ne + check_num2(40, 3, d.fragment_index, 0);
+    ne = ne + check_num2(40, 4, d.data_type, GD.INT8);
   catch exc
-    ne = ne + check_ok(exc, 16);
+    ne = ne + check_ok(exc, 40);
   end
 
-  % 18: entry (lincom) check
+  % 42: entry (lincom) check
   try
     d = gd_entry(D, 'lincom');
-    ne = ne + check_string2(18, 1, d.field, 'lincom');
-    ne = ne + check_num2(18, 2, d.field_type, GD.LINCOM_ENTRY);
-    ne = ne + check_num2(18, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(18, 4, d.in_fields, { 'data'; 'INDEX'; 'linterp' });
-    ne = ne + check_array2(18, 5, d.m, [ 1.1, 2.2, 5.5 ]);
-    ne = ne + check_array2(18, 6, d.b, [ 2.2, complex(3.3,4.4), 5.5 ]);
-    ne = ne + check_sarray2(18, 7, d.scalar, {0; 0; 'const'; 0; 0; 'const'});
-    ne = ne + check_array2(18, 8, d.scalar_ind, [0, 0, -1, 0, 0, -1]);
+    ne = ne + check_string2(42, 1, d.field, 'lincom');
+    ne = ne + check_num2(42, 2, d.field_type, GD.LINCOM_ENTRY);
+    ne = ne + check_num2(42, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(42, 4, d.in_fields, { 'data'; 'INDEX'; 'linterp' });
+    ne = ne + check_array2(42, 5, d.m, [ 1.1, 2.2, 5.5 ]);
+    ne = ne + check_array2(42, 6, d.b, [ 2.2, complex(3.3,4.4), 5.5 ]);
+    ne = ne + check_sarray2(42, 7, d.scalar, {0; 0; 'const'; 0; 0; 'const'});
+    ne = ne + check_array2(42, 8, d.scalar_ind, [0, 0, -1, 0, 0, -1]);
   catch exc
-    ne = ne + check_ok(exc, 18);
+    ne = ne + check_ok(exc, 42);
   end
 
-  % 20: entry (polynom) check
+  % 44: entry (polynom) check
   try
     d = gd_entry(D, 'polynom');
-    ne = ne + check_string2(20, 1, d.field, 'polynom');
-    ne = ne + check_num2(20, 2, d.field_type, GD.POLYNOM_ENTRY);
-    ne = ne + check_num2(20, 3, d.fragment_index, 0);
-    ne = ne + check_string2(20, 4, d.in_fields, 'data');
-    ne = ne + check_array2(20, 5, d.a, [ 1.1, 2.2, 2.2, complex(3.3, 4.4), ...
+    ne = ne + check_string2(44, 1, d.field, 'polynom');
+    ne = ne + check_num2(44, 2, d.field_type, GD.POLYNOM_ENTRY);
+    ne = ne + check_num2(44, 3, d.fragment_index, 0);
+    ne = ne + check_string2(44, 4, d.in_fields, 'data');
+    ne = ne + check_array2(44, 5, d.a, [ 1.1, 2.2, 2.2, complex(3.3, 4.4), ...
     5.5, 5.5]);
-    ne = ne + check_sarray2(20, 6, d.scalar, {0; 0; 0; 0; 'const'; 'const'});
-    ne = ne + check_array2(20, 7, d.scalar_ind, [0, 0, 0, 0, -1, -1]);
+    ne = ne + check_sarray2(44, 6, d.scalar, {0; 0; 0; 0; 'const'; 'const'});
+    ne = ne + check_array2(44, 7, d.scalar_ind, [0, 0, 0, 0, -1, -1]);
   catch exc
-    ne = ne + check_ok(exc, 20);
+    ne = ne + check_ok(exc, 44);
   end
 
-  % 21: entry (linterp) check
+  % 45: entry (linterp) check
   try
     d = gd_entry(D, 'linterp');
-    ne = ne + check_string2(21, 1, d.field, 'linterp');
-    ne = ne + check_num2(21, 2, d.field_type, GD.LINTERP_ENTRY);
-    ne = ne + check_num2(21, 3, d.fragment_index, 0);
-    ne = ne + check_string2(21, 4, d.in_fields, 'data');
-    ne = ne + check_string2(21, 5, d.table, './lut');
+    ne = ne + check_string2(45, 1, d.field, 'linterp');
+    ne = ne + check_num2(45, 2, d.field_type, GD.LINTERP_ENTRY);
+    ne = ne + check_num2(45, 3, d.fragment_index, 0);
+    ne = ne + check_string2(45, 4, d.in_fields, 'data');
+    ne = ne + check_string2(45, 5, d.table, './lut');
   catch exc
-    ne = ne + check_ok(exc, 21);
+    ne = ne + check_ok(exc, 45);
   end
 
-  % 22: entry (bit) check
+  % 46: entry (bit) check
   try
     d = gd_entry(D, 'bit');
-    ne = ne + check_string2(22, 1, d.field, 'bit');
-    ne = ne + check_num2(22, 2, d.field_type, GD.BIT_ENTRY);
-    ne = ne + check_num2(22, 3, d.fragment_index, 0);
-    ne = ne + check_string2(22, 4, d.in_fields, 'data');
-    ne = ne + check_num2(22, 5, d.bitnum, 3);
-    ne = ne + check_num2(22, 6, d.numbits, 4);
+    ne = ne + check_string2(46, 1, d.field, 'bit');
+    ne = ne + check_num2(46, 2, d.field_type, GD.BIT_ENTRY);
+    ne = ne + check_num2(46, 3, d.fragment_index, 0);
+    ne = ne + check_string2(46, 4, d.in_fields, 'data');
+    ne = ne + check_num2(46, 5, d.bitnum, 3);
+    ne = ne + check_num2(46, 6, d.numbits, 4);
   catch exc
-    ne = ne + check_ok(exc, 22);
+    ne = ne + check_ok(exc, 46);
   end
 
-  % 23: entry (sbit) check
+  % 47: entry (sbit) check
   try
     d = gd_entry(D, 'sbit');
-    ne = ne + check_string2(23, 1, d.field, 'sbit');
-    ne = ne + check_num2(23, 2, d.field_type, GD.SBIT_ENTRY);
-    ne = ne + check_num2(23, 3, d.fragment_index, 0);
-    ne = ne + check_string2(23, 4, d.in_fields, 'data');
-    ne = ne + check_num2(23, 5, d.bitnum, 5);
-    ne = ne + check_num2(23, 6, d.numbits, 6);
+    ne = ne + check_string2(47, 1, d.field, 'sbit');
+    ne = ne + check_num2(47, 2, d.field_type, GD.SBIT_ENTRY);
+    ne = ne + check_num2(47, 3, d.fragment_index, 0);
+    ne = ne + check_string2(47, 4, d.in_fields, 'data');
+    ne = ne + check_num2(47, 5, d.bitnum, 5);
+    ne = ne + check_num2(47, 6, d.numbits, 6);
   catch exc
-    ne = ne + check_ok(exc, 23);
+    ne = ne + check_ok(exc, 47);
   end
 
-  % 24: entry (mult) check
+  % 48: entry (mult) check
   try
     d = gd_entry(D, 'mult');
-    ne = ne + check_string2(24, 1, d.field, 'mult');
-    ne = ne + check_num2(24, 2, d.field_type, GD.MULTIPLY_ENTRY);
-    ne = ne + check_num2(24, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(24, 4, d.in_fields, { 'data'; 'sbit'; });
+    ne = ne + check_string2(48, 1, d.field, 'mult');
+    ne = ne + check_num2(48, 2, d.field_type, GD.MULTIPLY_ENTRY);
+    ne = ne + check_num2(48, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(48, 4, d.in_fields, { 'data'; 'sbit'; });
   catch exc
-    ne = ne + check_ok(exc, 24);
+    ne = ne + check_ok(exc, 48);
   end
 
-  % 25: entry (phase) check
+  % 49: entry (phase) check
   try
     d = gd_entry(D, 'phase');
-    ne = ne + check_string2(25, 1, d.field, 'phase');
-    ne = ne + check_num2(25, 2, d.field_type, GD.PHASE_ENTRY);
-    ne = ne + check_num2(25, 3, d.fragment_index, 0);
-    ne = ne + check_string2(25, 4, d.in_fields, 'data');
-    ne = ne + check_num2(25, 5, d.shift, 11);
+    ne = ne + check_string2(49, 1, d.field, 'phase');
+    ne = ne + check_num2(49, 2, d.field_type, GD.PHASE_ENTRY);
+    ne = ne + check_num2(49, 3, d.fragment_index, 0);
+    ne = ne + check_string2(49, 4, d.in_fields, 'data');
+    ne = ne + check_num2(49, 5, d.shift, 11);
   catch exc
-    ne = ne + check_ok(exc, 25);
+    ne = ne + check_ok(exc, 49);
   end
 
-  % 26: entry (const) check
+  % 50: entry (const) check
   try
     d = gd_entry(D, 'const');
-    ne = ne + check_string2(26, 1, d.field, 'const');
-    ne = ne + check_num2(26, 2, d.field_type, GD.CONST_ENTRY);
-    ne = ne + check_num2(26, 3, d.fragment_index, 0);
-    ne = ne + check_num2(26, 5, d.const_type, GD.FLOAT64);
+    ne = ne + check_string2(50, 1, d.field, 'const');
+    ne = ne + check_num2(50, 2, d.field_type, GD.CONST_ENTRY);
+    ne = ne + check_num2(50, 3, d.fragment_index, 0);
+    ne = ne + check_num2(50, 5, d.const_type, GD.FLOAT64);
   catch exc
-    ne = ne + check_ok(exc, 26);
+    ne = ne + check_ok(exc, 50);
   end
 
-  % 134: entry (string) check
+  % 51: entry (string) check
   try
     d = gd_entry(D, 'string');
-    ne = ne + check_string2(134, 1, d.field, 'string');
-    ne = ne + check_num2(134, 2, d.field_type, GD.STRING_ENTRY);
-    ne = ne + check_num2(134, 3, d.fragment_index, 0);
+    ne = ne + check_string2(51, 1, d.field, 'string');
+    ne = ne + check_num2(51, 2, d.field_type, GD.STRING_ENTRY);
+    ne = ne + check_num2(51, 3, d.fragment_index, 0);
   catch exc
-    ne = ne + check_ok(exc, 134);
+    ne = ne + check_ok(exc, 51);
   end
 
-  % 27: gd_fragment_index check
+  % 52: gd_fragment_index check
   try
     d = gd_fragment_index(D, 'data');
   catch exc
-    ne = ne + check_ok(exc, 27);
+    ne = ne + check_ok(exc, 52);
   end
-  ne = ne + check_num(27, d, 0);
+  ne = ne + check_num(52, d, 0);
 
-  % 28: add_raw
+  % 53: add_raw
   try
     gd_add_raw(D, 'new1', GD.FLOAT64, 3, 0);
   catch exc
-    ne = ne + check_ok2(exc, 28, 1);
+    ne = ne + check_ok2(exc, 53, 1);
   end
 
   try
     d = gd_entry(D, 'new1');
-    ne = ne + check_string2(28, 1, d.field, 'new1');
-    ne = ne + check_num2(28, 2, d.field_type, GD.RAW_ENTRY);
-    ne = ne + check_num2(28, 3, d.fragment_index, 0);
-    ne = ne + check_num2(28, 4, d.data_type, GD.FLOAT64);
-    ne = ne + check_num2(28, 4, d.spf, 3);
+    ne = ne + check_string2(53, 1, d.field, 'new1');
+    ne = ne + check_num2(53, 2, d.field_type, GD.RAW_ENTRY);
+    ne = ne + check_num2(53, 3, d.fragment_index, 0);
+    ne = ne + check_num2(53, 4, d.data_type, GD.FLOAT64);
+    ne = ne + check_num2(53, 4, d.spf, 3);
   catch exc
-    ne = ne + check_ok2(exc, 28, 2);
+    ne = ne + check_ok2(exc, 53, 2);
   end
 
-  % 29: add entry (lincom) check
+  % 54: add entry (lincom) check
   try
     gd_add_lincom(D, 'new2', { 'in1'; 'in2' }, [9.9, 7.7], [8.8, 6.6], 0);
   catch exc
-    ne = ne + check_ok2(exc, 29, 1);
+    ne = ne + check_ok2(exc, 54, 1);
   end
 
   try
     d = gd_entry(D, 'new2');
-    ne = ne + check_string2(29, 1, d.field, 'new2');
-    ne = ne + check_num2(29, 2, d.field_type, GD.LINCOM_ENTRY);
-    ne = ne + check_num2(29, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(29, 4, d.in_fields, { 'in1'; 'in2' });
-    ne = ne + check_array2(29, 5, d.m, [ 9.9, 7.7 ]);
-    ne = ne + check_array2(29, 6, d.b, [ 8.8, 6.6 ]);
+    ne = ne + check_string2(54, 1, d.field, 'new2');
+    ne = ne + check_num2(54, 2, d.field_type, GD.LINCOM_ENTRY);
+    ne = ne + check_num2(54, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(54, 4, d.in_fields, { 'in1'; 'in2' });
+    ne = ne + check_array2(54, 5, d.m, [ 9.9, 7.7 ]);
+    ne = ne + check_array2(54, 6, d.b, [ 8.8, 6.6 ]);
   catch exc
-    ne = ne + check_ok2(exc, 29, 2);
+    ne = ne + check_ok2(exc, 54, 2);
   end
 
-  % 32: add entry (polynom) check
+  % 57: add entry (polynom) check
   try
     gd_add_polynom(D, 'new5', 'in1', [3.9, 4.8, 5.7, complex(6.6,7.5)], 0);
   catch exc
-    ne = ne + check_ok2(exc, 32, 1);
+    ne = ne + check_ok2(exc, 57, 1);
   end
 
   try
     d = gd_entry(D, 'new5');
-    ne = ne + check_string2(32, 1, d.field, 'new5');
-    ne = ne + check_num2(32, 2, d.field_type, GD.POLYNOM_ENTRY);
-    ne = ne + check_num2(32, 3, d.fragment_index, 0);
-    ne = ne + check_string2(32, 4, d.in_fields, 'in1');
-    ne = ne + check_array2(32, 5, d.a, [3.9, 4.8, 5.7, complex(6.6,7.5)]);
+    ne = ne + check_string2(57, 1, d.field, 'new5');
+    ne = ne + check_num2(57, 2, d.field_type, GD.POLYNOM_ENTRY);
+    ne = ne + check_num2(57, 3, d.fragment_index, 0);
+    ne = ne + check_string2(57, 4, d.in_fields, 'in1');
+    ne = ne + check_array2(57, 5, d.a, [3.9, 4.8, 5.7, complex(6.6,7.5)]);
   catch exc
-    ne = ne + check_ok2(exc, 32, 2);
+    ne = ne + check_ok2(exc, 57, 2);
   end
 
-  % 33: add entry (linterp) check
+  % 58: add entry (linterp) check
   try
     gd_add_linterp(D, 'new6', 'in', './some/table', 0);
   catch exc
-    ne = ne + check_ok2(exc, 33, 1);
+    ne = ne + check_ok2(exc, 58, 1);
   end
 
   try
     d = gd_entry(D, 'new6');
-    ne = ne + check_string2(33, 1, d.field, 'new6');
-    ne = ne + check_num2(33, 2, d.field_type, GD.LINTERP_ENTRY);
-    ne = ne + check_num2(33, 3, d.fragment_index, 0);
-    ne = ne + check_string2(33, 4, d.in_fields, 'in');
-    ne = ne + check_string2(33, 5, d.table, './some/table');
+    ne = ne + check_string2(58, 1, d.field, 'new6');
+    ne = ne + check_num2(58, 2, d.field_type, GD.LINTERP_ENTRY);
+    ne = ne + check_num2(58, 3, d.fragment_index, 0);
+    ne = ne + check_string2(58, 4, d.in_fields, 'in');
+    ne = ne + check_string2(58, 5, d.table, './some/table');
   catch exc
-    ne = ne + check_ok2(exc, 33, 2);
+    ne = ne + check_ok2(exc, 58, 2);
   end
 
-  % 34: add entry (bit) check
+  % 59: add entry (bit) check
   try
     gd_add_bit(D, 'new7', 'in', 13, 12, 0);
   catch exc
-    ne = ne + check_ok2(exc, 34, 1);
+    ne = ne + check_ok2(exc, 59, 1);
   end
 
   try
     d = gd_entry(D, 'new7');
-    ne = ne + check_string2(34, 1, d.field, 'new7');
-    ne = ne + check_num2(34, 2, d.field_type, GD.BIT_ENTRY);
-    ne = ne + check_num2(34, 3, d.fragment_index, 0);
-    ne = ne + check_string2(34, 4, d.in_fields, 'in');
-    ne = ne + check_num2(34, 5, d.bitnum, 13);
-    ne = ne + check_num2(34, 6, d.numbits, 12);
+    ne = ne + check_string2(59, 1, d.field, 'new7');
+    ne = ne + check_num2(59, 2, d.field_type, GD.BIT_ENTRY);
+    ne = ne + check_num2(59, 3, d.fragment_index, 0);
+    ne = ne + check_string2(59, 4, d.in_fields, 'in');
+    ne = ne + check_num2(59, 5, d.bitnum, 13);
+    ne = ne + check_num2(59, 6, d.numbits, 12);
   catch exc
-    ne = ne + check_ok2(exc, 34, 2);
+    ne = ne + check_ok2(exc, 59, 2);
   end
 
-  % 35: add entry (sbit) check
+  % 60: add entry (sbit) check
   try
     gd_add_sbit(D, 'new8', 'in', 14, 15, 0);
   catch exc
-    ne = ne + check_ok2(exc, 35, 1);
+    ne = ne + check_ok2(exc, 60, 1);
   end
 
   try
     d = gd_entry(D, 'new8');
-    ne = ne + check_string2(35, 1, d.field, 'new8');
-    ne = ne + check_num2(35, 2, d.field_type, GD.SBIT_ENTRY);
-    ne = ne + check_num2(35, 3, d.fragment_index, 0);
-    ne = ne + check_string2(35, 4, d.in_fields, 'in');
-    ne = ne + check_num2(35, 5, d.bitnum, 14);
-    ne = ne + check_num2(35, 6, d.numbits, 15);
+    ne = ne + check_string2(60, 1, d.field, 'new8');
+    ne = ne + check_num2(60, 2, d.field_type, GD.SBIT_ENTRY);
+    ne = ne + check_num2(60, 3, d.fragment_index, 0);
+    ne = ne + check_string2(60, 4, d.in_fields, 'in');
+    ne = ne + check_num2(60, 5, d.bitnum, 14);
+    ne = ne + check_num2(60, 6, d.numbits, 15);
   catch exc
-    ne = ne + check_ok2(exc, 35, 2);
+    ne = ne + check_ok2(exc, 60, 2);
   end
 
-  % 36: add entry (mult) check
+  % 61: add entry (mult) check
   try
     gd_add_multiply(D, 'new9', 'in1', 'in2', 0);
   catch exc
-    ne = ne + check_ok2(exc, 36, 1);
+    ne = ne + check_ok2(exc, 61, 1);
   end
 
   try
     d = gd_entry(D, 'new9');
-    ne = ne + check_string2(36, 1, d.field, 'new9');
-    ne = ne + check_num2(36, 2, d.field_type, GD.MULTIPLY_ENTRY);
-    ne = ne + check_num2(36, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(36, 4, d.in_fields, { 'in1'; 'in2'; });
+    ne = ne + check_string2(61, 1, d.field, 'new9');
+    ne = ne + check_num2(61, 2, d.field_type, GD.MULTIPLY_ENTRY);
+    ne = ne + check_num2(61, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(61, 4, d.in_fields, { 'in1'; 'in2'; });
   catch exc
-    ne = ne + check_ok2(exc, 36, 2);
+    ne = ne + check_ok2(exc, 61, 2);
   end
 
-  % 37: add entry (phase) check
+  % 62: add entry (phase) check
   try
     gd_add_phase(D, 'new10', 'in1', 22, 0);
   catch exc
-    ne = ne + check_ok2(exc, 37, 1);
+    ne = ne + check_ok2(exc, 62, 1);
   end
 
   try
     d = gd_entry(D, 'new10');
-    ne = ne + check_string2(37, 1, d.field, 'new10');
-    ne = ne + check_num2(37, 2, d.field_type, GD.PHASE_ENTRY);
-    ne = ne + check_num2(37, 3, d.fragment_index, 0);
-    ne = ne + check_string2(37, 4, d.in_fields, 'in1');
-    ne = ne + check_num2(37, 5, d.shift, 22);
+    ne = ne + check_string2(62, 1, d.field, 'new10');
+    ne = ne + check_num2(62, 2, d.field_type, GD.PHASE_ENTRY);
+    ne = ne + check_num2(62, 3, d.fragment_index, 0);
+    ne = ne + check_string2(62, 4, d.in_fields, 'in1');
+    ne = ne + check_num2(62, 5, d.shift, 22);
   catch exc
-    ne = ne + check_ok2(exc, 37, 2);
+    ne = ne + check_ok2(exc, 62, 2);
   end
 
-  % 38: add entry (const) check
+  % 63: add entry (const) check
   try
     gd_add_const(D, 'new11', GD.COMPLEX128, 2.6, 0);
   catch exc
-    ne = ne + check_ok2(exc, 38, 1);
+    ne = ne + check_ok2(exc, 63, 1);
   end
 
   try
     d = gd_entry(D, 'new11');
-    ne = ne + check_string2(38, 1, d.field, 'new11');
-    ne = ne + check_num2(38, 2, d.field_type, GD.CONST_ENTRY);
-    ne = ne + check_num2(38, 3, d.fragment_index, 0);
-    ne = ne + check_num2(38, 5, d.const_type, GD.COMPLEX128);
+    ne = ne + check_string2(63, 1, d.field, 'new11');
+    ne = ne + check_num2(63, 2, d.field_type, GD.CONST_ENTRY);
+    ne = ne + check_num2(63, 3, d.fragment_index, 0);
+    ne = ne + check_num2(63, 5, d.const_type, GD.COMPLEX128);
   catch exc
-    ne = ne + check_ok2(exc, 38, 2);
+    ne = ne + check_ok2(exc, 63, 2);
   end
 
   try
     d = gd_get_constant(D, 'new11', GD.FLOAT64);
-    ne = ne + check_num2(38, 6, d, 2.6);
+    ne = ne + check_num2(63, 6, d, 2.6);
   catch exc
-    ne = ne + check_ok2(exc, 38, 3);
+    ne = ne + check_ok2(exc, 63, 3);
   end
 
-  % 39: fragmentname
+  % 64: fragmentname
   try
     d = gd_fragmentname(D, 0);
-    ne = ne + check_eostring(39, d, 'dirfile/format');
+    ne = ne + check_eostring(64, d, 'dirfile/format');
   catch exc
-    ne = ne + check_ok(exc, 39);
+    ne = ne + check_ok(exc, 64);
   end
 
-  % 40: nfragments
+  % 65: nfragments
   try
     d = gd_nfragments(D);
-    ne = ne + check_num(40, d, 1);
+    ne = ne + check_num(65, d, 1);
   catch exc
-    ne = ne + check_ok(exc, 40);
+    ne = ne + check_ok(exc, 65);
   end
 
-  % 41: include
+  % 66: include
   try
     d = gd_include(D, 'form2', 0, 0);
-    ne = ne + check_num2(41, 1, d, 1);
+    ne = ne + check_num2(66, 1, d, 1);
   catch exc
-    ne = ne + check_ok2(exc, 41, 1);
+    ne = ne + check_ok2(exc, 66, 1);
   end
 
   try
     d = gd_get_constant(D, 'const2');
-    ne = ne + check_num2(41, 2, d, -19);
+    ne = ne + check_num2(66, 2, d, -19);
   catch exc
-    ne = ne + check_ok2(exc, 41, 2);
+    ne = ne + check_ok2(exc, 66, 2);
   end
 
-  % 42: nfields_by_type
+  % 67: nfields_by_type
   try
     d = gd_nfields_by_type(D, GD.LINCOM_ENTRY);
-    ne = ne + check_num(42, d, 2);
+    ne = ne + check_num(67, d, 2);
   catch exc
-    ne = ne + check_ok(exc, 42);
+    ne = ne + check_ok(exc, 67);
   end
 
-  % 43: field_list_by_type
+  % 68: field_list_by_type
   try
     d = gd_field_list_by_type(D, GD.LINCOM_ENTRY);
-    ne = ne + check_sarray(43, d, { 'lincom', 'new2' });
+    ne = ne + check_sarray(68, d, { 'lincom', 'new2' });
   catch exc
-    ne = ne + check_ok(exc, 43);
+    ne = ne + check_ok(exc, 68);
   end
 
-  % 44: nfields_by_type
+  % 69: nfields_by_type
   try
     d = gd_nvectors(D);
-    ne = ne + check_num(44, d, 22);
+    ne = ne + check_num(69, d, 22);
   catch exc
-    ne = ne + check_ok(exc, 44);
+    ne = ne + check_ok(exc, 69);
   end
 
-  % 45: vector_list check
+  % 70: vector_list check
   try
     d = gd_vector_list(D);
-    ne = ne + check_sarray(45, d, ...
-    {'INDEX'; 'alias'; 'bit'; 'data'; 'div'; 'lincom'; 'linterp'; 'mplex'; ...
-    'mult'; 'new1'; 'new10'; 'new2'; 'new5'; 'new6'; 'new7'; 'new8'; 'new9'; ...
-    'phase'; 'polynom'; 'recip'; 'sbit'; 'window'});
+    ne = ne + check_sarray(70, d, ...
+    {'INDEX'; 'alias'; 'bit'; 'data'; 'div'; 'lincom'; 'linterp'; ...
+    'mplex'; 'mult'; 'new1'; 'new10'; 'new2'; 'new5'; 'new6'; 'new7'; ...
+    'new8'; 'new9'; 'phase'; 'polynom'; 'recip'; 'sbit'; 'window'});
   catch exc
-    ne = ne + check_ok(exc, 45);
+    ne = ne + check_ok(exc, 70);
   end
 
-  % 46: madd entry (lincom) check
+  % 71: madd entry (lincom) check
   try
     gd_madd_lincom(D, 'data', 'mnew1', { 'in1'; 'in2' }, [9.9, 7.7], ...
     [8.8, 6.6]);
   catch exc
-    ne = ne + check_ok2(exc, 46, 1);
+    ne = ne + check_ok2(exc, 71, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew1');
-    ne = ne + check_string2(46, 1, d.field, 'data/mnew1');
-    ne = ne + check_num2(46, 2, d.field_type, GD.LINCOM_ENTRY);
-    ne = ne + check_num2(46, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(46, 4, d.in_fields, { 'in1'; 'in2' });
-    ne = ne + check_array2(46, 5, d.m, [ 9.9, 7.7 ]);
-    ne = ne + check_array2(46, 6, d.b, [ 8.8, 6.6 ]);
+    ne = ne + check_string2(71, 1, d.field, 'data/mnew1');
+    ne = ne + check_num2(71, 2, d.field_type, GD.LINCOM_ENTRY);
+    ne = ne + check_num2(71, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(71, 4, d.in_fields, { 'in1'; 'in2' });
+    ne = ne + check_array2(71, 5, d.m, [ 9.9, 7.7 ]);
+    ne = ne + check_array2(71, 6, d.b, [ 8.8, 6.6 ]);
   catch exc
-    ne = ne + check_ok2(exc, 46, 2);
+    ne = ne + check_ok2(exc, 71, 2);
   end
 
-  % 49: madd polynom check
+  % 74: madd polynom check
   try
     gd_madd_polynom(D, 'data', 'mnew4', 'in1', [3.9, 4.8, 5.7, ...
     complex(6.6,7.5)]);
   catch exc
-    ne = ne + check_ok2(exc, 49, 1);
+    ne = ne + check_ok2(exc, 74, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew4');
-    ne = ne + check_string2(49, 1, d.field, 'data/mnew4');
-    ne = ne + check_num2(49, 2, d.field_type, GD.POLYNOM_ENTRY);
-    ne = ne + check_num2(49, 3, d.fragment_index, 0);
-    ne = ne + check_string2(49, 4, d.in_fields, 'in1');
-    ne = ne + check_array2(49, 5, d.a, [3.9, 4.8, 5.7, complex(6.6,7.5)]);
+    ne = ne + check_string2(74, 1, d.field, 'data/mnew4');
+    ne = ne + check_num2(74, 2, d.field_type, GD.POLYNOM_ENTRY);
+    ne = ne + check_num2(74, 3, d.fragment_index, 0);
+    ne = ne + check_string2(74, 4, d.in_fields, 'in1');
+    ne = ne + check_array2(74, 5, d.a, [3.9, 4.8, 5.7, complex(6.6,7.5)]);
   catch exc
-    ne = ne + check_ok2(exc, 49, 2);
+    ne = ne + check_ok2(exc, 74, 2);
   end
 
-  % 50: add entry (linterp) check
+  % 75: add entry (linterp) check
   try
     gd_madd_linterp(D, 'data', 'mnew6', 'in', './some/table');
   catch exc
-    ne = ne + check_ok2(exc, 50, 1);
+    ne = ne + check_ok2(exc, 75, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew6');
-    ne = ne + check_string2(50, 1, d.field, 'data/mnew6');
-    ne = ne + check_num2(50, 2, d.field_type, GD.LINTERP_ENTRY);
-    ne = ne + check_num2(50, 3, d.fragment_index, 0);
-    ne = ne + check_string2(50, 4, d.in_fields, 'in');
-    ne = ne + check_string2(50, 5, d.table, './some/table');
+    ne = ne + check_string2(75, 1, d.field, 'data/mnew6');
+    ne = ne + check_num2(75, 2, d.field_type, GD.LINTERP_ENTRY);
+    ne = ne + check_num2(75, 3, d.fragment_index, 0);
+    ne = ne + check_string2(75, 4, d.in_fields, 'in');
+    ne = ne + check_string2(75, 5, d.table, './some/table');
   catch exc
-    ne = ne + check_ok2(exc, 50, 2);
+    ne = ne + check_ok2(exc, 75, 2);
   end
 
-  % 51: add entry (bit) check
+  % 76: add entry (bit) check
   try
     gd_madd_bit(D, 'data', 'mnew7', 'in', 13, 12);
   catch exc
-    ne = ne + check_ok2(exc, 51, 1);
+    ne = ne + check_ok2(exc, 76, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew7');
-    ne = ne + check_string2(51, 1, d.field, 'data/mnew7');
-    ne = ne + check_num2(51, 2, d.field_type, GD.BIT_ENTRY);
-    ne = ne + check_num2(51, 3, d.fragment_index, 0);
-    ne = ne + check_string2(51, 4, d.in_fields, 'in');
-    ne = ne + check_num2(51, 5, d.bitnum, 13);
-    ne = ne + check_num2(51, 6, d.numbits, 12);
+    ne = ne + check_string2(76, 1, d.field, 'data/mnew7');
+    ne = ne + check_num2(76, 2, d.field_type, GD.BIT_ENTRY);
+    ne = ne + check_num2(76, 3, d.fragment_index, 0);
+    ne = ne + check_string2(76, 4, d.in_fields, 'in');
+    ne = ne + check_num2(76, 5, d.bitnum, 13);
+    ne = ne + check_num2(76, 6, d.numbits, 12);
   catch exc
-    ne = ne + check_ok2(exc, 34, 2);
+    ne = ne + check_ok2(exc, 76, 2);
   end
 
-  % 52: add entry (sbit) check
+  % 77: add entry (sbit) check
   try
     gd_madd_sbit(D, 'data', 'mnew8', 'in', 14, 15);
   catch exc
-    ne = ne + check_ok2(exc, 52, 1);
+    ne = ne + check_ok2(exc, 77, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew8');
-    ne = ne + check_string2(52, 1, d.field, 'data/mnew8');
-    ne = ne + check_num2(52, 2, d.field_type, GD.SBIT_ENTRY);
-    ne = ne + check_num2(52, 3, d.fragment_index, 0);
-    ne = ne + check_string2(52, 4, d.in_fields, 'in');
-    ne = ne + check_num2(52, 5, d.bitnum, 14);
-    ne = ne + check_num2(52, 6, d.numbits, 15);
+    ne = ne + check_string2(77, 1, d.field, 'data/mnew8');
+    ne = ne + check_num2(77, 2, d.field_type, GD.SBIT_ENTRY);
+    ne = ne + check_num2(77, 3, d.fragment_index, 0);
+    ne = ne + check_string2(77, 4, d.in_fields, 'in');
+    ne = ne + check_num2(77, 5, d.bitnum, 14);
+    ne = ne + check_num2(77, 6, d.numbits, 15);
   catch exc
-    ne = ne + check_ok2(exc, 52, 2);
+    ne = ne + check_ok2(exc, 77, 2);
   end
 
-  % 53: add entry (mult) check
+  % 78: add entry (mult) check
   try
     gd_madd_multiply(D, 'data', 'mnew9', 'in1', 'in2');
   catch exc
-    ne = ne + check_ok2(exc, 53, 1);
+    ne = ne + check_ok2(exc, 78, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew9');
-    ne = ne + check_string2(53, 1, d.field, 'data/mnew9');
-    ne = ne + check_num2(53, 2, d.field_type, GD.MULTIPLY_ENTRY);
-    ne = ne + check_num2(53, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(53, 4, d.in_fields, { 'in1'; 'in2'; });
+    ne = ne + check_string2(78, 1, d.field, 'data/mnew9');
+    ne = ne + check_num2(78, 2, d.field_type, GD.MULTIPLY_ENTRY);
+    ne = ne + check_num2(78, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(78, 4, d.in_fields, { 'in1'; 'in2'; });
   catch exc
-    ne = ne + check_ok2(exc, 53, 2);
+    ne = ne + check_ok2(exc, 78, 2);
   end
 
-  % 54: add entry (phase) check
+  % 79: add entry (phase) check
   try
     gd_madd_phase(D, 'data', 'mnew10', 'in1', 22);
   catch exc
-    ne = ne + check_ok2(exc, 54, 1);
+    ne = ne + check_ok2(exc, 79, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew10');
-    ne = ne + check_string2(54, 1, d.field, 'data/mnew10');
-    ne = ne + check_num2(54, 2, d.field_type, GD.PHASE_ENTRY);
-    ne = ne + check_num2(54, 3, d.fragment_index, 0);
-    ne = ne + check_string2(54, 4, d.in_fields, 'in1');
-    ne = ne + check_num2(54, 5, d.shift, 22);
+    ne = ne + check_string2(79, 1, d.field, 'data/mnew10');
+    ne = ne + check_num2(79, 2, d.field_type, GD.PHASE_ENTRY);
+    ne = ne + check_num2(79, 3, d.fragment_index, 0);
+    ne = ne + check_string2(79, 4, d.in_fields, 'in1');
+    ne = ne + check_num2(79, 5, d.shift, 22);
   catch exc
-    ne = ne + check_ok2(exc, 54, 2);
+    ne = ne + check_ok2(exc, 79, 2);
   end
 
-  % 55: madd entry (const) check
+  % 80: madd entry (const) check
   try
     gd_madd_const(D, 'data', 'mnew11', GD.FLOAT64, 2.6);
   catch exc
-    ne = ne + check_ok2(exc, 55, 1);
+    ne = ne + check_ok2(exc, 80, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew11');
-    ne = ne + check_string2(55, 1, d.field, 'data/mnew11');
-    ne = ne + check_num2(55, 2, d.field_type, GD.CONST_ENTRY);
-    ne = ne + check_num2(55, 3, d.fragment_index, 0);
-    ne = ne + check_num2(55, 5, d.const_type, GD.FLOAT64);
+    ne = ne + check_string2(80, 1, d.field, 'data/mnew11');
+    ne = ne + check_num2(80, 2, d.field_type, GD.CONST_ENTRY);
+    ne = ne + check_num2(80, 3, d.fragment_index, 0);
+    ne = ne + check_num2(80, 5, d.const_type, GD.FLOAT64);
   catch exc
-    ne = ne + check_ok2(exc, 55, 2);
+    ne = ne + check_ok2(exc, 80, 2);
   end
 
   try
     d = gd_get_constant(D, 'data/mnew11');
-    ne = ne + check_num2(55, 6, d, 2.6);
+    ne = ne + check_num2(80, 6, d, 2.6);
   catch exc
-    ne = ne + check_ok2(exc, 55, 3);
+    ne = ne + check_ok2(exc, 80, 3);
   end
 
-  % 56: get_string
+  % 81: get_string
   try
     d = gd_get_string(D, 'string');
-    ne = ne + check_string(56, d, 'Zaphod Beeblebrox');
+    ne = ne + check_string(81, d, 'Zaphod Beeblebrox');
   catch exc
-    ne = ne + check_ok(exc, 56);
+    ne = ne + check_ok(exc, 81);
   end
 
-  % 57: add string
+  % 82: add string
   try
     gd_add_string(D, 'new12', '---string---', 0);
   catch exc
-    ne = ne + check_ok2(exc, 57, 1);
+    ne = ne + check_ok2(exc, 82, 1);
   end
 
   try
     d = gd_entry(D, 'new12');
-    ne = ne + check_string2(57, 1, d.field, 'new12');
-    ne = ne + check_num2(57, 2, d.field_type, GD.STRING_ENTRY);
-    ne = ne + check_num2(57, 3, d.fragment_index, 0);
+    ne = ne + check_string2(82, 1, d.field, 'new12');
+    ne = ne + check_num2(82, 2, d.field_type, GD.STRING_ENTRY);
+    ne = ne + check_num2(82, 3, d.fragment_index, 0);
   catch exc
-    ne = ne + check_ok2(exc, 57, 2);
+    ne = ne + check_ok2(exc, 82, 2);
   end
 
   try
     d = gd_get_string(D, 'new12');
-    ne = ne + check_string(57, d, '---string---');
+    ne = ne + check_string(82, d, '---string---');
   catch exc
-    ne = ne + check_ok(exc, 57);
+    ne = ne + check_ok(exc, 82);
   end
 
-  % 58: madd string
+  % 83: madd string
   try
     gd_madd_string(D, 'data', 'mnew12', '---mstring---');
   catch exc
-    ne = ne + check_ok2(exc, 58, 1);
+    ne = ne + check_ok2(exc, 83, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew12');
-    ne = ne + check_string2(58, 1, d.field, 'data/mnew12');
-    ne = ne + check_num2(58, 2, d.field_type, GD.STRING_ENTRY);
-    ne = ne + check_num2(58, 3, d.fragment_index, 0);
+    ne = ne + check_string2(83, 1, d.field, 'data/mnew12');
+    ne = ne + check_num2(83, 2, d.field_type, GD.STRING_ENTRY);
+    ne = ne + check_num2(83, 3, d.fragment_index, 0);
   catch exc
-    ne = ne + check_ok2(exc, 58, 2);
+    ne = ne + check_ok2(exc, 83, 2);
   end
 
   try
     d = gd_get_string(D, 'data/mnew12');
-    ne = ne + check_string(58, d, '---mstring---');
+    ne = ne + check_string(83, d, '---mstring---');
   catch exc
-    ne = ne + check_ok(exc, 58);
+    ne = ne + check_ok(exc, 83);
   end
 
-  % 59: add_spec
+  % 84: add_spec
   try
     gd_add_spec(D, 'lorem STRING "Lorem ipsum"', 0);
   catch exc
-    ne = ne + check_ok2(exc, 59, 1);
+    ne = ne + check_ok2(exc, 84, 1);
   end
 
   try
     d = gd_get_string(D, 'lorem');
-    ne = ne + check_string(59, d, 'Lorem ipsum');
+    ne = ne + check_string(84, d, 'Lorem ipsum');
   catch exc
-    ne = ne + check_ok2(exc, 59, 2);
+    ne = ne + check_ok2(exc, 84, 2);
   end
 
-  % 60: madd_spec
+  % 85: madd_spec
   try
     gd_madd_spec(D, 'ipsum STRING "dolor sit amet."', 'lorem');
   catch exc
-    ne = ne + check_ok2(exc, 60, 1);
+    ne = ne + check_ok2(exc, 85, 1);
   end
 
   try
     d = gd_get_string(D, 'lorem/ipsum');
-    ne = ne + check_string(60, d, 'dolor sit amet.');
+    ne = ne + check_string(85, d, 'dolor sit amet.');
   catch exc
-    ne = ne + check_ok2(exc, 60, 2);
+    ne = ne + check_ok2(exc, 85, 2);
   end
 
-  % 61: put_constant
+  % 86: put_constant
   try
-    gd_put_constant(D, 'const', 61);
+    gd_put_constant(D, 'const', 86);
   catch exc
-    ne = ne + check_ok2(exc, 61, 1);
+    ne = ne + check_ok2(exc, 86, 1);
   end
 
   try
     d = gd_get_constant(D, 'const');
-    ne = ne + check_num2(61, 6, d, 61);
+    ne = ne + check_num2(86, 6, d, 86);
   catch exc
-    ne = ne + check_ok2(exc, 61, 2);
+    ne = ne + check_ok2(exc, 86, 2);
   end
 
-  % 133: put_constant
+  % 93: put_constant
   try
-    gd_put_constant(D, 'new11', complex(133,134));
+    gd_put_constant(D, 'new11', complex(93,134));
   catch exc
-    ne = ne + check_ok2(exc, 133, 1);
+    ne = ne + check_ok2(exc, 93, 1);
   end
 
   try
     d = gd_get_constant(D, 'new11');
-    ne = ne + check_num2(133, 6, d, complex(133,134));
+    ne = ne + check_num2(93, 6, d, complex(93,134));
   catch exc
-    ne = ne + check_ok2(exc, 133, 2);
+    ne = ne + check_ok2(exc, 93, 2);
   end
 
-  % 62: put_string
+  % 94: put_string
   try
     gd_put_string(D, 'string', 'Arthur Dent');
   catch exc
-    ne = ne + check_ok2(exc, 62, 1);
+    ne = ne + check_ok2(exc, 94, 1);
   end
 
   try
     d = gd_get_string(D, 'string');
-    ne = ne + check_string(62, d, 'Arthur Dent');
+    ne = ne + check_string(94, d, 'Arthur Dent');
   catch exc
-    ne = ne + check_ok2(exc, 62, 2);
+    ne = ne + check_ok2(exc, 94, 2);
   end
 
-  % 63: nmfields_by_type
+  % 95: nmfields_by_type
   try
     d = gd_nmfields_by_type(D, 'data', GD.LINCOM_ENTRY);
-    ne = ne + check_num(63, d, 1);
+    ne = ne + check_num(95, d, 1);
   catch exc
-    ne = ne + check_ok(exc, 63);
+    ne = ne + check_ok(exc, 95);
   end
 
-  % 64: mfield_list_by_type
+  % 96: mfield_list_by_type
   try
     d = gd_mfield_list_by_type(D, 'data', GD.LINCOM_ENTRY);
-    ne = ne + check_sarray(64, d, {'mnew1'});
+    ne = ne + check_sarray(96, d, {'mnew1'});
   catch exc
-    ne = ne + check_ok(exc, 64);
+    ne = ne + check_ok(exc, 96);
   end
 
-  % 65: nmvectors
+  % 97: nmvectors
   try
     d = gd_nmvectors(D, 'data');
-    ne = ne + check_num(65, d, 8);
+    ne = ne + check_num(97, d, 8);
   catch exc
-    ne = ne + check_ok(exc, 65);
+    ne = ne + check_ok(exc, 97);
   end
 
-  % 66: mvector_list
+  % 98: mvector_list
   try
     d = gd_mvector_list(D, 'data');
-    ne = ne + check_sarray(66, d, {'mlut', 'mnew1', 'mnew4', 'mnew6', ...
+    ne = ne + check_sarray(98, d, {'mlut', 'mnew1', 'mnew4', 'mnew6', ...
     'mnew7', 'mnew8', 'mnew9', 'mnew10'});
   catch exc
-    ne = ne + check_ok(exc, 66);
+    ne = ne + check_ok(exc, 98);
   end
 
-  % 67: gd_alter_raw
+  % 99: gd_alter_raw
   try
     gd_alter_raw(D, 'new1', GD.INT32, 4, 0);
   catch exc
-    ne = ne + check_ok2(exc, 67, 1);
+    ne = ne + check_ok2(exc, 99, 1);
   end
 
   try
     d = gd_entry(D, 'new1');
-    ne = ne + check_string2(67, 1, d.field, 'new1');
-    ne = ne + check_num2(67, 2, d.field_type, GD.RAW_ENTRY);
-    ne = ne + check_num2(67, 3, d.fragment_index, 0);
-    ne = ne + check_num2(67, 4, d.data_type, GD.INT32);
-    ne = ne + check_num2(67, 4, d.spf, 4);
+    ne = ne + check_string2(99, 1, d.field, 'new1');
+    ne = ne + check_num2(99, 2, d.field_type, GD.RAW_ENTRY);
+    ne = ne + check_num2(99, 3, d.fragment_index, 0);
+    ne = ne + check_num2(99, 4, d.data_type, GD.INT32);
+    ne = ne + check_num2(99, 4, d.spf, 4);
   catch exc
-    ne = ne + check_ok2(exc, 67, 2);
+    ne = ne + check_ok2(exc, 99, 2);
   end
 
-  % 68: gd_alter_lincom
+  % 100: gd_alter_lincom
   try
     gd_alter_lincom(D, 'new2', {'in4'; 0; 'in6'}, [ 0.99, 11, 1.96 ], ...
     [ 7.8, 0.022, 0 ]);
   catch exc
-    ne = ne + check_ok2(exc, 68, 1);
+    ne = ne + check_ok2(exc, 100, 1);
   end
 
   try
     d = gd_entry(D, 'new2');
-    ne = ne + check_string2(68, 1, d.field, 'new2');
-    ne = ne + check_num2(68, 2, d.field_type, GD.LINCOM_ENTRY);
-    ne = ne + check_num2(68, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(68, 4, d.in_fields, { 'in4'; 'in2'; 'in6' });
-    ne = ne + check_array2(68, 5, d.m, [ 0.99, 11, 1.96 ]);
-    ne = ne + check_array2(68, 6, d.b, [ 7.8, 0.022, 0 ]);
+    ne = ne + check_string2(100, 1, d.field, 'new2');
+    ne = ne + check_num2(100, 2, d.field_type, GD.LINCOM_ENTRY);
+    ne = ne + check_num2(100, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(100, 4, d.in_fields, { 'in4'; 'in2'; 'in6' });
+    ne = ne + check_array2(100, 5, d.m, [ 0.99, 11, 1.96 ]);
+    ne = ne + check_array2(100, 6, d.b, [ 7.8, 0.022, 0 ]);
   catch exc
-    ne = ne + check_ok2(exc, 68, 2);
+    ne = ne + check_ok2(exc, 100, 2);
   end
 
-  % 70: gd_alter_polynom
+  % 102: gd_alter_polynom
   try
     gd_alter_polynom(D, 'new5', 0, [ 1.1, 1.2, 1.3, 1.4, 1.5 ]);
   catch exc
-    ne = ne + check_ok2(exc, 70, 1);
+    ne = ne + check_ok2(exc, 102, 1);
   end
 
   try
     d = gd_entry(D, 'new5');
-    ne = ne + check_string2(70, 1, d.field, 'new5');
-    ne = ne + check_num2(70, 2, d.field_type, GD.POLYNOM_ENTRY);
-    ne = ne + check_num2(70, 3, d.fragment_index, 0);
-    ne = ne + check_string2(70, 4, d.in_fields, 'in1');
-    ne = ne + check_array2(70, 5, d.a, [1.1, 1.2, 1.3, 1.4, 1.5]);
+    ne = ne + check_string2(102, 1, d.field, 'new5');
+    ne = ne + check_num2(102, 2, d.field_type, GD.POLYNOM_ENTRY);
+    ne = ne + check_num2(102, 3, d.fragment_index, 0);
+    ne = ne + check_string2(102, 4, d.in_fields, 'in1');
+    ne = ne + check_array2(102, 5, d.a, [1.1, 1.2, 1.3, 1.4, 1.5]);
   catch exc
-    ne = ne + check_ok2(exc, 70, 2);
+    ne = ne + check_ok2(exc, 102, 2);
   end
 
-  % 72: gd_alter_linterp
+  % 104: gd_alter_linterp
   try
     gd_alter_linterp(D, 'new6', 'in3', 0, 0);
   catch exc
-    ne = ne + check_ok2(exc, 72, 1);
+    ne = ne + check_ok2(exc, 104, 1);
   end
 
   try
     d = gd_entry(D, 'new6');
-    ne = ne + check_string2(72, 1, d.field, 'new6');
-    ne = ne + check_num2(72, 2, d.field_type, GD.LINTERP_ENTRY);
-    ne = ne + check_num2(72, 3, d.fragment_index, 0);
-    ne = ne + check_string2(72, 4, d.in_fields, 'in3');
-    ne = ne + check_string2(72, 5, d.table, './some/table');
+    ne = ne + check_string2(104, 1, d.field, 'new6');
+    ne = ne + check_num2(104, 2, d.field_type, GD.LINTERP_ENTRY);
+    ne = ne + check_num2(104, 3, d.fragment_index, 0);
+    ne = ne + check_string2(104, 4, d.in_fields, 'in3');
+    ne = ne + check_string2(104, 5, d.table, './some/table');
   catch exc
-    ne = ne + check_ok2(exc, 72, 2);
+    ne = ne + check_ok2(exc, 104, 2);
   end
 
-  % 73: gd_alter_bit
+  % 105: gd_alter_bit
   try
     gd_alter_bit(D, 'new7', 'in3', 3, 0);
   catch exc
-    ne = ne + check_ok2(exc, 73, 1);
+    ne = ne + check_ok2(exc, 105, 1);
   end
 
   try
     d = gd_entry(D, 'new7');
-    ne = ne + check_string2(73, 1, d.field, 'new7');
-    ne = ne + check_num2(73, 2, d.field_type, GD.BIT_ENTRY);
-    ne = ne + check_num2(73, 3, d.fragment_index, 0);
-    ne = ne + check_string2(73, 4, d.in_fields, 'in3');
-    ne = ne + check_num2(73, 5, d.bitnum, 3);
-    ne = ne + check_num2(73, 6, d.numbits, 12);
+    ne = ne + check_string2(105, 1, d.field, 'new7');
+    ne = ne + check_num2(105, 2, d.field_type, GD.BIT_ENTRY);
+    ne = ne + check_num2(105, 3, d.fragment_index, 0);
+    ne = ne + check_string2(105, 4, d.in_fields, 'in3');
+    ne = ne + check_num2(105, 5, d.bitnum, 3);
+    ne = ne + check_num2(105, 6, d.numbits, 12);
   catch exc
-    ne = ne + check_ok2(exc, 73, 2);
+    ne = ne + check_ok2(exc, 105, 2);
   end
 
-  % 74: gd_alter_sbit
+  % 106: gd_alter_sbit
   try
     gd_alter_sbit(D, 'new8', 'in3', 3, 9);
   catch exc
-    ne = ne + check_ok2(exc, 74, 1);
+    ne = ne + check_ok2(exc, 106, 1);
   end
 
   try
     d = gd_entry(D, 'new8');
-    ne = ne + check_string2(74, 1, d.field, 'new8');
-    ne = ne + check_num2(74, 2, d.field_type, GD.SBIT_ENTRY);
-    ne = ne + check_num2(74, 3, d.fragment_index, 0);
-    ne = ne + check_string2(74, 4, d.in_fields, 'in3');
-    ne = ne + check_num2(74, 5, d.bitnum, 3);
-    ne = ne + check_num2(74, 6, d.numbits, 9);
+    ne = ne + check_string2(106, 1, d.field, 'new8');
+    ne = ne + check_num2(106, 2, d.field_type, GD.SBIT_ENTRY);
+    ne = ne + check_num2(106, 3, d.fragment_index, 0);
+    ne = ne + check_string2(106, 4, d.in_fields, 'in3');
+    ne = ne + check_num2(106, 5, d.bitnum, 3);
+    ne = ne + check_num2(106, 6, d.numbits, 9);
   catch exc
-    ne = ne + check_ok2(exc, 74, 2);
+    ne = ne + check_ok2(exc, 106, 2);
   end
 
-  % 75: gd_alter_multiply
+  % 107: gd_alter_multiply
   try
     gd_alter_multiply(D, 'new9', 'in6', 0);
   catch exc
-    ne = ne + check_ok2(exc, 75, 1);
+    ne = ne + check_ok2(exc, 107, 1);
   end
 
   try
     d = gd_entry(D, 'new9');
-    ne = ne + check_string2(75, 1, d.field, 'new9');
-    ne = ne + check_num2(75, 2, d.field_type, GD.MULTIPLY_ENTRY);
-    ne = ne + check_num2(75, 3, d.fragment_index, 0);
-    ne = ne + check_sarray2(75, 4, d.in_fields, { 'in6'; 'in2'; });
+    ne = ne + check_string2(107, 1, d.field, 'new9');
+    ne = ne + check_num2(107, 2, d.field_type, GD.MULTIPLY_ENTRY);
+    ne = ne + check_num2(107, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(107, 4, d.in_fields, { 'in6'; 'in2'; });
   catch exc
-    ne = ne + check_ok2(exc, 75, 2);
+    ne = ne + check_ok2(exc, 107, 2);
   end
 
-  % 76: alter phase
+  % 108: alter phase
   try
     gd_alter_phase(D, 'new10', 'in2', 23);
   catch exc
-    ne = ne + check_ok2(exc, 76, 1);
+    ne = ne + check_ok2(exc, 108, 1);
   end
 
   try
     d = gd_entry(D, 'new10');
-    ne = ne + check_string2(76, 1, d.field, 'new10');
-    ne = ne + check_num2(76, 2, d.field_type, GD.PHASE_ENTRY);
-    ne = ne + check_num2(76, 3, d.fragment_index, 0);
-    ne = ne + check_string2(76, 4, d.in_fields, 'in2');
-    ne = ne + check_num2(76, 5, d.shift, 23);
+    ne = ne + check_string2(108, 1, d.field, 'new10');
+    ne = ne + check_num2(108, 2, d.field_type, GD.PHASE_ENTRY);
+    ne = ne + check_num2(108, 3, d.fragment_index, 0);
+    ne = ne + check_string2(108, 4, d.in_fields, 'in2');
+    ne = ne + check_num2(108, 5, d.shift, 23);
   catch exc
-    ne = ne + check_ok2(exc, 76, 2);
+    ne = ne + check_ok2(exc, 108, 2);
   end
 
-  % 77: atler const
+  % 109: atler const
   try
     gd_alter_const(D, 'new11', GD.FLOAT64);
   catch exc
-    ne = ne + check_ok2(exc, 77, 1);
+    ne = ne + check_ok2(exc, 109, 1);
   end
 
   try
     d = gd_entry(D, 'new11');
-    ne = ne + check_string2(77, 1, d.field, 'new11');
-    ne = ne + check_num2(77, 2, d.field_type, GD.CONST_ENTRY);
-    ne = ne + check_num2(77, 3, d.fragment_index, 0);
-    ne = ne + check_num2(77, 5, d.const_type, GD.FLOAT64);
+    ne = ne + check_string2(109, 1, d.field, 'new11');
+    ne = ne + check_num2(109, 2, d.field_type, GD.CONST_ENTRY);
+    ne = ne + check_num2(109, 3, d.fragment_index, 0);
+    ne = ne + check_num2(109, 5, d.const_type, GD.FLOAT64);
   catch exc
-    ne = ne + check_ok2(exc, 77, 2);
+    ne = ne + check_ok2(exc, 109, 2);
   end
 
-  % 78: gd_encoding
+  % 110: gd_encoding
   try
     d = gd_encoding(D, 0);
-    ne = ne + check_num(78, d, GD.UNENCODED);
+    ne = ne + check_num(110, d, GD.UNENCODED);
   catch exc
-    ne = ne + check_ok(exc, 78);
+    ne = ne + check_ok(exc, 110);
   end
 
-  % 79: gd_encoding
+  % 111: gd_encoding
   try
     d = gd_endianness(D, 0);
-    ne = ne + check_num(79, d, GD.LITTLE_ENDIAN + GD.NOT_ARM_ENDIAN);
+    ne = ne + check_num(111, d, GD.LITTLE_ENDIAN + GD.NOT_ARM_ENDIAN);
   catch exc
-    ne = ne + check_ok(exc, 79);
+    ne = ne + check_ok(exc, 111);
   end
 
-  % 80: dirfilename
+  % 112: dirfilename
   try
     d = gd_dirfilename(D);
-    ne = ne + check_eostring(80, d, 'dirfile');
+    ne = ne + check_eostring(112, d, 'dirfile');
   catch exc
-    ne = ne + check_ok(exc, 80);
+    ne = ne + check_ok(exc, 112);
   end
 
-  % 81: gd_parent_fragment
+  % 113: gd_parent_fragment
   try
     d = gd_parent_fragment(D, 1);
-    ne = ne + check_num(81, d, 0);
+    ne = ne + check_num(113, d, 0);
   catch exc
-    ne = ne + check_ok(exc, 81);
+    ne = ne + check_ok(exc, 113);
   end
 
-  % 82: gd_alter_protection
+  % 114: gd_alter_protection
   try
     gd_alter_protection(D, 0, GD.PROTECT_DATA);
   catch exc
-    ne = ne + check_ok(exc, 82);
+    ne = ne + check_ok(exc, 114);
   end
 
-  % 83: gd_protection
+  % 115: gd_protection
   try
     d = gd_protection(D, 0);
-    ne = ne + check_num(83, d, GD.PROTECT_DATA);
+    ne = ne + check_num(115, d, GD.PROTECT_DATA);
   catch exc
-    ne = ne + check_ok(exc, 83);
+    ne = ne + check_ok(exc, 115);
   end
 
-  % 84: gd_raw_filename
+  % 116: gd_raw_filename
   try
     d = gd_raw_filename(D, 'data');
-    ne = ne + check_eostring(84, d, 'dirfile/data');
+    ne = ne + check_eostring(116, d, 'dirfile/data');
   catch exc
-    ne = ne + check_ok(exc, 84);
+    ne = ne + check_ok(exc, 116);
   end
 
-  % 85: gd_reference
+  % 117: gd_reference
   try
     d = gd_reference(D);
-    ne = ne + check_string2(85, 1, d, 'data');
+    ne = ne + check_string2(117, 1, d, 'data');
   catch exc
-    ne = ne + check_ok2(exc, 85, 1);
+    ne = ne + check_ok2(exc, 117, 1);
   end
 
   try
     d = gd_reference(D, 'new1');
-    ne = ne + check_string2(85, 2, d, 'new1');
+    ne = ne + check_string2(117, 2, d, 'new1');
   catch exc
-    ne = ne + check_ok2(exc, 85, 2);
+    ne = ne + check_ok2(exc, 117, 2);
+  end
+
+  % 118: gd_eof
+  try
+    d = gd_eof(D, 'lincom');
+    ne = ne + check_num(118, d, 81);
+  catch exc
+    ne = ne + check_ok(exc, 118);
   end
 
-  % 87: gd_alter_encoding
+  % 119: gd_alter_encoding
   try
     gd_alter_encoding(D, GD.SLIM_ENCODED, 1, 0);
   catch exc
-    ne = ne + check_ok(exc, 87);
+    ne = ne + check_ok(exc, 119);
   end
 
-  % 88: gd_alter_endiannness
+  % 120: gd_alter_endiannness
   try
     gd_alter_endianness(D, GD.BIG_ENDIAN, 1, 0);
   catch exc
-    ne = ne + check_ok(exc, 88);
+    ne = ne + check_ok(exc, 120);
   end
 
-  % 89: gd_alter_spec
+  % 121: gd_alter_spec
   try
     gd_alter_spec(D, 'new10 PHASE in5 3', 0);
   catch exc
-    ne = ne + check_ok2(exc, 89, 1);
+    ne = ne + check_ok2(exc, 121, 1);
   end
 
   try
     d = gd_entry(D, 'new10');
-    ne = ne + check_string2(89, 1, d.field, 'new10');
-    ne = ne + check_num2(89, 2, d.field_type, GD.PHASE_ENTRY);
-    ne = ne + check_num2(89, 3, d.fragment_index, 0);
-    ne = ne + check_string2(89, 4, d.in_fields, 'in5');
-    ne = ne + check_num2(89, 5, d.shift, 3);
+    ne = ne + check_string2(121, 1, d.field, 'new10');
+    ne = ne + check_num2(121, 2, d.field_type, GD.PHASE_ENTRY);
+    ne = ne + check_num2(121, 3, d.fragment_index, 0);
+    ne = ne + check_string2(121, 4, d.in_fields, 'in5');
+    ne = ne + check_num2(121, 5, d.shift, 3);
   catch exc
-    ne = ne + check_ok2(exc, 89, 2);
+    ne = ne + check_ok2(exc, 121, 2);
   end
 
-  % 90: gd_delete
+  % 122: gd_delete
   try
     gd_delete(D, 'new10', 0);
   catch exc
-    ne = ne + check_ok2(exc, 90, 1);
+    ne = ne + check_ok2(exc, 122, 1);
   end
 
   try
     d = gd_entry(D, 'new10');
   catch exc
-    ne = ne + check_exc2(exc, 90, 2, 'BadCode');
+    ne = ne + check_exc2(exc, 122, 2, 'BadCode');
   end
 
-  % 91: gd_malter_spec
+  % 123: gd_malter_spec
   try
     gd_malter_spec(D, 'mnew10 PHASE in4 11', 'data', 0);
   catch exc
-    ne = ne + check_ok2(exc, 91, 1);
+    ne = ne + check_ok2(exc, 123, 1);
   end
 
   try
     d = gd_entry(D, 'data/mnew10');
-    ne = ne + check_string2(91, 1, d.field, 'data/mnew10');
-    ne = ne + check_num2(91, 2, d.field_type, GD.PHASE_ENTRY);
-    ne = ne + check_num2(91, 3, d.fragment_index, 0);
-    ne = ne + check_string2(91, 4, d.in_fields, 'in4');
-    ne = ne + check_num2(91, 5, d.shift, 11);
+    ne = ne + check_string2(123, 1, d.field, 'data/mnew10');
+    ne = ne + check_num2(123, 2, d.field_type, GD.PHASE_ENTRY);
+    ne = ne + check_num2(123, 3, d.fragment_index, 0);
+    ne = ne + check_string2(123, 4, d.in_fields, 'in4');
+    ne = ne + check_num2(123, 5, d.shift, 11);
   catch exc
-    ne = ne + check_ok2(exc, 91, 2);
+    ne = ne + check_ok2(exc, 123, 2);
   end
 
-  % 92: move
+  % 124: move
   try
     gd_move(D, 'new9', 1, 0);
   catch exc
-    ne = ne + check_ok2(exc, 92, 1);
+    ne = ne + check_ok2(exc, 124, 1);
   end
 
   try
     d = gd_fragment_index(D, 'new9');
-    ne = ne + check_num(92, d, 1);
+    ne = ne + check_num(124, d, 1);
   catch exc
-    ne = ne + check_ok2(exc, 92, 2);
+    ne = ne + check_ok2(exc, 124, 2);
   end
 
-  % 93: rename
+  % 125: rename
   try
     gd_rename(D, 'new9', 'newer', 0);
   catch exc
-    ne = ne + check_ok2(exc, 93, 1);
+    ne = ne + check_ok2(exc, 125, 1);
   end
 
   try
     d = gd_fragment_index(D, 'newer');
-    ne = ne + check_num(93, d, 1);
+    ne = ne + check_num(125, d, 1);
   catch exc
-    ne = ne + check_ok2(exc, 93, 2);
+    ne = ne + check_ok2(exc, 125, 2);
   end
 
-  % 94: unclude
+  % 126: unclude
   try
     gd_uninclude(D, 1, 0);
   catch exc
-    ne = ne + check_ok2(exc, 94, 1);
+    ne = ne + check_ok2(exc, 126, 1);
   end
 
   try
     d = gd_nfragments(D);
-    ne = ne + check_num(94, d, 1);
+    ne = ne + check_num(126, d, 1);
   catch exc
-    ne = ne + check_ok2(exc, 94, 2);
+    ne = ne + check_ok2(exc, 126, 2);
   end
 
-  % 95: frameoffset
+  % 127: frameoffset
   try
     d = gd_frameoffset(D, 0);
-    ne = ne + check_num(95, d, 0);
+    ne = ne + check_num(127, d, 0);
   catch exc
-    ne = ne + check_ok(exc, 95);
+    ne = ne + check_ok(exc, 127);
   end
 
-  % 96: alter_frameoffset
+  % 128: alter_frameoffset
   try
     gd_alter_frameoffset(D, 33, 0, 0);
   catch exc
-    ne = ne + check_ok2(exc, 96, 1);
+    ne = ne + check_ok2(exc, 128, 1);
   end
 
   try
     d = gd_frameoffset(D, 0);
-    ne = ne + check_num(96, d, 33);
+    ne = ne + check_num(128, d, 33);
   catch exc
-    ne = ne + check_ok2(exc, 96, 2);
+    ne = ne + check_ok2(exc, 128, 2);
   end
 
-  % 97: native_type
+  % 129: native_type
   try
     d = gd_native_type(D, 'data');
-    ne = ne + check_num(97, d, GD.INT8);
+    ne = ne + check_num(129, d, GD.INT8);
   catch exc
-    ne = ne + check_ok(exc, 97);
+    ne = ne + check_ok(exc, 129);
   end
 
-  % 99: validate
+  % 131: validate
   try
     d = gd_validate(D, 'new7');
   catch exc
-    ne = ne + check_exc(exc, 99, 'BadCode');
+    ne = ne + check_exc(exc, 131, 'BadCode');
   end
 
-  % 100: framenum
+  % 132: framenum
   try
     gd_reference(D, 'data');
     d = gd_framenum(D, 'data', 33.3);
-    ne = ne + check_num(100, d, 37.1625);
+    ne = ne + check_num(132, d, 37.1625);
   catch exc
-    ne = ne + check_ok(exc, 100);
+    ne = ne + check_ok(exc, 132);
   end
 
-  % 101: framenum_subset
+  % 133: framenum_subset
   try
     d = gd_framenum(D, 'data', 33.3, 6);
-    ne = ne + check_num(101, d, 37.1625);
-  catch exc
-    ne = ne + check_ok(exc, 101);
-  end
-
-  % 86: gd_eof
-  try
-    d = gd_eof(D, 'lincom');
-    ne = ne + check_num(86, d, 345);
+    ne = ne + check_num(133, d, 37.1625);
   catch exc
-    ne = ne + check_ok(exc, 86);
+    ne = ne + check_ok(exc, 133);
   end
 
   % 142: gd_bof
@@ -1321,7 +1323,7 @@ try
     ne = ne + check_ok(exc, 145);
   end
 
-  % 146: add entry (mult) check
+  % 146: add entry (DIV) check
   try
     gd_add_divide(D, 'new14', 'in1', 'in2', 0);
   catch exc
@@ -1478,9 +1480,9 @@ try
     ne = ne + check_ok2(exc, 169, 2);
   end
 
-  % 177: gd_carray_len
+  % 177: gd_array_len
   try
-    d = gd_carray_len(D, 'carray');
+    d = gd_array_len(D, 'carray');
     ne = ne + check_num(177, d, 6);
   catch exc
     ne = ne + check_ok(exc, 177);
@@ -1493,7 +1495,7 @@ try
     ne = ne + check_num2(178, 2, d.field_type, GD.CARRAY_ENTRY);
     ne = ne + check_num2(178, 3, d.fragment_index, 0);
     ne = ne + check_num2(178, 4, d.const_type, GD.FLOAT64);
-    ne = ne + check_num2(178, 4, d.array_len, 6);
+    ne = ne + check_num2(178, 5, d.array_len, 6);
   catch exc
     ne = ne + check_ok(exc, 178);
   end
@@ -1511,7 +1513,7 @@ try
     ne = ne + check_num2(179, 2, d.field_type, GD.CARRAY_ENTRY);
     ne = ne + check_num2(179, 3, d.fragment_index, 0);
     ne = ne + check_num2(179, 4, d.const_type, GD.FLOAT64);
-    ne = ne + check_num2(179, 4, d.array_len, 4);
+    ne = ne + check_num2(179, 5, d.array_len, 4);
   catch exc
     ne = ne + check_ok2(exc, 179, 2);
   end
@@ -1523,7 +1525,7 @@ try
     ne = ne + check_ok2(exc, 179, 3);
   end
 
-  % 180: add_carray
+  % 180: madd_carray
   try
     gd_madd_carray(D, 'data', 'mnew17', GD.FLOAT64, [1.8, 18.0]);
   catch exc
@@ -1536,7 +1538,7 @@ try
     ne = ne + check_num2(180, 2, d.field_type, GD.CARRAY_ENTRY);
     ne = ne + check_num2(180, 3, d.fragment_index, 0);
     ne = ne + check_num2(180, 4, d.const_type, GD.FLOAT64);
-    ne = ne + check_num2(180, 4, d.array_len, 2);
+    ne = ne + check_num2(180, 5, d.array_len, 2);
   catch exc
     ne = ne + check_ok2(exc, 180, 2);
   end
@@ -1548,7 +1550,7 @@ try
     ne = ne + check_ok2(exc, 180, 3);
   end
 
-  % 181: add_carray
+  % 181: alter_carray
   try
     gd_alter_carray(D, 'new17', GD.INT32, 5);
   catch exc
@@ -1561,7 +1563,7 @@ try
     ne = ne + check_num2(181, 2, d.field_type, GD.CARRAY_ENTRY);
     ne = ne + check_num2(181, 3, d.fragment_index, 0);
     ne = ne + check_num2(181, 4, d.const_type, GD.INT32);
-    ne = ne + check_num2(181, 4, d.array_len, 5);
+    ne = ne + check_num2(181, 5, d.array_len, 5);
   catch exc
     ne = ne + check_ok2(exc, 181, 2);
   end
@@ -1576,7 +1578,7 @@ try
   % 183: gd_constants
   try
     d = gd_constants(D);
-    ne = ne + check_array(183, d, [61, 133]);
+    ne = ne + check_array(183, d, [86, 93]);
   catch exc
     ne = ne + check_ok(exc, 183);
   end
@@ -1809,33 +1811,6 @@ try
     ne = ne + check_ok2(exc, 41, 1);
   end
 
-  % 224: move_alias
-  try
-    gd_move_alias(D, 'new20', 1);
-  catch exc
-    ne = ne + check_ok2(exc, 224, 1);
-  end
-
-  try
-    d = gd_fragment_index(D, 'Anew20Z');
-    ne = ne + check_num(224, d, 1);
-  catch exc
-    ne = ne + check_ok2(exc, 224, 2);
-  end
-
-  % 225: delete_alias
-  try
-    gd_delete_alias(D, 'Anew20Z');
-  catch exc
-    ne = ne + check_ok2(exc, 225, 1);
-  end
-
-  try
-    d = gd_fragment_index(D, 'Anew20Z');
-  catch exc
-    ne = ne + check_exc2(exc, 225, 2, 'BadCode');
-  end
-
   % 226: fragment_affixes
   try
     d = gd_fragment_affixes(D, 1);
@@ -1979,8 +1954,8 @@ try
   try
     d = gd_entry_list(D, 'data', GD.SCALAR_ENTRIES, ...
     GD.ENTRIES_HIDDEN + GD.ENTRIES_NOALIAS);
-    ne = ne + check_sarray(239, d, {'mstr', 'mconst', 'mcarray', 'mnew11', ...
-    'mnew12', 'mnew17'});
+    ne = ne + check_sarray(239, d, {'mstr', 'mconst', 'mcarray', ...
+    'mnew11', 'mnew12', 'mnew17'});
   catch exc
     ne = ne + check_ok(exc, 239);
   end
@@ -2000,7 +1975,7 @@ try
     ne = ne + check_ok(exc, 241);
   end
 
-  % 242: gd_carrays
+  % 242: gd_mcarrays
   try
     d = gd_mcarrays(D, 'data');
     ne = ne + check_num2(242, 1, length(d), 2);
@@ -2010,18 +1985,22 @@ try
     ne = ne + check_ok(exc, 242);
   end
 
-  % 243: NULL return from gd_reference
+  % 271: gd_encoding_support
+  d = gd_encoding_support(GD.SIE_ENCODED);
+  ne = ne + check_num(271, d, GD.RDWR);
+
+  % 272: NULL return from gd_reference
   try
     d = gd_open('dirfile/empty', GD.RDWR + GD.CREAT + GD.EXCL);
   catch exc
-    ne = ne + check_ok2(exc, 242, 1);
+    ne = ne + check_ok2(exc, 272, 1);
   end
 
   try
     d = gd_reference(d);
-    ne = ne + check_string(242, d, '');
+    ne = ne + check_string(272, d, '');
   catch exc
-    ne = ne + check_ok2(exc, 242, 1);
+    ne = ne + check_ok2(exc, 272, 1);
   end
 
 
@@ -2052,6 +2031,7 @@ try
 
 
 
+
   gd_discard(D);
   rmdir(filedir, 's');
   if ne > 0
diff --git a/bindings/perl/GetData.pm.in b/bindings/perl/GetData.pm.in
index d206fb0..e1f4acf 100644
--- a/bindings/perl/GetData.pm.in
+++ b/bindings/perl/GetData.pm.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2011, 2015 D. V. Wiebe
+# Copyright (C) 2011-2013, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -158,6 +158,7 @@ The following encoding types are known by GetData:
 =over
 
 $GetData::BZIP2_ENCODED,
+$GetData::FLAC_ENCODED,
 $GetData::GZIP_ENCODED,
 $GetData::LZMA_ENCODED,
 $GetData::SIE_ENCODED,
@@ -338,6 +339,19 @@ Elements of the C<scalar> array which are undef indicate literal parameters
 undef is used in C<scalar_ind> where the C API uses -1, to indicate CONST
 fields, instead of CARRAYs.
 
+=head1 NON-MEMBER FUNCTIONS
+
+=over
+
+=item encoding_support ($ENCODING)
+
+Returns C<$GetData::RDWR> if the library can both read and write the specified
+encoding, C<$GetData::RDONLY> if it can only read, or -1 otherwise.
+C<$ENCODING> should be one of the encoding symbols listed above in the
+L</"Encoding Types"> section.
+
+=back
+
 =head1 DIRFILE CREATION METHODS
 
 =over
@@ -922,11 +936,11 @@ If C<$IN_FIELD> or C<$CHECK_FIELD> are undef, or if C<$WINDOP ==
 $GetData::WINDOP_UNK>, that paremeter is not changed. Otherwise,
 C<$WINDOP> should be one of the symbols listed under L</WINDOW Operators> above.
 
-=item $dirfile->bof ($FIELD_CODE)
+=item $dirfile->array_len ($FIELD_CODE)
 
 Z<>
 
-=item $dirfile->carray_len ($FIELD_CODE)
+=item $dirfile->bof ($FIELD_CODE)
 
 Z<>
 
@@ -944,11 +958,6 @@ $GetData::DEL_META.
 
 =back
 
-=item $dirfile->delete_alias ($FIELD_CODE, [$FLAGS])
-
-If not given, C<$FLAGS> defaults to 0; otherwise, see the description of
-L</delete> above for valid values.
-
 =item $dirfile->desync ([$FLAGS])
 
 If omitted, C<$FLAGS> defaults to zero.  Otherwise, it should be zero or more
@@ -1112,11 +1121,17 @@ Z<>
 
 =item $dirfile->move ($FIELD_CODE, $NEW_FRAGMENT, [$MOVE_DATA])
 
-If not given, C<$MOVE_DATA> defaults to 0.
+If not given, C<$FLAGS> defaults to 0.  Otherwise, it should be a bitwise or'd
+collection of zero or more of the following flags:
 
-=item $dirfile->move_alias ($FIELD_CODE, $NEW_FRAGMENT)
+=over
 
-Z<>
+$GetData::REN_DANGLE,
+$GetData::REN_DATA,
+$GetData::REN_FORCE,
+$GetData::REN_UPDB.
+
+=back
 
 =item $dirfile->mplex_lookback ($LOOKBACK)
 
@@ -1163,7 +1178,9 @@ collection of zero or more of the following flags:
 
 =over
 
+$GetData::REN_DANGLE,
 $GetData::REN_DATA,
+$GetData::REN_FORCE,
 $GetData::REN_UPDB.
 
 =back
@@ -1220,7 +1237,7 @@ If C<$PREFIX> is omitted or undef, the prefix is removed.
 
 =head1 COPYRIGHT
 
-Copyright (C) 2012 D. V. Wiebe
+Copyright (C) 2012-2015 D. V. Wiebe
 
 GetData is free software; you can redistribute it and/or modify it under the
 terms of the GNU Lesser General Public License as published by the Free Software
diff --git a/bindings/perl/GetData.xs b/bindings/perl/GetData.xs
index 5c24fcc..2d4f2f8 100644
--- a/bindings/perl/GetData.xs
+++ b/bindings/perl/GetData.xs
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2013 D. V. Wiebe
+/* Copyright (C) 2011-2015 D. V. Wiebe
  *
  **************************************************************************
  *
@@ -41,24 +41,17 @@
 
 #define undef &PL_sv_undef
 
-/* lfs hackery */
-#if defined _LARGEFILE64_SOURCE || (defined _FILE_OFFSET_BITS && \
-    _FILE_OFFSET_BITS == 64) || (defined __CYGWIN__) || (defined __APPLE__)
-# define gdp64(x) x ## 64
-#else
-# define gdp64(x) x
-#endif
-
 /* fake data types to simplify our typemap */
 typedef GD_DCOMPLEXP_t gdp_complex_in;
-typedef GD_DCOMPLEXA(gdpu_complex);
-typedef int gdpu_bitnum_t;
-typedef int gdpu_numbits_t;
-typedef gd_shift_t gdpu_shift_t;
-typedef unsigned int gdpu_uint_t;
-typedef gd_type_t gdpu_type_t;
-typedef int gdpu_int;
-typedef const char gdpu_char;
+typedef GD_DCOMPLEXA(gdp_complex);
+typedef int gdp_bitnum_t;
+typedef int gdp_numbits_t;
+typedef gd_shift_t gdp_shift_t;
+typedef unsigned int gdp_uint_t;
+typedef gd_type_t gdp_type_t;
+typedef int gdp_int;
+typedef const char gdp_char;
+typedef gd_entry_t gdp_pentry_t;
 
 #define GDP_DIRFILE_ALIAS \
   const char *gdp_package = ix ? "GetData::Dirifle" : "GetData";
@@ -95,7 +88,7 @@ static gd_type_t gdp_get_type(SV **sv, const char *pkg, const char *func)
 {
   dtrace("%p, \"%s\", \"%s\"", sv, pkg, func);
 
-  if (sv == NULL && *sv == undef)
+  if (sv == NULL || *sv == undef)
     croak("%s::%s() - Value may not be undef", pkg, func);
 
   if (sv_isa(*sv, "Math::Complex")) {
@@ -110,6 +103,73 @@ static gd_type_t gdp_get_type(SV **sv, const char *pkg, const char *func)
   return GD_FLOAT64;
 }
 
+/* convert a reference to a list of strings into a const char** */
+static const char **gdp_convert_const_avpv(SV *src, size_t *len_out,
+  const char *pkg, const char *func)
+{
+  const char **dst;
+
+  dtrace("%p, %p, \"%s\", \"%s\"", src, len_out, pkg, func);
+
+  if (src == undef) {
+    dst = NULL;
+    if (len_out)
+      *len_out = 0;
+  } else if (SvROK(src) && SvTYPE(SvRV(src)) == SVt_PVAV) {
+    AV *av = (AV*)SvRV(src);
+    I32 i, len = av_len(av);
+
+    dst = safemalloc(sizeof(char*) * (1 + len));
+    for (i = 0; i <= len; ++i) {
+      SV **sv = av_fetch(av, i, 0);
+      if (sv == NULL || SvTYPE(*sv) != SVt_PV) {
+        safefree(dst);
+        croak("%s::%s() - Expected array of strings", pkg, func);
+      }
+      dst[i] = SvPV_nolen(*av_fetch(av, i, 0));
+    }
+    if (len_out)
+      *len_out = (size_t)len + 1;
+  } else
+    croak("%s::%s - Expected array of strings", pkg, func);
+
+  dreturn("%p", dst);
+  return dst;
+}
+
+/* convert a string list or a reference to a list into a const char ** */
+static const char **gdp_convert_strarr(size_t *len_out,  I32 items, I32 ax,
+    int offs, const char *pkg, const char *func)
+{
+  const char **dst;
+
+  dtrace("%p, %i, %i, %i, \"%s\", \"%s\"", len_out, (int)items, (int)ax,
+      offs, pkg, func);
+
+  /* if we have more than one data argument, or the first argument is a
+   * string, assume it's not a reference */
+  if (items - offs > 1 || SvTYPE(ST(offs)) == SVt_PVAV) {
+    I32 i, len;
+    len = items - offs;
+    dst = safemalloc(sizeof(char*) * (items - offs));
+    for (i = 0; i < len; ++i) {
+      SV *sv = ST(offs + i);
+      if (SvTYPE(sv) != SVt_PV) {
+        safefree(dst);
+        croak("%s::%s() - Expected array of strings", pkg, func);
+      }
+      dst[i] = SvPV_nolen(sv);
+    }
+
+    if (len_out)
+      *len_out = len;
+  } else
+    dst = gdp_convert_const_avpv(ST(offs), len_out, pkg, func);
+
+  dreturn("%p", dst);
+  return dst;
+}
+
 /* convert a Perl object into a complex number */
 static void gdp_convert_cmp(GD_DCOMPLEXP_t val, SV *src, int *ok,
     const char* pkg, const char *func)
@@ -154,126 +214,241 @@ static void gdp_convert_cmp(GD_DCOMPLEXP_t val, SV *src, int *ok,
   dreturn("(%g;%g)", crealp(val), cimagp(val));
 }
 
-#define GDP_EHASH_FETCH(key) \
+#define GDP_EHASH_FETCH(part,key) \
   v = gdp_hv_fetchs((HV*)sv, key, 0); \
-  if (v == NULL) \
+  if (!part && v == NULL) \
     croak("%s::%s() - Missing required key '" key "' in entry hash", pkg, func)
 
-#define GDP_EHASH_FETCH_CMP(key,member) do { \
-    GDP_EHASH_FETCH(key); \
-    gdp_convert_cmp(gd_csp_(E->member), *v, NULL, pkg, func); \
+/* handle both "<foo>" and "c<foo>" names */
+#define GDP_EHASH_FETCH_CMP(part,key,member) do { \
+    GDP_EHASH_FETCH(1,"c" key); \
+    if (v == NULL) GDP_EHASH_FETCH(part,key); \
+    if (v) gdp_convert_cmp(gd_csp_(E->member), *v, NULL, pkg, func); \
   } while(0)
 
-#define GDP_EHASH_FETCH_IV(key,member,type) \
-  do { GDP_EHASH_FETCH(key); E->member = (type)SvIV(*v); } while(0)
-
-#define GDP_EHASH_FETCH_NV(key,member) \
-  do { GDP_EHASH_FETCH(key); E->member = SvNV(*v); } while(0)
+#define GDP_EHASH_FETCH_IV(part,key,variable,type) \
+  do { GDP_EHASH_FETCH(part,key); if (v) variable = (type)SvIV(*v); } while(0)
 
-#define GDP_EHASH_FETCH_UV(key,member,type) \
-  do { GDP_EHASH_FETCH(key); E->member = (type)SvUV(*v); } while(0)
+#define GDP_EHASH_FETCH_NV(part,key,member) \
+  do { GDP_EHASH_FETCH(part,key); if (v) E->member = SvNV(*v); } while(0)
 
-#define GDP_EHASH_FETCH_UV_REQ(key,member,type) \
-  do { GDP_EHASH_FETCH_REQ(key); E->member = (type)SvUV(*v); } while(0)
+#define GDP_EHASH_FETCH_UV(part,key,member,type) \
+  do { GDP_EHASH_FETCH(part,key); if (v) E->member = (type)SvUV(*v); } while(0)
 
-#define GDP_EHASH_FETCH_PV(key,member) \
+#define GDP_EHASH_FETCH_PV(part,key,member) \
  do { \
-    GDP_EHASH_FETCH(key); \
-    E->member = (!SvOK(*v)) ? NULL : SvPV_nolen(*v); \
+    GDP_EHASH_FETCH(part,key); \
+    if (v) E->member = (!SvOK(*v)) ? NULL : SvPV_nolen(*v); \
   } while(0)
 
 /* populate a complex double array in gd_entry_t */
-static void gdp_fetch_cmp_list(GD_DCOMPLEXV(c), HV *hv, const char* key,
-  int n, const char *pkg, const char *func)
+static int gdp_fetch_cmp_list(GD_DCOMPLEXV(c), HV *hv, int partial, char key,
+    int min, int max, unsigned mask, const char *pkg, const char *func)
 {
-  dtrace("%p, %p, \"%s\", %i, \"%s\", \"%s\"", c, hv, key, n, pkg, func);
-  int i;
-  SV **v = hv_fetch(hv, key, strlen(key), 0);
+  dtrace("%p, %p, %i, '%c', %i, %i, 0x%X, \"%s\", \"%s\"", c, hv, partial, key,
+      min, max, mask, pkg, func);
+
+  int i, n = 0;
+  char ckey[3] = { 'c', key, 0 };
+  int have[GD_MAX_POLYORD + 1];
+  SV **v, *sv = NULL;
+
+  /* try without the 'c' prefix */
+  v = hv_fetch(hv, ckey + 1, 1, 0);
 
+  /* try with the 'c' prefix */
   if (v == NULL)
-    croak("%s::%s() - Missing required key '%s' in entry hash", pkg, func, key);
+    v = hv_fetch(hv, ckey, 2, 0);
 
-  if (SvTYPE(*v) != SVt_PVAV)
-    croak("%s::%s() - Key '%s' must be list in entry hash", pkg, func, key);
+  /* de-reference as needed */
+  if (v) {
+    sv = *v;
+    while (SvROK(sv))
+      sv = SvRV(sv);
+  }
 
-  for (i = 0; i < n; ++i) {
-    v = av_fetch((AV*)*v, i, 0);
-    if (v)
-      gdp_convert_cmp(gd_cap_(c,i), *v, NULL, pkg, func);
+  if (sv == NULL || SvTYPE(sv) == SVt_NULL) {
+    if (partial) {
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    croak("%s::%s() - Missing required key '%c' in entry hash", pkg, func,
+        key);
   }
 
-  dreturnvoid();
+  memset(have, 0, sizeof(int) * (GD_MAX_POLYORD + 1));
+  for (i = 0; i < max; ++i)
+    if (mask & (1 << i))
+      have[i] = 1;
+
+  if (SvTYPE(sv) != SVt_PVAV)
+    croak("%s::%s() - Key '%c' must be list in entry hash (%i)", pkg, func, key,
+    SvTYPE(sv));
+
+  for (i = 0; i < GD_MAX_LINCOM; ++i)
+    if (!have[i]) {
+      v = av_fetch((AV*)sv, i, 0);
+      if (v) {
+        if (i < max)
+          gdp_convert_cmp(gd_cap_(c,i), *v, NULL, pkg, func);
+        have[i] = 1;
+      }
+    }
+
+  /* find n */
+  for (i = 0; i < GD_MAX_POLYORD + 1; ++i)
+    if (i >= n && have[n])
+      n = i + 1;
+
+  if (n < min || n > max)
+    croak("%s::%s() - Bad array length (%i) for key '%c' in entry hash", pkg,
+        func, n, key);
+
+  dreturn("%i", n);
+  return n;
 }
 
 /* populate in_fields in gd_entry_t */
-static void gdp_fetch_in_fields(char **in_fields, SV *sv, int n,
-  const char *pkg, const char *func)
+static int gdp_fetch_in_fields(char **in_fields, SV *sv, int partial, int min,
+    int max, const char *pkg, const char *func)
 {
-  dtrace("%p, %p, %i, \"%s\", \"%s\"", in_fields, sv, n, pkg, func);
-  int i;
-  SV **v;
+  dtrace("%p, %p, %i, %i, %i, \"%s\", \"%s\"", in_fields, sv, partial, min, max,
+      pkg, func);
 
-  GDP_EHASH_FETCH("in_fields");
+  int i, n = 0;
+  SV **v, *vv;
 
-  if (SvTYPE(*v) != SVt_PVAV)
-    croak("%s::%s() - Key 'in_fields' must be list in entry hash", pkg, func);
+  GDP_EHASH_FETCH(partial, "in_fields");
+  if (partial && !v) {
+    dreturn("%i", 0);
+    return 0;
+  }
 
-  for (i = 0; i < n; ++i) {
-    v = av_fetch((AV*)*v, i, 0);
-    if (v)
-      in_fields[i] = SvPV_nolen(*v);
+  /* de-reference as needed */
+  vv = *v;
+  while (SvROK(vv))
+    vv = SvRV(vv);
+
+  if (SvTYPE(vv) == SVt_NULL) { /* undef */
+    dreturn("%i", 0);
+    return 0;
   }
 
-  dreturnvoid();
+  if (SvTYPE(vv) != SVt_PVAV) {
+    if (SvOK(vv)) {
+      n = 1;
+      in_fields[0] = SvPV_nolen(vv);
+    } else
+      croak("%s::%s() - Key 'in_fields' must be list or string in entry hash",
+          pkg, func);
+  } else {
+    int have[GD_MAX_LINCOM * 2];
+
+    memset(have, 0, sizeof(int) * GD_MAX_LINCOM * 2);
+
+    for (i = 0; i < GD_MAX_LINCOM; ++i) {
+      v = av_fetch((AV*)vv, i, 0);
+      if (v) {
+        if (i < max)
+          in_fields[i] = SvPV_nolen(*v);
+        have[i] = 1;
+      }
+    }
+
+    /* find n */
+    for (i = 0; i < GD_MAX_LINCOM; ++i)
+      if (i >= n && have[n])
+        n = i + 1;
+  }
+
+  if (n < min || n > max) {
+    croak("%s::%s() - Bad array length (%i) for key 'in_fields' in entry hash",
+        pkg, func, n);
+  }
+
+  dreturn("%i", n);
+  return n;
 }
 
 /* populate scalar elements of gd_entry_t */
-static void gdp_fetch_scalars(gd_entry_t *E, HV *hv, unsigned int mask,
+static unsigned gdp_fetch_scalars(gd_entry_t *E, HV *hv, unsigned int mask,
   const char *pkg, const char* func)
 {
   dtrace("%p, %p, %06x \"%s\", \"%s\"", E, hv, mask, pkg, func);
   int i;
+  unsigned mask_out = 0;
 
-  SV **scalar = gdp_hv_fetchs(hv, "scalar", 0);
-  SV **scalar_ind = gdp_hv_fetchs(hv, "scalar_ind", 0);
-  SV **v;
+  SV *scalar, *scalar_ind = NULL;
+  SV **v = gdp_hv_fetchs(hv, "scalar", 0);
 
   /* there's no point in recording scalar indicies if we don't have scalars */
-  if (scalar == NULL) {
-    dreturnvoid();
-    return;
+  if (v == NULL) {
+    dreturn("%i", 0);
+    return 0;
   }
 
-  if (SvTYPE(*scalar) != SVt_PVAV)
+  scalar = *v;
+  while (SvROK(scalar))
+    scalar = SvRV(scalar);
+
+  if (SvTYPE(scalar) == SVt_NULL) { /* drop undef */
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  v = gdp_hv_fetchs(hv, "scalar_ind", 0);
+  if (v) {
+    scalar_ind = *v;
+    while (SvROK(scalar_ind))
+      scalar_ind = SvRV(scalar_ind);
+
+    if (SvTYPE(scalar_ind) == SVt_NULL)
+      scalar_ind == NULL;
+  }
+
+  if (SvTYPE(scalar) != SVt_PVAV)
     croak("%s::%s() - Key 'scalar' must be list in entry hash", pkg, func);
-  if (scalar_ind && SvTYPE(*scalar_ind) != SVt_PVAV)
+  if (scalar_ind && SvTYPE(scalar_ind) != SVt_PVAV)
     croak("%s::%s() - Key 'scalar_ind' must be list in entry hash", pkg, func);
 
   for (i = 0; i <= GD_MAX_POLYORD; ++i)
     if (mask & (1 << i)) {
-      v = av_fetch((AV*)*scalar, i, 0);
-      if (v) {
+      v = av_fetch((AV*)scalar, i, 0);
+      if (v == NULL || SvTYPE(*v) == SVt_NULL)
+        E->scalar[i] = NULL; /* skip */
+      else {
         E->scalar[i] = SvPV_nolen(*v);
+        mask_out |= (1 << i);
         if (scalar_ind) {
-          v = av_fetch((AV*)*scalar_ind, i, 0);
-          if (v)
+          v = av_fetch((AV*)scalar_ind, i, 0);
+          if (v && SvTYPE(*v) != SVt_NULL)
             E->scalar_ind[i] = SvIV(*v);
-        }
+          else
+            E->scalar_ind[i] = 0;
+        } else
+          E->scalar_ind[i] = 0;
       }
     }
 
-  dreturnvoid();
+  dreturn("%u", mask_out);
+  return mask_out;
 }
 
 /* convert a Perl hash into a gd_entry_t */
-static void gdp_to_entry(gd_entry_t *E, SV *sv, const char *pkg,
-  const char *func)
+static void gdp_to_entry(gd_entry_t *E, SV *sv, const gd_entry_t *old_E,
+    const char *pkg, const char *func)
 {
-  dtrace("%p, %p, \"%s\", \"%s\"", E, sv, pkg, func);
+  dtrace("%p, %p, %p, \"%s\", \"%s\"", E, sv, old_E, pkg, func);
   SV **v;
-  int n;
+  int n, min, max;
+  unsigned mask, tmask;
+  const int partial = (old_E != NULL);
 
-  memset(E, 0, sizeof(gd_entry_t));
+  if (partial)
+    memcpy(E, old_E, sizeof(gd_entry_t));
+  else
+    memset(E, 0, sizeof(gd_entry_t));
 
   /* de-reference as needed */
   while (SvROK(sv))
@@ -282,90 +457,161 @@ static void gdp_to_entry(gd_entry_t *E, SV *sv, const char *pkg,
   if (SvTYPE(sv) != SVt_PVHV)
     croak("%s::%s() - Entry must be hash", pkg, func);
 
-  GDP_EHASH_FETCH_UV("field_type", field_type, gd_entype_t);
-  GDP_EHASH_FETCH_PV("field", field);
-  GDP_EHASH_FETCH_UV("fragment_index", fragment_index, int);
+  GDP_EHASH_FETCH_UV(0, "field_type", field_type, gd_entype_t);
+  GDP_EHASH_FETCH_PV(partial, "field", field);
+  GDP_EHASH_FETCH_UV(partial, "fragment_index", fragment_index, int);
 
   switch (E->field_type) {
     case GD_BIT_ENTRY:
     case GD_SBIT_ENTRY:
-      GDP_EHASH_FETCH_PV("in_fields", in_fields[0]);
-      GDP_EHASH_FETCH_UV("bitnum", EN(bit,bitnum), int);
-      GDP_EHASH_FETCH_UV("numbits", EN(bit,numbits), int);
-      gdp_fetch_scalars(E, (HV*)sv, 0x3, pkg, func);
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func);
+
+      mask = gdp_fetch_scalars(E, (HV*)sv, 0x3, pkg, func);
+
+      if (!(mask & 1))
+        GDP_EHASH_FETCH_UV(partial, "bitnum", EN(bit,bitnum), int);
+
+      if (!(mask & 2)) {
+        GDP_EHASH_FETCH_UV(1, "numbits", EN(bit,numbits), int);
+        if (v == NULL)
+          if (!partial)
+            E->EN(bit,numbits) = 1;
+      }
+
       break;
     case GD_CARRAY_ENTRY:
-      GDP_EHASH_FETCH_IV("array_len", EN(scalar,array_len), size_t);
+      GDP_EHASH_FETCH_IV(partial, "array_len", E->EN(scalar,array_len), size_t);
       /* fallthrough */
     case GD_CONST_ENTRY:
-      GDP_EHASH_FETCH_UV("const_type", EN(scalar,const_type), gd_type_t);
+      GDP_EHASH_FETCH_UV(partial, "const_type", EN(scalar,const_type),
+          gd_type_t);
       break;
     case GD_LINCOM_ENTRY:
-      GDP_EHASH_FETCH_IV("n_fields", EN(lincom,n_fields), int);
-      n = (E->EN(lincom,n_fields) > GD_MAX_LINCOM) ? GD_MAX_LINCOM
-        : E->EN(lincom,n_fields);
-      gdp_fetch_in_fields(E->in_fields, sv, n, pkg, func);
-      E->comp_scal = 1;
-      gdp_fetch_cmp_list(E->EN(lincom,cm), (HV*)sv, "cm", n, pkg, func);
-      gdp_fetch_cmp_list(E->EN(lincom,cb), (HV*)sv, "cb", n, pkg, func);
-      gdp_fetch_scalars(E, (HV*)sv, ((1 << n) - 1) * 9, pkg, func);
+      GDP_EHASH_FETCH_IV(1, "n_fields", n, int);
+      if (v) {
+        if (n > GD_MAX_LINCOM || n < 1)
+          croak("%s::%s() - n_fields out of range", pkg, func);
+
+        min = max = n;
+      } else {
+        min = 1;
+        max = GD_MAX_LINCOM;
+      }
+
+      E->EN(lincom,n_fields) = gdp_fetch_in_fields(E->in_fields, sv, partial,
+          min, max, pkg, func);
+
+      if (E->EN(lincom,n_fields) != 0)
+        min = max = E->EN(lincom,n_fields);
+
+      E->flags |= GD_EN_COMPSCAL;
+      tmask = (1 << max) - 1;
+
+      mask = gdp_fetch_scalars(E, (HV*)sv, ((1 << max) - 1) * 9, pkg, func);
+
+      if ((mask & tmask) != tmask) {
+        E->EN(lincom,n_fields) = gdp_fetch_cmp_list(E->EN(lincom,cm), (HV*)sv,
+            partial, 'm', min, max, mask, pkg, func);
+
+        if (E->EN(lincom,n_fields) != 0)
+          min = max = E->EN(lincom,n_fields);
+      }
+
+      if (((mask >> GD_MAX_LINCOM) & tmask) != tmask)
+        E->EN(lincom,n_fields) = gdp_fetch_cmp_list(E->EN(lincom,cb), (HV*)sv,
+            partial, 'b', min, max, mask >> GD_MAX_LINCOM, pkg, func);
+      else
+        E->EN(lincom,n_fields) = max;
       break;
     case GD_LINTERP_ENTRY:
-      GDP_EHASH_FETCH_PV("in_fields", in_fields[0]);
-      GDP_EHASH_FETCH_PV("table", EN(linterp,table));
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func);
+      GDP_EHASH_FETCH_PV(partial, "table", EN(linterp,table));
       break;
     case GD_MULTIPLY_ENTRY:
     case GD_DIVIDE_ENTRY:
-      gdp_fetch_in_fields(E->in_fields, sv, 2, pkg, func);
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 2, 2, pkg, func);
       break;
     case GD_PHASE_ENTRY:
-      GDP_EHASH_FETCH_PV("in_fields", in_fields[0]);
-      GDP_EHASH_FETCH_IV("shift", EN(phase,shift), gd_shift_t);
-      gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func);
+
+      mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+
+      if (!(mask & 1))
+        GDP_EHASH_FETCH_IV(partial, "shift", E->EN(phase,shift), gd_shift_t);
       break;
     case GD_POLYNOM_ENTRY:
-      GDP_EHASH_FETCH_PV("in_fields", in_fields[0]);
-      GDP_EHASH_FETCH_IV("poly_ord", EN(polynom,poly_ord), int);
-      n = (E->EN(polynom,poly_ord) > GD_MAX_POLYORD) ? GD_MAX_POLYORD
-        : E->EN(polynom,poly_ord);
-      E->comp_scal = 1;
-      gdp_fetch_cmp_list(E->EN(polynom,ca), (HV*)sv, "ca", n, pkg, func);
-      gdp_fetch_scalars(E, (HV*)sv, (1 << (n + 1)) - 1, pkg, func);
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func);
+
+      GDP_EHASH_FETCH_IV(1, "poly_ord", n, int);
+      if (v) {
+        if (n > GD_MAX_POLYORD || n < 1)
+          croak("%s::%s() - poly_ord out of range", pkg, func);
+
+        min = max = n + 1;
+      } else {
+        min = 2;
+        max = GD_MAX_POLYORD + 1;
+      }
+
+      mask = gdp_fetch_scalars(E, (HV*)sv, (1 << (max + 1)) - 1, pkg, func);
+      tmask = (1 << max) - 1;
+
+      E->flags |= GD_EN_COMPSCAL;
+      if ((mask & tmask) != tmask)
+        E->EN(polynom,poly_ord) = gdp_fetch_cmp_list(E->EN(polynom,ca), (HV*)sv,
+            partial, 'a', min, max, mask, pkg, func) - 1;
+      else
+        E->EN(polynom,poly_ord) = max - 1;
       break;
     case GD_RECIP_ENTRY:
-      GDP_EHASH_FETCH_PV("in_fields", in_fields[0]);
-      E->comp_scal = 1;
-      GDP_EHASH_FETCH_CMP("cdividend", EN(recip,cdividend));
-      gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func);
+      mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+
+      E->flags |= GD_EN_COMPSCAL;
+      if (!(mask & 1))
+        GDP_EHASH_FETCH_CMP(partial, "dividend", EN(recip,cdividend));
       break;
     case GD_WINDOW_ENTRY:
-      gdp_fetch_in_fields(E->in_fields, sv, 2, pkg, func);
-      GDP_EHASH_FETCH_IV("windop", EN(window,windop), gd_windop_t);
-      switch(E->EN(window,windop)) {
-        case GD_WINDOP_EQ:
-        case GD_WINDOP_NE:
-          GDP_EHASH_FETCH_IV("threshold", EN(window,threshold).i, int64_t);
-          break;
-        case GD_WINDOP_SET:
-        case GD_WINDOP_CLR:
-          GDP_EHASH_FETCH_UV("threshold", EN(window,threshold).u, uint64_t);
-          break;
-        default:
-          GDP_EHASH_FETCH_NV("threshold", EN(window,threshold).r);
-          break;
-      }
-      gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 2, 2, pkg, func);
+      GDP_EHASH_FETCH_IV(partial, "windop", E->EN(window,windop), gd_windop_t);
+
+      mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+
+      if (!(mask & 1))
+        switch(E->EN(window,windop)) {
+          case GD_WINDOP_EQ:
+          case GD_WINDOP_NE:
+            GDP_EHASH_FETCH_IV(partial, "threshold", E->EN(window,threshold).i,
+                int64_t);
+            break;
+          case GD_WINDOP_SET:
+          case GD_WINDOP_CLR:
+            GDP_EHASH_FETCH_UV(partial, "threshold", EN(window,threshold).u,
+                uint64_t);
+            break;
+          default:
+            GDP_EHASH_FETCH_NV(partial, "threshold", EN(window,threshold).r);
+            break;
+        }
       break;
     case GD_MPLEX_ENTRY:
-      gdp_fetch_in_fields(E->in_fields, sv, 2, pkg, func);
-      GDP_EHASH_FETCH_UV("count_val", EN(mplex,count_val), int);
-      GDP_EHASH_FETCH_UV("period", EN(mplex,period), int);
-      gdp_fetch_scalars(E, (HV*)sv, 0x3, pkg, func);
+      gdp_fetch_in_fields(E->in_fields, sv, partial, 2, 2, pkg, func);
+
+      mask = gdp_fetch_scalars(E, (HV*)sv, 0x3, pkg, func);
+
+      if (!(mask & 1))
+        GDP_EHASH_FETCH_UV(partial, "count_val", EN(mplex,count_val), int);
+
+      if (!(mask & 2))
+        GDP_EHASH_FETCH_UV(1, "period", EN(mplex,period), int);
       break;
     case GD_RAW_ENTRY:
-      GDP_EHASH_FETCH_UV("spf", EN(raw,spf), unsigned int);
-      GDP_EHASH_FETCH_UV("data_type", EN(raw,data_type), gd_type_t);
-      gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+      GDP_EHASH_FETCH_UV(partial, "data_type", EN(raw,data_type), gd_type_t);
+
+      mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func);
+
+      if (!(mask & 1))
+        GDP_EHASH_FETCH_UV(partial, "spf", EN(raw,spf), unsigned int);
       break;
     case GD_NO_ENTRY:
     case GD_INDEX_ENTRY:
@@ -605,7 +851,23 @@ static SV *gdp_newSVcmp(double r, double i)
   return sv;
 }
 
-/* convert a char ** into a reference to a list of strings */
+/* convert a NULL-terminated char ** into a reference to a list of strings */
+static SV *gdp_newRVavpv0(const char **l)
+{
+  dtrace("%p", l);
+  SV *rv;
+  int i;
+  AV *av = newAV();
+
+  for (i = 0; l[i]; ++i)
+    av_store(av, i, newSVpv(l[i], 0));
+
+  rv = newRV_noinc((SV*)av);
+  dreturn("%p", rv);
+  return rv;
+}
+
+/* convert a char ** with length into a reference to a list of strings */
 static SV *gdp_newRVavpv(const char **l, size_t n)
 {
   dtrace("%p, %zi", l, n);
@@ -680,6 +942,8 @@ static int gdp_parser_callback(gd_parser_data_t *pdata, void *extra)
   SV *ret, **dummy;
   int n, sem = GD_SYNTAX_ABORT;
   int was_rv = 0;
+  AV *av;
+  int len;
 
   /* local stack pointer */
   dSP;
@@ -732,56 +996,53 @@ static int gdp_parser_callback(gd_parser_data_t *pdata, void *extra)
 
   /* ferret out response */
   switch (SvTYPE(ret)) {
-    AV *av;
-    int len;
-
     case SVt_IV:
-    sem = SvIV(ret);
-    break;
+      sem = SvIV(ret);
+      break;
     case SVt_PVAV:
-    av = (AV *)ret;
-    len = av_len(av);
-    if (len < 0) {
-      croak("GetData: parser callback returned empty array.");
-      return GD_SYNTAX_ABORT; /* ca'n't get here */
-    } else if (len > 1) {
-      croak("GetData: too many elements in array returned by parser "
-          "callback.");
-      return GD_SYNTAX_ABORT; /* ca'n't get here */
-    } else if (len == 0) {
-      SV **val = av_fetch(av, 0, 0);
-      if (val == NULL || SvROK(*val)) {
-        croak("GetData: bad data type in array returned by parser callback.");
+      av = (AV *)ret;
+      len = av_len(av);
+      if (len < 0) {
+        croak("GetData: parser callback returned empty array.");
         return GD_SYNTAX_ABORT; /* ca'n't get here */
-      }
-
-      if (SvTYPE(*val) == SVt_IV) {
-        sem = SvIV(*val);
-      } else if (SvTYPE(*val) == SVt_PV) {
-        pdata->line = strdup(SvPV_nolen(*val));
-        sem = GD_SYNTAX_RESCAN;
-      } else {
-        croak("GetData: bad data type in array returned by parser callback.");
+      } else if (len > 1) {
+        croak("GetData: too many elements in array returned by parser "
+            "callback.");
         return GD_SYNTAX_ABORT; /* ca'n't get here */
-      }
-    } else { /* len == 1 */
-      SV **val0 = av_fetch(av, 0, 0);
-      SV **val1 = av_fetch(av, 1, 0);
+      } else if (len == 0) {
+        SV **val = av_fetch(av, 0, 0);
+        if (val == NULL || SvROK(*val)) {
+          croak("GetData: bad data type in array returned by parser callback.");
+          return GD_SYNTAX_ABORT; /* ca'n't get here */
+        }
 
-      if (val0 == NULL || SvROK(*val0) || val1 == NULL || SvROK(*val1)) {
-        croak("GetData: bad data type in array returned by parser callback.");
-        return GD_SYNTAX_ABORT; /* ca'n't get here */
-      }
+        if (SvTYPE(*val) == SVt_IV) {
+          sem = SvIV(*val);
+        } else if (SvTYPE(*val) == SVt_PV) {
+          pdata->line = strdup(SvPV_nolen(*val));
+          sem = GD_SYNTAX_RESCAN;
+        } else {
+          croak("GetData: bad data type in array returned by parser callback.");
+          return GD_SYNTAX_ABORT; /* ca'n't get here */
+        }
+      } else { /* len == 1 */
+        SV **val0 = av_fetch(av, 0, 0);
+        SV **val1 = av_fetch(av, 1, 0);
 
-      if (SvTYPE(*val0) == SVt_IV && SvTYPE(*val1) == SVt_PV) {
-        sem = SvIV(*val0);
-        pdata->line = strdup(SvPV_nolen(*val1));
-      } else {
-        croak("GetData: bad data type in array returned by parser callback.");
-        return GD_SYNTAX_ABORT; /* ca'n't get here */
+        if (val0 == NULL || SvROK(*val0) || val1 == NULL || SvROK(*val1)) {
+          croak("GetData: bad data type in array returned by parser callback.");
+          return GD_SYNTAX_ABORT; /* ca'n't get here */
+        }
+
+        if (SvTYPE(*val0) == SVt_IV && SvTYPE(*val1) == SVt_PV) {
+          sem = SvIV(*val0);
+          pdata->line = strdup(SvPV_nolen(*val1));
+        } else {
+          croak("GetData: bad data type in array returned by parser callback.");
+          return GD_SYNTAX_ABORT; /* ca'n't get here */
+        }
       }
-    }
-    break;
+      break;
     case SVt_PV:
     pdata->line = strdup(SvPV_nolen(ret));
     sem = GD_SYNTAX_RESCAN;
@@ -981,7 +1242,7 @@ get_carray(dirfile, field_code, return_type)
   PPCODE:
     dtrace("%p, \"%s\", %03x; %i", dirfile, field_code, return_type,
         (int)GIMME_V);
-    size_t len = gd_carray_len(dirfile, field_code);
+    size_t len = gd_array_len(dirfile, field_code);
     data_out = safemalloc(GD_SIZE(return_type) * len);
     gd_get_carray(dirfile, field_code, return_type, data_out);
 
@@ -1172,7 +1433,8 @@ entry(dirfile, field_code)
           GDP_PUSHrvavcmp(E.EN(lincom,cm), E.EN(lincom,n_fields));
           GDP_PUSHpvn("b");
           GDP_PUSHrvavcmp(E.EN(lincom,cb), E.EN(lincom,n_fields));
-          sp = gdp_store_scalars(sp, &E, ((1 << E.EN(lincom,n_fields)) - 1) * 9);
+          sp = gdp_store_scalars(sp, &E,
+              ((1 << E.EN(lincom,n_fields)) - 1) * 9);
           break;
         case GD_LINTERP_ENTRY:
           GDP_PUSHpvn("in_fields");
@@ -1431,18 +1693,20 @@ discard(dirfile)
     dreturn("%i", RETVAL);
 
 void
-getdata(dirfile, field_code, first_frame, first_samp, num_frames, num_samp, return_type)
+getdata(dirfile, field_code, first_frame, first_samp, num_frames, num_samp, return_type=GD_UNKNOWN)
   DIRFILE * dirfile
   const char * field_code
-  off64_t first_frame
-  off64_t first_samp
+  gd_off64_t first_frame
+  gd_off64_t first_samp
   size_t num_frames
   size_t num_samp
   gd_type_t return_type
   PREINIT:
-    void *data_out = NULL;
     unsigned int spf = 1;
+    gd_entype_t t;
     GDP_DIRFILE_ALIAS;
+    size_t i, len;
+    void * data_out;
   ALIAS:
     GetData::Dirfile::getdata = 1
   PPCODE:
@@ -1450,21 +1714,30 @@ getdata(dirfile, field_code, first_frame, first_samp, num_frames, num_samp, retu
         (long long)first_frame, (long long)first_samp, num_frames, num_samp,
         return_type, (int)GIMME_V);
 
+    t = gd_entry_type(dirfile, field_code);
+
+    GDP_UNDEF_ON_ERROR();
+
     if (num_frames) {
       spf = gd_spf(dirfile, field_code);
 
+      num_samp += spf * num_frames;
+
       GDP_UNDEF_ON_ERROR();
     }
 
-    data_out = safemalloc(GD_SIZE(return_type) * (spf * num_frames + num_samp));
+    if (return_type == GD_UNKNOWN)
+      croak("%s::getdata() - No return type specified", gdp_package);
+      
+    data_out = safemalloc(GD_SIZE(return_type) * num_samp);
 
-    size_t len = gdp64(gd_getdata)(dirfile, field_code, first_frame, first_samp,
-        num_frames, num_samp, return_type, data_out);
+    len = gd_getdata64(dirfile, field_code, first_frame, first_samp, 0,
+        num_samp, return_type, data_out);
 
     GDP_UNDEF_ON_ERROR(safefree(data_out));
 
-    /* In array context, unpack the array and push it onto the stack, otherwise
-     * just return the packed data */
+    /* In array context, unpack the array and push it onto the stack,
+     * otherwise just return the packed data */
     if (GIMME_V == G_ARRAY)
       sp = (SV **)gdp_unpack(sp, data_out, len, return_type);
     else
@@ -1535,9 +1808,9 @@ field_list_by_type(dirfile, type)
 void
 entry_list(dirfile, parent, type, flags)
     DIRFILE * dirfile
-    gdpu_char * parent
-    gdpu_int    type
-    gdpu_uint_t flags
+    gdp_char * parent
+    gdp_int    type
+    gdp_uint_t flags
   PREINIT:
     GDP_DIRFILE_ALIAS;
   ALIAS:
@@ -1775,7 +2048,7 @@ int
 put_carray_slice(dirfile, field_code, start, d, ...)
     DIRFILE * dirfile
     const char * field_code
-    off64_t start
+    gd_off64_t start
     SV *d;
   PREINIT:
     GDP_DIRFILE_ALIAS;
@@ -1786,7 +2059,7 @@ put_carray_slice(dirfile, field_code, start, d, ...)
     dtrace("%p, \"%s\", %lli, %p, ...[%li]", dirfile, field_code,
         (long long)start, d, (long)items - 4);
 
-    din = gdp_convert_data(d, items, ax, 3, gdp_package, "put_carray");
+    din = gdp_convert_data(d, items, ax, 3, gdp_package, "put_carray_slice");
 
     RETVAL = gd_put_carray_slice(dirfile, field_code, start, din.nsamp,
         din.type, din.data_in);
@@ -1816,7 +2089,7 @@ add_carray(dirfile, field_code, const_type, fragment_index, d, ...)
     dtrace("%p, \"%s\", %03x, %i, %p, ...[%li]", dirfile, field_code,
         const_type, fragment_index, d, (long)items - 5);
 
-    din = gdp_convert_data(d, items, ax, 4, gdp_package, "put_carray");
+    din = gdp_convert_data(d, items, ax, 4, gdp_package, "add_carray");
 
     RETVAL = gd_add_carray(dirfile, field_code, const_type, din.nsamp,
         din.type, din.data_in, fragment_index);
@@ -1846,7 +2119,7 @@ madd_carray(dirfile, parent, field_code, const_type, d, ...)
     dtrace("%p, \"%s\", \"%s\", %03x, %p, ...[%li]", dirfile, parent,
         field_code, const_type, d, (long)items - 5);
 
-    din = gdp_convert_data(d, items, ax, 4, gdp_package, "put_carray");
+    din = gdp_convert_data(d, items, ax, 4, gdp_package, "madd_carray");
 
     RETVAL = gd_madd_carray(dirfile, parent, field_code, const_type, din.nsamp,
         din.type, din.data_in);
@@ -1864,8 +2137,8 @@ size_t
 putdata(dirfile, field_code, first_frame, first_sample, d, ...)
     DIRFILE * dirfile
     const char * field_code
-    off64_t first_frame
-    off64_t first_sample
+    gd_off64_t first_frame
+    gd_off64_t first_sample
     SV *d;
   PREINIT:
     GDP_DIRFILE_ALIAS;
@@ -2078,8 +2351,8 @@ include(dirfile, file, fragment_index, flags, prefix=NULL, suffix=NULL)
 	const char * file
 	int fragment_index
 	unsigned long int flags
-	gdpu_char * prefix
-	gdpu_char * suffix
+	gdp_char * prefix
+	gdp_char * suffix
 	PREINIT:
 		GDP_DIRFILE_ALIAS;
 	ALIAS:
@@ -2095,4 +2368,22 @@ include(dirfile, file, fragment_index, flags, prefix=NULL, suffix=NULL)
 	CLEANUP:
 		dreturn("%i", RETVAL);
 
+size_t
+carray_len(dirfile, field_code)
+	DIRFILE * dirfile
+	const char * field_code
+	PREINIT:
+		GDP_DIRFILE_ALIAS;
+	ALIAS:
+		GetData::Dirfile::carray_len = 1
+	CODE:
+		dtrace("%p, \"%s\"", dirfile, field_code);
+    warn("carray_len is deprecated.  Use array_len instead.");
+		RETVAL = gd_array_len(dirfile, field_code);
+		GDP_UNDEF_ON_ERROR();
+	OUTPUT:
+		RETVAL
+	CLEANUP:
+		dreturn("%zi", RETVAL);
+
 INCLUDE: simple_funcs.xs
diff --git a/bindings/perl/Makefile.am b/bindings/perl/Makefile.am
index 7a7a78d..7f59599 100644
--- a/bindings/perl/Makefile.am
+++ b/bindings/perl/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2011, 2012, 2015 D. V. Wiebe
+# Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/bindings/perl/Makefile.in b/bindings/perl/Makefile.in
index f971384..cfd302f 100644
--- a/bindings/perl/Makefile.in
+++ b/bindings/perl/Makefile.in
@@ -85,10 +85,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -177,6 +175,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -202,8 +202,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -251,7 +262,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -266,12 +276,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -335,9 +349,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -345,6 +360,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -358,7 +374,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2011, 2012, 2015 D. V. Wiebe
+# Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/bindings/perl/funclist.pl b/bindings/perl/funclist.pl
index 2f61a80..b1f4b37 100644
--- a/bindings/perl/funclist.pl
+++ b/bindings/perl/funclist.pl
@@ -1,3 +1,24 @@
+# Copyright (C) 2011 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+use strict;
 use strict;
 use warnings;
 
diff --git a/bindings/perl/simple_funcs.pl b/bindings/perl/simple_funcs.pl
index 4864a42..be6e2ac 100644
--- a/bindings/perl/simple_funcs.pl
+++ b/bindings/perl/simple_funcs.pl
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2011-2013 D. V. Wiebe
+# Copyright (C) 2011-2013, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -41,11 +41,11 @@ sub printmunge {
   my ($t, $n) = @$_;
 
   return "&$n" if ($t =~ /&$/);
-  return "(long long)$n" if ($t eq "off64_t" or $t eq "gd_shift_t" or
-    $t eq "gdpu_shift_t" or $t eq "int64_t");
+  return "(long long)$n" if ($t eq "gd_off64_t" or $t eq "gd_shift_t" or
+    $t eq "gdp_shift_t" or $t eq "int64_t");
   return "(unsigned long long)$n" if ($t eq "uint64_t");
   return "creal($n), cimag($n)" if ($t eq "_Complex double" or
-    $t eq "gdpu_complex");
+    $t eq "gdp_complex");
   return "$n.r, (unsigned long long)$n.u, (long long)$n.i"
   if ($t eq "gd_triplet_t");
   return $n;
@@ -59,25 +59,25 @@ sub printfmt {
     return "\\\"%s\\\"";
   } elsif (/[\*&]$/ or $_ eq "gdp_complex_in") {
     return "%p";
-  } elsif ($_ eq "_Complex double" or $_ eq "gdpu_complex") {
+  } elsif ($_ eq "_Complex double" or $_ eq "gdp_complex") {
     return "%g;%g";
   } elsif ($_ eq "double") {
     return "%g";
-  } elsif ($_ eq "gdpu_bitnum_t" or $_ eq "gdpu_numbits_t"
+  } elsif ($_ eq "gdp_bitnum_t" or $_ eq "gdp_numbits_t"
       or $_ eq "gd_windop_t")
   {
     return "%i";
   } elsif ($_ eq "gd_entype_t") {
     return "%02x";
-  } elsif ($_ eq "gd_shift_t" or $_ eq "gdpu_shift_t") {
+  } elsif ($_ eq "gd_shift_t" or $_ eq "gdp_shift_t") {
     return "%lli";
-  } elsif ($_ eq "gdpu_uint_t") {
+  } elsif ($_ eq "gdp_uint_t") {
     return "%u";
-  } elsif ($_ eq "gd_type_t" or $_ eq "gdpu_type_t") {
+  } elsif ($_ eq "gd_type_t" or $_ eq "gdp_type_t") {
     return "%03x";
-  } elsif ($_ eq "int" or $_ eq "gdpu_int") {
+  } elsif ($_ eq "int" or $_ eq "gdp_int") {
     return "%i";
-  } elsif ($_ eq "off64_t") {
+  } elsif ($_ eq "gd_off64_t") {
     return "%lli";
   } elsif ($_ eq "size_t") {
     return "%zi";
@@ -140,7 +140,7 @@ while (<>) {
   if ($ret ne "void") {
     print "RETVAL = ";
   }
-  print (($lfs) ? "gdp64(gd_$func)" : "gd_$func");
+  print "gd_$func" . (($lfs) ? "64" : "");
   print "($arglist);\n";
 
   if ($ret ne "void") {
diff --git a/bindings/perl/simple_funcs.xsin b/bindings/perl/simple_funcs.xsin
index bb365af..660f616 100644
--- a/bindings/perl/simple_funcs.xsin
+++ b/bindings/perl/simple_funcs.xsin
@@ -7,7 +7,7 @@ int add_cpolynom:add_polynom(DIRFILE *dirfile, const char *field_code,
     int poly_ord, const char *in_field, gdp_complex_in ca,
     int fragment_index=0)
 int add_crecip:add_recip(DIRFILE *dirfile, const char *field_code,
-    const char *in_field, gdpu_complex cdividend, int fragment_index=0)
+    const char *in_field, gdp_complex cdividend, int fragment_index=0)
 int add_divide(DIRFILE *dirfile, const char *field_code, const char *in_field1,
     const char *in_field2, int fragment_index=0)
 int add_linterp(DIRFILE *dirfile, const char *field_code, const char *in_field,
@@ -21,25 +21,25 @@ int add_sbit(DIRFILE *dirfile, const char *field_code, const char *in_field,
 int add_string(DIRFILE *dirfile, const char *field_code, const char *value,
     int fragment_index=0)
 int alter_bit(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field=NULL, gdpu_bitnum_t bitnum=-1, gdpu_numbits_t numbits=0)
+    gdp_char *in_field=NULL, gdp_bitnum_t bitnum=-1, gdp_numbits_t numbits=0)
 int alter_carray(DIRFILE* dirfile, const char* field_code, gd_type_t const_type,
     size_t array_len)
 int alter_clincom:alter_lincom(DIRFILE *dirfile, const char *field_code,
-    gdpu_int n_fields=0, const char **in_fields=NULL, gdp_complex_in m=NULL,
+    gdp_int n_fields=0, const char **in_fields=NULL, gdp_complex_in m=NULL,
     gdp_complex_in b=NULL)
 int alter_cpolynom:alter_polynom(DIRFILE *dirfile, const char *field_code,
-    gdpu_int poly_ord=0, gdpu_char *in_field=NULL, gdp_complex_in a=NULL)
+    gdp_int poly_ord=0, gdp_char *in_field=NULL, gdp_complex_in a=NULL)
 int alter_crecip:alter_recip(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field=NULL, gdpu_complex cdividend)
+    gdp_char *in_field=NULL, gdp_complex cdividend)
 int alter_divide(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field1=NULL, gdpu_char *in_field2=NULL)
+    gdp_char *in_field1=NULL, gdp_char *in_field2=NULL)
 int alter_multiply(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field1=NULL, gdpu_char *in_field2=NULL)
+    gdp_char *in_field1=NULL, gdp_char *in_field2=NULL)
 int alter_phase(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field, gdpu_shift_t shift)
+    gdp_char *in_field, gdp_shift_t shift)
 int alter_sbit(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field=NULL, gdpu_bitnum_t bitnum=-1, gdpu_numbits_t numbits=0)
-size_t carray_len(DIRFILE *dirfile, const char *field_code)
+    gdp_char *in_field=NULL, gdp_bitnum_t bitnum=-1, gdp_numbits_t numbits=0)
+size_t array_len(DIRFILE *dirfile, const char *field_code)
 unsigned long int encoding(DIRFILE *dirfile, int fragment)
 unsigned long int endianness(DIRFILE *dirfile, int fragment)
 int fragment_index(DIRFILE *dirfile, const char *field_code)
@@ -54,7 +54,7 @@ int madd_cpolynom:madd_polynom(DIRFILE *dirfile, const char *parent,
     const char *field_code, int poly_ord, const char *in_field,
     gdp_complex_in ca)
 int madd_crecip:madd_recip(DIRFILE *dirfile, const char *parent,
-    const char *field_code, const char *in_field, gdpu_complex cdividend)
+    const char *field_code, const char *in_field, gdp_complex cdividend)
 int madd_divide(DIRFILE *dirfile, const char *parent, const char *field_code,
     const char *in_field1, const char *in_field2)
 int madd_linterp(DIRFILE *dirfile, const char *parent, const char *field_code,
@@ -75,7 +75,7 @@ int parent_fragment(DIRFILE *dirfile, int fragment_index)
 int alter_protection(DIRFILE *dirfile, int protection_level, int fragment_index)
 int protection(DIRFILE *dirfile, int fragment_index)
 const char *raw_filename(DIRFILE *dirfile, const char *field_code)
-const char *reference(DIRFILE *dirfile, gdpu_char *field_code=NULL)
+const char *reference(DIRFILE *dirfile, gdp_char *field_code=NULL)
 unsigned int spf(DIRFILE *dirfile, const char *field_code)
 size_t put_string(DIRFILE *dirfile, const char *field_code, const char *data)
 int validate(DIRFILE *dirfile, const char *field_code)
@@ -84,17 +84,17 @@ int add_raw(DIRFILE *dirfile, const char *field_code, gd_type_t data_type,
     unsigned int spf, int fragment_index=0)
 int add_spec(DIRFILE *dirfile, const char *line, int fragment_index=0)
 int alter_const(DIRFILE *dirfile, const char *field_code,
-    gdpu_type_t const_type=GD_NULL);
+    gdp_type_t const_type=GD_NULL);
 int alter_encoding(DIRFILE *dirfile, unsigned long int encoding, int fragment=0,
     int recode=0)
 int alter_endianness(DIRFILE *dirfile, unsigned long int byte_sex,
     int fragment=0, int recode=0)
-int alter_entry(DIRFILE *dirfile, const char *field_code, gd_entry_t &entry,
+int alter_entry(DIRFILE *dirfile, const char *field_code, gdp_pentry_t &entry,
     int recode=0)
 int alter_linterp(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field=NULL, gdpu_char *table=NULL, int recode=0)
+    gdp_char *in_field=NULL, gdp_char *table=NULL, int recode=0)
 int alter_raw(DIRFILE *dirfile, const char *field_code,
-    gdpu_type_t data_type=GD_NULL, gdpu_uint_t spf=0, int recode=0)
+    gdp_type_t data_type=GD_NULL, gdp_uint_t spf=0, int recode=0)
 int alter_spec(DIRFILE *dirfile, const char *line, int recode=0)
 int delete(DIRFILE *dirfile, const char *field_code, int flags=0)
 int flush(DIRFILE *dirfile, const char *field_code)
@@ -107,24 +107,22 @@ int rename(DIRFILE *dirfile, const char *old_code, const char *new_name,
     int move_data=0)
 int rewrite_fragment(DIRFILE *dirfile, int fragment)
 int uninclude(DIRFILE *dirfile, int fragment_index, int del=0)
-int alter_frameoffset64(DIRFILE *dirfile, off64_t offset, int fragment=0,
+int alter_frameoffset64(DIRFILE *dirfile, gd_off64_t offset, int fragment=0,
     int recode=0)
-off64_t frameoffset64(DIRFILE *dirfile, int fragment)
+gd_off64_t frameoffset64(DIRFILE *dirfile, int fragment)
 double framenum_subset64:framenum(DIRFILE *dirfile, const char* field_code_in,
-    double value, off64_t field_start=0, off64_t field_end=0)
-off64_t nframes64(DIRFILE *dirfile)
-off64_t bof64(DIRFILE *dirfile, const char* field_code)
-off64_t eof64(DIRFILE *dirfile, const char* field_code)
+    double value, gd_off64_t field_start=0, gd_off64_t field_end=0)
+gd_off64_t nframes64(DIRFILE *dirfile)
+gd_off64_t bof64(DIRFILE *dirfile, const char* field_code)
+gd_off64_t eof64(DIRFILE *dirfile, const char* field_code)
 int error_count(DIRFILE *dirfile)
-off64_t seek(DIRFILE *dirfile, const char* field_code, off64_t frame_num,
-    off64_t sample_num, int flags=GD_SEEK_SET)
-off64_t tell(DIRFILE *dirfile, const char* field_code)
+gd_off64_t seek(DIRFILE *dirfile, const char* field_code, gd_off64_t frame_num,
+    gd_off64_t sample_num, int flags=GD_SEEK_SET)
+gd_off64_t tell(DIRFILE *dirfile, const char* field_code)
 int hide(DIRFILE *dirfile, const char *field_code)
 int hidden(DIRFILE *dirfile, const char *field_code)
 int unhide(DIRFILE *dirfile, const char *field_code)
 int sync(DIRFILE *dirfile, const char *field_code)
-int move_alias(DIRFILE *dirfile, const char *field_code, int new_fragment)
-int delete_alias(DIRFILE *dirfile, const char *field_code, unsigned int flags=0)
 const char *alias_target(DIRFILE *dirfile, const char *field_code)
 int add_alias(DIRFILE *dirfile, const char *field_code, const char *target,
     int fragment_index=0)
@@ -136,14 +134,14 @@ int add_window(DIRFILE *dirfile, const char *field_code, const char *in_field,
 int madd_window(DIRFILE *dirfile, const char *parent, const char *field_code,
     const char *in_field, const char *check_field, gd_windop_t windop,
     gd_triplet_t threshold)
-int alter_window(DIRFILE *dirfile, const char *field_code, gdpu_char *in_field,
-    gdpu_char *check_field, gd_windop_t windop, gd_triplet_t threshold)
-int alter_affixes(DIRFILE *dirfile, int index, gdpu_char *prefix,
-    gdpu_char *suffix=NULL)
+int alter_window(DIRFILE *dirfile, const char *field_code, gdp_char *in_field,
+    gdp_char *check_field, gd_windop_t windop, gd_triplet_t threshold)
+int alter_affixes(DIRFILE *dirfile, int index, gdp_char *prefix,
+    gdp_char *suffix=NULL)
 int add_mplex(DIRFILE *dirfile, const char *field_code, const char *in_field,
     const char *count_field, int count_val, int period, int fragment_index=0)
 int alter_mplex(DIRFILE *dirfile, const char *field_code,
-    gdpu_char *in_field=NULL, gdpu_char *count_field=NULL, int count_val=-1,
+    gdp_char *in_field=NULL, gdp_char *count_field=NULL, int count_val=-1,
     int period=-1)
 int madd_mplex(DIRFILE *dirfile, const char *parent, const char *field_code,
     const char *in_field, const char *count_field, int count_val,
@@ -152,6 +150,6 @@ int raw_close(DIRFILE *dirfile, const char *field_code)
 int desync(DIRFILE *dirfile, unsigned int flags=0)
 unsigned long int flags(DIRFILE *dirfile, unsigned long int set=0,
     unsigned long int reset=0)
-int verbose_prefix(DIRFILE *dirfile, gdpu_char *prefix=NULL)
+int verbose_prefix(DIRFILE *dirfile, gdp_char *prefix=NULL)
 void mplex_lookback(DIRFILE *dirfile, int lookback)
 char *linterp_tablename(DIRFILE *dirfile, const char *field_code)
diff --git a/bindings/perl/t/big_test.t b/bindings/perl/t/big_test.t
index 78f1df3..4cbb964 100644
--- a/bindings/perl/t/big_test.t
+++ b/bindings/perl/t/big_test.t
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2011-2012 D. V. Wiebe
+# Copyright (C) 2011-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -22,7 +22,7 @@
 use GetData;
 use Math::Complex;
 use strict;
-use Test::More tests => 1320;
+use Test::More tests => 1519;
 
 my $ne = 0;
 my ($s, @a, %h);
@@ -113,7 +113,9 @@ sub CheckNum2 {
 
 sub CheckString {
   print "\n";
-  is ($_[1], $_[2], "s[$_[0]] = \"$_[1]\", expected \"$_[2]\"");
+  is ($_[1], $_[2], "s[$_[0]] = \"" .
+    ((defined $_[1]) ? "\"" . $_[1] . "\"" : "undef") . ", expected " .
+    ((defined $_[2]) ? "\"" . $_[2] . "\"" : "undef"));
   print "#";
 }
 
@@ -145,11 +147,11 @@ sub CheckOK { &CheckError($_[0], 0) }
 sub CheckOK2 { &CheckError2(@_, 0) }
 
 my $nfields = 17;
-my @fields = (qw(INDEX alias bit carray const data div lincom linterp mplex mult
-  phase polynom recip sbit string window));
+my @fields = (qw(INDEX alias bit carray const data div lincom linterp mplex
+  mult phase polynom recip sbit string window));
 
 #create the dirfile
-system "rm -rf dirfile" if (-e "dirfile" and not -d "dirfile");
+system "rm -rf dirfile" if (-e "dirfile");
 (mkdir "dirfile" or die) unless -e "dirfile";
 
 open GLOB, ">dirfile/data" or die;
@@ -185,1021 +187,1014 @@ open GLOB, ">dirfile/form2" or die;
 print GLOB "const2 CONST INT8 -19\n" or die;
 close GLOB;
 
-# 0: error check
+# 1: error check
 $_ = &GetData::open("x", $GetData::RDONLY);
-CheckError(0, $GetData::E_OPEN);
+CheckError(1, $GetData::E_IO);
 
-# 1: open check
+# 2: open check
 $_ = &GetData::open("dirfile", $GetData::RDWR);
-CheckOK(1);
+CheckOK(2);
 
-# 2: getdata (INT8) check
+# 3: getdata (INT8) check
 $s = $_->getdata("data", 5, 0, 1, 0, $GetData::INT8);
-CheckOK(2);
-CheckString(2, $s, join "", map chr, 41 .. 48);
+CheckOK(3);
+CheckString(3, $s, join "", map chr, 41 .. 48);
 
-# 102: getdata (unpacked) check
+# 4: getdata (unpacked) check
 @a = $_->getdata("data", 5, 0, 1, 0, $GetData::INT16);
-CheckOK(102);
-CheckArray(102, \@a, 41 .. 48);
+CheckOK(4);
+CheckArray(4, \@a, 41 .. 48);
 
-# 108: getdata (complex unpacked) check
+# 10: getdata (complex unpacked) check
 @a = $_->getdata("data", 5, 0, 1, 0, $GetData::COMPLEX128);
-CheckOK(108);
-CheckArray(108, \@a, 41 .. 48);
+CheckOK(10);
+CheckArray(10, \@a, 41 .. 48);
 
-# 3: constant (INT8) check
+# 12: constant (INT8) check
 $s = $_->get_constant("const", $GetData::INT8);
-CheckOK(3);
-CheckNum(3, $s, 5);
+CheckOK(12);
+CheckNum(12, $s, 5);
 
-# 116: constant (COMPLEX128) check
+# 19: constant (COMPLEX128) check
 $s = $_->get_constant("const", $GetData::COMPLEX128);
-CheckOK(116);
-CheckNum(116, $s, 5.5);
+CheckOK(19);
+CheckNum(19, $s, 5.5);
 
-# 6: nfields check
+# 23: nfields check
 $s = $_->field_list;
-CheckOK(6);
-CheckNum(6, $s, $nfields);
+CheckOK(23);
+CheckNum(23, $s, $nfields);
 
-# 8: field_list check
+# 25: field_list check
 @a = $_->field_list;
-CheckOK(8);
-CheckSArray(8, \@a, @fields);
+CheckOK(25);
+CheckSArray(25, \@a, @fields);
 
-# 9: nmfields check
+# 26: nmfields check
 $s = $_->mfield_list("data");
-CheckOK(9);
-CheckNum(9, $s, 4);
+CheckOK(26);
+CheckNum(26, $s, 4);
 
-# 10: mfield_list check
+# 27: mfield_list check
 @a = $_->mfield_list("data");
-CheckOK(10);
-CheckSArray(10, \@a, qw(mstr mconst mcarray mlut));
+CheckOK(27);
+CheckSArray(27, \@a, qw(mstr mconst mcarray mlut));
 
-# 11: nframes check
+# 28: nframes check
 $s = $_->nframes;
-CheckOK(11);
-CheckNum(11, $s, 10);
+CheckOK(28);
+CheckNum(28, $s, 10);
 
-# 12: spf check
+# 29: spf check
 $s = $_->spf("data");
-CheckOK(12);
-CheckNum(12, $s, 8);
+CheckOK(29);
+CheckNum(29, $s, 8);
 
-# 13: putdata (packed) check
+# 30: putdata (packed) check
 $s = $_->putdata("data", 5, 1, $GetData::UINT8, "\15\16\17\20");
-CheckOK2(13,1);
-CheckNum(13,$s,4);
+CheckOK2(30,1);
+CheckNum(30,$s,4);
 
 @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
-CheckOK2(13,2);
-CheckArray(13, \@a, 41, 015, 016, 017, 020, 46, 47, 48);
+CheckOK2(30,2);
+CheckArray(30, \@a, 41, 015, 016, 017, 020, 46, 47, 48);
 
-# 118: putdata (typed ref) check
+# 31: putdata (typed ref) check
 $s = $_->putdata("data", 5, 1, $GetData::UINT16, [ 23, 24, 25, 26 ]);
-CheckOK2(118,1);
-CheckNum(118,$s,4);
+CheckOK2(31,1);
+CheckNum(31,$s,4);
 
 @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
-CheckOK2(118,2);
-CheckArray(118, \@a, 41, 23, 24, 25, 26, 46, 47, 48);
+CheckOK2(31,2);
+CheckArray(31, \@a, 41, 23, 24, 25, 26, 46, 47, 48);
 
-# 120: putdata (untyped ref) check
+# 33: putdata (untyped ref) check
 $s = $_->putdata("data", 5, 1, [ 33, 34, 35, 36 ]);
-CheckOK2(120,1);
-CheckNum(120,$s,4);
+CheckOK2(33,1);
+CheckNum(33,$s,4);
 
 @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
-CheckOK2(120,2);
-CheckArray(120, \@a, 41, 33, 34, 35, 36, 46, 47, 48);
+CheckOK2(33,2);
+CheckArray(33, \@a, 41, 33, 34, 35, 36, 46, 47, 48);
 
-# 122: putdata (simple list) check
+# 35: putdata (simple list) check
 $s = $_->putdata("data", 5, 1, 23., 24., 25., 26.);
-CheckOK2(122,1);
-CheckNum(122,$s,4);
+CheckOK2(35,1);
+CheckNum(35,$s,4);
 
 @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
-CheckOK2(122,2);
-CheckArray(122, \@a, 41, 23, 24, 25, 26, 46, 47, 48);
+CheckOK2(35,2);
+CheckArray(35, \@a, 41, 23, 24, 25, 26, 46, 47, 48);
 
-# 124: putdata (undef list) check
+# 37: putdata (undef list) check
 $s = $_->putdata("data", 5, 1, undef, 13.+0*i, 14.+0*i, 15.+0*i, 16.+0*i);
-CheckOK2(124,1);
-CheckNum(124,$s,4);
+CheckOK2(37,1);
+CheckNum(37,$s,4);
 
 @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
-CheckOK2(124,2);
-CheckArray(124, \@a, 41, 13, 14, 15, 16, 46, 47, 48);
+CheckOK2(37,2);
+CheckArray(37, \@a, 41, 13, 14, 15, 16, 46, 47, 48);
 
-# 14: error_string check
+# 38: error_string check
 $s = $_->getdata("x", 5, 0, 1, 0, $GetData::UINT8);
-CheckError(14,$GetData::E_BAD_CODE);
-CheckString(14, $_->error_string, "Field not found: x");
+CheckError(38,$GetData::E_BAD_CODE);
+CheckString(38, $_->error_string, "Field not found: x");
 
-# 15: get_entry check
+# 39: get_entry check
 $s = $_->entry("data");
-CheckOK(15);
-CheckNum(15,$s,$GetData::RAW_ENTRY);
+CheckOK(39);
+CheckNum(39,$s,$GetData::RAW_ENTRY);
 
-# 16: get_entry check
+# 40: get_entry check
 %h = $_->entry("data");
-CheckOK(16);
-CheckSArray2(16, 0, [ sort keys %h ],
+CheckOK(40);
+CheckSArray2(40, 0, [ sort keys %h ],
   qw(data_type field field_type fragment_index scalar scalar_ind spf));
-CheckNum2(16, 1, $h{'data_type'}, $GetData::INT8);
-CheckString2(16, 2, $h{'field'}, "data");
-CheckNum2(16, 3, $h{'field_type'}, $GetData::RAW_ENTRY);
-CheckNum2(16, 4, $h{'fragment_index'}, 0);
-CheckSArray2(16, 6, $h{'scalar'}, undef);
-CheckArray2(16, 7, $h{'scalar_ind'}, undef);
-CheckNum2(16, 8, $h{'spf'}, 8);
-
-# 18: get_entry check
+CheckNum2(40, 1, $h{'data_type'}, $GetData::INT8);
+CheckString2(40, 2, $h{'field'}, "data");
+CheckNum2(40, 3, $h{'field_type'}, $GetData::RAW_ENTRY);
+CheckNum2(40, 4, $h{'fragment_index'}, 0);
+CheckSArray2(40, 6, $h{'scalar'}, undef);
+CheckArray2(40, 7, $h{'scalar_ind'}, undef);
+CheckNum2(40, 8, $h{'spf'}, 8);
+
+# 42: get_entry check
 %h = $_->entry("lincom");
-CheckOK(18);
-CheckSArray2(18, 1, [ sort keys %h ], qw(b field field_type),
+CheckOK(42);
+CheckSArray2(42, 1, [ sort keys %h ], qw(b field field_type),
   qw(fragment_index in_fields m n_fields scalar scalar_ind));
-CheckArray2(18, 2, $h{'b'}, 2.2, 3.3+4.4*i, 5.5);
-CheckString2(18, 5, $h{'field'}, "lincom");
-CheckNum2(18, 6, $h{'field_type'}, $GetData::LINCOM_ENTRY);
-CheckNum2(18, 7, $h{'fragment_index'}, 0);
-CheckSArray2(18, 8, $h{'in_fields'}, qw(data INDEX linterp));
-CheckArray2(18, 3, $h{'m'}, 1.1, 2.2, 5.5);
-CheckNum2(18, 10, $h{'n_fields'}, 3);
-CheckSArray2(18, 11, $h{'scalar'}, undef, undef, "const", undef, undef,
+CheckArray2(42, 2, $h{'b'}, 2.2, 3.3+4.4*i, 5.5);
+CheckString2(42, 5, $h{'field'}, "lincom");
+CheckNum2(42, 6, $h{'field_type'}, $GetData::LINCOM_ENTRY);
+CheckNum2(42, 7, $h{'fragment_index'}, 0);
+CheckSArray2(42, 8, $h{'in_fields'}, qw(data INDEX linterp));
+CheckArray2(42, 3, $h{'m'}, 1.1, 2.2, 5.5);
+CheckNum2(42, 10, $h{'n_fields'}, 3);
+CheckSArray2(42, 11, $h{'scalar'}, undef, undef, "const", undef, undef,
   "const");
-CheckArray2(18, 12, $h{'scalar_ind'}, undef, undef, -1, undef, undef, -1);
+CheckArray2(42, 12, $h{'scalar_ind'}, undef, undef, -1, undef, undef, -1);
 
-# 20: get_entry check
+# 44: get_entry check
 %h = $_->entry("polynom");
-CheckOK(20);
-CheckSArray2(20, 1, [ sort keys %h ], qw(a field field_type),
+CheckOK(44);
+CheckSArray2(44, 1, [ sort keys %h ], qw(a field field_type),
   qw(fragment_index in_fields poly_ord scalar scalar_ind));
-CheckArray2(20, 2, $h{'a'}, 1.1, 2.2, 2.2, 3.3+4.4*i, 5.5, 5.5);
-CheckString2(20, 4, $h{'field'}, "polynom");
-CheckNum2(20, 5, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
-CheckNum2(20, 6, $h{'fragment_index'}, 0);
-CheckString2(20, 7, $h{'in_fields'}, "data");
-CheckNum2(20, 8, $h{'poly_ord'}, 5);
-CheckSArray2(20, 9, $h{'scalar'}, undef, undef, undef, undef, "const", "const");
-CheckArray2(20, 10, $h{'scalar_ind'}, undef, undef, undef, undef, -1, -1);
-
-# 21: get_entry check
+CheckArray2(44, 2, $h{'a'}, 1.1, 2.2, 2.2, 3.3+4.4*i, 5.5, 5.5);
+CheckString2(44, 4, $h{'field'}, "polynom");
+CheckNum2(44, 5, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
+CheckNum2(44, 6, $h{'fragment_index'}, 0);
+CheckString2(44, 7, $h{'in_fields'}, "data");
+CheckNum2(44, 8, $h{'poly_ord'}, 5);
+CheckSArray2(44, 9, $h{'scalar'}, undef, undef, undef, undef, "const", "const");
+CheckArray2(44, 10, $h{'scalar_ind'}, undef, undef, undef, undef, -1, -1);
+
+# 45: get_entry check
 %h = $_->entry("linterp");
-CheckOK(21);
-CheckSArray2(21, 0, [ sort keys %h ], qw(field field_type fragment_index),
+CheckOK(45);
+CheckSArray2(45, 0, [ sort keys %h ], qw(field field_type fragment_index),
   qw(in_fields table));
-CheckString2(21, 1, $h{'field'}, "linterp");
-CheckNum2(21, 2, $h{'field_type'}, $GetData::LINTERP_ENTRY);
-CheckNum2(21, 3, $h{'fragment_index'}, 0);
-CheckString2(21, 4, $h{'in_fields'}, "data");
-CheckString2(21, 5, $h{'table'}, "./lut");
+CheckString2(45, 1, $h{'field'}, "linterp");
+CheckNum2(45, 2, $h{'field_type'}, $GetData::LINTERP_ENTRY);
+CheckNum2(45, 3, $h{'fragment_index'}, 0);
+CheckString2(45, 4, $h{'in_fields'}, "data");
+CheckString2(45, 5, $h{'table'}, "./lut");
 
-# 22: get_entry check
+# 46: get_entry check
 %h = $_->entry("bit");
-CheckOK(22);
-CheckSArray2(22, 0, [ sort keys %h ], qw(bitnum field field_type),
+CheckOK(46);
+CheckSArray2(46, 0, [ sort keys %h ], qw(bitnum field field_type),
   qw(fragment_index in_fields numbits scalar scalar_ind));
-CheckNum2(22, 1, $h{'bitnum'}, 3);
-CheckString2(22, 2, $h{'field'}, "bit");
-CheckNum2(22, 3, $h{'field_type'}, $GetData::BIT_ENTRY);
-CheckNum2(22, 4, $h{'fragment_index'}, 0);
-CheckString2(22, 5, $h{'in_fields'}, "data");
-CheckNum2(22, 6, $h{'numbits'}, 4);
-CheckSArray2(22, 7, $h{'scalar'}, undef, undef);
-CheckArray2(22, 8, $h{'scalar_ind'}, undef, undef);
-
-# 23: get_entry check
+CheckNum2(46, 1, $h{'bitnum'}, 3);
+CheckString2(46, 2, $h{'field'}, "bit");
+CheckNum2(46, 3, $h{'field_type'}, $GetData::BIT_ENTRY);
+CheckNum2(46, 4, $h{'fragment_index'}, 0);
+CheckString2(46, 5, $h{'in_fields'}, "data");
+CheckNum2(46, 6, $h{'numbits'}, 4);
+CheckSArray2(46, 7, $h{'scalar'}, undef, undef);
+CheckArray2(46, 8, $h{'scalar_ind'}, undef, undef);
+
+# 47: get_entry check
 %h = $_->entry("sbit");
-CheckOK(23);
-CheckSArray2(23, 0, [ sort keys %h ], qw(bitnum field field_type),
+CheckOK(47);
+CheckSArray2(47, 0, [ sort keys %h ], qw(bitnum field field_type),
   qw(fragment_index in_fields numbits scalar scalar_ind));
-CheckNum2(23, 1, $h{'bitnum'}, 5);
-CheckString2(23, 2, $h{'field'}, "sbit");
-CheckNum2(23, 3, $h{'field_type'}, $GetData::SBIT_ENTRY);
-CheckNum2(23, 4, $h{'fragment_index'}, 0);
-CheckString2(23, 5, $h{'in_fields'}, "data");
-CheckNum2(23, 6, $h{'numbits'}, 6);
-CheckSArray2(23, 7, $h{'scalar'}, undef, undef);
-CheckArray2(23, 8, $h{'scalar_ind'}, undef, undef);
-
-# 24: get_entry check
+CheckNum2(47, 1, $h{'bitnum'}, 5);
+CheckString2(47, 2, $h{'field'}, "sbit");
+CheckNum2(47, 3, $h{'field_type'}, $GetData::SBIT_ENTRY);
+CheckNum2(47, 4, $h{'fragment_index'}, 0);
+CheckString2(47, 5, $h{'in_fields'}, "data");
+CheckNum2(47, 6, $h{'numbits'}, 6);
+CheckSArray2(47, 7, $h{'scalar'}, undef, undef);
+CheckArray2(47, 8, $h{'scalar_ind'}, undef, undef);
+
+# 48: get_entry check
 %h = $_->entry("mult");
-CheckOK(24);
-CheckSArray2(24, 0, [ sort keys %h ], qw(field field_type fragment_index),
+CheckOK(48);
+CheckSArray2(48, 0, [ sort keys %h ], qw(field field_type fragment_index),
   "in_fields");
-CheckString2(24, 1, $h{'field'}, "mult");
-CheckNum2(24, 2, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
-CheckNum2(24, 3, $h{'fragment_index'}, 0);
-CheckSArray2(24, 4, $h{'in_fields'}, qw(data sbit));
+CheckString2(48, 1, $h{'field'}, "mult");
+CheckNum2(48, 2, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
+CheckNum2(48, 3, $h{'fragment_index'}, 0);
+CheckSArray2(48, 4, $h{'in_fields'}, qw(data sbit));
 
-# 25: get_entry check
+# 49: get_entry check
 %h = $_->entry("phase");
-CheckOK(25);
-CheckSArray2(25, 0, [ sort keys %h ], qw(field field_type fragment_index),
+CheckOK(49);
+CheckSArray2(49, 0, [ sort keys %h ], qw(field field_type fragment_index),
   qw(in_fields scalar scalar_ind shift));
-CheckString2(25, 1, $h{'field'}, "phase");
-CheckNum2(25, 2, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(25, 3, $h{'fragment_index'}, 0);
-CheckString2(25, 4, $h{'in_fields'}, "data");
-CheckSArray2(25, 5, $h{'scalar'}, undef);
-CheckArray2(25, 6, $h{'scalar_ind'}, undef);
-CheckNum2(25, 7, $h{'shift'}, 11);
-
-# 26: get_entry check
+CheckString2(49, 1, $h{'field'}, "phase");
+CheckNum2(49, 2, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(49, 3, $h{'fragment_index'}, 0);
+CheckString2(49, 4, $h{'in_fields'}, "data");
+CheckSArray2(49, 5, $h{'scalar'}, undef);
+CheckArray2(49, 6, $h{'scalar_ind'}, undef);
+CheckNum2(49, 7, $h{'shift'}, 11);
+
+# 50: get_entry check
 %h = $_->entry("const");
-CheckOK(26);
-CheckSArray2(26, 0, [ sort keys %h ], qw(const_type field field_type),
+CheckOK(50);
+CheckSArray2(50, 0, [ sort keys %h ], qw(const_type field field_type),
   "fragment_index");
-CheckNum2(26, 1, $h{'const_type'}, $GetData::FLOAT64);
-CheckString2(26, 2, $h{'field'}, "const");
-CheckNum2(26, 3, $h{'field_type'}, $GetData::CONST_ENTRY);
-CheckNum2(26, 4, $h{'fragment_index'}, 0);
+CheckNum2(50, 1, $h{'const_type'}, $GetData::FLOAT64);
+CheckString2(50, 2, $h{'field'}, "const");
+CheckNum2(50, 3, $h{'field_type'}, $GetData::CONST_ENTRY);
+CheckNum2(50, 4, $h{'fragment_index'}, 0);
 
-# 134: get_entry check
+# 51: get_entry check
 %h = $_->entry("string");
-CheckOK(134);
-CheckSArray2(134, 0, [ sort keys %h ], qw(field field_type fragment_index));
-CheckString2(134, 1, $h{'field'}, "string");
-CheckNum2(134, 2, $h{'field_type'}, $GetData::STRING_ENTRY);
-CheckNum2(134, 3, $h{'fragment_index'}, 0);
+CheckOK(51);
+CheckSArray2(51, 0, [ sort keys %h ], qw(field field_type fragment_index));
+CheckString2(51, 1, $h{'field'}, "string");
+CheckNum2(51, 2, $h{'field_type'}, $GetData::STRING_ENTRY);
+CheckNum2(51, 3, $h{'fragment_index'}, 0);
 
-# 27: fragment_index check
+# 52: fragment_index check
 $s = $_->fragment_index("data");
-CheckOK(27);
-CheckNum(27, $s, 0);
+CheckOK(52);
+CheckNum(52, $s, 0);
 
-# 28: add_raw check
+# 53: add_raw check
 $s = $_->add_raw("new1", $GetData::FLOAT64, 3);
-CheckOK2(28, 1);
-CheckNum2(28, 2, $s, 0);
+CheckOK2(53, 1);
+CheckNum2(53, 2, $s, 0);
 
 %h = $_->entry("new1");
-CheckOK2(28, 3);
-CheckNum2(28, 4, $h{'data_type'}, $GetData::FLOAT64);
-CheckString2(28, 5, $h{'field'}, "new1");
-CheckNum2(28, 6, $h{'field_type'}, $GetData::RAW_ENTRY);
-CheckNum2(28, 7, $h{'fragment_index'}, 0);
-CheckSArray2(28, 8, $h{'scalar'}, undef);
-CheckArray2(28, 9, $h{'scalar_ind'}, undef);
-CheckNum2(28, 10, $h{'spf'}, 3);
-
-#30: add_lincom check
+CheckOK2(53, 3);
+CheckNum2(53, 4, $h{'data_type'}, $GetData::FLOAT64);
+CheckString2(53, 5, $h{'field'}, "new1");
+CheckNum2(53, 6, $h{'field_type'}, $GetData::RAW_ENTRY);
+CheckNum2(53, 7, $h{'fragment_index'}, 0);
+CheckSArray2(53, 8, $h{'scalar'}, undef);
+CheckArray2(53, 9, $h{'scalar_ind'}, undef);
+CheckNum2(53, 10, $h{'spf'}, 3);
+
+#55: add_lincom check
 $s = $_->add_lincom("new3", 2, [ qw(in1 in2) ], [ 1.1+1.2*i, 1.4+1.5*i ],
   [ 1.3+1.4*i, 1.6+1.7*i ], 0);
-CheckOK2(30, 1);
-CheckNum2(30, 2, $s, 0);
+CheckOK2(55, 1);
+CheckNum2(55, 2, $s, 0);
 
 %h = $_->entry("new3");
-CheckOK2(30, 3);
-CheckArray2(30, 4, $h{'b'}, 1.3+1.4*i, 1.6+1.7*i);
-CheckString2(30, 6, $h{'field'}, "new3");
-CheckNum2(30, 7, $h{'field_type'}, $GetData::LINCOM_ENTRY);
-CheckNum2(30, 8, $h{'fragment_index'}, 0);
-CheckSArray2(30, 9, $h{'in_fields'}, qw(in1 in2));
-CheckArray2(30, 10, $h{'m'}, 1.1+1.2*i, 1.4+1.5*i);
-CheckNum2(30, 11, $h{'n_fields'}, 2);
-CheckSArray2(30, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
-CheckArray2(30, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
-
-# 31: add_polynom
+CheckOK2(55, 3);
+CheckArray2(55, 4, $h{'b'}, 1.3+1.4*i, 1.6+1.7*i);
+CheckString2(55, 6, $h{'field'}, "new3");
+CheckNum2(55, 7, $h{'field_type'}, $GetData::LINCOM_ENTRY);
+CheckNum2(55, 8, $h{'fragment_index'}, 0);
+CheckSArray2(55, 9, $h{'in_fields'}, qw(in1 in2));
+CheckArray2(55, 10, $h{'m'}, 1.1+1.2*i, 1.4+1.5*i);
+CheckNum2(55, 11, $h{'n_fields'}, 2);
+CheckSArray2(55, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
+CheckArray2(55, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
+
+# 56: add_polynom
 $s = $_->add_polynom("new4", 3, "in1", [ 3.9, 4.8, 5.7, 6.6 ], 0);
-CheckOK2(31, 1);
-CheckNum2(31, 2, $s, 0);
+CheckOK2(56, 1);
+CheckNum2(56, 2, $s, 0);
 
 %h = $_->entry("new4");
-CheckOK2(31, 3);
-CheckArray2(31, 4, $h{'a'}, 3.9, 4.8, 5.7, 6.6);
-CheckString2(31, 7, $h{'field'}, "new4");
-CheckNum2(31, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
-CheckNum2(31, 9, $h{'fragment_index'}, 0);
-CheckString2(31, 10, $h{'in_fields'}, "in1");
-CheckNum2(31, 11, $h{'poly_ord'}, 3);
-CheckSArray2(31, 12, $h{'scalar'}, undef, undef, undef, undef);
-CheckArray2(31, 13, $h{'scalar_ind'}, undef, undef, undef, undef);
-
-# 33: add_linterp
+CheckOK2(56, 3);
+CheckArray2(56, 4, $h{'a'}, 3.9, 4.8, 5.7, 6.6);
+CheckString2(56, 7, $h{'field'}, "new4");
+CheckNum2(56, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
+CheckNum2(56, 9, $h{'fragment_index'}, 0);
+CheckString2(56, 10, $h{'in_fields'}, "in1");
+CheckNum2(56, 11, $h{'poly_ord'}, 3);
+CheckSArray2(56, 12, $h{'scalar'}, undef, undef, undef, undef);
+CheckArray2(56, 13, $h{'scalar_ind'}, undef, undef, undef, undef);
+
+# 58: add_linterp
 $s = $_->add_linterp("new6", "in", "./some/table");
-CheckOK2(33, 1);
-CheckNum2(33, 2, $s, 0);
+CheckOK2(58, 1);
+CheckNum2(58, 2, $s, 0);
 
 %h = $_->entry("new6");
-CheckOK2(33, 2);
-CheckString2(33, 3, $h{'field'}, "new6");
-CheckNum2(33, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY);
-CheckNum2(33, 5, $h{'fragment_index'}, 0);
-CheckString2(33, 6, $h{'in_fields'}, "in");
-CheckString2(33, 7, $h{'table'}, "./some/table");
-
-# 34: add_bit
+CheckOK2(58, 2);
+CheckString2(58, 3, $h{'field'}, "new6");
+CheckNum2(58, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY);
+CheckNum2(58, 5, $h{'fragment_index'}, 0);
+CheckString2(58, 6, $h{'in_fields'}, "in");
+CheckString2(58, 7, $h{'table'}, "./some/table");
+
+# 59: add_bit
 $s = $_->add_bit("new7", "in1", 11, 22);
-CheckOK2(34, 1);
-CheckNum2(34, 2, $s, 0);
+CheckOK2(59, 1);
+CheckNum2(59, 2, $s, 0);
 
 %h = $_->entry("new7");
-CheckOK(34, 2);
-CheckNum2(34, 3, $h{'bitnum'}, 11);
-CheckString2(34, 4, $h{'field'}, "new7");
-CheckNum2(34, 5, $h{'field_type'}, $GetData::BIT_ENTRY);
-CheckNum2(34, 6, $h{'fragment_index'}, 0);
-CheckString2(34, 7, $h{'in_fields'}, "in1");
-CheckNum2(34, 8, $h{'numbits'}, 22);
-CheckSArray2(34, 9, $h{'scalar'}, undef, undef);
-CheckArray2(34, 10, $h{'scalar_ind'}, undef, undef);
-
-# 35: add_sbit
+CheckOK(59, 2);
+CheckNum2(59, 3, $h{'bitnum'}, 11);
+CheckString2(59, 4, $h{'field'}, "new7");
+CheckNum2(59, 5, $h{'field_type'}, $GetData::BIT_ENTRY);
+CheckNum2(59, 6, $h{'fragment_index'}, 0);
+CheckString2(59, 7, $h{'in_fields'}, "in1");
+CheckNum2(59, 8, $h{'numbits'}, 22);
+CheckSArray2(59, 9, $h{'scalar'}, undef, undef);
+CheckArray2(59, 10, $h{'scalar_ind'}, undef, undef);
+
+# 60: add_sbit
 $s = $_->add_sbit("new8", "in2", 5, 10);
-CheckOK2(35, 1);
-CheckNum2(35, 2, $s, 0);
+CheckOK2(60, 1);
+CheckNum2(60, 2, $s, 0);
 
 %h = $_->entry("new8");
-CheckOK(35, 2);
-CheckNum2(35, 3, $h{'bitnum'}, 5);
-CheckString2(35, 4, $h{'field'}, "new8");
-CheckNum2(35, 5, $h{'field_type'}, $GetData::SBIT_ENTRY);
-CheckNum2(35, 6, $h{'fragment_index'}, 0);
-CheckString2(35, 7, $h{'in_fields'}, "in2");
-CheckNum2(35, 8, $h{'numbits'}, 10);
-CheckSArray2(35, 9, $h{'scalar'}, undef, undef);
-CheckArray2(35, 10, $h{'scalar_ind'}, undef, undef);
-
-# 36: add_mutiply
+CheckOK(60, 2);
+CheckNum2(60, 3, $h{'bitnum'}, 5);
+CheckString2(60, 4, $h{'field'}, "new8");
+CheckNum2(60, 5, $h{'field_type'}, $GetData::SBIT_ENTRY);
+CheckNum2(60, 6, $h{'fragment_index'}, 0);
+CheckString2(60, 7, $h{'in_fields'}, "in2");
+CheckNum2(60, 8, $h{'numbits'}, 10);
+CheckSArray2(60, 9, $h{'scalar'}, undef, undef);
+CheckArray2(60, 10, $h{'scalar_ind'}, undef, undef);
+
+# 61: add_mutiply
 $s = $_->add_multiply("new9", "in2", "in3");
-CheckOK2(36, 1);
-CheckNum2(36, 2, $s, 0);
+CheckOK2(61, 1);
+CheckNum2(61, 2, $s, 0);
 
 %h = $_->entry("new9");
-CheckOK2(36, 3);
-CheckString2(36, 4, $h{'field'}, "new9");
-CheckNum2(36, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
-CheckNum2(36, 6, $h{'fragment_index'}, 0);
-CheckSArray2(36, 7, $h{'in_fields'}, qw(in2 in3));
+CheckOK2(61, 3);
+CheckString2(61, 4, $h{'field'}, "new9");
+CheckNum2(61, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
+CheckNum2(61, 6, $h{'fragment_index'}, 0);
+CheckSArray2(61, 7, $h{'in_fields'}, qw(in2 in3));
 
-# 37: add_phase
+# 62: add_phase
 $s = $_->add_phase("new10", "in6", 42);
-CheckOK2(37, 1);
-CheckNum2(37, 2, $s, 0);
+CheckOK2(62, 1);
+CheckNum2(62, 2, $s, 0);
 
 %h = $_->entry("new10");
-CheckOK2(37, 2);
-CheckString2(37, 3, $h{'field'}, "new10");
-CheckNum2(37, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(37, 5, $h{'fragment_index'}, 0);
-CheckString2(37, 6, $h{'in_fields'}, "in6");
-CheckSArray2(37, 7, $h{'scalar'}, undef);
-CheckArray2(37, 8, $h{'scalar_ind'}, undef);
-CheckNum2(37, 9, $h{'shift'}, 42);
-
-# 38: add_const
+CheckOK2(62, 2);
+CheckString2(62, 3, $h{'field'}, "new10");
+CheckNum2(62, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(62, 5, $h{'fragment_index'}, 0);
+CheckString2(62, 6, $h{'in_fields'}, "in6");
+CheckSArray2(62, 7, $h{'scalar'}, undef);
+CheckArray2(62, 8, $h{'scalar_ind'}, undef);
+CheckNum2(62, 9, $h{'shift'}, 42);
+
+# 63: add_const
 $s = $_->add_const("new11", $GetData::FLOAT64, "33.3");
-CheckOK2(38, 1);
-CheckNum2(38, 2, $s, 0);
+CheckOK2(63, 1);
+CheckNum2(63, 2, $s, 0);
 
 %h = $_->entry("new11");
-CheckOK2(38, 3);
-CheckNum2(38, 4, $h{'const_type'}, $GetData::FLOAT64);
-CheckString2(38, 5, $h{'field'}, "new11");
-CheckNum2(38, 6, $h{'field_type'}, $GetData::CONST_ENTRY);
-CheckNum2(38, 7, $h{'fragment_index'}, 0);
+CheckOK2(63, 3);
+CheckNum2(63, 4, $h{'const_type'}, $GetData::FLOAT64);
+CheckString2(63, 5, $h{'field'}, "new11");
+CheckNum2(63, 6, $h{'field_type'}, $GetData::CONST_ENTRY);
+CheckNum2(63, 7, $h{'fragment_index'}, 0);
 
 $s = $_->get_constant("new11", $GetData::FLOAT64);
-CheckOK2(38, 8);
-CheckNum2(38, 9, $s, 33.3);
+CheckOK2(63, 8);
+CheckNum2(63, 9, $s, 33.3);
 
-# 125: add check
-$s = $_->add({
-    field          => "new13",
-    field_type     => $GetData::PHASE_ENTRY,
-    fragment_index => 0,
-    in_fields      => "new9",
-    shift          => -88
-  });
-CheckOK2(125,1);
-CheckNum2(125, 2, $s, 0);
-
-%h = $_->entry("new13");
-CheckOK2(125, 2);
-CheckString2(125, 3, $h{'field'}, "new13");
-CheckNum2(125, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(125, 5, $h{'fragment_index'}, 0);
-CheckString2(125, 6, $h{'in_fields'}, "new9");
-CheckSArray2(125, 7, $h{'scalar'}, undef);
-CheckArray2(125, 8, $h{'scalar_ind'}, undef);
-CheckNum2(125, 9, $h{'shift'}, -88);
-
-# 39: fragment_name
+# 64: fragment_name
 $s = $_->fragmentname(0);
-CheckOK(39);
-CheckEOString(39, $s, "dirfile/format");
+CheckOK(64);
+CheckEOString(64, $s, "dirfile/format");
 
-# 40: nfragments
+# 65: nfragments
 $s = $_->fragments;
-CheckOK(40);
-CheckNum(40, $s, 1);
-
-# 182: fragment list
- at a = $_->fragments;
-CheckOK(182);
-CheckEOSArray(182, \@a, "dirfile/format");
+CheckOK(65);
+CheckNum(65, $s, 1);
 
-# 41: include
+# 66: include
 $s = $_->include("form2", 0, 0);
-CheckOK2(41, 1);
-CheckNum2(41, 2, $s, 1);
+CheckOK2(66, 1);
+CheckNum2(66, 2, $s, 1);
 
 $s = $_->get_constant("const2", $GetData::INT32);
-CheckOK2(41, 3);
-CheckNum2(41, 4, $s, -19);
+CheckOK2(66, 3);
+CheckNum2(66, 4, $s, -19);
 
-# 42: nfields_by_type
+# 67: nfields_by_type
 $s = $_->field_list_by_type($GetData::LINCOM_ENTRY);
-CheckOK(42);
-CheckNum(42, $s, 2);
+CheckOK(67);
+CheckNum(67, $s, 2);
 
-# 43: field_list_by_type
+# 68: field_list_by_type
 @a = $_->field_list_by_type($GetData::LINCOM_ENTRY);
-CheckOK(43);
-CheckSArray(43, \@a, qw(lincom new3));
+CheckOK(68);
+CheckSArray(68, \@a, qw(lincom new3));
 
-# 44: nvectors
+# 69: nvectors
 $s = $_->vector_list;
-CheckOK(44);
-CheckNum(44, $s, 23);
+CheckOK(69);
+CheckNum(69, $s, 22);
 
-# 45: vector_list
+# 70: vector_list
 @a = $_->vector_list;
-CheckOK(45);
-CheckSArray(45, \@a, qw(INDEX alias bit data div lincom linterp mplex mult),
-  qw(new1 new10 new13 new3 new4 new6 new7 new8 new9 phase polynom recip sbit),
-  qw(window));
+CheckOK(70);
+CheckSArray(70, \@a, qw(INDEX alias bit data div lincom linterp mplex
+  mult new1 new10 new3 new4 new6 new7 new8 new9 phase polynom recip sbit
+  window));
 
-#47: madd_lincom check
+#72: madd_lincom check
 $s = $_->madd_lincom("data", "mnew2", 2, [ qw(in1 in2) ], [ 9.9+8.8*i, 7.7 ],
   [ 6.6, 5.5 ]);
-CheckOK2(47, 1);
-CheckNum2(47, 2, $s, 0);
+CheckOK2(72, 1);
+CheckNum2(72, 2, $s, 0);
 
 %h = $_->entry("data/mnew2");
-CheckOK2(47, 3);
-CheckArray2(47, 4, $h{'b'}, 6.6, 5.5);
-CheckArray2(47, 5, $h{'m'}, 9.9+8.8*i, 7.7);
-CheckString2(47, 7, $h{'field'}, "data/mnew2");
-CheckNum2(47, 8, $h{'field_type'}, $GetData::LINCOM_ENTRY);
-CheckNum2(47, 9, $h{'fragment_index'}, 0);
-CheckSArray2(47, 10, $h{'in_fields'}, qw(in1 in2));
-CheckNum2(47, 11, $h{'n_fields'}, 2);
-CheckSArray2(47, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
-CheckArray2(47, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
-
-# 48: madd_polynom
+CheckOK2(72, 3);
+CheckArray2(72, 4, $h{'b'}, 6.6, 5.5);
+CheckArray2(72, 5, $h{'m'}, 9.9+8.8*i, 7.7);
+CheckString2(72, 7, $h{'field'}, "data/mnew2");
+CheckNum2(72, 8, $h{'field_type'}, $GetData::LINCOM_ENTRY);
+CheckNum2(72, 9, $h{'fragment_index'}, 0);
+CheckSArray2(72, 10, $h{'in_fields'}, qw(in1 in2));
+CheckNum2(72, 11, $h{'n_fields'}, 2);
+CheckSArray2(72, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
+CheckArray2(72, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
+
+# 73: madd_polynom
 $s = $_->madd_polynom("data", "mnew3", 3, "in1", [ 3.9, 4.8, 5.7, 6.6 ]);
-CheckOK2(48, 1);
-CheckNum2(48, 2, $s, 0);
+CheckOK2(73, 1);
+CheckNum2(73, 2, $s, 0);
 
 %h = $_->entry("data/mnew3");
-CheckOK2(48, 3);
-CheckArray2(48, 4, $h{'a'}, 3.9, 4.8, 5.7, 6.6);
-CheckString2(48, 7, $h{'field'}, "data/mnew3");
-CheckNum2(48, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
-CheckNum2(48, 9, $h{'fragment_index'}, 0);
-CheckString2(48, 10, $h{'in_fields'}, "in1");
-CheckNum2(48, 11, $h{'poly_ord'}, 3);
-CheckSArray2(48, 12, $h{'scalar'}, undef, undef, undef, undef);
-CheckArray2(48, 13, $h{'scalar_ind'}, undef, undef, undef, undef);
-
-# 50: madd_linterp
+CheckOK2(73, 3);
+CheckArray2(73, 4, $h{'a'}, 3.9, 4.8, 5.7, 6.6);
+CheckString2(73, 7, $h{'field'}, "data/mnew3");
+CheckNum2(73, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
+CheckNum2(73, 9, $h{'fragment_index'}, 0);
+CheckString2(73, 10, $h{'in_fields'}, "in1");
+CheckNum2(73, 11, $h{'poly_ord'}, 3);
+CheckSArray2(73, 12, $h{'scalar'}, undef, undef, undef, undef);
+CheckArray2(73, 13, $h{'scalar_ind'}, undef, undef, undef, undef);
+
+# 75: madd_linterp
 $s = $_->madd_linterp("data", "mnew6", "in", "./more/table");
-CheckOK2(50, 1);
-CheckNum2(50, 2, $s, 0);
+CheckOK2(75, 1);
+CheckNum2(75, 2, $s, 0);
 
 %h = $_->entry("data/mnew6");
-CheckOK2(50, 2);
-CheckString2(50, 3, $h{'field'}, "data/mnew6");
-CheckNum2(50, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY);
-CheckNum2(50, 5, $h{'fragment_index'}, 0);
-CheckString2(50, 6, $h{'in_fields'}, "in");
-CheckString2(50, 7, $h{'table'}, "./more/table");
-
-# 51: madd_bit
+CheckOK2(75, 2);
+CheckString2(75, 3, $h{'field'}, "data/mnew6");
+CheckNum2(75, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY);
+CheckNum2(75, 5, $h{'fragment_index'}, 0);
+CheckString2(75, 6, $h{'in_fields'}, "in");
+CheckString2(75, 7, $h{'table'}, "./more/table");
+
+# 76: madd_bit
 $s = $_->madd_bit("data", "mnew7", "in1", 3, 2);
-CheckOK2(51, 1);
-CheckNum2(51, 2, $s, 0);
+CheckOK2(76, 1);
+CheckNum2(76, 2, $s, 0);
 
 %h = $_->entry("data/mnew7");
-CheckOK(51, 2);
-CheckNum2(51, 3, $h{'bitnum'}, 3);
-CheckString2(51, 4, $h{'field'}, "data/mnew7");
-CheckNum2(51, 5, $h{'field_type'}, $GetData::BIT_ENTRY);
-CheckNum2(51, 6, $h{'fragment_index'}, 0);
-CheckString2(51, 7, $h{'in_fields'}, "in1");
-CheckNum2(51, 8, $h{'numbits'}, 2);
-CheckSArray2(51, 9, $h{'scalar'}, undef, undef);
-CheckArray2(51, 10, $h{'scalar_ind'}, undef, undef);
-
-# 52: madd_sbit
+CheckOK(76, 2);
+CheckNum2(76, 3, $h{'bitnum'}, 3);
+CheckString2(76, 4, $h{'field'}, "data/mnew7");
+CheckNum2(76, 5, $h{'field_type'}, $GetData::BIT_ENTRY);
+CheckNum2(76, 6, $h{'fragment_index'}, 0);
+CheckString2(76, 7, $h{'in_fields'}, "in1");
+CheckNum2(76, 8, $h{'numbits'}, 2);
+CheckSArray2(76, 9, $h{'scalar'}, undef, undef);
+CheckArray2(76, 10, $h{'scalar_ind'}, undef, undef);
+
+# 77: madd_sbit
 $s = $_->madd_sbit("data", "mnew8", "in2", 4, 5);
-CheckOK2(52, 1);
-CheckNum2(52, 2, $s, 0);
+CheckOK2(77, 1);
+CheckNum2(77, 2, $s, 0);
 
 %h = $_->entry("data/mnew8");
-CheckOK(52, 2);
-CheckNum2(52, 3, $h{'bitnum'}, 4);
-CheckString2(52, 4, $h{'field'}, "data/mnew8");
-CheckNum2(52, 5, $h{'field_type'}, $GetData::SBIT_ENTRY);
-CheckNum2(52, 6, $h{'fragment_index'}, 0);
-CheckString2(52, 7, $h{'in_fields'}, "in2");
-CheckNum2(52, 8, $h{'numbits'}, 5);
-CheckSArray2(52, 9, $h{'scalar'}, undef, undef);
-CheckArray2(52, 10, $h{'scalar_ind'}, undef, undef);
-
-# 53: madd_mutiply
+CheckOK(77, 2);
+CheckNum2(77, 3, $h{'bitnum'}, 4);
+CheckString2(77, 4, $h{'field'}, "data/mnew8");
+CheckNum2(77, 5, $h{'field_type'}, $GetData::SBIT_ENTRY);
+CheckNum2(77, 6, $h{'fragment_index'}, 0);
+CheckString2(77, 7, $h{'in_fields'}, "in2");
+CheckNum2(77, 8, $h{'numbits'}, 5);
+CheckSArray2(77, 9, $h{'scalar'}, undef, undef);
+CheckArray2(77, 10, $h{'scalar_ind'}, undef, undef);
+
+# 78: madd_mutiply
 $s = $_->madd_multiply("data", "mnew9", "in3", "in2");
-CheckOK2(53, 1);
-CheckNum2(53, 2, $s, 0);
+CheckOK2(78, 1);
+CheckNum2(78, 2, $s, 0);
 
 %h = $_->entry("data/mnew9");
-CheckOK2(53, 3);
-CheckString2(53, 4, $h{'field'}, "data/mnew9");
-CheckNum2(53, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
-CheckNum2(53, 6, $h{'fragment_index'}, 0);
-CheckSArray2(53, 7, $h{'in_fields'}, qw(in3 in2));
+CheckOK2(78, 3);
+CheckString2(78, 4, $h{'field'}, "data/mnew9");
+CheckNum2(78, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
+CheckNum2(78, 6, $h{'fragment_index'}, 0);
+CheckSArray2(78, 7, $h{'in_fields'}, qw(in3 in2));
 
-# 54: madd_phase
+# 79: madd_phase
 $s = $_->madd_phase("data", "mnew10", "in6", 44);
-CheckOK2(54, 1);
-CheckNum2(54, 2, $s, 0);
+CheckOK2(79, 1);
+CheckNum2(79, 2, $s, 0);
 
 %h = $_->entry("data/mnew10");
-CheckOK2(54, 2);
-CheckString2(54, 3, $h{'field'}, "data/mnew10");
-CheckNum2(54, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(54, 5, $h{'fragment_index'}, 0);
-CheckString2(54, 6, $h{'in_fields'}, "in6");
-CheckSArray2(54, 7, $h{'scalar'}, undef);
-CheckArray2(54, 8, $h{'scalar_ind'}, undef);
-CheckNum2(54, 9, $h{'shift'}, 44);
-
-# 55: madd_const
+CheckOK2(79, 2);
+CheckString2(79, 3, $h{'field'}, "data/mnew10");
+CheckNum2(79, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(79, 5, $h{'fragment_index'}, 0);
+CheckString2(79, 6, $h{'in_fields'}, "in6");
+CheckSArray2(79, 7, $h{'scalar'}, undef);
+CheckArray2(79, 8, $h{'scalar_ind'}, undef);
+CheckNum2(79, 9, $h{'shift'}, 44);
+
+# 80: madd_const
 $s = $_->madd_const("data", "mnew11", $GetData::FLOAT64, 9.2);
-CheckOK2(55, 1);
-CheckNum2(55, 2, $s, 0);
+CheckOK2(80, 1);
+CheckNum2(80, 2, $s, 0);
 
 %h = $_->entry("data/mnew11");
-CheckOK2(55, 3);
-CheckNum2(55, 4, $h{'const_type'}, $GetData::FLOAT64);
-CheckString2(55, 5, $h{'field'}, "data/mnew11");
-CheckNum2(55, 6, $h{'field_type'}, $GetData::CONST_ENTRY);
-CheckNum2(55, 7, $h{'fragment_index'}, 0);
+CheckOK2(80, 3);
+CheckNum2(80, 4, $h{'const_type'}, $GetData::FLOAT64);
+CheckString2(80, 5, $h{'field'}, "data/mnew11");
+CheckNum2(80, 6, $h{'field_type'}, $GetData::CONST_ENTRY);
+CheckNum2(80, 7, $h{'fragment_index'}, 0);
 
 $s = $_->get_constant("data/mnew11", $GetData::FLOAT64);
-CheckOK2(55, 8);
-CheckNum2(55, 9, $s, 9.2);
+CheckOK2(80, 8);
+CheckNum2(80, 9, $s, 9.2);
 
-# 126: madd check
-$s = $_->madd({
-    field          => "mnew13",
-    field_type     => $GetData::PHASE_ENTRY,
-    fragment_index => 0,
-    in_fields      => "data",
-    shift          => 2
-  }, "data");
-CheckOK2(126,1);
-CheckNum2(126, 2, $s, 0);
-
-%h = $_->entry("data/mnew13");
-CheckOK2(126, 2);
-CheckString2(126, 3, $h{'field'}, "data/mnew13");
-CheckNum2(126, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(126, 5, $h{'fragment_index'}, 0);
-CheckString2(126, 6, $h{'in_fields'}, "data");
-CheckSArray2(126, 7, $h{'scalar'}, undef);
-CheckArray2(126, 8, $h{'scalar_ind'}, undef);
-CheckNum2(126, 9, $h{'shift'}, 2);
-
-# 56: get_string
+# 81: get_string
 $s = $_->get_string("string");
-CheckOK(56);
-CheckString(56, $s, "Zaphod Beeblebrox");
+CheckOK(81);
+CheckString(81, $s, "Zaphod Beeblebrox");
 
-# 57: add_string
+# 82: add_string
 $s = $_->add_string("new12", "a string");
-CheckOK2(57, 1);
-CheckNum2(57, 2, $s, 0);
+CheckOK2(82, 1);
+CheckNum2(82, 2, $s, 0);
 
 %h = $_->entry("new12");
-CheckOK2(57, 3);
-CheckString2(57, 4, $h{'field'}, "new12");
-CheckNum2(57, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
-CheckNum2(57, 6, $h{'fragment_index'}, 0);
+CheckOK2(82, 3);
+CheckString2(82, 4, $h{'field'}, "new12");
+CheckNum2(82, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
+CheckNum2(82, 6, $h{'fragment_index'}, 0);
 
 $s = $_->get_string("new12");
-CheckOK2(57, 7);
-CheckString2(57, 8, $s, "a string");
+CheckOK2(82, 7);
+CheckString2(82, 8, $s, "a string");
 
-# 58: madd_string
+# 83: madd_string
 $s = $_->madd_string("data", "mnew12", "another string");
-CheckOK2(58, 1);
-CheckNum2(58, 2, $s, 0);
+CheckOK2(83, 1);
+CheckNum2(83, 2, $s, 0);
 
 %h = $_->entry("data/mnew12");
-CheckOK2(58, 3);
-CheckString2(58, 4, $h{'field'}, "data/mnew12");
-CheckNum2(58, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
-CheckNum2(58, 6, $h{'fragment_index'}, 0);
+CheckOK2(83, 3);
+CheckString2(83, 4, $h{'field'}, "data/mnew12");
+CheckNum2(83, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
+CheckNum2(83, 6, $h{'fragment_index'}, 0);
 
 $s = $_->get_string("data/mnew12");
-CheckOK2(58, 7);
-CheckString2(58, 8, $s, "another string");
+CheckOK2(83, 7);
+CheckString2(83, 8, $s, "another string");
 
-# 59: add_spec
+# 84: add_spec
 $s = $_->add_spec("lorem STRING \"Lorem ipsum\"", 0);
-CheckOK2(59, 1);
-CheckNum2(59, 2, $s, 0);
+CheckOK2(84, 1);
+CheckNum2(84, 2, $s, 0);
 
 %h = $_->entry("lorem");
-CheckOK2(59, 3);
-CheckString2(59, 4, $h{'field'}, "lorem");
-CheckNum2(59, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
-CheckNum2(59, 6, $h{'fragment_index'}, 0);
+CheckOK2(84, 3);
+CheckString2(84, 4, $h{'field'}, "lorem");
+CheckNum2(84, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
+CheckNum2(84, 6, $h{'fragment_index'}, 0);
 
 $s = $_->get_string("lorem");
-CheckOK2(59, 7);
-CheckString2(59, 8, $s, "Lorem ipsum");
+CheckOK2(84, 7);
+CheckString2(84, 8, $s, "Lorem ipsum");
 
-# 60: add_spec
+# 85: add_spec
 $s = $_->madd_spec("ipsum STRING \"dolor sit amet.\"", "lorem");
-CheckOK2(60, 1);
-CheckNum2(60, 2, $s, 0);
+CheckOK2(85, 1);
+CheckNum2(85, 2, $s, 0);
 
 %h = $_->entry("lorem/ipsum");
-CheckOK2(60, 3);
-CheckString2(60, 4, $h{'field'}, "lorem/ipsum");
-CheckNum2(60, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
-CheckNum2(60, 6, $h{'fragment_index'}, 0);
+CheckOK2(85, 3);
+CheckString2(85, 4, $h{'field'}, "lorem/ipsum");
+CheckNum2(85, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
+CheckNum2(85, 6, $h{'fragment_index'}, 0);
 
 $s = $_->get_string("lorem/ipsum");
-CheckOK2(60, 7);
-CheckString2(60, 8, $s, "dolor sit amet.");
+CheckOK2(85, 7);
+CheckString2(85, 8, $s, "dolor sit amet.");
 
-# 61: put_constant
-$s = $_->put_constant("const", 61);
-CheckOK2(61, 1);
-CheckNum2(61, 2, $s, 0);
+# 86: put_constant
+$s = $_->put_constant("const", 86);
+CheckOK2(86, 1);
+CheckNum2(86, 2, $s, 0);
 
 $s = $_->get_constant("const", $GetData::FLOAT64);
-CheckOK2(61, 3);
-CheckNum2(61, 4, $s, 61.);
+CheckOK2(86, 3);
+CheckNum2(86, 4, $s, 86.);
 
-# 62: put_string
+# 94: put_string
 $s = $_->put_string("string", "Arthur Dent");
-CheckOK2(62, 1);
-CheckNum2(62, 2, $s, 12);
+CheckOK2(94, 1);
+CheckNum2(94, 2, $s, 12);
 
 $s = $_->get_string("string");
-CheckOK2(62, 3);
-CheckString2(62, 4, $s, "Arthur Dent");
+CheckOK2(94, 3);
+CheckString2(94, 4, $s, "Arthur Dent");
 
-# 63: nmfields_by_type
+# 95: nmfields_by_type
 $s = $_->mfield_list_by_type("data", $GetData::LINCOM_ENTRY);
-CheckOK(63);
-CheckNum(63, $s, 1);
+CheckOK(95);
+CheckNum(95, $s, 1);
 
-# 64: mfield_list_by_type
+# 96: mfield_list_by_type
 @a = $_->mfield_list_by_type("data", $GetData::LINCOM_ENTRY);
-CheckOK(64);
-CheckSArray(64, \@a, qw(mnew2));
+CheckOK(96);
+CheckSArray(96, \@a, qw(mnew2));
 
-# 65: nmfields_by_type
+# 97: nmvectors
 $s = $_->mvector_list("data");
-CheckOK(65);
-CheckNum(65, $s, 9);
+CheckOK(97);
+CheckNum(97, $s, 8);
 
-# 66: mfield_list_by_type
+# 98: mvector_list
 @a = $_->mvector_list("data");
-CheckOK(66);
-CheckSArray(66, \@a,
-  qw(mlut mnew2 mnew3 mnew6 mnew7 mnew8 mnew9 mnew10 mnew13));
+CheckOK(98);
+CheckSArray(98, \@a,
+  qw(mlut mnew2 mnew3 mnew6 mnew7 mnew8 mnew9 mnew10));
 
-# 67: alter raw
+# 99: alter raw
 $s = $_->alter_raw("new1", $GetData::INT32, undef);
-CheckOK2(67, 1);
-CheckNum2(67, 2, $s, 0);
+CheckOK2(99, 1);
+CheckNum2(99, 2, $s, 0);
 
 %h = $_->entry("new1");
-CheckOK2(67, 3);
-CheckNum2(67, 4, $h{'data_type'}, $GetData::INT32);
-CheckString2(67, 5, $h{'field'}, "new1");
-CheckNum2(67, 6, $h{'field_type'}, $GetData::RAW_ENTRY);
-CheckNum2(67, 7, $h{'fragment_index'}, 0);
-CheckSArray2(67, 8, $h{'scalar'}, undef);
-CheckArray2(67, 9, $h{'scalar_ind'}, undef);
-CheckNum2(67, 10, $h{'spf'}, 3);
-
-#69: alter_lincom check
+CheckOK2(99, 3);
+CheckNum2(99, 4, $h{'data_type'}, $GetData::INT32);
+CheckString2(99, 5, $h{'field'}, "new1");
+CheckNum2(99, 6, $h{'field_type'}, $GetData::RAW_ENTRY);
+CheckNum2(99, 7, $h{'fragment_index'}, 0);
+CheckSArray2(99, 8, $h{'scalar'}, undef);
+CheckArray2(99, 9, $h{'scalar_ind'}, undef);
+CheckNum2(99, 10, $h{'spf'}, 3);
+
+# 100: alter_lincom check
 $s = $_->alter_lincom("new3", undef, [ qw(in3 in4) ], [ 3., 4. ]);
-CheckOK2(69, 1);
-CheckNum2(69, 2, $s, 0);
+CheckOK2(100, 1);
+CheckNum2(100, 2, $s, 0);
 
 %h = $_->entry("new3");
-CheckOK2(69, 3);
-CheckArray2(69, 4, $h{'b'}, 1.3+1.4*i, 1.6+1.7*i);
-CheckArray2(69, 5, $h{'m'}, 3, 4);
-CheckString2(69, 7, $h{'field'}, "new3");
-CheckNum2(69, 8, $h{'field_type'}, $GetData::LINCOM_ENTRY);
-CheckNum2(69, 9, $h{'fragment_index'}, 0);
-CheckSArray2(69, 10, $h{'in_fields'}, qw(in3 in4));
-CheckNum2(69, 11, $h{'n_fields'}, 2);
-CheckSArray2(69, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
-CheckArray2(69, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
-
-# 71: alter_polynom
+CheckOK2(100, 3);
+CheckArray2(100, 4, $h{'b'}, 1.3+1.4*i, 1.6+1.7*i);
+CheckArray2(100, 5, $h{'m'}, 3, 4);
+CheckString2(100, 7, $h{'field'}, "new3");
+CheckNum2(100, 8, $h{'field_type'}, $GetData::LINCOM_ENTRY);
+CheckNum2(100, 9, $h{'fragment_index'}, 0);
+CheckSArray2(100, 10, $h{'in_fields'}, qw(in3 in4));
+CheckNum2(100, 11, $h{'n_fields'}, 2);
+CheckSArray2(100, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
+CheckArray2(100, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
+
+# 102: alter_polynom
 $s = $_->alter_polynom("new4", 4, undef, [ 1*i, 2*i, 3*i, 4*i, 5*i ]);
-CheckOK2(71, 1);
-CheckNum2(71, 2, $s, 0);
+CheckOK2(102, 1);
+CheckNum2(102, 2, $s, 0);
 
 %h = $_->entry("new4");
-CheckOK2(71, 3);
-CheckArray2(71, 4, $h{'a'}, 1*i, 2*i, 3*i, 4*i, 5*i);
-CheckString2(71, 7, $h{'field'}, "new4");
-CheckNum2(71, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
-CheckNum2(71, 9, $h{'fragment_index'}, 0);
-CheckString2(71, 10, $h{'in_fields'}, "in1");
-CheckNum2(71, 11, $h{'poly_ord'}, 4);
-CheckSArray2(71, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
-CheckArray2(71, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
-
-# 72: alter_linterp
+CheckOK2(102, 3);
+CheckArray2(102, 4, $h{'a'}, 1*i, 2*i, 3*i, 4*i, 5*i);
+CheckString2(102, 7, $h{'field'}, "new4");
+CheckNum2(102, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
+CheckNum2(102, 9, $h{'fragment_index'}, 0);
+CheckString2(102, 10, $h{'in_fields'}, "in1");
+CheckNum2(102, 11, $h{'poly_ord'}, 4);
+CheckSArray2(102, 12, $h{'scalar'}, undef, undef, undef, undef, undef);
+CheckArray2(102, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef);
+
+# 104: alter_linterp
 $s = $_->alter_linterp("new6", undef, "./other/table");
-CheckOK2(72, 1);
-CheckNum2(72, 2, $s, 0);
+CheckOK2(104, 1);
+CheckNum2(104, 2, $s, 0);
 
 %h = $_->entry("new6");
-CheckOK2(72, 2);
-CheckString2(72, 3, $h{'field'}, "new6");
-CheckNum2(72, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY);
-CheckNum2(72, 5, $h{'fragment_index'}, 0);
-CheckString2(72, 6, $h{'in_fields'}, "in");
-CheckString2(72, 7, $h{'table'}, "./other/table");
-
-# 73: alter_bit
+CheckOK2(104, 2);
+CheckString2(104, 3, $h{'field'}, "new6");
+CheckNum2(104, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY);
+CheckNum2(104, 5, $h{'fragment_index'}, 0);
+CheckString2(104, 6, $h{'in_fields'}, "in");
+CheckString2(104, 7, $h{'table'}, "./other/table");
+
+# 105: alter_bit
 $s = $_->alter_bit("new7", "in3", undef, 8);
-CheckOK2(73, 1);
-CheckNum2(73, 2, $s, 0);
+CheckOK2(105, 1);
+CheckNum2(105, 2, $s, 0);
 
 %h = $_->entry("new7");
-CheckOK(73, 2);
-CheckNum2(73, 3, $h{'bitnum'}, 11);
-CheckString2(73, 4, $h{'field'}, "new7");
-CheckNum2(73, 5, $h{'field_type'}, $GetData::BIT_ENTRY);
-CheckNum2(73, 6, $h{'fragment_index'}, 0);
-CheckString2(73, 7, $h{'in_fields'}, "in3");
-CheckNum2(73, 8, $h{'numbits'}, 8);
-CheckSArray2(73, 9, $h{'scalar'}, undef, undef);
-CheckArray2(73, 10, $h{'scalar_ind'}, undef, undef);
-
-# 74: alter_sbit
+CheckOK(105, 2);
+CheckNum2(105, 3, $h{'bitnum'}, 11);
+CheckString2(105, 4, $h{'field'}, "new7");
+CheckNum2(105, 5, $h{'field_type'}, $GetData::BIT_ENTRY);
+CheckNum2(105, 6, $h{'fragment_index'}, 0);
+CheckString2(105, 7, $h{'in_fields'}, "in3");
+CheckNum2(105, 8, $h{'numbits'}, 8);
+CheckSArray2(105, 9, $h{'scalar'}, undef, undef);
+CheckArray2(105, 10, $h{'scalar_ind'}, undef, undef);
+
+# 106: alter_sbit
 $s = $_->alter_sbit("new8", "in1");
-CheckOK2(74, 1);
-CheckNum2(74, 2, $s, 0);
+CheckOK2(106, 1);
+CheckNum2(106, 2, $s, 0);
 
 %h = $_->entry("new8");
-CheckOK(74, 2);
-CheckNum2(74, 3, $h{'bitnum'}, 5);
-CheckString2(74, 4, $h{'field'}, "new8");
-CheckNum2(74, 5, $h{'field_type'}, $GetData::SBIT_ENTRY);
-CheckNum2(74, 6, $h{'fragment_index'}, 0);
-CheckString2(74, 7, $h{'in_fields'}, "in1");
-CheckNum2(74, 8, $h{'numbits'}, 10);
-CheckSArray2(74, 9, $h{'scalar'}, undef, undef);
-CheckArray2(74, 10, $h{'scalar_ind'}, undef, undef);
-
-# 75: alter_mutiply
+CheckOK(106, 2);
+CheckNum2(106, 3, $h{'bitnum'}, 5);
+CheckString2(106, 4, $h{'field'}, "new8");
+CheckNum2(106, 5, $h{'field_type'}, $GetData::SBIT_ENTRY);
+CheckNum2(106, 6, $h{'fragment_index'}, 0);
+CheckString2(106, 7, $h{'in_fields'}, "in1");
+CheckNum2(106, 8, $h{'numbits'}, 10);
+CheckSArray2(106, 9, $h{'scalar'}, undef, undef);
+CheckArray2(106, 10, $h{'scalar_ind'}, undef, undef);
+
+# 107: alter_mutiply
 $s = $_->alter_multiply("new9", "in1");
-CheckOK2(75, 1);
-CheckNum2(75, 2, $s, 0);
+CheckOK2(107, 1);
+CheckNum2(107, 2, $s, 0);
 
 %h = $_->entry("new9");
-CheckOK2(75, 3);
-CheckString2(75, 4, $h{'field'}, "new9");
-CheckNum2(75, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
-CheckNum2(75, 6, $h{'fragment_index'}, 0);
-CheckSArray2(75, 7, $h{'in_fields'}, qw(in1 in3));
+CheckOK2(107, 3);
+CheckString2(107, 4, $h{'field'}, "new9");
+CheckNum2(107, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
+CheckNum2(107, 6, $h{'fragment_index'}, 0);
+CheckSArray2(107, 7, $h{'in_fields'}, qw(in1 in3));
 
-# 76: alter_phase
+# 108: alter_phase
 $s = $_->alter_phase("new10", undef, -3);
-CheckOK2(76, 1);
-CheckNum2(76, 2, $s, 0);
+CheckOK2(108, 1);
+CheckNum2(108, 2, $s, 0);
 
 %h = $_->entry("new10");
-CheckOK2(76, 2);
-CheckString2(76, 3, $h{'field'}, "new10");
-CheckNum2(76, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(76, 5, $h{'fragment_index'}, 0);
-CheckString2(76, 6, $h{'in_fields'}, "in6");
-CheckSArray2(76, 7, $h{'scalar'}, undef);
-CheckArray2(76, 8, $h{'scalar_ind'}, undef);
-CheckNum2(76, 9, $h{'shift'}, -3);
-
-# 77: alter_const
+CheckOK2(108, 2);
+CheckString2(108, 3, $h{'field'}, "new10");
+CheckNum2(108, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(108, 5, $h{'fragment_index'}, 0);
+CheckString2(108, 6, $h{'in_fields'}, "in6");
+CheckSArray2(108, 7, $h{'scalar'}, undef);
+CheckArray2(108, 8, $h{'scalar_ind'}, undef);
+CheckNum2(108, 9, $h{'shift'}, -3);
+
+# 109: alter_const
 $s = $_->alter_const("new11", $GetData::FLOAT32);
-CheckOK2(77, 1);
-CheckNum2(77, 2, $s, 0);
+CheckOK2(109, 1);
+CheckNum2(109, 2, $s, 0);
 
 %h = $_->entry("new11");
-CheckOK2(77, 3);
-CheckNum2(77, 4, $h{'const_type'}, $GetData::FLOAT32);
-CheckString2(77, 5, $h{'field'}, "new11");
-CheckNum2(77, 6, $h{'field_type'}, $GetData::CONST_ENTRY);
-CheckNum2(77, 7, $h{'fragment_index'}, 0);
-
-# 141: alter check
-$s = $_->alter_entry("new13", {
-    field          => undef,
-    field_type     => $GetData::PHASE_ENTRY,
-    fragment_index => 0,
-    in_fields      => "new3",
-    shift          => -2
-  });
-CheckOK2(141,1);
-CheckNum2(141, 2, $s, 0);
+CheckOK2(109, 3);
+CheckNum2(109, 4, $h{'const_type'}, $GetData::FLOAT32);
+CheckString2(109, 5, $h{'field'}, "new11");
+CheckNum2(109, 6, $h{'field_type'}, $GetData::CONST_ENTRY);
+CheckNum2(109, 7, $h{'fragment_index'}, 0);
 
-%h = $_->entry("new13");
-CheckOK2(141, 2);
-CheckString2(141, 3, $h{'field'}, "new13");
-CheckNum2(141, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(141, 5, $h{'fragment_index'}, 0);
-CheckString2(141, 6, $h{'in_fields'}, "new3");
-CheckSArray2(141, 7, $h{'scalar'}, undef);
-CheckArray2(141, 8, $h{'scalar_ind'}, undef);
-CheckNum2(141, 9, $h{'shift'}, -2);
-
-# 78: encoding check
+# 110: encoding check
 $s = $_->encoding(0);
-CheckOK(78);
-CheckNum(78, $s, $GetData::UNENCODED);
+CheckOK(110);
+CheckNum(110, $s, $GetData::UNENCODED);
 
-# 79: endianness check
+# 111: endianness check
 $s = $_->endianness(0);
-CheckOK(79);
-CheckNum(79, $s, $GetData::LITTLE_ENDIAN | $GetData::NOT_ARM_ENDIAN);
+CheckOK(111);
+CheckNum(111, $s, $GetData::LITTLE_ENDIAN | $GetData::NOT_ARM_ENDIAN);
 
-# 80: dirfilename
+# 112: dirfilename
 $s = $_->dirfilename;
-CheckOK(80);
-CheckEOString(80, $s, "dirfile");
+CheckOK(112);
+CheckEOString(112, $s, "dirfile");
 
-# 81: parent_fragment
+# 113: parent_fragment
 $s = $_->parent_fragment(1);
-CheckOK(81);
-CheckNum(81, $s, 0);
+CheckOK(113);
+CheckNum(113, $s, 0);
 
-# 82: alter_protection
+# 114: alter_protection
 $s = $_->alter_protection($GetData::PROTECT_DATA, 1);
-CheckOK(82);
-CheckNum(82, $s, 0);
+CheckOK(114);
+CheckNum(114, $s, 0);
 
-# 83: protection
+# 115: protection
 $s = $_->protection(1);
-CheckOK(83);
-CheckNum(83, $s, $GetData::PROTECT_DATA);
+CheckOK(115);
+CheckNum(115, $s, $GetData::PROTECT_DATA);
 
-# 84: raw_filename
+# 116: raw_filename
 $s = $_->raw_filename("data");
-CheckOK(84);
-CheckEOString(84, $s, "dirfile/data");
+CheckOK(116);
+CheckEOString(116, $s, "dirfile/data");
 
-# 85: reference
+# 117: reference
 $s = $_->reference("new1");
-CheckOK(85);
-CheckString(85, $s, "new1");
+CheckOK(117);
+CheckString(117, $s, "new1");
+
+# 118: gd_eof
+$s = $_->eof("lincom");
+CheckOK(118);
+CheckNum(118, $s, 81);
 
-# 87: alter_encoding
+# 119: alter_encoding
 $s = $_->alter_encoding($GetData::SLIM_ENCODED, 1);
-CheckOK2(87, 1);
-CheckNum2(87, 2, $s, 0);
+CheckOK2(119, 1);
+CheckNum2(119, 2, $s, 0);
 
 $s = $_->encoding(1);
-CheckOK2(87, 3);
-CheckNum2(87, 4, $s, $GetData::SLIM_ENCODED);
+CheckOK2(119, 3);
+CheckNum2(119, 4, $s, $GetData::SLIM_ENCODED);
 
-# 88: alter_endianness
+# 120: alter_endianness
 $s = $_->alter_endianness($GetData::BIG_ENDIAN, 1);
-CheckOK2(88, 1);
-CheckNum2(88, 2, $s, 0);
+CheckOK2(120, 1);
+CheckNum2(120, 2, $s, 0);
 
 $s = $_->endianness(1);
-CheckOK2(88, 3);
-CheckNum2(88, 4, $s, $GetData::BIG_ENDIAN);
+CheckOK2(120, 3);
+CheckNum2(120, 4, $s, $GetData::BIG_ENDIAN);
 
-# 89: alter_spec
+# 121: alter_spec
 $s = $_->alter_spec("new10 PHASE in const");
-CheckOK2(89, 1);
-CheckNum2(89, 2, $s, 0);
+CheckOK2(121, 1);
+CheckNum2(121, 2, $s, 0);
 
 %h = $_->entry("new10");
-CheckOK2(89, 2);
-CheckString2(89, 3, $h{'field'}, "new10");
-CheckNum2(89, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(89, 5, $h{'fragment_index'}, 0);
-CheckString2(89, 6, $h{'in_fields'}, "in");
-CheckSArray2(89, 7, $h{'scalar'}, "const");
-CheckArray2(89, 8, $h{'scalar_ind'}, -1);
-CheckNum2(89, 9, $h{'shift'}, 61);
-
-# 90: delete
+CheckOK2(121, 2);
+CheckString2(121, 3, $h{'field'}, "new10");
+CheckNum2(121, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(121, 5, $h{'fragment_index'}, 0);
+CheckString2(121, 6, $h{'in_fields'}, "in");
+CheckSArray2(121, 7, $h{'scalar'}, "const");
+CheckArray2(121, 8, $h{'scalar_ind'}, -1);
+CheckNum2(121, 9, $h{'shift'}, 86);
+
+# 122: delete
 $s = $_->delete("new10");
-CheckOK2(90, 0);
-CheckNum2(90, 1, $s, 0);
+CheckOK2(122, 0);
+CheckNum2(122, 1, $s, 0);
 
 $s = $_->entry("new10");
-CheckError2(90, 2, $GetData::E_BAD_CODE);
-CheckNum2(90, 3, $s, undef);
+CheckError2(122, 2, $GetData::E_BAD_CODE);
+CheckNum2(122, 3, $s, undef);
 
-# 91: malter_spec
+# 123: malter_spec
 $s = $_->malter_spec("mnew10 PHASE in4 11", "data");
-CheckOK2(91, 0);
-CheckNum2(91, 1, $s, 0);
+CheckOK2(123, 0);
+CheckNum2(123, 1, $s, 0);
 
 %h = $_->entry("data/mnew10");
-CheckOK2(91, 2);
-CheckString2(91, 3, $h{'field'}, "data/mnew10");
-CheckNum2(91, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
-CheckNum2(91, 5, $h{'fragment_index'}, 0);
-CheckString2(91, 6, $h{'in_fields'}, "in4");
-CheckSArray2(91, 7, $h{'scalar'}, undef);
-CheckArray2(91, 8, $h{'scalar_ind'}, undef);
-CheckNum2(91, 9, $h{'shift'}, 11);
-
-# 92: move
+CheckOK2(123, 2);
+CheckString2(123, 3, $h{'field'}, "data/mnew10");
+CheckNum2(123, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(123, 5, $h{'fragment_index'}, 0);
+CheckString2(123, 6, $h{'in_fields'}, "in4");
+CheckSArray2(123, 7, $h{'scalar'}, undef);
+CheckArray2(123, 8, $h{'scalar_ind'}, undef);
+CheckNum2(123, 9, $h{'shift'}, 11);
+
+# 124: move
 $s = $_->move("new9", 1);
-CheckOK2(92, 0);
-CheckNum2(92, 1, $s, 0);
+CheckOK2(124, 0);
+CheckNum2(124, 1, $s, 0);
 
 %h = $_->entry("new9");
-CheckOK2(92, 3);
-CheckString2(92, 4, $h{'field'}, "new9");
-CheckNum2(92, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
-CheckNum2(92, 6, $h{'fragment_index'}, 1);
-CheckSArray2(92, 7, $h{'in_fields'}, qw(in1 in3));
+CheckOK2(124, 3);
+CheckString2(124, 4, $h{'field'}, "new9");
+CheckNum2(124, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
+CheckNum2(124, 6, $h{'fragment_index'}, 1);
+CheckSArray2(124, 7, $h{'in_fields'}, qw(in1 in3));
 
-# 93: move
+# 125: rename
 $s = $_->rename(qw(new9 newer));
-CheckOK2(93, 0);
-CheckNum2(93, 1, $s, 0);
+CheckOK2(125, 0);
+CheckNum2(125, 1, $s, 0);
 
 $s = $_->entry("new9");
-CheckError2(93, 2, $GetData::E_BAD_CODE);
+CheckError2(125, 2, $GetData::E_BAD_CODE);
 
 %h = $_->entry("newer");
-CheckOK2(93, 3);
-CheckString2(93, 4, $h{'field'}, "newer");
-CheckNum2(93, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
-CheckNum2(93, 6, $h{'fragment_index'}, 1);
-CheckSArray2(93, 7, $h{'in_fields'}, qw(in1 in3));
+CheckOK2(125, 3);
+CheckString2(125, 4, $h{'field'}, "newer");
+CheckNum2(125, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
+CheckNum2(125, 6, $h{'fragment_index'}, 1);
+CheckSArray2(125, 7, $h{'in_fields'}, qw(in1 in3));
 
-# 94: uninclude
+# 126: uninclude
 $s = $_->uninclude(1);
-CheckOK2(94, 0);
-CheckNum2(94, 1, $s, 0);
+CheckOK2(126, 0);
+CheckNum2(126, 1, $s, 0);
 
 $s = $_->entry("newer");
-CheckError2(94, 2, $GetData::E_BAD_CODE);
+CheckError2(126, 2, $GetData::E_BAD_CODE);
 
-# 95: frameoffset
+# 127: frameoffset
 $s = $_->frameoffset(0);
-CheckOK(95);
-CheckNum(95, $s, 0);
+CheckOK(127);
+CheckNum(127, $s, 0);
 
-# 96: alter_frameoffset
+# 128: alter_frameoffset
 $s = $_->alter_frameoffset(33, 0);
-CheckOK2(96, 0);
-CheckNum2(96, 1, $s, 0);
+CheckOK2(128, 0);
+CheckNum2(128, 1, $s, 0);
 
 $s = $_->frameoffset(0);
-CheckOK2(96, 2);
-CheckNum2(96, 3, $s, 33);
+CheckOK2(128, 2);
+CheckNum2(128, 3, $s, 33);
 
-# 97: native_type
+# 129: native_type
 $s = $_->native_type("data");
-CheckOK(97);
-CheckNum(97, $s, $GetData::INT8);
+CheckOK(129);
+CheckNum(129, $s, $GetData::INT8);
 
-# 99: validate
+# 131: validate
 $s = $_->validate("new7");
-CheckError(99, $GetData::E_BAD_CODE);
-CheckNum(99, $s, undef);
+CheckError(131, $GetData::E_BAD_CODE);
+CheckNum(131, $s, undef);
 
-# 101: framenum
+# 133: framenum
 $s = $_->framenum("data", 33.3, 6);
-CheckOK(101);
-CheckNum(101, $s, 37.0375);
+CheckOK(133);
+CheckNum(133, $s, 37.0375);
 
-# 86: gd_eof
-$s = $_->eof("lincom");
-CheckOK(86);
-CheckNum(86, $s, 345);
+# 135: add check
+$s = $_->add({
+    field          => "new135",
+    field_type     => $GetData::RAW_ENTRY,
+    fragment_index => 0,
+    data_type      => $GetData::FLOAT32,
+    spf            => 5
+  });
+CheckOK2(135,1);
+CheckNum2(135, 2, $s, 0);
+
+%h = $_->entry("new135");
+CheckOK2(135, 2);
+CheckString2(135, 3, $h{'field'}, "new135");
+CheckNum2(135, 4, $h{'field_type'}, $GetData::RAW_ENTRY);
+CheckNum2(135, 5, $h{'fragment_index'}, 0);
+CheckNum2(135, 6, $h{'data_type'}, $GetData::FLOAT32);
+CheckNum2(135, 7, $h{'spf'}, 5);
+CheckSArray2(135, 8, $h{'scalar'}, undef);
+CheckArray2(135, 9, $h{'scalar_ind'}, undef);
+
+# 136: madd check
+$s = $_->madd({
+    field          => "mnew136",
+    field_type     => $GetData::PHASE_ENTRY,
+    fragment_index => 0,
+    in_fields      => "data",
+    shift          => 2
+  }, "data");
+CheckOK2(136,1);
+CheckNum2(136, 2, $s, 0);
+
+%h = $_->entry("data/mnew136");
+CheckOK2(136, 2);
+CheckString2(136, 3, $h{'field'}, "data/mnew136");
+CheckNum2(136, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(136, 5, $h{'fragment_index'}, 0);
+CheckString2(136, 6, $h{'in_fields'}, "data");
+CheckSArray2(136, 7, $h{'scalar'}, undef);
+CheckArray2(136, 8, $h{'scalar_ind'}, undef);
+CheckNum2(136, 9, $h{'shift'}, 2);
+
+# 141: alter check
+$s = $_->alter_entry("new135", {
+    field_type     => $GetData::RAW_ENTRY,
+    data_type      => $GetData::FLOAT64,
+    spf            => 141
+  });
+CheckOK2(141,1);
+CheckNum2(141, 2, $s, 0);
+
+%h = $_->entry("new135");
+CheckOK2(141, 2);
+CheckString2(141, 3, $h{'field'}, "new135");
+CheckNum2(141, 4, $h{'field_type'}, $GetData::RAW_ENTRY);
+CheckNum2(141, 5, $h{'fragment_index'}, 0);
+CheckString2(141, 6, $h{'data_type'}, $GetData::FLOAT64);
+CheckNum2(141, 9, $h{'spf'}, 141);
+CheckSArray2(141, 7, $h{'scalar'}, undef);
+CheckArray2(141, 8, $h{'scalar_ind'}, undef);
 
 # 142: gd_bof
 $s = $_->bof("lincom");
@@ -1268,7 +1263,7 @@ CheckNum2(149, 2, $h{'field_type'}, $GetData::DIVIDE_ENTRY);
 CheckNum2(149, 3, $h{'fragment_index'}, 0);
 CheckSArray2(149, 4, $h{'in_fields'}, qw(in1 in8));
 
-# 151: add recip
+# 151: madd recip
 $s = $_->madd_recip(qw(data mnew16 in2), 1.0);
 CheckOK2(151, 0);
 CheckNum2(151, 1, $s, 0);
@@ -1364,17 +1359,17 @@ CheckNum2(168, 2, $s, 0);
 CheckOK2(168, 3);
 CheckArray2(168, 4, \@a, 9, 8, 7, 6, 5, 4);
 
-#169 put caray slice
+# 169: put carray slice
 $s = $_->put_carray_slice("carray", 2, [ 169, 169 ]);
-CheckOK2(168, 1);
-CheckNum2(168, 2, $s, 0);
+CheckOK2(169, 1);
+CheckNum2(169, 2, $s, 0);
 
 @a = $_->get_carray("carray", $GetData::UINT8);
-CheckOK2(168, 3);
-CheckArray2(168, 4, \@a, 9, 8, 169, 169, 5, 4);
+CheckOK2(169, 3);
+CheckArray2(169, 4, \@a, 9, 8, 169, 169, 5, 4);
 
-# 177: carray len
-$s = $_->carray_len("carray");
+# 177: array len
+$s = $_->array_len("carray");
 CheckOK(177);
 CheckNum(177, $s, 6);
 
@@ -1406,7 +1401,7 @@ CheckNum2(179, 8, $h{'fragment_index'}, 0);
 CheckOK2(179, 9);
 CheckArray2(179, 10, \@a, 1.79, 17.9);
 
-# 180: add carray
+# 180: madd carray
 $s = $_->madd_carray("data", "mnew17", $GetData::FLOAT64, undef, 1.80, 18.0);
 CheckOK2(180, 1);
 CheckNum2(180, 2, $s, 0);
@@ -1423,14 +1418,36 @@ CheckNum2(180, 8, $h{'fragment_index'}, 0);
 CheckOK2(180, 9);
 CheckArray2(180, 10, \@a, 1.80, 18.0);
 
+# 181: alter carray
+$s = $_->alter_carray("new17", $GetData::FLOAT32, 3);
+CheckOK2(181, 0);
+CheckNum2(181, 1, $s, 0);
+
+%h = $_->entry("new17");
+CheckOK2(181, 3);
+CheckNum2(181, 4, $h{'array_len'}, 3);
+CheckNum2(181, 5, $h{'const_type'}, $GetData::FLOAT32);
+CheckString2(181, 6, $h{'field'}, "new17");
+CheckNum2(181, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY);
+CheckNum2(181, 8, $h{'fragment_index'}, 0);
+
+ at a = $_->get_carray("new17", $GetData::FLOAT64);
+CheckOK2(181, 9);
+CheckArray2(181, 10, \@a, 1.79, 17.9, 0);
+
+# 182: fragment list
+ at a = $_->fragments;
+CheckOK(182);
+CheckEOSArray(182, \@a, "dirfile/format");
+
 # 183: constants
 $s = $_->constants($GetData::UINT8);
 CheckOK2(183, 0);
-CheckString2(183, 1, $s, "=!");
+CheckString2(183, 1, $s, "V!");
 
 @a = $_->constants($GetData::FLOAT64);
 CheckOK2(183, 2);
-CheckArray2(183, 3, \@a, 61, 33.3);
+CheckArray2(183, 3, \@a, 86, 33.3);
 
 # 191: mconstants
 $s = $_->mconstants("data", $GetData::UINT8);
@@ -1586,21 +1603,6 @@ CheckSArray(222, \@a, "data", "alias", "data/mnew20", "new20");
 $s = $_->include('format1', 0, $GetData::CREAT | $GetData::EXCL, 'A', 'Z');
 CheckOK(223);
 
-# 224: GDMOVA check
-$s = $_->move_alias('new20', 1);
-CheckOK2(224, 1);
-
-$s = $_->fragment_index('Anew20Z');
-CheckOK2(224, 2);
-CheckNum(224, $s, 1);
-
-# 225: gd_delete_alias check
-$s = $_->delete_alias('Anew20Z', 0);
-CheckOK2(225, 1);
-
-$_->fragment_index('Anew20Z');
-CheckError2(225, 2, $GetData::E_BAD_CODE);
-
 # 226: gd_fragment_affixes check
 @a = $_->fragment_affixes(1);
 CheckOK(226);
@@ -1697,15 +1699,15 @@ CheckNum2(237, 2, $s, 24);
 @a = $_->entry_list(undef, $GetData::VECTOR_ENTRIES,
   $GetData::ENTRIES_HIDDEN | $GetData::ENTRIES_NOALIAS);
 CheckOK(239);
-CheckSArray(239, \@a, qw(INDEX bit data div lincom linterp mplex mult new1 new13
-new14 new16 new18 new21 new3 new4 new6 new7 new8 phase polynom recip sbit
-window));
+CheckSArray(239, \@a, qw(INDEX bit data div lincom linterp mplex mult new1
+  new135 new14 new16 new18 new21 new3 new4 new6 new7 new8 phase polynom recip
+  sbit window));
 
 # 240: gd_mplex_lookback
 $_->mplex_lookback($GetData::LOOKBACK_ALL);
 CheckOK(240);
 
-# 241: raw_filename
+# 241: linterp_tablename
 $s = $_->linterp_tablename("linterp");
 CheckOK(241);
 CheckEOString(241, $s, "dirfile/lut");
@@ -1717,15 +1719,288 @@ CheckNum2(242, 2, $#a, 1);
 CheckArray2(242, 3, $a[0], 1.9, 2.8, 3.7, 4.6, 5.5 );
 CheckArray2(242, 4, $a[1], 1.8, 18 );
 
-# 243: NULL return from gd_reference
+# 243: add lincom
+$s = $_->add({
+    field          => 'new243',
+    field_type     => $GetData::LINCOM_ENTRY,
+    fragment_index => 0,
+    in_fields      => [qw(in1 in2 in3)],
+    m              => [1.1, undef, 1.4],
+    scalar         => [undef, 'const', undef, 'carray', 'carray', 'carray'],
+    scalar_ind     => [undef, undef,   undef, 3,        4,        5]
+  });
+CheckOK2(243, 1);
+CheckNum2(243, 2, $s, 0);
+
+%h = $_->entry("new243");
+CheckOK2(243, 3);
+CheckArray2(243, 4, $h{'b'}, 169, 5, 4);
+CheckString2(243, 6, $h{'field'}, "new243");
+CheckNum2(243, 7, $h{'field_type'}, $GetData::LINCOM_ENTRY);
+CheckNum2(243, 8, $h{'fragment_index'}, 0);
+CheckSArray2(243, 9, $h{'in_fields'}, qw(in1 in2 in3));
+CheckArray2(243, 10, $h{'m'}, 1.1, 86, 1.4);
+CheckNum2(243, 11, $h{'n_fields'}, 3);
+CheckSArray2(243, 12, $h{'scalar'}, undef, 'const', undef,
+  'carray', 'carray', 'carray');
+CheckArray2(243, 13, $h{'scalar_ind'}, undef, -1, undef, 3, 4, 5);
+
+# 244: add polynom
+$s = $_->add({
+    field          => 'new244',
+    field_type     => $GetData::POLYNOM_ENTRY,
+    fragment_index => 0,
+    in_fields      => 'in2',
+    a              => [33, 44+i*55, 66],
+    scalar         => [undef, undef, undef, 'carray'],
+    scalar_ind     => [undef, undef, undef, 3       ]
+  });
+CheckOK2(244, 1);
+CheckNum2(244, 2, $s, 0);
+
+%h = $_->entry("new244");
+CheckOK2(244, 3);
+CheckArray2(244, 2, $h{'a'}, 33, 44+i*55, 66, 169);
+CheckString2(244, 4, $h{'field'}, "new244");
+CheckNum2(244, 5, $h{'field_type'}, $GetData::POLYNOM_ENTRY);
+CheckNum2(244, 6, $h{'fragment_index'}, 0);
+CheckString2(244, 7, $h{'in_fields'}, "in2");
+CheckNum2(244, 8, $h{'poly_ord'}, 3);
+CheckSArray2(244, 9, $h{'scalar'}, undef, undef, undef, "carray");
+CheckArray2(244, 10, $h{'scalar_ind'}, undef, undef, undef, 3);
+
+# 245: add linterp
+$s = $_->add({
+    field          => 'new245',
+    field_type     => $GetData::LINTERP_ENTRY,
+    fragment_index => 0,
+    in_fields      => 'in',
+    table          => './some/table'
+  });
+CheckOK2(245, 1);
+CheckNum2(245, 2, $s, 0);
+
+%h = $_->entry("new245");
+CheckOK2(245, 2);
+CheckString2(245, 3, $h{'field'}, "new245");
+CheckNum2(245, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY);
+CheckNum2(245, 5, $h{'fragment_index'}, 0);
+CheckString2(245, 6, $h{'in_fields'}, "in");
+CheckString2(245, 7, $h{'table'}, "./some/table");
+
+# 246: add bit
+$s = $_->add({
+    field          => 'new246',
+    field_type     => $GetData::BIT_ENTRY,
+    fragment_index => 0,
+    in_fields      => 'in1',
+    bitnum         => 11
+  });
+CheckOK2(246, 1);
+CheckNum2(246, 2, $s, 0);
+
+%h = $_->entry("new246");
+CheckOK(246, 2);
+CheckNum2(246, 3, $h{'bitnum'}, 11);
+CheckString2(246, 4, $h{'field'}, "new246");
+CheckNum2(246, 5, $h{'field_type'}, $GetData::BIT_ENTRY);
+CheckNum2(246, 6, $h{'fragment_index'}, 0);
+CheckString2(246, 7, $h{'in_fields'}, "in1");
+CheckNum2(246, 8, $h{'numbits'}, 1);
+CheckSArray2(246, 9, $h{'scalar'}, undef, undef);
+CheckArray2(246, 10, $h{'scalar_ind'}, undef, undef);
+
+# 247: add multiply
+$s = $_->add({
+    field          => 'new247',
+    field_type     => $GetData::MULTIPLY_ENTRY,
+    fragment_index => 0,
+    in_fields      => [qw(in1 in2)]
+  });
+CheckOK2(247, 1);
+CheckNum2(247, 2, $s, 0);
+
+%h = $_->entry("new247");
+CheckOK2(247, 3);
+CheckString2(247, 4, $h{'field'}, "new247");
+CheckNum2(247, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY);
+CheckNum2(247, 6, $h{'fragment_index'}, 0);
+CheckSArray2(247, 7, $h{'in_fields'}, qw(in1 in2));
+
+# 248: add phase
+$s = $_->add({
+    field          => "new248",
+    field_type     => $GetData::PHASE_ENTRY,
+    fragment_index => 0,
+    in_fields      => "new9",
+    shift          => -88
+  });
+CheckOK2(248,1);
+CheckNum2(248, 2, $s, 0);
+
+%h = $_->entry("new248");
+CheckOK2(248, 2);
+CheckString2(248, 3, $h{'field'}, "new248");
+CheckNum2(248, 4, $h{'field_type'}, $GetData::PHASE_ENTRY);
+CheckNum2(248, 5, $h{'fragment_index'}, 0);
+CheckString2(248, 6, $h{'in_fields'}, "new9");
+CheckSArray2(248, 7, $h{'scalar'}, undef);
+CheckArray2(248, 8, $h{'scalar_ind'}, undef);
+CheckNum2(248, 9, $h{'shift'}, -88);
+
+# 249: add const
+$s = $_->add({
+    field          => 'new249',
+    field_type     => $GetData::CONST_ENTRY,
+    fragment_index => 0,
+    const_type     => $GetData::UINT8
+  });
+CheckOK2(249, 1);
+CheckNum2(249, 2, $s, 0);
+
+%h = $_->entry("new249");
+CheckOK2(249, 3);
+CheckNum2(249, 4, $h{'const_type'}, $GetData::UINT8);
+CheckString2(249, 5, $h{'field'}, "new249");
+CheckNum2(249, 6, $h{'field_type'}, $GetData::CONST_ENTRY);
+CheckNum2(249, 7, $h{'fragment_index'}, 0);
+
+$s = $_->get_constant("new249", $GetData::FLOAT64);
+CheckOK2(249, 8);
+CheckNum2(249, 9, $s, 0);
+
+# 250: add string
+$s = $_->add({
+    field          => 'new250',
+    field_type     => $GetData::STRING_ENTRY,
+    fragment_index => 0,
+  });
+CheckOK2(250, 1);
+CheckNum2(250, 2, $s, 0);
+
+%h = $_->entry("new250");
+CheckOK2(250, 3);
+CheckString2(250, 4, $h{'field'}, "new250");
+CheckNum2(250, 5, $h{'field_type'}, $GetData::STRING_ENTRY);
+CheckNum2(250, 6, $h{'fragment_index'}, 0);
+
+$s = $_->get_string("new250");
+CheckOK2(250, 7);
+CheckString2(250, 8, $s, "");
+
+# 251: add recip
+$s = $_->add({
+    field          => 'Bnew251',
+    field_type     => $GetData::RECIP_ENTRY,
+    fragment_index => 1,
+    in_fields      => 'Bin2',
+    dividend       => 33.3+i*44.4,
+    scalar         => undef
+  });
+CheckOK2(251, 0);
+CheckNum2(251, 1, $s, 0);
+
+%h = $_->entry("Bnew251");
+CheckOK(251);
+CheckNum2(251, 2, $h{'dividend'}, 33.3 + 44.4 * i);
+CheckString2(251, 3, $h{'field'}, "Bnew251");
+CheckNum2(251, 4, $h{'field_type'}, $GetData::RECIP_ENTRY);
+CheckNum2(251, 5, $h{'fragment_index'}, 1);
+CheckString2(251, 6, $h{'in_fields'}, "Bin2");
+
+# 252: add const
+$s = $_->add({
+    field          => 'new252',
+    field_type     => $GetData::CARRAY_ENTRY,
+    fragment_index => 0,
+    array_len      => 5,
+    const_type     => $GetData::UINT8
+  });
+CheckOK2(252, 1);
+CheckNum2(252, 2, $s, 0);
+
+%h = $_->entry("new252");
+CheckOK2(252, 3);
+CheckNum2(252, 4, $h{'const_type'}, $GetData::UINT8);
+CheckNum2(252, 5, $h{'array_len'}, 5);
+CheckString2(252, 6, $h{'field'}, "new252");
+CheckNum2(252, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY);
+CheckNum2(252, 8, $h{'fragment_index'}, 0);
+
+ at a = $_->get_carray("new252", $GetData::FLOAT64);
+CheckOK2(252, 9);
+CheckArray2(252, 10, \@a, 0, 0, 0, 0, 0);
+
+# 253: add window
+$s = $_->add({
+    field          => 'new253',
+    field_type     => $GetData::WINDOW_ENTRY,
+    fragment_index => 0,
+    in_fields      => [qw(in1 in2)],
+    windop         => $GetData::WINDOP_NE,
+    threshold      => 32
+  });
+CheckOK2(253, 1);
+CheckNum2(253, 2, $s, 0);
+
+%h = $_->entry('new253');
+CheckOK2(253, 3);
+CheckString2(253, 4, $h{'field'}, "new253");
+CheckNum2(253, 5, $h{"field_type"}, $GetData::WINDOW_ENTRY);
+CheckNum2(253, 6, $h{"fragment_index"}, 0);
+CheckNum2(253, 7, $h{"windop"}, $GetData::WINDOP_NE);
+CheckNum2(253, 8, $h{"threshold"}, 32);
+CheckSArray2(253, 9, $h{"in_fields"}, 'in1', 'in2');
+
+# 254: add mplex
+$s = $_->add({
+    field          => 'new254',
+    field_type     => $GetData::MPLEX_ENTRY,
+    fragment_index => 0,
+    in_fields      => [qw(in1 in3)],
+    count_val      => 254
+  });
+CheckOK2(254, 1);
+
+%h = $_->entry('new254');
+CheckOK2(254, 2);
+CheckNum2(254, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY);
+CheckNum2(254, 2, $h{"fragment_index"}, 0);
+CheckNum2(254, 3, $h{"count_val"}, 254);
+CheckSArray2(254, 4, $h{"in_fields"}, 'in1', 'in3');
+CheckNum2(254, 5, $h{"period"}, 0);
+
+# 259: alter_entry with scalar
+$s = $_->alter_entry('new243', {
+    field_type     => $GetData::LINCOM_ENTRY,
+    scalar         => [ undef, "", "const", "carray", undef, "const" ],
+    scalar_ind     => [ undef, undef, undef,       4, undef,      -1 ]
+  });
+CheckOK2(259, 1);
+CheckNum2(259, 2, $s, 0);
+
+%h = $_->entry("new243");
+CheckOK2(259, 3);
+CheckArray2(259, 4, $h{'b'}, 5, 5, 86);
+CheckString2(259, 6, $h{'field'}, "new243");
+CheckNum2(259, 7, $h{'field_type'}, $GetData::LINCOM_ENTRY);
+CheckNum2(259, 8, $h{'fragment_index'}, 0);
+CheckSArray2(259, 9, $h{'in_fields'}, qw(in1 in2 in3));
+CheckArray2(259, 10, $h{'m'}, 1.1, 86, 86);
+CheckNum2(259, 11, $h{'n_fields'}, 3);
+CheckSArray2(259, 12, $h{'scalar'}, undef, 'const', 'const',
+  'carray', undef, 'const');
+CheckArray2(259, 13, $h{'scalar_ind'}, undef, -1, -1, 4, undef, -1);
+
+# 272: NULL return from gd_reference
 {
   local $_ = &GetData::open("dirfile/empty",
     $GetData::RDWR | $GetData::CREAT | $GetData::EXCL);
-  CheckOK2(243, 1);
+  CheckOK2(272, 1);
 
   $s = $_->reference();
-  CheckOK2(243, 2);
-  CheckString(243, $s, undef);
+  CheckOK2(272, 2);
+  CheckString(272, $s, undef);
 }
 
 
@@ -1735,5 +2010,9 @@ CheckArray2(242, 4, $a[1], 1.8, 18 );
 
 
 
+
+
+
+
 $d = $_ = undef;
 system "rm -rf dirfile";
diff --git a/bindings/perl/t/callback.t b/bindings/perl/t/callback.t
index edb7192..bd4db8e 100644
--- a/bindings/perl/t/callback.t
+++ b/bindings/perl/t/callback.t
@@ -1,3 +1,23 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2011 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+
 use GetData;
 use strict;
 use Test::More tests => 8;
diff --git a/bindings/perl/typemap b/bindings/perl/typemap
index 6dc84f7..783c5b8 100644
--- a/bindings/perl/typemap
+++ b/bindings/perl/typemap
@@ -21,13 +21,13 @@ TYPEMAP
 # basic C types
 const char ** T_CONST_AVPV
 _Complex double T_COMPLEX
-off64_t T_IV
 unsigned long int T_UV
 
 # GetData types
 DIRFILE * T_DIRFILE
 gd_entry_t T_ENTRY
 gd_entype_t T_UV
+gd_off64_t T_IV
 gd_shift_t T_IV
 gd_triplet_t T_TRIPLET
 gd_type_t T_IV
@@ -35,14 +35,15 @@ gd_windop_t T_IV
 
 # GetData Perl pseudotypes
 gdp_complex_in T_COMPLEXIN
-gdpu_bitnum_t T_IV_FFFF
-gdpu_char * T_PV_NULL
-gdpu_int T_IV_ZERO
-gdpu_numbits_t T_IV_ZERO
-gdpu_shift_t T_IV_ZERO
-gdpu_uint_t T_UV_ZERO
-gdpu_type_t T_IV_ZERO
-gdpu_complex T_COMPLEX_ZERO
+gdp_bitnum_t T_IV_FFFF
+gdp_char * T_PV_NULL
+gdp_int T_IV_ZERO
+gdp_numbits_t T_IV_ZERO
+gdp_shift_t T_IV_ZERO
+gdp_uint_t T_UV_ZERO
+gdp_type_t T_IV_ZERO
+gdp_complex T_COMPLEX_ZERO
+gdp_pentry_t T_PENTRY
 
 
 INPUT
@@ -79,27 +80,21 @@ T_COMPLEXIN
       gdp_package);
   }
 T_CONST_AVPV
-  if ($arg == undef)
-    $var = NULL;
-  else if (SvROK($arg) && SvTYPE(SvRV($arg)) == SVt_PVAV) {
-    AV *av = (AV*)SvRV($arg);
-    I32 i, len = av_len(av);
-
-    $var = ($type)safemalloc(sizeof(char*) * (1 + len));
-    for (i = 0; i <= len; ++i) {
-      SV **sv = av_fetch(av, i, 0);
-      if (sv == NULL || SvTYPE(*sv) != SVt_PV) {
-        safefree($var);
-        croak(\"%s::${func_name}() - Expected array of strings\", gdp_package);
-      }
-      ${var}[i] = SvPV_nolen(*av_fetch(av, i, 0));
-    }
-  } else
-    croak(\"%s::${func_name}() - Expected array of strings\", gdp_package);
+  { $var = gdp_convert_const_avpv($arg, NULL, gdp_package, \"${func_name}\"); }
 T_COMPLEX
   { gdp_convert_cmp(gd_csp_($var), $arg, NULL, gdp_package, \"${func_name}\"); }
 T_ENTRY
-  gdp_to_entry(&$var, $arg, gdp_package, \"${func_name}\");
+  gdp_to_entry(&$var, $arg, NULL, gdp_package, \"${func_name}\");
+T_PENTRY
+  {
+    gd_entry_t old_E;
+    if (gd_entry(dirfile, field_code, &old_E)) {
+      dreturnvoid();
+      XSRETURN_UNDEF;
+    }
+    gd_free_entry_strings(&old_E);
+    gdp_to_entry(&$var, $arg, &old_E, gdp_package, \"${func_name}\");
+  }
 T_IV_FFFF
   if ($arg == undef)
     $var = ($type)-1;
@@ -139,6 +134,7 @@ T_TRIPLET
       $var.r = SvNV($arg);
       break;
   }}
+  
 
  
 
diff --git a/bindings/php/Makefile.am b/bindings/php/Makefile.am
new file mode 100644
index 0000000..d78d24e
--- /dev/null
+++ b/bindings/php/Makefile.am
@@ -0,0 +1,40 @@
+# Copyright (C) 2013, 2014 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+php_LTLIBRARIES = getdata.la
+AM_CFLAGS = ${WALL} ${WEXTRA}
+AM_CPPFLAGS = -I$(top_srcdir)/src ${CPPFLAGS} ${PHP_CPPFLAGS}
+getdata_la_LDFLAGS = -module -avoid-version -shared ${PHP_LDFLAGS}
+getdata_la_LIBADD = ${PHP_LIBS} ../../src/libgetdata.la
+getdata_la_SOURCES = getdata.c php_getdata.h
+nodist_getdata_la_SOURCES = constants.c
+
+BUILT_SOURCES=constants.c
+
+constants.c: ../make_parameters ../../src/getdata.h
+	  ../make_parameters h > $@
+
+../make_parameters: ../make_parameters.c ../../src/gd_config.h
+	  cd .. && ${MAKE} make_parameters
+
+clean-local:
+	rm -rf *~ ${BUILT_SOURCES}
+
+SUBDIRS=. test
diff --git a/bindings/php/Makefile.in b/bindings/php/Makefile.in
new file mode 100644
index 0000000..b1256e7
--- /dev/null
+++ b/bindings/php/Makefile.in
@@ -0,0 +1,903 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/php
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(phpdir)"
+LTLIBRARIES = $(php_LTLIBRARIES)
+getdata_la_DEPENDENCIES = ../../src/libgetdata.la
+am_getdata_la_OBJECTS = getdata.lo
+nodist_getdata_la_OBJECTS = constants.lo
+getdata_la_OBJECTS = $(am_getdata_la_OBJECTS) \
+	$(nodist_getdata_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+getdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(getdata_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+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) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(getdata_la_SOURCES) $(nodist_getdata_la_SOURCES)
+DIST_SOURCES = $(getdata_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
+DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
+DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
+DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
+DEFINE_gd_int64_t = @DEFINE_gd_int64_t@
+DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@
+DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIFF = @DIFF@
+DLLTOOL = @DLLTOOL@
+DL_LIBRARY_PATH = @DL_LIBRARY_PATH@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+F95GETDATA_VERSION = @F95GETDATA_VERSION@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FFLAGS = @FFLAGS@
+FGETDATA_VERSION = @FGETDATA_VERSION@
+FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
+FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
+GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
+GD_FDIRSEP = @GD_FDIRSEP@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_DEBUG = @GETDATA_DEBUG@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GETDATA_MAJOR = @GETDATA_MAJOR@
+GETDATA_MINOR = @GETDATA_MINOR@
+GETDATA_REVISION = @GETDATA_REVISION@
+GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+GZIP_LIBS = @GZIP_LIBS@
+IDL = @IDL@
+IDL_CFLAGS = @IDL_CFLAGS@
+IDL_LIBS = @IDL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JOT = @JOT@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBLTDL = @LIBLTDL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTDLINCL = @LTDLINCL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+LZMA_LIBS = @LZMA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATLAB = @MATLAB@
+MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@
+MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@
+MEX = @MEX@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+SLIM_LIBS = @SLIM_LIBS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@
+ZZIP_LDFLAGS = @ZZIP_LDFLAGS@
+ZZIP_LIBS = @ZZIP_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+absolute_docdir = @absolute_docdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+idldir = @idldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+matlabbasedir = @matlabbasedir@
+mexext = @mexext@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slimdata = @path_slimdata@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+phpdir = @phpdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2013, 2014 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+php_LTLIBRARIES = getdata.la
+AM_CFLAGS = ${WALL} ${WEXTRA}
+AM_CPPFLAGS = -I$(top_srcdir)/src ${CPPFLAGS} ${PHP_CPPFLAGS}
+getdata_la_LDFLAGS = -module -avoid-version -shared ${PHP_LDFLAGS}
+getdata_la_LIBADD = ${PHP_LIBS} ../../src/libgetdata.la
+getdata_la_SOURCES = getdata.c php_getdata.h
+nodist_getdata_la_SOURCES = constants.c
+BUILT_SOURCES = constants.c
+SUBDIRS = . test
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/php/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/php/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-phpLTLIBRARIES: $(php_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(php_LTLIBRARIES)'; test -n "$(phpdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(phpdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(phpdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(phpdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(phpdir)"; \
+	}
+
+uninstall-phpLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(php_LTLIBRARIES)'; test -n "$(phpdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(phpdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(phpdir)/$$f"; \
+	done
+
+clean-phpLTLIBRARIES:
+	-test -z "$(php_LTLIBRARIES)" || rm -f $(php_LTLIBRARIES)
+	@list='$(php_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+getdata.la: $(getdata_la_OBJECTS) $(getdata_la_DEPENDENCIES) $(EXTRA_getdata_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(getdata_la_LINK) -rpath $(phpdir) $(getdata_la_OBJECTS) $(getdata_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/constants.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getdata.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LTLIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(phpdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local clean-phpLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-phpLTLIBRARIES
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-phpLTLIBRARIES
+
+.MAKE: $(am__recursive_targets) all check install install-am \
+	install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libtool clean-local \
+	clean-phpLTLIBRARIES cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-phpLTLIBRARIES install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-phpLTLIBRARIES
+
+
+constants.c: ../make_parameters ../../src/getdata.h
+	  ../make_parameters h > $@
+
+../make_parameters: ../make_parameters.c ../../src/gd_config.h
+	  cd .. && ${MAKE} make_parameters
+
+clean-local:
+	rm -rf *~ ${BUILT_SOURCES}
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/php/getdata.c b/bindings/php/getdata.c
new file mode 100644
index 0000000..d7ca690
--- /dev/null
+++ b/bindings/php/getdata.c
@@ -0,0 +1,4895 @@
+/* Copyright (C) 2013, 2014, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "php_getdata.h"
+#include "php_ini.h"
+
+/* corresponding type of the PHP integer */
+#if SIZEOF_LONG == 4
+#define GDPHP_LONG GD_INT32
+typedef int32_t gdphp_long_t;
+#elif SIZEOF_LONG == 8
+#define GDPHP_LONG GD_INT64
+typedef int64_t gdphp_long_t;
+#endif
+
+/* PHP globals */
+ZEND_BEGIN_MODULE_GLOBALS(getdata)
+  zend_bool degrade_complex;
+  zend_bool unpack;
+ZEND_END_MODULE_GLOBALS(getdata)
+
+ZEND_DECLARE_MODULE_GLOBALS(getdata)
+
+#ifdef ZTS
+# define GDPHP_G(v) TSRMG(getdata_globals_id, zend_getdata_globals *, v)
+# define dtracetsrm(fmt, ...)  dtrace(fmt ", %p", __VA_ARGS__, tsrm_ls)
+#else
+# define GDPHP_G(v) (getdata_globals.v)
+# define dtracetsrm dtrace
+#endif
+
+/* PHP INI entries */
+PHP_INI_BEGIN()
+  STD_PHP_INI_ENTRY("getdata.degrade_complex", "true", PHP_INI_ALL,
+      OnUpdateBool, degrade_complex, zend_getdata_globals, getdata_globals)
+  STD_PHP_INI_ENTRY("getdata.unpack", "false", PHP_INI_ALL, OnUpdateBool,
+      unpack, zend_getdata_globals, getdata_globals)
+PHP_INI_END()
+
+/* Common idioms */
+#define GDPHP_FETCH_DIRFILE(r, z) do { \
+  r = (gdphp_dirfile*)zend_fetch_resource(&(z) TSRMLS_CC, -1, "Dirfile", NULL, \
+      2, le_gdphp_dirfile, le_gdphp_dirfile_persist); \
+  if (!r) { GDPHP_RETURN_F; } \
+} while(0)
+
+#define GDPHP_RETURN_T do { dreturn("%s", "TRUE");  RETURN_TRUE; } while(0)
+#define GDPHP_RETURN_F do { dreturn("%s", "FALSE"); RETURN_FALSE; } while(0)
+#define GDPHP_CHECK_ERROR(D) do { if (gd_error(D)) GDPHP_RETURN_F; } while(0)
+#define GDPHP_RETURN_ERROR(D) do { \
+  if (gd_error(D)) GDPHP_RETURN_F; \
+  else GDPHP_RETURN_T; \
+} while(0) 
+#define GDPHP_RETURN_BOOL(e) do { \
+  if (e) GDPHP_RETURN_F; else GDPHP_RETURN_T; } while (0)
+
+#define GDPHP_PARSE(...) do { \
+  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, __VA_ARGS__) \
+      != SUCCESS) { \
+    GDPHP_RETURN_F; \
+  } \
+} while(0)
+
+#define GDPHP_PARSED(vars, ...) do { \
+  zval *gdphp_dirfile_zval; \
+  gdphp_dirfile *gdphp_dirfile_rsrc; \
+  GDPHP_PARSE("r" vars, &gdphp_dirfile_zval, __VA_ARGS__); \
+  GDPHP_FETCH_DIRFILE(gdphp_dirfile_rsrc, gdphp_dirfile_zval); \
+  D = gdphp_dirfile_rsrc->D; \
+} while(0)
+
+#define GDPHP_PARSED_ONLY() do { \
+  zval *gdphp_dirfile_zval; \
+  gdphp_dirfile *gdphp_dirfile_rsrc; \
+  GDPHP_PARSE("r", &gdphp_dirfile_zval); \
+  GDPHP_FETCH_DIRFILE(gdphp_dirfile_rsrc, gdphp_dirfile_zval); \
+  D = gdphp_dirfile_rsrc->D; \
+} while(0)
+
+#define dtracephp() dtrace("%i, %p, %p, %p, %i", ht, return_value, \
+    return_value_ptr, this_ptr, return_value_used)
+
+struct gdphp_din {
+  void *data;
+  gd_type_t type;
+  int free_din;
+  size_t ns;
+};
+
+/* error reporting */
+struct gdphp_context_t {
+  int p;
+  const char *k;
+  int i;
+};
+
+#define dtracectx(fmt, ...) dtrace(fmt " {%i,%s,%i}", __VA_ARGS__, ctx->p, \
+    ctx->k ? ctx->k : "-", ctx->i)
+#define GDPHP_CONTEXT(v) struct gdphp_context_t v = { 0, NULL, -1 };
+#define GDPHP_CONTEXTp(v,p) struct gdphp_context_t v = { p, NULL, -1 };
+#define GDPHP_DIE_BUFFER_LEN 1000
+#define GDPHP_DIE(x,fmt) do { \
+  char gdphp_die_buffer[GDPHP_DIE_BUFFER_LEN]; \
+  zend_error(E_ERROR,fmt " in %s", gdphp_context(gdphp_die_buffer,x)); \
+} while (0)
+#define GDPHP_DIE2(x,fmt,...) do { \
+  char gdphp_die_buffer[GDPHP_DIE_BUFFER_LEN]; \
+  zend_error(E_ERROR,fmt " in %s", __VA_ARGS__, \
+      gdphp_context(gdphp_die_buffer,x)); \
+} while (0)
+
+/* report the context (for error messages) */
+static char *gdphp_context(char *buffer, const struct gdphp_context_t *ctx)
+{
+  dtrace("%p, %p", buffer, ctx);
+
+  if (ctx->k) {
+    if (ctx->i >= 0)
+      snprintf(buffer, GDPHP_DIE_BUFFER_LEN,
+          "element %i of '%s' of parameter %i", ctx->i, ctx->k, ctx->p + 1);
+    else 
+      snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "element '%s' of parameter %i",
+          ctx->k, ctx->p + 1);
+  } else if (ctx->i >= 0)
+    snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "element %i of parameter %i", ctx->i,
+        ctx->p + 1);
+  else
+    snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "parameter %i", ctx->p + 1);
+
+  dreturn("\"%s\"", buffer);
+  return buffer;
+}
+
+/* the dirfile resource */
+typedef struct _gdphp_dirfile {
+  DIRFILE *D;
+  char *callback;
+  int callback_len;
+  zval **callback_data;
+  char *key;
+  int key_len;
+} gdphp_dirfile;
+
+int le_gdphp_dirfile;
+int le_gdphp_dirfile_persist;
+
+static void gdphp_dirfile_dtor(zend_rsrc_list_entry *z TSRMLS_DC)
+{
+  dtracetsrm("%p", z);
+
+  gdphp_dirfile *r = (gdphp_dirfile*)(z->ptr);
+
+  gd_discard(r->D);
+
+  if (r->callback)
+    efree(r->callback);
+  if (r->callback_data && *(r->callback_data))
+    Z_DELREF_PP(r->callback_data);
+  efree(r->key);
+  efree(r);
+
+  dreturnvoid();
+}
+
+static void gdphp_dirfile_pdtor(zend_rsrc_list_entry *z TSRMLS_DC)
+{
+  dtracetsrm("%p", z);
+
+  gdphp_dirfile *r = (gdphp_dirfile*)(z->ptr);
+
+  gd_discard(r->D);
+
+  if (r->callback)
+    pefree(r->callback, 1);
+  if (r->callback_data)
+    Z_DELREF_PP(r->callback_data);
+  pefree(r->key, 1);
+  pefree(r, 1);
+
+  dreturnvoid();
+}
+
+/* callback wrapper */
+static int gdphp_callback(gd_parser_data_t *pdata, void *extra)
+{
+  int sem = GD_SYNTAX_ABORT;
+  int new_line = 0;
+  char *ptr;
+  gdphp_dirfile *r = (gdphp_dirfile*)extra;
+  zval *response;
+  zval *function_name;
+  zval *zpdata;
+  zval **params[2] = { &zpdata, r->callback_data };
+
+  dtrace("%p, %p", pdata, r->callback_data);
+
+  if (r->callback == NULL) { /* nothing to do */
+    dreturn("%i", GD_SYNTAX_ABORT);
+    return GD_SYNTAX_ABORT;
+  }
+
+  TSRMLS_FETCH();
+
+  /* make a zval for the function name */
+  ALLOC_INIT_ZVAL(function_name);
+  ZVAL_STRINGL(function_name, r->callback, r->callback_len, 1);
+
+  /* make a hashtable for the parser data */
+  ALLOC_INIT_ZVAL(zpdata);
+  array_init(zpdata);
+  add_assoc_long(zpdata, "suberror", pdata->suberror);
+  add_assoc_long(zpdata, "linenum", pdata->linenum);
+  add_assoc_string(zpdata, "line", pdata->line, 1);
+  add_assoc_string(zpdata, "filename", (char*)pdata->filename, 1);
+
+  /* call the callback */
+  if (call_user_function_ex(CG(function_table), NULL, function_name, &response,
+        2, params, 0, NULL TSRMLS_CC) != SUCCESS)
+  {
+    zend_error(E_ERROR, "Unable to execute GetData callback");
+  }
+
+  zval_ptr_dtor(&function_name);
+
+  /* interpret the response */
+  switch (Z_TYPE_P(response)) {
+    case IS_LONG:
+      sem = (int)Z_LVAL_P(response);
+      break;
+    case IS_STRING: /* this means rescan */
+      ptr = strdup(Z_STRVAL_P(response));
+      if (ptr == NULL)
+        zend_error(E_ERROR, "Out of memory");
+      pdata->line = ptr;
+      sem = GD_SYNTAX_RESCAN;
+      new_line = 1;
+      break;
+    default:
+      zend_error(E_ERROR, "Bad response from GetData callback");
+  }
+
+  /* copy the line out of the zpdata hash, if necessary and possible */
+  if (sem == GD_SYNTAX_RESCAN && new_line == 0) {
+    zval *line;
+    if (zend_hash_find(Z_ARRVAL_P(zpdata), "line", sizeof("line"),
+          (void**)&line) == SUCCESS)
+    {
+      if (Z_TYPE_P(line) == IS_STRING) {
+        ptr = strdup(Z_STRVAL_P(response));
+        if (ptr == NULL)
+          zend_error(E_ERROR, "Out of memory");
+        pdata->line = ptr;
+      }
+    }
+  }
+
+  zval_ptr_dtor(&zpdata);
+
+  dreturn("%i", sem);
+  return sem;
+}
+
+/* create a dirfile resource */
+static gdphp_dirfile *gdphp_open(const char *dirfilename, int len, long flags,
+    const char *callback, int callback_len, zval **callback_data, int persist)
+{
+  gdphp_dirfile *r;
+  DIRFILE *D;
+
+  dtrace("\"%s\", %i, 0x%lX, \"%s\", %i, %p, %i", dirfilename, len, flags,
+      callback, callback_len, callback_data, persist);
+
+  /* create the resource */
+  r = pemalloc(sizeof(gdphp_dirfile), persist);
+  memset(r, 0, sizeof(gdphp_dirfile));
+
+  r->callback_len = callback_len;
+  if (callback)
+    r->callback = pestrdup(callback, persist);
+
+  r->key_len = len;
+  if (len > 0) {
+    r->key = pemalloc(len, persist);
+    memcpy(r->key, dirfilename, len);
+  }
+
+  if (callback_data) {
+    Z_ADDREF_PP(callback_data);
+    r->callback_data = callback_data;
+  }
+
+  /* open */
+  if (callback)
+    D = gd_cbopen(dirfilename, (unsigned)flags, gdphp_callback, r);
+  else
+    D = gd_open(dirfilename, (unsigned)flags);
+
+  /* record the dirfile */
+  r->D = D;
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* convert a complex pair to a 2-element array */
+static zval *gdphp_from_complex(zval *z, double r, double i)
+{
+  dtrace("%p, %g, %g", z, r, i);
+
+  TSRMLS_FETCH();
+
+  if (z == NULL)
+    ALLOC_INIT_ZVAL(z);
+
+  if (i == 0 && GDPHP_G(degrade_complex)) {
+    ZVAL_DOUBLE(z, r);
+  } else {
+    array_init(z);
+    add_index_double(z, 0, r);
+    add_index_double(z, 1, i);
+  }
+
+  dreturn("%p", z);
+  return z;
+}
+
+/* add a complex scalar to a hash */
+static void gdphp_add_assoc_complex(zval *z, const char *key, double r,
+    double i)
+{
+  dtrace("%p, \"%s\", %g, %g", z, key, r, i);
+
+  add_assoc_zval(z, key, gdphp_from_complex(NULL, r, i));
+
+  dreturnvoid();
+}
+
+/* add an array of complex data to a hash */
+static void gdphp_add_assoc_cmparray(zval *z, const char *key, double *l,
+    int n)
+{
+  zval *a;
+  int i;
+
+  dtrace("%p, \"%s\", %p, %i", z, key, l, n);
+
+  ALLOC_INIT_ZVAL(a);
+  array_init(a);
+
+  for (i = 0; i < n; ++i)
+    add_index_zval(a, i, gdphp_from_complex(NULL, l[i * 2], l[i * 2 + 1]));
+
+  add_assoc_zval(z, key, a);
+
+  dreturnvoid();
+}
+
+/* add an array of strings to a hash */
+static void gdphp_add_assoc_string_arr(zval *z, const char *key, char **l,
+    int n)
+{
+  zval *a;
+  int i;
+
+  dtrace("%p, \"%s\", %p, %i", z, key, l, n);
+
+  ALLOC_INIT_ZVAL(a);
+  array_init(a);
+
+  for (i = 0; i < n; ++i)
+    add_index_string(a, i, l[i], 1);
+
+  add_assoc_zval(z, key, a);
+
+  dreturnvoid();
+}
+
+/* add scalars to a entry hash */
+static void gdphp_add_assoc_scalars(zval *z, gd_entry_t *E, unsigned mask)
+{
+  int i;
+
+  zval *scalar;
+  zval *lm;
+
+  dtrace("%p, %p, 0x%X", z, E, mask);
+
+  ALLOC_INIT_ZVAL(scalar);
+  array_init(scalar);
+
+  for (i = 0; i <= GD_MAX_POLYORD; ++i)
+    if (mask & (1 << i))
+      if (E->scalar[i]) {
+        ALLOC_INIT_ZVAL(lm);
+        array_init(lm);
+        add_index_string(lm, 0, E->scalar[i], 1);
+        add_index_long(lm, 1, E->scalar_ind[i]);
+        add_index_zval(scalar, i, lm);
+      }
+
+  add_assoc_zval(z, "scalar", scalar);
+
+  dreturnvoid();
+}
+
+/* convert from a gd_entry_t to a hash */
+static void gdphp_from_entry(zval *z, gd_entry_t *E)
+{
+  dtrace("%p, %p", z, E);
+  
+  array_init(z);
+
+  add_assoc_string(z, "field", E->field, 1);
+  add_assoc_long(z, "field_type", E->field_type);
+  add_assoc_long(z, "fragment_index", E->fragment_index);
+  switch (E->field_type) {
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1);
+      add_assoc_long(z, "bitnum", E->EN(bit,bitnum));
+      add_assoc_long(z, "numbits", E->EN(bit,numbits));
+      gdphp_add_assoc_scalars(z, E, 0x3);
+      break;
+    case GD_CARRAY_ENTRY:
+      add_assoc_long(z, "array_len", E->EN(scalar,array_len));
+      /* fallthrough */
+    case GD_CONST_ENTRY:
+      add_assoc_long(z, "const_type", E->EN(scalar,const_type));
+      break;
+    case GD_LINCOM_ENTRY:
+      add_assoc_long(z, "n_fields", E->EN(lincom,n_fields));
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields,
+          E->EN(lincom,n_fields));
+      gdphp_add_assoc_cmparray(z, "m", (double*)E->EN(lincom,cm),
+          E->EN(lincom,n_fields));
+      gdphp_add_assoc_cmparray(z, "b", (double*)E->EN(lincom,cb),
+          E->EN(lincom,n_fields));
+      gdphp_add_assoc_scalars(z, E, ((1 << E->EN(lincom,n_fields)) - 1) * 9);
+      break;
+    case GD_LINTERP_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1);
+      add_assoc_string(z, "table", E->EN(linterp,table), 1);
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2);
+      break;
+    case GD_PHASE_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1);
+      add_assoc_long(z, "shift", E->EN(phase,shift));
+      gdphp_add_assoc_scalars(z, E, 0x1);
+      break;
+    case GD_POLYNOM_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1);
+      add_assoc_long(z, "poly_ord", E->EN(polynom,poly_ord));
+      gdphp_add_assoc_cmparray(z, "a", (double*)E->EN(polynom,ca),
+          E->EN(polynom,poly_ord) + 1);
+      gdphp_add_assoc_scalars(z, E, (1 << (E->EN(polynom,poly_ord) + 1)) - 1);
+      break;
+    case GD_RECIP_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1);
+      gdphp_add_assoc_complex(z, "dividend", creal(E->EN(recip,cdividend)),
+          cimag(E->EN(recip,cdividend)));
+      gdphp_add_assoc_scalars(z, E, 0x1);
+      break;
+    case GD_RAW_ENTRY:
+      add_assoc_long(z, "spf", E->EN(raw,spf));
+      add_assoc_long(z, "data_type", E->EN(raw,data_type));
+      gdphp_add_assoc_scalars(z, E, 0x1);
+      break;
+    case GD_WINDOW_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2);
+      add_assoc_long(z, "windop", E->EN(window,windop));
+      switch (E->EN(window,windop)) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          add_assoc_long(z, "threshold", E->EN(window,threshold.u));
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          add_assoc_long(z, "threshold", E->EN(window,threshold.i));
+          break;
+        default:
+          add_assoc_double(z, "threshold", E->EN(window,threshold.r));
+          break;
+      }
+      gdphp_add_assoc_scalars(z, E, 0x1);
+      break;
+    case GD_MPLEX_ENTRY:
+      gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2);
+      add_assoc_long(z, "count_val", E->EN(mplex,count_val));
+      add_assoc_long(z, "period", E->EN(mplex,period));
+      gdphp_add_assoc_scalars(z, E, 0x3);
+      break;
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      break;
+  }
+
+  dreturnvoid();
+}
+
+/* interpret a long as a gd_type_t symbol */
+static gd_type_t gdphp_type_from_long(zval *z, struct gdphp_context_t *ctx)
+{
+  gd_type_t t = GD_UNKNOWN;
+  dtracectx("%p", z);
+
+  if (Z_TYPE_P(z) != IS_LONG)
+    GDPHP_DIE(ctx, "Bad type code");
+
+  switch (Z_LVAL_P(z)) {
+    case GD_NULL:
+    case GD_UINT8:
+    case GD_INT8:
+    case GD_UINT16:
+    case GD_INT16:
+    case GD_UINT32:
+    case GD_INT32:
+    case GD_UINT64:
+    case GD_INT64:
+    case GD_FLOAT32:
+    case GD_FLOAT64:
+    case GD_COMPLEX64:
+    case GD_COMPLEX128:
+      t = Z_LVAL_P(z);
+  }
+
+  dreturn("0x%X", t);
+  return t;
+}
+
+static int gdphp_to_datum(void *dst, gd_type_t type, zval *src, int complain,
+    struct gdphp_context_t *ctx);
+
+/* convert an array to a complex number -- z is known to be an array; returns
+ * zero on success, non-zero (or doesn't return) on error */
+static int gdphp_to_complex(double *r, double *i, zval *z, int complain,
+    struct gdphp_context_t *ctx)
+{
+  int n, converted = 0;
+
+  dtracectx("%p, %p, %p, %i", r, i, z, complain);
+
+  HashTable *a = Z_ARRVAL_P(z);
+
+  n = zend_hash_num_elements(a);
+
+  if (n == 2) {
+    zval **d;
+
+    if (zend_hash_index_find(a, 0, (void**)&d) == SUCCESS)
+      if (gdphp_to_datum(r, GD_FLOAT64, *d, 0, ctx) == 0)
+        converted++;
+
+    if (zend_hash_index_find(a, 1, (void**)&d) == SUCCESS)
+      if (gdphp_to_datum(i, GD_FLOAT64, *d, 0, ctx) == 0)
+        converted++;
+  }
+
+  if (converted < 2) {
+    if (complain)
+      GDPHP_DIE(ctx, "Bad numeric data");
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  dreturn("%i (%g, %g)", 0, *r, *i);
+  return 0;
+}
+
+/* return a GD type based on a PHP type */
+static gd_type_t gdphp_get_type(zval *z, struct gdphp_context_t *ctx)
+{
+  gd_type_t t = GD_UNKNOWN;
+  double r, i;
+
+  dtracectx("%p", z);
+
+  switch (Z_TYPE_P(z)) {
+    case IS_NULL:
+      t = GD_NULL;
+      break;
+    case IS_LONG:
+    case IS_BOOL:
+      t = GD_INT64;
+      break;
+    case IS_DOUBLE:
+      t = GD_FLOAT64;
+      break;
+    case IS_ARRAY: /* check for complex by tring to convert */
+      if (gdphp_to_complex(&r, &i, z, 0, ctx) == 0)
+        t = GD_COMPLEX128;
+  }
+
+  dreturn("0x%X", t);
+  return t;
+}
+
+#define CCONVERT_ZVAL(t) \
+  do { \
+    switch (Z_TYPE_P(src)) { \
+      double r, i; \
+      case IS_NULL:               ((t*)dst)[0] = ((t*)dst)[1] = 0; break; \
+      case IS_LONG: case IS_BOOL: ((t*)dst)[0] = Z_LVAL_P(src); \
+                                  ((t*)dst)[1] = 0; break; \
+      case IS_DOUBLE:             ((t*)dst)[0] = Z_DVAL_P(src); \
+                                  ((t*)dst)[1] = 0; break; \
+      case IS_ARRAY: gdphp_to_complex(&r, &i, src, 1, ctx); \
+                     ((t*)dst)[0] = r; ((t*)dst)[1] = i; break; \
+      default: if (complain) GDPHP_DIE(ctx, "bad numeric type"); r = 1; \
+    } \
+  } while (0)
+
+#define CONVERT_ZVAL(t) \
+  do { \
+    switch (Z_TYPE_P(src)) { \
+      double r, i; \
+      case IS_LONG: case IS_BOOL: *((t*)dst) = Z_LVAL_P(src); break; \
+      case IS_DOUBLE:             *((t*)dst) = Z_DVAL_P(src); break; \
+      case IS_ARRAY: gdphp_to_complex(&r, &i, src, 1, ctx); \
+                     *((t*)dst) = r; break; \
+      default: if (complain) GDPHP_DIE(ctx, "bad numeric type"); r = 1; \
+    } \
+  } while (0)
+
+/* convert a zval to a C numeric type */
+static int gdphp_to_datum(void *dst, gd_type_t type, zval *src, int complain,
+    struct gdphp_context_t *ctx)
+{
+  int r = 0;
+  dtracectx("%p, 0x%X, %p, %i", dst, type, src, complain);
+
+  switch (type) {
+    case GD_NULL: case GD_UNKNOWN:               break;
+    case GD_UINT8:       CONVERT_ZVAL( uint8_t); break;
+    case GD_INT8:        CONVERT_ZVAL(  int8_t); break;
+    case GD_UINT16:      CONVERT_ZVAL(uint16_t); break;
+    case GD_INT16:       CONVERT_ZVAL( int16_t); break;
+    case GD_UINT32:      CONVERT_ZVAL(uint32_t); break;
+    case GD_INT32:       CONVERT_ZVAL( int32_t); break;
+    case GD_UINT64:      CONVERT_ZVAL(uint64_t); break;
+    case GD_INT64:       CONVERT_ZVAL( int64_t); break;
+    case GD_FLOAT32:     CONVERT_ZVAL(   float); break;
+    case GD_FLOAT64:     CONVERT_ZVAL(  double); break;
+    case GD_COMPLEX64:  CCONVERT_ZVAL(   float); break;
+    case GD_COMPLEX128: CCONVERT_ZVAL(  double); break;
+  }
+
+  dreturn("%i", r);
+  return r;
+}
+
+static gd_type_t gdphp_to_datum_and_type(void *datum, zval *z,
+    struct gdphp_context_t *ctx)
+{
+  gd_type_t t = GD_UNKNOWN;
+
+  dtracectx("%p, %p", datum, z);
+
+  switch (Z_TYPE_P(z)) {
+    case IS_LONG:
+      t = GDPHP_LONG;
+      *((gdphp_long_t*)datum) = Z_LVAL_P(z);
+      break;
+    case IS_DOUBLE:
+      t = GD_FLOAT64;
+      *((double*)datum) = Z_DVAL_P(z);
+      break;
+    case IS_ARRAY:
+      /* check if it is a complex array */
+      if (gdphp_to_complex(datum, ((double*)datum) + 1, z, 0, ctx) == 0) {
+        t = GD_COMPLEX128;
+        break;
+      }
+      /* FALLTHROUGH */
+    default:
+      GDPHP_DIE(ctx, "expected numeric scalar");
+  }
+
+  dreturn("0x%X", t);
+  return t;
+}
+
+gd_static_inline_ char *gdphp_check_null_string(char *v)
+{
+  dtrace("\"%s\"", v);
+  if (v == NULL || v[0] == 0) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  dreturn("\"%s\"", v);
+  return v;
+}
+
+static void gdphp_to_threshold(gd_triplet_t *t, gd_windop_t windop, zval *z,
+    struct gdphp_context_t *ctx)
+{
+  dtracectx("%p, %i, %p", t, windop, z);
+
+  switch (windop) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      gdphp_to_datum(&t->i, GD_INT64, z, 1, ctx);
+      break;
+    case GD_WINDOP_SET:
+    case GD_WINDOP_CLR:
+      gdphp_to_datum(&t->u, GD_UINT64, z, 1, ctx);
+      break;
+    default:
+      gdphp_to_datum(&t->r, GD_FLOAT64, z, 1, ctx);
+      break;
+  }
+
+  dreturnvoid();
+}
+
+/* doesn't return on error */
+static void gdphp_validate_type(gd_type_t t, struct gdphp_context_t *ctx) {
+  dtracectx("0x%X", t);
+
+  if (GD_SIZE(t) == 0)
+    GDPHP_DIE(ctx, "bad data type");
+
+  dreturnvoid();
+}
+
+/* convert a PHP array ot an array of complex data; returns length */
+static int gdphp_convert_cmparray(double *out, zval *z, int min, int max,
+    unsigned mask, struct gdphp_context_t *ctx)
+{
+  HashTable *a = Z_ARRVAL_P(z);
+  HashPosition i;
+  zval **d = NULL;
+  int n = -1;
+  unsigned key_len;
+  char *key;
+  long index;
+
+  int *have;
+
+  dtracectx("%p, %p, %i, %i, 0x%X", out, z, min, max, mask);
+
+  /* remember which elements we've seen */
+  have = emalloc(sizeof(int) * max);
+  memset(have, 0, sizeof(int) * max);
+
+  for (index = 0; index < max; ++index)
+    if (mask & (1 << index))
+      have[index] = 1;
+
+  /* populate the C array */
+  for (zend_hash_internal_pointer_reset_ex(a, &i);
+      zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS;
+      zend_hash_move_forward_ex(a, &i))
+  {
+    /* check key */
+    if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i)
+        == HASH_KEY_IS_STRING)
+    {
+      GDPHP_DIE(ctx, "cannot use associative array");
+    } else if (index < 0 || index >= max)
+      GDPHP_DIE2(ctx, "bad array index (%li)", index);
+
+    if (!have[index]) {
+      gdphp_to_datum(out + index * 2, GD_COMPLEX128, *d, 1, ctx);
+      have[index] = 1;
+    }
+  }
+
+  /* check for holes and calculate n */
+  for (index = max - 1; index >= 0; --index) {
+    if (have[index] == 0 && n != -1)
+      GDPHP_DIE(ctx, "uninitialised data in numeric array");
+    else if (have[index] && n == -1)
+      n = index + 1;
+  }
+
+  if (n < min || n > max)
+    GDPHP_DIE(ctx, "bad array count");
+
+  efree(have);
+
+  dreturn("%i", n);
+  return n;
+}
+
+/* convert a PHP array to a bounded array of strings; returns the number of
+ * elements */
+static int gdphp_convert_nsarray(char **out, zval *z, int min, int max,
+    struct gdphp_context_t *ctx)
+{
+  HashTable *a = Z_ARRVAL_P(z);
+  HashPosition i;
+  zval **d = NULL;
+  int n = -1;
+  unsigned key_len;
+  char *key;
+  long index;
+
+  dtracectx("%p, %p, %i, %i", out, z, min, max);
+
+  /* santitise */
+  memset(out, 0, sizeof(char*) * max);
+
+  /* populate the C array */
+  for (zend_hash_internal_pointer_reset_ex(a, &i);
+      zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS;
+      zend_hash_move_forward_ex(a, &i))
+  {
+    /* check key */
+    if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i)
+        == HASH_KEY_IS_STRING)
+    {
+      GDPHP_DIE(ctx, "cannot use associative array");
+    } else if (index < 0 || index >= max)
+      GDPHP_DIE2(ctx, "bad array index (%li)", index);
+
+    if (Z_TYPE_PP(d) != IS_STRING)
+      GDPHP_DIE(ctx, "string array required");
+
+    out[index] = Z_STRVAL_PP(d);
+  }
+
+  /* check for holes and calculate n */
+  for (index = max - 1; index >= 0; --index) {
+    if (out[index] == NULL && n != -1)
+      GDPHP_DIE(ctx, "uninitialised data in string array");
+    else if (out[index] && n == -1)
+      n = index + 1;
+  }
+
+  if (n < min || n > max)
+    GDPHP_DIE(ctx, "bad string array count");
+
+  dreturn("%i", n);
+  return n;
+}
+
+/* convert an array to data */
+static void gdphp_convert_array(struct gdphp_din *din, zval *zdata,
+    struct gdphp_context_t *ctx)
+{
+  HashTable *a = Z_ARRVAL_P(zdata);
+  HashPosition i;
+  zval **d = NULL;
+  char *key;
+  unsigned key_len;
+  long index;
+
+  dtracectx("%p, %p", din, zdata);
+
+  din->ns = 0;
+
+  /* pass 1: validate data and determine ns */
+  for (zend_hash_internal_pointer_reset_ex(a, &i);
+      zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS;
+      zend_hash_move_forward_ex(a, &i))
+  {
+    /* make sure this isn't an associative array */
+    if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i)
+        == HASH_KEY_IS_STRING)
+    {
+      GDPHP_DIE(ctx, "cannot use associative arrays");
+    } else if (index < 0) /* does zend_hash_get_current_key_ex return ulong
+                             or a long? */
+      GDPHP_DIE(ctx, "bad array index");
+
+    if ((unsigned long)index + 1 > din->ns)
+      din->ns = index + 1;
+
+    if (din->type == GD_UNKNOWN) {
+        din->type = gdphp_get_type(*d, ctx);
+        if (din->type == GD_UNKNOWN)
+          GDPHP_DIE(ctx, "bad numeric type");
+        else if (din->type == GD_NULL)
+          din->type = GD_UNKNOWN;
+    }
+  }
+
+  if (din->ns == 0 || din->type == GD_UNKNOWN) {
+    din->type = GD_NULL;
+    din->ns = 0;
+  } else {
+    /* allocate the buffer */
+    din->free_din = 1;
+    din->data = emalloc(din->ns * GD_SIZE(din->type));
+
+    /* zero */
+    if (din->type == GD_FLOAT64 || din->type == GD_COMPLEX128) {
+      size_t j, ns = din->ns;
+
+      if (din->type == GD_COMPLEX128)
+        ns *= 2;
+
+      for (j = 0; j < ns; ++j)
+        ((double*)(din->data))[j] = NAN;
+    } else if (din->type == GD_FLOAT32 || din->type == GD_COMPLEX64) {
+      size_t j, ns = din->ns;
+
+      if (din->type == GD_COMPLEX128)
+        ns *= 2;
+
+      for (j = 0; j < ns; ++j)
+        ((float*)(din->data))[j] = (float)NAN;
+    } else
+      memset(din->data, 0, din->ns * GD_SIZE(din->type));
+
+    /* pass 2: convert the data */
+    for (zend_hash_internal_pointer_reset_ex(a, &i);
+        zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS;
+        zend_hash_move_forward_ex(a, &i))
+    {
+      zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i);
+
+      gdphp_to_datum(((char*)(din->data)) + index * GD_SIZE(din->type),
+          din->type, *d, 1, ctx);
+    }
+  }
+
+  dreturn("0x%X, %zu", din->type, din->ns);
+}
+
+/* convert input data */
+static struct gdphp_din gdphp_convert_data(zval *zdata1, zval *zdata2, int p1,
+    int p2)
+{
+  struct gdphp_din din;
+
+  dtrace("%p, %p, %i, %i", zdata1, zdata2, p1, p2);
+
+  if (zdata2 == NULL) {
+    GDPHP_CONTEXTp(ctx,p1);
+
+    if (Z_TYPE_P(zdata1) == IS_ARRAY) {
+      din.type = GD_UNKNOWN;
+      gdphp_convert_array(&din, zdata1, &ctx);
+    } else
+      GDPHP_DIE(&ctx, "bad input data: expected array or type code");
+  } else {
+    /* in the two argument case, the first argument is taken to be a type code
+     */
+    GDPHP_CONTEXTp(ctx,p1);
+
+    din.type = gdphp_type_from_long(zdata1, &ctx); /* doesn't return on error */
+
+    ctx.p = p2;
+
+    switch (Z_TYPE_P(zdata2)) {
+      case IS_STRING: /* packed data -- just use it in place */
+        din.data = Z_STRVAL_P(zdata2);
+        din.ns = Z_STRLEN_P(zdata2) / GD_SIZE(din.type);
+        din.free_din = 0;
+        break;
+      case IS_ARRAY:
+        gdphp_convert_array(&din, zdata2, &ctx);
+        break;
+      default:
+        GDPHP_DIE(&ctx, "bad input data: expected array or string");
+    }
+  }
+
+  dreturn("{%p, 0x%X, %i, %zu}", din.data, din.type, din.free_din, din.ns);
+  return din;
+}
+
+static long gdphp_convert_long(zval *z, struct gdphp_context_t *ctx)
+{
+  long l;
+
+  dtracectx("%p", z);
+
+  if (Z_TYPE_P(z) != IS_LONG && Z_TYPE_P(z) != IS_DOUBLE)
+    GDPHP_DIE(ctx, "expected number");
+
+  convert_to_long(z); /* coerce */
+  l = Z_LVAL_P(z);
+  
+  dreturn("%li", l);
+  return l;
+}
+
+static double gdphp_convert_double(zval *z, struct gdphp_context_t *ctx)
+{
+  double d;
+
+  dtracectx("%p", z);
+
+  if (Z_TYPE_P(z) != IS_LONG && Z_TYPE_P(z) != IS_DOUBLE)
+    GDPHP_DIE(ctx, "expected number");
+
+  convert_to_double(z); /* coerce */
+  d = Z_DVAL_P(z);
+  
+  dreturn("%g", d);
+  return d;
+}
+
+/* convert PHP string with error checking */
+static char *gdphp_convert_string(zval *z, struct gdphp_context_t *ctx)
+{
+  char *s;
+
+  dtracectx("%p", z);
+
+  if (Z_TYPE_P(z) != IS_STRING)
+    GDPHP_DIE(ctx, "expected string");
+
+  s = Z_STRVAL_P(z);
+  
+  dreturn("\"%s\"", s);
+  return s;
+}
+
+static void gdphp_entry_complex(double *v, HashTable *a, const char *key,
+    size_t len, int partial, struct gdphp_context_t *ctx)
+{
+  zval **z;
+
+  dtracectx("%p, %p, \"%s\", %zu, %i", v, a, key, len, partial);
+
+  if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) {
+    ctx->k = key;
+    gdphp_to_datum(v, GD_COMPLEX128, *z, 1, ctx);
+    ctx->k = NULL;
+  } else if (!partial)
+    GDPHP_DIE2(ctx, "required key '%s' not found", key);
+
+  dreturnvoid();
+}
+
+static long gdphp_entry_long(HashTable *a, const char *key, size_t len,
+    int *missing, int partial, struct gdphp_context_t *ctx)
+{
+  long r = 0;
+  zval **z;
+
+  dtracectx("%p, \"%s\", %zu, %p, %i", a, key, len, missing, partial);
+
+  if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) {
+    ctx->k = key;
+    r = gdphp_convert_long(*z, ctx);
+    ctx->k = NULL;
+    if (missing != NULL)
+      *missing = 0;
+  } else if (missing != NULL)
+    *missing = 1;
+  else if (!partial)
+    GDPHP_DIE2(ctx, "required key '%s' not found", key);
+
+  dreturn("%li", r);
+  return r;
+}
+
+static double gdphp_entry_double(HashTable *a, const char *key, size_t len,
+    int partial, struct gdphp_context_t *ctx)
+{
+  double r = 0;
+  zval **z;
+
+  dtracectx("%p, \"%s\", %zu, %i", a, key, len, partial);
+
+  if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) {
+    ctx->k = key;
+    r = gdphp_convert_double(*z, ctx);
+    ctx->k = NULL;
+  } else if (!partial)
+    GDPHP_DIE2(ctx, "required key '%s' not found", key);
+
+  dreturn("%g", r);
+  return r;
+}
+
+static int gdphp_entry_infields(char **l, HashTable *a, int min, int max,
+    int partial, struct gdphp_context_t *ctx)
+{
+  zval **z;
+  int n = 0;
+
+  dtracectx("%p, %p, %i, %i, %i", l, a, min, max, partial);
+
+  if (zend_hash_find(a, "in_fields", sizeof("in_fields"), (void**)&z) ==
+      SUCCESS)
+  {
+    ctx->k = "in_fields";
+    if (Z_TYPE_PP(z) == IS_ARRAY)
+      n = gdphp_convert_nsarray(l, *z, min, max, ctx);
+    else if (Z_TYPE_PP(z) == IS_STRING) {
+      if (min > 1)
+        GDPHP_DIE(ctx, "bad string array count");
+      n = 1;
+      l[0] = gdphp_convert_string(*z, ctx);
+    } else
+      GDPHP_DIE(ctx, "expected string or string array");
+    ctx->k = NULL;
+  } else if (!partial)
+    GDPHP_DIE(ctx, "required key 'in_fields' not found");
+
+  dreturn("%i", n);
+  return n;
+}
+
+static int gdphp_entry_cmparray(double *l, HashTable *a, char *key, size_t len,
+    int min, int max, unsigned mask, int partial, struct gdphp_context_t *ctx)
+{
+  zval **z;
+  int n = 0;
+
+  dtracectx("%p, %p, \"%s\", %zu, %i, %i, 0x%X", l, a, key, len, min, max,
+      mask);
+
+  if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) {
+    ctx->k = key;
+    if (Z_TYPE_PP(z) == IS_ARRAY)
+      n = gdphp_convert_cmparray(l, *z, min, max, mask, ctx);
+    else if (Z_TYPE_PP(z) == IS_DOUBLE) {
+      if (min > 1)
+        GDPHP_DIE(ctx, "bad array count");
+      n = 1;
+      l[0] = Z_DVAL_PP(z);
+    } else
+      GDPHP_DIE(ctx, "expected array or float");
+    ctx->k = NULL;
+  } else if (!partial)
+    GDPHP_DIE2(ctx, "required key '%s' not found", key);
+
+  dreturn("%i", n);
+  return n;
+}
+
+/* populate an entry from the scalar array in an entry array; returns a
+ * bitmask of the elements set */
+static unsigned gdphp_entry_scalars(char** scalar, int *scalar_ind,
+    HashTable *a, unsigned mask, struct gdphp_context_t *ctx)
+{
+  unsigned mask_out = 0;
+  zval **z;
+  int i;
+
+  dtracectx("%p, %p, %p, 0x%X", scalar, scalar_ind, a, mask);
+  
+  /* find 'scalar' in the entry array */
+  if (zend_hash_find(a, "scalar", sizeof("scalar"), (void**)&z) != SUCCESS) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  ctx->k = "scalar";
+
+  /* 'scalar' must be an array (or null) */
+  if (Z_TYPE_PP(z) == IS_NULL) {
+    ctx->k = NULL;
+    dreturn("%i", 0);
+    return 0;
+  } else if (Z_TYPE_PP(z) != IS_ARRAY)
+    GDPHP_DIE(ctx, "expected array");
+
+  /* loop through the array of scalars */
+  a = Z_ARRVAL_PP(z);
+  for (i = 0; i < 2 * GD_MAX_LINCOM; ++i) {
+    if (!(mask & (1 << i)))
+      continue;
+
+    /* get the i'th scalar array element */
+    ctx->i = i;
+    if (zend_hash_index_find(a, i, (void**)&z) == SUCCESS) {
+      HashTable *sa;
+
+      if (Z_TYPE_PP(z) == IS_NULL)
+        continue;
+      if (Z_TYPE_PP(z) != IS_ARRAY)
+        GDPHP_DIE(ctx, "expected array");
+
+      sa = Z_ARRVAL_PP(z);
+
+      /* element zero should be the name of a scalar field. */
+      if (zend_hash_index_find(sa, 0, (void**)&z) == SUCCESS) {
+        if (Z_TYPE_PP(z) != IS_STRING)
+          GDPHP_DIE(ctx, "expected scalar field name");
+        scalar[i] = Z_STRVAL_PP(z);
+      } else
+        GDPHP_DIE(ctx, "element zero of should be scalar field name");
+
+      mask_out |= 1 << i;
+
+      /* element one should be the index; if missing zero is assumed */
+      if (zend_hash_index_find(sa, 1, (void**)&z) == SUCCESS) {
+        convert_to_long(*z); /* coerce */
+        scalar_ind[i] = Z_LVAL_PP(z);
+      } else
+        scalar_ind[i] = 0;
+    }
+  }
+
+  ctx->k = NULL;
+  ctx->i = -1;
+  dreturn("0x%02X", mask_out);
+  return mask_out;
+}
+
+static char *gdphp_entry_string(HashTable *a, const char *key,
+    size_t len, int partial, struct gdphp_context_t *ctx)
+{
+  char *s = NULL;
+  zval **z;
+  
+  dtracectx("%p, \"%s\", %zu, %i", a, key, len, partial);
+
+  if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) {
+    ctx->k = key;
+    s = gdphp_convert_string(*z, ctx);
+    ctx->k = NULL;
+  } else if (!partial)
+    GDPHP_DIE2(ctx, "required key '%s' not found", key);
+
+  dreturn("\"%s\"", s);
+  return s;
+}
+
+/* convert an entry array to a gd_entry_t; z is known to be an array */
+static void gdphp_to_entry(gd_entry_t *E, zval *z, const gd_entry_t *old_E,
+    int no_fragment, struct gdphp_context_t *ctx)
+{
+  /* lincom scalar masks */
+  const unsigned lincom_mask[4] = { 0x00, 0x09, 0x1B, 0x3F };
+  const int partial = (old_E != NULL);
+
+  int n, missing = 0, min = 0, max = 0;
+  unsigned mask, tmask;
+  HashTable *a = Z_ARRVAL_P(z);
+
+  dtracectx("%p, %p, %p, %i", E, z, old_E, no_fragment);
+
+  if (old_E)
+    memcpy(E, old_E, sizeof(gd_entry_t));
+  else
+    memset(E, 0, sizeof(gd_entry_t));
+
+  if (!partial)
+    E->field = gdphp_entry_string(a, "field", sizeof("field"), partial, ctx);
+
+  E->field_type = gdphp_entry_long(a, "field_type", sizeof("field_type"), NULL,
+      partial, ctx);
+
+  if (no_fragment)
+    E->fragment_index = 0;
+  else
+    E->fragment_index = gdphp_entry_long(a, "fragment_index",
+        sizeof("fragment_index"), NULL, partial, ctx);
+
+
+  switch (E->field_type) {
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx);
+
+      mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 3, ctx);
+
+      if (!(mask & 1))
+        E->EN(bit,bitnum) = gdphp_entry_long(a, "bitnum", sizeof("bitnum"),
+            NULL, partial, ctx);
+
+      if (!(mask & 2)) {
+        E->EN(bit,numbits) = gdphp_entry_long(a, "numbits", sizeof("numbits"),
+            &missing, partial, ctx);
+
+        if (missing && !partial)
+          E->EN(bit,numbits) = 1;
+      }
+      break;
+    case GD_CARRAY_ENTRY:
+      E->EN(scalar,array_len) = gdphp_entry_long(a, "array_len",
+          sizeof("array_len"), NULL, partial, ctx);
+      /* FALLTHROUGH */
+    case GD_CONST_ENTRY:
+      E->EN(scalar,const_type) = gdphp_entry_long(a, "const_type",
+          sizeof("const_type"), NULL, partial, ctx);
+      break;
+    case GD_LINCOM_ENTRY:
+      /* honour n_fields, if given */
+      n = gdphp_entry_long(a, "n_fields", sizeof("n_fields"), &missing,
+          partial, ctx);
+      if (missing) {
+        min = 1;
+        max = GD_MAX_LINCOM;
+      } else if (n < 1 || n > GD_MAX_LINCOM) {
+        GDPHP_DIE2(ctx, "bad value for 'n_fields' (%i)", n);
+      } else
+        min = max = n;
+
+      E->EN(lincom,n_fields) = gdphp_entry_infields((char**)E->in_fields, a,
+          min, max, partial, ctx);
+      
+      if (E->EN(lincom,n_fields) != 0)
+        min = max = E->EN(lincom,n_fields);
+
+      mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, lincom_mask[max],
+          ctx);
+
+      E->flags |= GD_EN_COMPSCAL;
+      tmask = (1 << max) - 1;
+
+      if ((mask & tmask) != tmask)
+        gdphp_entry_cmparray((double*)E->EN(lincom,cm), a, "m", sizeof("m"),
+            min, max, mask, partial, ctx);
+
+      if (((mask >> GD_MAX_LINCOM) & tmask) != tmask)
+        gdphp_entry_cmparray((double*)E->EN(lincom,cb), a, "b", sizeof("m"),
+            min, max, mask >> GD_MAX_LINCOM, partial, ctx);
+      else
+        E->EN(lincom,n_fields) = max;
+      break;
+    case GD_LINTERP_ENTRY:
+      gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx);
+      E->EN(linterp,table) = gdphp_entry_string(a, "table", sizeof("table"),
+          partial, ctx);
+      break;
+    case GD_MPLEX_ENTRY:
+      gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx);
+      mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 3, ctx);
+
+      if (!(mask & 1))
+        E->EN(mplex,count_val) = gdphp_entry_long(a, "count_val",
+            sizeof("count_val"), NULL, partial, ctx);
+      
+      if (!(mask & 2)) {
+        E->EN(mplex,period) = gdphp_entry_long(a, "period", sizeof("period"),
+            &missing, partial, ctx);
+
+        if (missing)
+          E->EN(mplex,period) = 0;
+      }
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx);
+      break;
+    case GD_PHASE_ENTRY:
+      gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx);
+      mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx);
+      if (!(mask & 1))
+        E->EN(phase,shift) = gdphp_entry_long(a, "shift", sizeof("shift"), NULL,
+            partial, ctx);
+      break;
+    case GD_POLYNOM_ENTRY:
+      /* honour poly_ord, if given */
+      n = gdphp_entry_long(a, "poly_ord", sizeof("poly_ord"), &missing, partial,
+          ctx);
+      if (missing) {
+        min = 2;
+        max = GD_MAX_POLYORD + 1;
+      } else if (n < 1 || n > GD_MAX_POLYORD) {
+        GDPHP_DIE2(ctx, "bad value for 'poly_ord' (%i)", n);
+      } else
+        min = max = n + 1;
+
+      gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx);
+
+      mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, (1 << max) - 1,
+          ctx);
+
+      E->flags |= GD_EN_COMPSCAL;
+      tmask = (1 << max) - 1;
+      if ((mask & tmask) != tmask)
+        E->EN(polynom,poly_ord) =
+          gdphp_entry_cmparray((double*)E->EN(polynom,ca), a, "a", sizeof("a"),
+            min, max, mask, partial, ctx) - 1;
+      else
+        E->EN(polynom,poly_ord) = max - 1;
+      break;
+    case GD_RAW_ENTRY:
+      E->EN(raw,data_type) = gdphp_entry_long(a, "data_type",
+          sizeof("data_type"), NULL, partial, ctx);
+      E->EN(raw,spf) = gdphp_entry_long(a, "spf", sizeof("spf"), NULL, partial,
+          ctx);
+      break;
+    case GD_RECIP_ENTRY:
+      gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx);
+      mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx);
+      E->flags |= GD_EN_COMPSCAL;
+      if (!(mask & 1))
+        gdphp_entry_complex((double*)gd_csp_(E->EN(recip,cdividend)), a,
+            "dividend", sizeof("dividend"), partial, ctx);
+      break;
+    case GD_STRING_ENTRY:
+      /* nothing to do */
+      break;
+    case GD_WINDOW_ENTRY:
+      gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx);
+      mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx);
+      E->EN(window,windop) = gdphp_entry_long(a, "windop", sizeof("windop"),
+          NULL, partial, ctx);
+      if (!(mask & 1))
+        switch (E->EN(window,windop)) {
+          case GD_WINDOP_EQ:
+          case GD_WINDOP_NE:
+            E->EN(window,threshold.i) = gdphp_entry_long(a, "threshold",
+                sizeof("threshold"), NULL, partial, ctx);
+            break;
+          case GD_WINDOP_SET:
+          case GD_WINDOP_CLR:
+            E->EN(window,threshold.u) = gdphp_entry_long(a, "threshold",
+                sizeof("threshold"), NULL, partial, ctx);
+            break;
+          default:
+            E->EN(window,threshold.r) = gdphp_entry_double(a, "threshold",
+                sizeof("threshold"), partial, ctx);
+            break;
+        }
+      break;
+    default:
+      GDPHP_DIE2(ctx, "bad field type (%i)", E->field_type);
+  }
+
+  dreturnvoid();
+}
+
+/* convert a C string list to a array of strings; if n is zero, the list is
+ * NULL terminated */
+static zval *gdphp_to_string_array(zval *z, const char **l, int n)
+{
+  int i;
+
+  dtrace("%p, %p, %i", z, l, n);
+
+  if (z == NULL)
+    ALLOC_INIT_ZVAL(z);
+
+  array_init(z);
+
+  for (i = 0; (l[i] && n == 0) || (n > 0 && i < n); ++i)
+    if (l[i] == NULL)
+      add_index_null(z, i);
+    else
+      add_index_string(z, i, l[i], 1);
+
+  dreturn("%p", z);
+  return z;
+}
+
+/* convert a datum to a PHP value */
+static void gdphp_from_datum(zval *z, void *datum, gd_type_t type)
+{
+  dtrace("%p, %p, 0x%X", z, datum, type);
+
+  switch (type) {
+    case GD_UINT8:
+      ZVAL_LONG(z, *((uint8_t*)datum));
+      break;
+    case GD_INT8:
+      ZVAL_LONG(z, *((int8_t*)datum));
+      break;
+    case GD_UINT16:
+      ZVAL_LONG(z, *((uint16_t*)datum));
+      break;
+    case GD_INT16:
+      ZVAL_LONG(z, *((int16_t*)datum));
+      break;
+    case GD_UINT32:
+      ZVAL_LONG(z, *((uint32_t*)datum));
+      break;
+    case GD_INT32:
+      ZVAL_LONG(z, *((int32_t*)datum));
+      break;
+    case GD_UINT64:
+      ZVAL_LONG(z, *((uint64_t*)datum));
+      break;
+    case GD_INT64:
+      ZVAL_LONG(z, *((int64_t*)datum));
+      break;
+    case GD_FLOAT32:
+      ZVAL_DOUBLE(z, *((float*)datum));
+      break;
+    case GD_FLOAT64:
+      ZVAL_DOUBLE(z, *((double*)datum));
+      break;
+    case GD_COMPLEX64:
+      gdphp_from_complex(z, ((float*)datum)[0], ((float*)datum)[1]);
+      break;
+    case GD_COMPLEX128:
+      gdphp_from_complex(z, ((double*)datum)[0], ((double*)datum)[1]);
+      break;
+    default:
+      ZVAL_NULL(z);
+      break;
+  }
+
+  dreturnvoid();
+}
+
+/* convert a data vector to a PHP array -- <a> must already be initialised as
+ * an array */
+static void gdphp_data_to_array(zval *a, const void *data, gd_type_t type,
+    size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %p, 0x%X, %zu", a, data, type, n);
+
+  switch (type) {
+    case GD_UINT8:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((uint8_t*)(data))[i]);
+      break;
+    case GD_INT8:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((int8_t*)(data))[i]);
+      break;
+    case GD_UINT16:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((uint16_t*)(data))[i]);
+      break;
+    case GD_INT16:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((int16_t*)(data))[i]);
+      break;
+    case GD_UINT32:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((uint32_t*)(data))[i]);
+      break;
+    case GD_INT32:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((int32_t*)(data))[i]);
+      break;
+    case GD_UINT64:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((uint64_t*)(data))[i]);
+      break;
+    case GD_INT64:
+      for (i = 0; i < n; ++i)
+        add_index_long(a, i, ((int64_t*)(data))[i]);
+      break;
+    case GD_FLOAT32:
+      for (i = 0; i < n; ++i)
+        add_index_double(a, i, ((float*)(data))[i]);
+      break;
+    case GD_FLOAT64:
+      for (i = 0; i < n; ++i)
+        add_index_double(a, i, ((double*)(data))[i]);
+      break;
+    case GD_COMPLEX64:
+      for (i = 0; i < n; ++i)
+        add_index_zval(a, i, gdphp_from_complex(NULL, ((float*)(data))[i * 2],
+              ((float*)(data))[i * 2 + 1]));
+      break;
+    case GD_COMPLEX128:
+      for (i = 0; i < n; ++i)
+        add_index_zval(a, i, gdphp_from_complex(NULL, ((double*)(data))[i * 2],
+              ((double*)(data))[i * 2 + 1]));
+      break;
+    default:
+      /* fill with nulls */
+      for (i = 0; i < n; ++i)
+        add_index_null(a, i);
+      break;
+  }
+
+  dreturnvoid();
+}
+
+static zval *gdphp_from_data(zval *z, size_t n, gd_type_t data_type, void *data,
+    int duplicate, int unpack)
+{
+  dtrace("%p, %zu, 0x%X, %p, %i, %i", z, n, data_type, data, duplicate, unpack);
+
+  if (z == NULL)
+    ALLOC_INIT_ZVAL(z);
+
+  if (unpack) {
+    array_init(z);
+    gdphp_data_to_array(z, data, data_type, n);
+    if (!duplicate)
+      efree(data);
+  } else { /* packed data */
+    if (n == 0) {
+      if (!duplicate)
+        efree(data);
+      ZVAL_EMPTY_STRING(z);
+    } else {
+      if (!duplicate)
+        data = erealloc(data, n * GD_SIZE(data_type)); /* trim excess */
+      ZVAL_STRINGL(z, data, n * GD_SIZE(data_type), duplicate);
+    }
+  }
+
+  dreturn("%p", z);
+  return z;
+}
+
+/* convert a zval to a long, with null checking - unfortunately PHP
+ * automatically converts nulls passed as longs into zero */
+static int gdphp_long_from_zval_null(zval *z, long dflt)
+{
+  long v = dflt;
+
+  dtrace("%p, %li", z, dflt);
+
+  if (z != NULL && Z_TYPE_P(z) != IS_NULL) {
+    convert_to_long(z); /* coerce */
+    v = Z_LVAL_P(z);
+  }
+
+  dreturn("%li", v);
+  return v;
+}
+
+/* get the unpack value */
+static zend_bool gdphp_unpack(zval *z)
+{
+  zend_bool unpack;
+
+  dtrace("%p", z);
+
+  TSRMLS_FETCH();
+
+  if (z != NULL && Z_TYPE_P(z) != IS_NULL) {
+    convert_to_boolean(z); /* coerce */
+    unpack = Z_BVAL_P(z);
+  } else
+    unpack = GDPHP_G(unpack);
+
+  dreturn("%i", unpack);
+  return unpack;
+}
+
+static void gdphp_init_globals(zend_getdata_globals *g)
+{
+  dtrace("%p", g);
+
+  g->unpack = 0;
+  g->degrade_complex = 1;
+
+  dreturnvoid();
+}
+
+/* module init function */
+PHP_MINIT_FUNCTION(getdata)
+{
+  dtracetsrm("%i, %i", type, module_number);
+
+  /* initialise globals */
+  ZEND_INIT_MODULE_GLOBALS(getdata, gdphp_init_globals, NULL);
+
+  /* INI entries */
+  REGISTER_INI_ENTRIES();
+
+  /* Register constants */
+  gdphp_register_constants(module_number);
+
+  /* conveniences */
+  zend_register_long_constant(ZEND_STRS("GD_INT"), GDPHP_LONG, CONST_CS,
+      module_number TSRMLS_CC);
+  zend_register_long_constant(ZEND_STRS("GD_FLOAT"), GD_FLOAT64, CONST_CS,
+      module_number TSRMLS_CC);
+
+  /* dirfile resource */
+  le_gdphp_dirfile = zend_register_list_destructors_ex(gdphp_dirfile_dtor, NULL,
+      "Dirfile", module_number);
+  le_gdphp_dirfile_persist = zend_register_list_destructors_ex(NULL,
+      gdphp_dirfile_pdtor, "Dirfile", module_number);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+PHP_MSHUTDOWN_FUNCTION(getdata)
+{
+  dtracetsrm("%i, %i", type, module_number);
+
+  UNREGISTER_INI_ENTRIES();
+
+  dreturn("%i", SUCCESS);
+  return SUCCESS;
+}
+
+PHP_MINFO_FUNCTION(getdata)
+{
+  dtracetsrm("%p", zend_module);
+
+  php_info_print_table_start();
+  php_info_print_table_header(2, "GetData support", "enabled");
+  php_info_print_table_row(2, "Version", PACKAGE_VERSION);
+  php_info_print_table_end();
+
+  dreturnvoid();
+}
+
+
+/* BINDINGS */
+PHP_FUNCTION(gd_add)
+{
+  zval *z;
+
+  gd_entry_t E;
+  DIRFILE *D;
+
+  GDPHP_CONTEXTp(ctx,2);
+
+  dtracephp();
+
+  GDPHP_PARSED("a", &z);
+
+  gdphp_to_entry(&E, z, NULL, 0, &ctx);
+
+  /* no need to free entry strings */
+  GDPHP_RETURN_BOOL(gd_add(D, &E));
+}
+
+PHP_FUNCTION(gd_add_alias)
+{
+  char *field_code, *target;
+  int field_code_len, target_len;
+  long index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ss|l", &field_code, &field_code_len, &target, &target_len,
+      &index);
+
+  GDPHP_RETURN_BOOL(gd_add_alias(D, field_code, target, index));
+}
+
+PHP_FUNCTION(gd_add_bit)
+{
+  char *field_code, *in_field;
+  int field_code_len, in_field_len;
+  long bitnum, index = 0;
+  zval *znumbits = NULL;
+
+  int numbits;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ssl|zl", &field_code, &field_code_len, &in_field, &in_field_len,
+      &bitnum, &znumbits, &index);
+
+  numbits = gdphp_long_from_zval_null(znumbits, 1);
+
+  GDPHP_RETURN_BOOL(gd_add_bit(D, field_code, in_field, bitnum, numbits,
+        index));
+}
+
+PHP_FUNCTION(gd_add_carray)
+{
+  char *field_code;
+  int field_code_len;
+  long data_type;
+  zval *z1, *z2 = NULL, *z3 = NULL;
+  DIRFILE *D;
+
+  int r;
+  struct gdphp_din din;
+  int index = 0;
+
+  dtracephp();
+
+  GDPHP_PARSED("slz|zz", &field_code, &field_code_len, &data_type, &z1, &z2,
+      &z3);
+
+  /* allowed types for the last three parameters:
+   *
+   * 1: anything: data
+   * 2: array, anything: data, index
+   * 3: other, anything: type, data
+   * 4: other, anything, anything: type, data, index
+   */
+  if (z2 == NULL) /* 1 */
+    din = gdphp_convert_data(z1, NULL, 3, 4);
+  else if (Z_TYPE_P(z1) == IS_ARRAY) { /* 2 */
+    din = gdphp_convert_data(z1, NULL, 3, 3);
+    convert_to_long(z2); /* coerce */
+    index = Z_LVAL_P(z2);
+  } else if (z3 == NULL) /* 3 */
+    din = gdphp_convert_data(z1, z2, 3, 4);
+  else { /* 4 */
+    din = gdphp_convert_data(z1, z2, 3, 4);
+    convert_to_long(z3); /* coerce */
+    index = Z_LVAL_P(z3);
+  }
+
+  r = gd_add_carray(D, field_code, data_type, din.ns, din.type, din.data,
+      index);
+
+  if (din.free_din)
+    efree(din.data);
+
+  GDPHP_RETURN_BOOL(r);
+}
+
+PHP_FUNCTION(gd_add_const)
+{
+  char *field_code;
+  int field_code_len;
+  long data_type, index = 0;
+  zval *z;
+
+  DIRFILE *D;
+  char data[16];
+  GDPHP_CONTEXTp(ctx,3);
+
+  dtracephp();
+
+  GDPHP_PARSED("slz|l", &field_code, &field_code_len, &data_type, &z, &index);
+
+  /* might as well convert to the storage type now */
+  gdphp_to_datum(data, data_type, z, 1, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_add_const(D, field_code, data_type, data_type, data,
+        index));
+}
+
+PHP_FUNCTION(gd_add_divide)
+{
+  char *field_code, *in1, *in2;
+  int field_code_len, in1_len, in2_len;
+  long index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in1, &in1_len, &in2,
+      &in2_len, &index);
+
+  GDPHP_RETURN_BOOL(gd_add_divide(D, field_code, in1, in2, index));
+}
+
+PHP_FUNCTION(gd_add_lincom)
+{
+  char *field_code;
+  int field_code_len;
+  long index = 0;
+  zval *zin, *zm, *zb;
+
+  char *in[GD_MAX_LINCOM];
+  double m[GD_MAX_LINCOM * 2];
+  double b[GD_MAX_LINCOM * 2];
+  int n;
+
+  DIRFILE *D;
+  GDPHP_CONTEXT(ctx);
+
+  dtracephp();
+
+  GDPHP_PARSED("saaa|l", &field_code, &field_code_len, &zin, &zm, &zb, &index);
+
+  /* these don't return on error */
+  ctx.p = 2;
+  n = gdphp_convert_nsarray((char**)in, zin, 1, GD_MAX_LINCOM, &ctx);
+  ctx.p = 3;
+  gdphp_convert_cmparray(m, zm, n, n, 0, &ctx);
+  ctx.p = 4;
+  gdphp_convert_cmparray(b, zb, n, n, 0, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_add_clincom(D, field_code, n, (const char**)in,
+        (GD_DCOMPLEXP_t)m, (GD_DCOMPLEXP_t)b, index));
+}
+
+PHP_FUNCTION(gd_add_linterp)
+{
+  char *field_code, *in_field, *table;
+  int field_code_len, in_field_len, table_len;
+  long index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in_field, &in_field_len,
+      &table, &table_len, &index);
+
+  GDPHP_RETURN_BOOL(gd_add_linterp(D, field_code, in_field, table, index));
+}
+
+PHP_FUNCTION(gd_add_mplex)
+{
+  char *field_code, *in1, *in2;
+  int field_code_len, in1_len, in2_len;
+  long count, period = 0, index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sssl|ll", &field_code, &field_code_len, &in1, &in1_len, &in2,
+      &in2_len, &count, &period, &index);
+
+  GDPHP_RETURN_BOOL(gd_add_mplex(D, field_code, in1, in2, count, period,
+        index));
+}
+
+PHP_FUNCTION(gd_add_multiply)
+{
+  char *field_code, *in1, *in2;
+  int field_code_len, in1_len, in2_len;
+  long index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in1, &in1_len, &in2,
+      &in2_len, &index);
+
+  GDPHP_RETURN_BOOL(gd_add_multiply(D, field_code, in1, in2, index));
+}
+
+PHP_FUNCTION(gd_add_phase)
+{
+  char *field_code, *in_field;
+  int field_code_len, in_field_len;
+  long shift, index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ssl|l", &field_code, &field_code_len, &in_field, &in_field_len,
+      &shift, &index);
+
+  GDPHP_RETURN_BOOL(gd_add_phase(D, field_code, in_field, shift, index));
+}
+
+PHP_FUNCTION(gd_add_polynom)
+{
+  char *field_code, *in_field;
+  int field_code_len, in_field_len;
+  long index = 0;
+  zval *za;
+
+  double a[2 * (GD_MAX_POLYORD + 1)];
+  int o;
+
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,3);
+
+  dtracephp();
+
+  GDPHP_PARSED("ssa|l", &field_code, &field_code_len, &in_field, &in_field_len,
+      &za, &index);
+
+  /* doesn't return on error */
+  o = gdphp_convert_cmparray(a, za, 2, GD_MAX_POLYORD + 1, 0, &ctx) - 1;
+
+  GDPHP_RETURN_BOOL(gd_add_cpolynom(D, field_code, o, in_field,
+        (GD_DCOMPLEXP_t)a, index));
+}
+
+PHP_FUNCTION(gd_add_raw)
+{
+  char *field_code;
+  int field_code_len;
+  long data_type, spf, index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sll|l", &field_code, &field_code_len, &data_type, &spf,
+      &index);
+
+  GDPHP_RETURN_BOOL(gd_add_raw(D, field_code, data_type, spf, index));
+}
+
+PHP_FUNCTION(gd_add_recip)
+{
+  char *field_code, *in_field;
+  int field_code_len, in_field_len;
+  zval *zdividend;
+  long index = 0;
+
+  double dividend[2];
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,3);
+
+  dtracephp();
+
+  GDPHP_PARSED("ssz|l", &field_code, &field_code_len, &in_field, &in_field_len,
+      &zdividend, &index);
+
+  gdphp_to_datum(dividend, GD_COMPLEX128, zdividend, 1, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_add_crecip89(D, field_code, in_field, dividend, index));
+}
+
+PHP_FUNCTION(gd_add_sbit)
+{
+  char *field_code, *in_field;
+  int field_code_len, in_field_len;
+  long bitnum, index = 0;
+  zval *znumbits = NULL;
+
+  int numbits;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ssl|zl", &field_code, &field_code_len, &in_field, &in_field_len,
+      &bitnum, &znumbits, &index);
+
+  numbits = gdphp_long_from_zval_null(znumbits, 1);
+
+  GDPHP_RETURN_BOOL(gd_add_sbit(D, field_code, in_field, bitnum, numbits,
+        index));
+}
+
+PHP_FUNCTION(gd_add_spec)
+{
+  char *spec;
+  int spec_len;
+  long index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|l", &spec, &spec_len, &index);
+
+  GDPHP_RETURN_BOOL(gd_add_spec(D, spec, index));
+}
+
+PHP_FUNCTION(gd_add_string)
+{
+  char *field_code, *value;
+  int field_code_len, value_len;
+  long index = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ss|l", &field_code, &field_code_len, &value, &value_len,
+      &index);
+
+  GDPHP_RETURN_BOOL(gd_add_string(D, field_code, value, index));
+}
+
+PHP_FUNCTION(gd_add_window)
+{
+  char *field_code, *in1, *in2;
+  int field_code_len, in1_len, in2_len;
+  long windop, index = 0;
+  zval *zthreshold;
+
+  gd_triplet_t threshold;
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,5);
+
+  dtracephp();
+
+  GDPHP_PARSED("ssslz|l", &field_code, &field_code_len, &in1, &in1_len, &in2,
+      &in2_len, &windop, &zthreshold, &index);
+
+  gdphp_to_threshold(&threshold, windop, zthreshold, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_add_window(D, field_code, in1, in2, windop, threshold,
+        index));
+}
+
+PHP_FUNCTION(gd_alias_target)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char *s;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  s = gd_alias_target(D, field_code);
+
+  if (s == NULL)
+    GDPHP_RETURN_F;
+
+  dreturn("\"%s\"", s);
+  RETURN_STRING(s, 1);
+}
+
+PHP_FUNCTION(gd_aliases)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char **fl;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  fl = gd_aliases(D, field_code);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_alter_affixes)
+{
+  zval *zprefix, *zsuffix;
+  long index;
+  
+  char *prefix = NULL, *suffix = NULL;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("lzz", &index, &zprefix, &zsuffix);
+
+  if (Z_TYPE_P(zprefix) != IS_NULL) {
+    convert_to_string(zprefix); /* coerce */
+    prefix = Z_STRVAL_P(zprefix);
+  }
+
+  if (Z_TYPE_P(zsuffix) != IS_NULL) {
+    convert_to_string(zsuffix); /* coerce */
+    suffix = Z_STRVAL_P(zsuffix);
+  }
+
+  GDPHP_RETURN_BOOL(gd_alter_affixes(D, index, prefix, suffix));
+}
+
+PHP_FUNCTION(gd_alter_bit)
+{
+  char *field_code, *in_field = NULL;
+  int field_code_len, in_field_len;
+  long numbits = 0;
+  zval *zbitnum = NULL;
+
+  DIRFILE *D;
+  char *in_fieldp;
+  int bitnum;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|szl", &field_code, &field_code_len, &in_field, &in_field_len,
+      &zbitnum, &numbits);
+
+  in_fieldp = gdphp_check_null_string(in_field);
+
+  bitnum = gdphp_long_from_zval_null(zbitnum, -1);
+
+  GDPHP_RETURN_BOOL(gd_alter_bit(D, field_code, in_fieldp, bitnum, numbits));
+}
+
+PHP_FUNCTION(gd_alter_carray)
+{
+  char *field_code;
+  int field_code_len;
+  long type = GD_NULL, len = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|ll", &field_code, &field_code_len, &type, &len);
+
+  GDPHP_RETURN_BOOL(gd_alter_carray(D, field_code, type, len));
+}
+
+PHP_FUNCTION(gd_alter_const)
+{
+  char *field_code;
+  int field_code_len;
+  long type = GD_NULL;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|l", &field_code, &field_code_len, &type);
+
+  GDPHP_RETURN_BOOL(gd_alter_const(D, field_code, type));
+}
+
+PHP_FUNCTION(gd_alter_encoding)
+{
+  long e, i;
+  zend_bool recode = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ll|b", &e, &i, &recode);
+
+  GDPHP_RETURN_BOOL(gd_alter_encoding(D, e, i, recode));
+}
+
+PHP_FUNCTION(gd_alter_endianness)
+{
+  long e, i;
+  zend_bool recode = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ll|b", &e, &i, &recode);
+
+  GDPHP_RETURN_BOOL(gd_alter_endianness(D, e, i, recode));
+}
+
+PHP_FUNCTION(gd_alter_entry)
+{
+  char *field_code;
+  int field_code_len;
+  zend_bool recode = 0;
+  zval *z;
+
+  gd_entry_t E, old_E;
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,2);
+
+  dtracephp();
+
+  GDPHP_PARSED("sa|b", &field_code, &field_code_len, &z, &recode);
+
+  /* find the old entry */
+  if (gd_entry(D, field_code, &old_E))
+    GDPHP_RETURN_F;
+
+  gd_free_entry_strings(&old_E); /* don't need these */
+
+  gdphp_to_entry(&E, z, &old_E, 1, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_alter_entry(D, field_code, &E, recode));
+}
+
+PHP_FUNCTION(gd_alter_frameoffset)
+{
+  long i, o;
+  zend_bool recode = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ll|b", &o, &i, &recode);
+
+  GDPHP_RETURN_BOOL(gd_alter_frameoffset64(D, o, i, recode));
+}
+
+PHP_FUNCTION(gd_alter_divide)
+{
+  char *field_code, *in_field1 = NULL, *in_field2 = NULL;
+  int field_code_len, in_field1_len, in_field2_len;
+  
+  DIRFILE *D;
+  char *in_field1p, *in_field2p;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|ss", &field_code, &field_code_len, &in_field1,
+      &in_field1_len, &in_field2, &in_field2_len);
+
+  in_field1p = gdphp_check_null_string(in_field1);
+  in_field2p = gdphp_check_null_string(in_field2);
+  
+  GDPHP_RETURN_BOOL(gd_alter_divide(D, field_code, in_field1p, in_field2p));
+}
+
+PHP_FUNCTION(gd_alter_lincom)
+{
+  char *field_code;
+  int field_code_len;
+  long n = 0;
+  zval *zin = NULL, *zm = NULL, *zb = NULL;
+
+  DIRFILE *D;
+  int min, max, nout;
+  const char *in_fields[GD_MAX_LINCOM];
+  const char **in_fieldsp = in_fields;
+  double m[GD_MAX_LINCOM * 2];
+  double b[GD_MAX_LINCOM * 2];
+  GD_DCOMPLEXP_t mp = (GD_DCOMPLEXP_t)m;
+  GD_DCOMPLEXP_t bp = (GD_DCOMPLEXP_t)b;
+  GDPHP_CONTEXT(ctx);
+
+  dtracephp();
+
+  GDPHP_PARSED("s|lzzz", &field_code, &field_code_len, &n, &zin, &zm, &zb);
+
+  /* handle passed nulls */
+  if (n == 0) {
+    min = 1;
+    max = GD_MAX_LINCOM;
+  } else
+    min = max = n;
+
+  if (zin == NULL || Z_TYPE_P(zin) == IS_NULL) {
+    in_fieldsp = NULL;
+  } else {
+    int nout;
+    min = n, max = n;
+    ctx.p = 2;
+
+    nout = gdphp_convert_nsarray((char**)in_fields, zin, 1, GD_MAX_LINCOM,
+        &ctx);
+
+    if (n == 0)
+      min = max = n = nout;
+  }
+
+  if (zm == NULL || Z_TYPE_P(zm) == IS_NULL)
+    mp = NULL;
+  else {
+    ctx.p = 3;
+
+    nout = gdphp_convert_cmparray(m, zm, min, max, 0, &ctx);
+
+    if (n == 0)
+      min = max = n = nout;
+  }
+
+  if (zb == NULL || Z_TYPE_P(zb) == IS_NULL)
+    bp = NULL;
+  else {
+    ctx.p = 4;
+    nout = gdphp_convert_cmparray(b, zb, min, max, 0, &ctx);
+
+    if (n == 0)
+      n = nout;
+  }
+
+  GDPHP_RETURN_BOOL(gd_alter_clincom(D, field_code, n, in_fieldsp, mp, bp));
+}
+
+PHP_FUNCTION(gd_alter_linterp)
+{
+  char *field_code, *in_field = NULL, *table = NULL;
+  int field_code_len, in_field_len, table_len;
+  zend_bool rename = 0;
+  
+  DIRFILE *D;
+  char *in_fieldp, *tablep;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|ssb", &field_code, &field_code_len, &in_field, &in_field_len,
+      &table, &table_len, &rename);
+
+  in_fieldp = gdphp_check_null_string(in_field);
+  tablep = gdphp_check_null_string(table);
+  
+  GDPHP_RETURN_BOOL(gd_alter_linterp(D, field_code, in_fieldp, tablep, rename));
+}
+
+PHP_FUNCTION(gd_alter_mplex)
+{
+  char *field_code, *in_field1 = NULL, *in_field2 = NULL;
+  int field_code_len, in_field1_len, in_field2_len;
+  zval *zcount_val = NULL, *zperiod = NULL;
+  
+  DIRFILE *D;
+  char *in_field1p, *in_field2p;
+  int count_val, period;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|sszz", &field_code, &field_code_len, &in_field1,
+      &in_field1_len, &in_field2, &in_field2_len, &zcount_val, &zperiod);
+
+  in_field1p = gdphp_check_null_string(in_field1);
+  in_field2p = gdphp_check_null_string(in_field2);
+  period = gdphp_long_from_zval_null(zperiod, -1);
+  
+  /* there's no way to indicate no change to count_val in the C API */
+  if (zcount_val == NULL || Z_TYPE_P(zcount_val) == IS_NULL) {
+    gd_entry_t E;
+    if (gd_entry(D, field_code, &E))
+      GDPHP_RETURN_F;
+    count_val = E.EN(mplex,count_val);
+    gd_free_entry_strings(&E);
+  } else {
+    convert_to_long(zcount_val); /* coerce */
+    count_val = Z_LVAL_P(zcount_val);
+  }
+
+  GDPHP_RETURN_BOOL(gd_alter_mplex(D, field_code, in_field1p, in_field2p,
+        count_val, period));
+}
+
+PHP_FUNCTION(gd_alter_multiply)
+{
+  char *field_code, *in_field1 = NULL, *in_field2 = NULL;
+  int field_code_len, in_field1_len, in_field2_len;
+  
+  DIRFILE *D;
+  char *in_field1p, *in_field2p;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|ss", &field_code, &field_code_len, &in_field1,
+      &in_field1_len, &in_field2, &in_field2_len);
+
+  in_field1p = gdphp_check_null_string(in_field1);
+  in_field2p = gdphp_check_null_string(in_field2);
+  
+  GDPHP_RETURN_BOOL(gd_alter_multiply(D, field_code, in_field1p, in_field2p));
+}
+
+PHP_FUNCTION(gd_alter_phase)
+{
+  char *field_code, *in_field = NULL;
+  int field_code_len, in_field_len;
+  zval *zshift = NULL;
+  
+  DIRFILE *D;
+  char *in_fieldp;
+  gd_shift_t shift;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|sz", &field_code, &field_code_len, &in_field, &in_field_len,
+      &zshift);
+
+  /* handle null shift */
+  if (zshift == NULL || Z_TYPE_P(zshift) == IS_NULL) {
+    /* there's no way to get specify no change in shift, so fetch the current
+     * value */
+    gd_entry_t E;
+    if (gd_entry(D, field_code, &E))
+      GDPHP_RETURN_F;
+    shift = E.EN(phase,shift);
+    gd_free_entry_strings(&E);
+  } else {
+    convert_to_long(zshift); /* coerce */
+    shift = Z_LVAL_P(zshift);
+  }
+
+  in_fieldp = gdphp_check_null_string(in_field);
+  
+  GDPHP_RETURN_BOOL(gd_alter_phase(D, field_code, in_fieldp, shift));
+}
+
+PHP_FUNCTION(gd_alter_polynom)
+{
+  char *field_code, *in_field = NULL;
+  int field_code_len, in_field_len;
+  long o = 0;
+  zval *za = NULL;
+
+  DIRFILE *D;
+  int min, max, oout;
+  char *in_fieldp;
+  double a[(GD_MAX_POLYORD + 1) * 2];
+  GD_DCOMPLEXP_t ap = (GD_DCOMPLEXP_t)a;
+  GDPHP_CONTEXTp(ctx,4);
+
+  dtracephp();
+
+  GDPHP_PARSED("s|lsz", &field_code, &field_code_len, &o, &in_field,
+      &in_field_len, &za);
+
+  /* handle nulls */
+  in_fieldp = gdphp_check_null_string(in_field);
+
+  if (o == 0) {
+    min = 2;
+    max = GD_MAX_POLYORD + 1;
+  } else
+    min = max = o + 1;
+
+  if (za == NULL || Z_TYPE_P(za) == IS_NULL)
+    ap = NULL;
+  else {
+    oout = gdphp_convert_cmparray(a, za, min, max, 0, &ctx);
+
+    if (o == 0)
+      o = oout;
+  }
+
+  GDPHP_RETURN_BOOL(gd_alter_cpolynom(D, field_code, o, in_fieldp, ap));
+}
+
+PHP_FUNCTION(gd_alter_protection)
+{
+  long p, i;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ll", &p, &i);
+
+  GDPHP_RETURN_BOOL(gd_alter_protection(D, p, i));
+}
+
+PHP_FUNCTION(gd_alter_raw)
+{
+  char *field_code;
+  int field_code_len;
+  long type = GD_NULL, spf = 0;
+  zend_bool recode = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|llb", &field_code, &field_code_len, &type, &spf, &recode);
+
+  GDPHP_RETURN_BOOL(gd_alter_raw(D, field_code, type, spf, recode));
+}
+
+PHP_FUNCTION(gd_alter_recip)
+{
+  char *field_code, *in_field = NULL;
+  int field_code_len, in_field_len;
+  zval *zdividend = NULL;
+
+  DIRFILE *D;
+  char *in_fieldp;
+  double dividend[2];
+  GDPHP_CONTEXTp(ctx,3);
+
+  dtracephp();
+
+  GDPHP_PARSED("s|sz", &field_code, &field_code_len, &in_field, &in_field_len,
+      &zdividend);
+
+  /* handle nulls */
+  in_fieldp = gdphp_check_null_string(in_field);
+  if (zdividend == NULL || Z_TYPE_P(zdividend) == IS_NULL)
+    dividend[0] = dividend[1] = 0;
+  else
+    gdphp_to_datum(dividend, GD_COMPLEX128, zdividend, 1, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_alter_crecip89(D, field_code, in_fieldp, dividend));
+}
+
+PHP_FUNCTION(gd_alter_sbit)
+{
+  char *field_code, *in_field = NULL;
+  int field_code_len, in_field_len;
+  long numbits = 0;
+  zval *zbitnum = NULL;
+
+  DIRFILE *D;
+  char *in_fieldp;
+  int bitnum;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|szl", &field_code, &field_code_len, &in_field, &in_field_len,
+      &zbitnum, &numbits);
+
+  in_fieldp = gdphp_check_null_string(in_field);
+
+  bitnum = gdphp_long_from_zval_null(zbitnum, -1);
+
+  GDPHP_RETURN_BOOL(gd_alter_sbit(D, field_code, in_fieldp, bitnum, numbits));
+}
+
+PHP_FUNCTION(gd_alter_spec)
+{
+  char *spec;
+  int spec_len;
+  zend_bool recode = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|b", &spec, &spec_len, &recode);
+
+  GDPHP_RETURN_BOOL(gd_alter_spec(D, spec, recode));
+}
+
+PHP_FUNCTION(gd_alter_window)
+{
+  char *field_code, *in1 = NULL, *in2 = NULL;
+  int field_code_len, in1_len, in2_len;
+  long windop;
+  zval *zthreshold = NULL;
+
+  gd_triplet_t threshold;
+  char *in1p, *in2p;
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,5);
+
+  dtracephp();
+
+  GDPHP_PARSED("s|sslz", &field_code, &field_code_len, &in1, &in1_len, &in2,
+      &in2_len, &windop, &zthreshold);
+
+  in1p = gdphp_check_null_string(in1);
+  in2p = gdphp_check_null_string(in2);
+
+  /* there is no way to specify no change to the threshold in the C API */
+  if (zthreshold == NULL || Z_TYPE_P(zthreshold) == IS_NULL) {
+    gd_entry_t E;
+    if (gd_entry(D, field_code, &E))
+      GDPHP_RETURN_F;
+    memcpy(&threshold, &E.EN(window,threshold), sizeof(threshold));
+    gd_free_entry_strings(&E);
+  } else
+    gdphp_to_threshold(&threshold, windop, zthreshold, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_alter_window(D, field_code, in1p, in2p, windop,
+        threshold));
+}
+
+PHP_FUNCTION(gd_bof)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  long bof;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  bof = (long)gd_bof64(D, field_code);
+
+  if (bof < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", bof);
+  RETURN_LONG(bof);
+}
+
+PHP_FUNCTION(gd_carray_len)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  size_t n;
+
+  dtracephp();
+
+  zend_error(E_DEPRECATED,
+      "gd_carray_len() is deprecated.  Use gd_array_len() instead.");
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  n = gd_array_len(D, field_code);
+
+  if (n == 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%zu", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_array_len)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  size_t n;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  n = gd_array_len(D, field_code);
+
+  if (n == 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%zu", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_carrays)
+{
+  zval *zunpack = NULL;
+  long data_type;
+
+  DIRFILE *D;
+  int unpack, i;
+  const gd_carray_t *c;
+
+  dtracephp();
+
+  GDPHP_PARSED("l|z", &data_type, &zunpack);
+
+  unpack = gdphp_unpack(zunpack);
+
+  c = gd_carrays(D, data_type);
+
+  if (c == NULL)
+    GDPHP_RETURN_F;
+
+  /* convert */
+  array_init(return_value);
+
+  for (i = 0; c[i].n; ++i)
+    add_index_zval(return_value, i, gdphp_from_data(NULL, c[i].n, data_type,
+          c[i].d, 1, unpack));
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_close)
+{
+  zval *z;
+  gdphp_dirfile *r;
+
+  dtracephp();
+
+  GDPHP_PARSE("r", &z);
+  GDPHP_FETCH_DIRFILE(r, z);
+
+  if (gd_close(r->D))
+    GDPHP_RETURN_F;
+
+  /* delete the resource on success */
+  r->D = NULL; /* avoid double close */
+  zend_list_delete(Z_LVAL_P(z));
+
+  GDPHP_RETURN_T;
+}
+
+PHP_FUNCTION(gd_constants)
+{
+  long data_type;
+  zval *zunpack = NULL;
+
+  void *data;
+  unsigned n;
+  DIRFILE *D;
+  zend_bool unpack;
+  GDPHP_CONTEXTp(ctx,2);
+
+  dtracephp();
+
+  GDPHP_PARSED("l|z", &data_type, &zunpack);
+
+  unpack = gdphp_unpack(zunpack);
+  gdphp_validate_type(data_type, &ctx);
+
+  data = (void*)gd_constants(D, data_type);
+  
+  GDPHP_CHECK_ERROR(D);
+
+  n = gd_nfields_by_type(D, GD_CONST_ENTRY);
+
+  GDPHP_CHECK_ERROR(D);
+
+  gdphp_from_data(return_value, n, data_type, data, 1, unpack);
+  dreturn("%i", n);
+}
+
+PHP_FUNCTION(gd_delete)
+{
+  char *field_code;
+  int field_code_len;
+  long flags = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s|l", &field_code, &field_code_len, &flags);
+
+  GDPHP_RETURN_BOOL(gd_delete(D, field_code, flags));
+}
+
+PHP_FUNCTION(gd_desync)
+{
+  long flags = 0;
+
+  int r;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|l", &flags);
+
+  r = gd_desync(D, flags);
+
+  if (r < 0)
+    RETURN_NULL();
+
+  GDPHP_RETURN_BOOL(!r);
+}
+
+PHP_FUNCTION(gd_dirfile_standards)
+{
+  zval *zversion = NULL;
+
+  long version;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|z", &zversion);
+
+  version = gdphp_long_from_zval_null(zversion, GD_VERSION_CURRENT);
+
+  version = gd_dirfile_standards(D, version);
+
+  if (version < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", version);
+  RETURN_LONG(version);
+}
+
+PHP_FUNCTION(gd_dirfilekey)
+{
+  zval *z;
+  gdphp_dirfile *r;
+
+  dtracephp();
+
+  GDPHP_PARSE("r", &z);
+  GDPHP_FETCH_DIRFILE(r, z);
+
+  dreturn("\"%s\"", r->key);
+  RETURN_STRINGL(r->key, r->key_len, 1);
+}
+
+PHP_FUNCTION(gd_dirfilename)
+{
+  const char *s;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  s = gd_dirfilename(D);
+  dreturn("\"%s\"", s);
+  RETURN_STRING(s, 1);
+}
+
+PHP_FUNCTION(gd_discard)
+{
+  zval *z;
+  gdphp_dirfile *r;
+
+  dtracephp();
+
+  GDPHP_PARSE("r", &z);
+  GDPHP_FETCH_DIRFILE(r, z);
+
+  if (gd_discard(r->D))
+    GDPHP_RETURN_F;
+
+  /* delete the resource on success */
+  r->D = NULL; /* avoid double close */
+  zend_list_delete(Z_LVAL_P(z));
+
+  GDPHP_RETURN_T;
+}
+
+PHP_FUNCTION(gd_encoding)
+{
+  long i = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|l", &i);
+
+  i = gd_encoding(D, i);
+
+  if (i == 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%lx", i);
+  RETURN_LONG(i);
+}
+
+PHP_FUNCTION(gd_endianness)
+{
+  long i = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|l", &i);
+
+  i = gd_endianness(D, i);
+
+  if (i == 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%lx", i);
+  RETURN_LONG(i);
+}
+
+PHP_FUNCTION(gd_entry)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  gd_entry_t E;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  if (gd_entry(D, field_code, &E))
+    GDPHP_RETURN_F;
+
+  gdphp_from_entry(return_value, &E);
+  gd_free_entry_strings(&E);
+  dreturn("%p", return_value);
+}
+
+PHP_FUNCTION(gd_entry_list)
+{
+  char *parent;
+  int parent_len;
+  long type = 0, flags = 0;
+  DIRFILE *D;
+
+  const char **fl;
+  char *parentp;
+  dtracephp();
+
+  GDPHP_PARSED("|sll", &parent, &parent_len, &type, &flags);
+
+  parentp = gdphp_check_null_string(parent);
+
+  fl = gd_entry_list(D, parentp, type, flags);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_entry_type)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  gd_entype_t entype;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  entype = gd_entry_type(D, field_code);
+
+  if (entype == GD_NO_ENTRY)
+    GDPHP_RETURN_F;
+
+  dreturn("%i", entype);
+  RETURN_LONG(entype);
+}
+
+PHP_FUNCTION(gd_eof)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  long eof;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  eof = (long)gd_eof64(D, field_code);
+
+  if (eof < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", eof);
+  RETURN_LONG(eof);
+}
+
+PHP_FUNCTION(gd_error)
+{
+  long e;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  e = gd_error(D);
+
+  dreturn("%li", e);
+  RETURN_LONG(e);
+}
+
+PHP_FUNCTION(gd_error_string)
+{
+  char *s;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  s = gd_error_string(D, NULL, 0);
+
+  if (s) {
+    RETVAL_STRING(s, 1);
+    dreturn("\"%s\"", s);
+    free(s);
+  } else
+    GDPHP_RETURN_F;
+}
+
+PHP_FUNCTION(gd_field_list)
+{
+  DIRFILE *D;
+  const char **fl;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  fl = gd_field_list(D);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_field_list_by_type)
+{
+  DIRFILE *D;
+  const char **fl;
+  long type;
+
+  dtracephp();
+
+  GDPHP_PARSED("l", &type);
+
+  fl = gd_field_list_by_type(D, type);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_flags)
+{
+  long set = 0, reset = 0;
+  unsigned long flags;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|ll", &set, &reset);
+
+  flags = gd_flags(D, set, reset);
+
+  dreturn("0x%lX", flags);
+  RETURN_LONG(flags);
+}
+  
+PHP_FUNCTION(gd_flush)
+{
+  char *field_code = NULL;
+  int field_code_len;
+
+  char *field_codep;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|s", &field_code, &field_code_len);
+
+  field_codep = gdphp_check_null_string(field_code);
+
+  GDPHP_RETURN_BOOL(gd_flush(D, field_codep));
+}
+
+PHP_FUNCTION(gd_fragment_affixes)
+{
+  long index;
+
+  DIRFILE *D;
+  char *affixes[2] = {NULL, NULL};
+
+  dtracephp();
+
+  GDPHP_PARSED("l", &index);
+
+  if (gd_fragment_affixes(D, index, affixes + 0, affixes + 1))
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, (const char**)affixes, 2);
+  dreturn("{\"%s\", \"%s\"}", affixes[0], affixes[1]);
+  free(affixes[0]);
+  free(affixes[1]);
+}
+
+PHP_FUNCTION(gd_fragment_index)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  int i;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  i = gd_fragment_index(D, field_code);
+
+  if (i < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%i", i);
+  RETURN_LONG(i);
+}
+
+PHP_FUNCTION(gd_fragmentname)
+{
+  long i;
+  const char *s;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("l", &i);
+
+  s = gd_fragmentname(D, i);
+
+  dreturn("\"%s\"", s);
+  RETURN_STRING(s, 1);
+}
+
+PHP_FUNCTION(gd_frameoffset)
+{
+  long i = 0;
+  
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|l", &i);
+
+  i = gd_frameoffset64(D, i);
+
+  dreturn("%li", i);
+  RETURN_LONG(i);
+}
+
+PHP_FUNCTION(gd_framenum)
+{
+  char *field_code;
+  int field_code_len;
+  double value;
+  long start = 0, stop = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sd|ll", &field_code, &field_code_len, &value, &start, &stop);
+
+  value = gd_framenum_subset64(D, field_code, value, start, stop);
+
+  /* check for NAN */
+  if (value != value)
+    GDPHP_RETURN_F;
+
+  dreturn("%g", value);
+  RETURN_DOUBLE(value);
+}
+
+PHP_FUNCTION(gd_get_carray)
+{
+  long data_type;
+  char *field_code;
+  int field_code_len;
+  long start = 0;
+  zval *zlen = NULL, *zunpack = NULL;
+
+  long len;
+  void *data = NULL;
+  DIRFILE *D;
+  zend_bool unpack;
+  GDPHP_CONTEXTp(ctx,3);
+
+  dtracephp();
+
+  GDPHP_PARSED("sl|lzz", &field_code, &field_code_len, &data_type, &start,
+      &zlen, &zunpack);
+
+  len = gdphp_long_from_zval_null(zlen, -1);
+  unpack = gdphp_unpack(zunpack);
+
+  if (len == -1) {
+    len = gd_array_len(D, field_code) - start;
+    if (len == 0) /* error */
+      GDPHP_RETURN_F;
+  }
+
+  if (len == 0) { /* explicit request for no data */
+    dreturnvoid();
+    if (unpack) {
+      array_init(return_value);
+      return;
+    } else
+      RETURN_EMPTY_STRING();
+  }
+
+  gdphp_validate_type(data_type, &ctx);
+  data = emalloc(len * GD_SIZE(data_type));
+
+  if (gd_get_carray_slice(D, field_code, start, len, data_type, data)) {
+    efree(data);
+    GDPHP_RETURN_F;
+  }
+
+  gdphp_from_data(return_value, len, data_type, data, 0, unpack);
+  dreturn("%li", len);
+}
+
+PHP_FUNCTION(gd_get_constant)
+{
+  long data_type;
+  char *field_code;
+  int field_code_len;
+
+  char datum[16];
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sl", &field_code, &field_code_len, &data_type);
+
+  if (gd_get_constant(D, field_code, data_type, datum))
+    GDPHP_RETURN_F;
+
+  gdphp_from_datum(return_value, datum, data_type);
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_get_string)
+{
+  char *field_code;
+  int field_code_len;
+
+  char *s;
+  size_t len;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  /* get length */
+  len = gd_get_string(D, field_code, 0, NULL);
+
+  if (gd_error(D))
+    GDPHP_RETURN_F;
+  else if (len == 0) {
+    dreturn("%s", "");
+    RETURN_EMPTY_STRING();
+  }
+
+  /* allocate a buffer and get the string */
+  s = emalloc(len);
+
+  if (gd_get_string(D, field_code, len, s) != len)
+    GDPHP_RETURN_F;
+
+  dreturn("\"%s\"", s);
+  RETURN_STRINGL(s, len - 1, 0);
+}
+
+PHP_FUNCTION(gd_getdata)
+{
+  long first_frame, first_sample, num_frames, num_samples;
+  char *field_code;
+  int field_code_len;
+  size_t ns;
+  zval *zunpack = NULL;
+
+  long data_type = GD_UNKNOWN;
+  DIRFILE *D;
+  zend_bool unpack;
+  size_t n = 0;
+  GDPHP_CONTEXTp(ctx,6);
+  void *data;
+
+  dtracephp();
+
+  GDPHP_PARSED("sllll|lz", &field_code, &field_code_len, &first_frame,
+      &first_sample, &num_frames, &num_samples, &data_type, &zunpack);
+
+  unpack = gdphp_unpack(zunpack);
+
+  /* figure out how much data we have */
+  if (num_frames > 0) {
+    unsigned spf = gd_spf(D, field_code);
+    if (spf == 0)
+      GDPHP_RETURN_F;
+    ns = num_frames * spf + num_samples;
+  } else
+    ns = num_samples;
+
+  /* get the type, if needed */
+  if (data_type == GD_UNKNOWN)
+    data_type = gd_native_type(D, field_code);
+
+  /* allocate a buffer */
+  gdphp_validate_type(data_type, &ctx);
+  data = emalloc(ns * GD_SIZE(data_type));
+
+  n = gd_getdata(D, field_code, first_frame, first_sample, 0, ns, data_type,
+      data);
+
+  GDPHP_CHECK_ERROR(D);
+
+  gdphp_from_data(return_value, n, data_type, data, 0, unpack);
+
+  dreturn("%" PRNsize_t, n);
+}
+
+PHP_FUNCTION(gd_hidden)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  int hidden;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  hidden = gd_hidden(D, field_code);
+
+  if (hidden < 0) {
+    dreturnvoid();
+    RETURN_NULL();
+  }
+
+  GDPHP_RETURN_BOOL(!hidden);
+}
+
+PHP_FUNCTION(gd_hide)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  GDPHP_RETURN_BOOL(gd_hide(D, field_code));
+}
+
+PHP_FUNCTION(gd_include)
+{
+  char *path, *prefix = NULL, *suffix = NULL;
+  int path_len, prefix_len, suffix_len;
+  long i, parent, flags = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sl|lss", &path, &path_len, &parent, &flags, &prefix,
+      &prefix_len, &suffix, &suffix_len);
+
+  i = gd_include_affix(D, path, parent, prefix, suffix, flags);
+
+  if (i < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", i);
+  RETURN_LONG(i);
+}
+
+PHP_FUNCTION(gd_invalid_dirfile)
+{
+  gdphp_dirfile *r;
+
+  dtracephp();
+
+  if (zend_parse_parameters_none() != SUCCESS) {
+    GDPHP_RETURN_F;
+  }
+
+  /* create the resource */
+  r = emalloc(sizeof(gdphp_dirfile));
+  memset(r, 0, sizeof(gdphp_dirfile));
+
+  r->D = gd_invalid_dirfile();
+
+  ZEND_REGISTER_RESOURCE(return_value, r, le_gdphp_dirfile);
+  dreturn("%p", r);
+}
+
+PHP_FUNCTION(gd_linterp_tablename)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char *s;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  if ((s = gd_linterp_tablename(D, field_code)) == NULL)
+    GDPHP_RETURN_F;
+
+  dreturn("\"%s\"", s);
+  RETURN_STRING(s, 1);
+}
+
+PHP_FUNCTION(gd_madd)
+{
+  char *parent;
+  int parent_len;
+  zval *z;
+
+  gd_entry_t E;
+  DIRFILE *D;
+
+  GDPHP_CONTEXT(ctx);
+
+  dtracephp();
+
+  GDPHP_PARSED("as", &z, &parent, &parent_len);
+
+  ctx.p = 2;
+  gdphp_to_entry(&E, z, NULL, 1, &ctx);
+
+  /* no need to free entry strings */
+  GDPHP_RETURN_BOOL(gd_madd(D, &E, parent));
+}
+
+PHP_FUNCTION(gd_madd_alias)
+{
+  char *field_code, *target, *parent;
+  int field_code_len, target_len, parent_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sss", &parent, &parent_len, &field_code, &field_code_len,
+      &target, &target_len);
+
+  GDPHP_RETURN_BOOL(gd_madd_alias(D, parent, field_code, target));
+}
+
+PHP_FUNCTION(gd_madd_bit)
+{
+  char *field_code, *in_field, *parent;
+  int field_code_len, in_field_len, parent_len;
+  long bitnum, numbits = 1;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sssl|l", &parent, &parent_len, &field_code, &field_code_len,
+      &in_field, &in_field_len, &bitnum, &numbits);
+
+  GDPHP_RETURN_BOOL(gd_madd_bit(D, parent, field_code, in_field, bitnum,
+        numbits));
+}
+
+PHP_FUNCTION(gd_madd_carray)
+{
+  char *field_code, *parent;
+  int field_code_len, parent_len;
+  long data_type;
+  zval *zdata1, *zdata2 = NULL;
+  DIRFILE *D;
+
+  int r;
+  struct gdphp_din din;
+
+  dtracephp();
+
+  GDPHP_PARSED("sslz|z", &parent, &parent_len, &field_code, &field_code_len,
+      &data_type, &zdata1, &zdata2);
+
+  din = gdphp_convert_data(zdata1, zdata2, 4, 5);
+
+  r = gd_madd_carray(D, parent, field_code, data_type, din.ns, din.type,
+      din.data);
+
+  if (din.free_din)
+    efree(din.data);
+
+  GDPHP_RETURN_BOOL(r);
+}
+
+PHP_FUNCTION(gd_madd_const)
+{
+  char *field_code, *parent;
+  int field_code_len, parent_len;
+  long data_type;
+  zval *z;
+
+  DIRFILE *D;
+  char data[16];
+  GDPHP_CONTEXTp(ctx,3);
+
+  dtracephp();
+
+  GDPHP_PARSED("sslz", &parent, &parent_len, &field_code, &field_code_len,
+      &data_type, &z);
+
+  /* might as well convert to the storage type now */
+  gdphp_to_datum(data, data_type, z, 1, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_madd_const(D, parent, field_code, data_type, data_type,
+        data));
+}
+
+PHP_FUNCTION(gd_madd_divide)
+{
+  char *field_code, *in1, *in2, *parent;
+  int field_code_len, in1_len, in2_len, parent_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ssss", &parent, &parent_len, &field_code, &field_code_len, &in1,
+      &in1_len, &in2, &in2_len);
+
+  GDPHP_RETURN_BOOL(gd_madd_divide(D, parent, field_code, in1, in2));
+}
+
+PHP_FUNCTION(gd_madd_lincom)
+{
+  char *field_code, *parent;
+  int field_code_len, parent_len;
+  zval *zin, *zm, *zb;
+
+  char *in[GD_MAX_LINCOM];
+  double m[GD_MAX_LINCOM * 2];
+  double b[GD_MAX_LINCOM * 2];
+  int n;
+
+  DIRFILE *D;
+  GDPHP_CONTEXT(ctx);
+
+  dtracephp();
+
+  GDPHP_PARSED("ssaaa", &parent, &parent_len, &field_code, &field_code_len,
+      &zin, &zm, &zb);
+
+  /* these don't return on error */
+  ctx.p = 2;
+  n = gdphp_convert_nsarray((char**)in, zin, 1, GD_MAX_LINCOM, &ctx);
+  ctx.p = 3;
+  gdphp_convert_cmparray(m, zm, n, n, 0, &ctx);
+  ctx.p = 4;
+  gdphp_convert_cmparray(b, zb, n, n, 0, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_madd_clincom(D, parent, field_code, n, (const char**)in,
+        (GD_DCOMPLEXP_t)m, (GD_DCOMPLEXP_t)b));
+}
+
+PHP_FUNCTION(gd_madd_linterp)
+{
+  char *field_code, *in_field, *table, *parent;
+  int field_code_len, in_field_len, table_len, parent_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ssss", &parent, &parent_len, &field_code, &field_code_len,
+      &in_field, &in_field_len, &table, &table_len);
+
+  GDPHP_RETURN_BOOL(gd_madd_linterp(D, parent, field_code, in_field, table));
+}
+
+PHP_FUNCTION(gd_madd_mplex)
+{
+  char *field_code, *in1, *in2, *parent;
+  int field_code_len, in1_len, in2_len, parent_len;
+  long count, period = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ssssl|l", &parent, &parent_len, &field_code, &field_code_len,
+      &in1, &in1_len, &in2, &in2_len, &count, &period);
+
+  GDPHP_RETURN_BOOL(gd_madd_mplex(D, parent, field_code, in1, in2, count,
+        period));
+}
+
+PHP_FUNCTION(gd_madd_multiply)
+{
+  char *field_code, *in1, *in2, *parent;
+  int field_code_len, in1_len, in2_len, parent_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ssss", &parent, &parent_len, &field_code, &field_code_len, &in1,
+      &in1_len, &in2, &in2_len);
+
+  GDPHP_RETURN_BOOL(gd_madd_multiply(D, parent, field_code, in1, in2));
+}
+
+PHP_FUNCTION(gd_madd_phase)
+{
+  char *field_code, *in_field, *parent;
+  int field_code_len, in_field_len, parent_len;
+  long shift;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sssl", &parent, &parent_len, &field_code, &field_code_len,
+      &in_field, &in_field_len, &shift);
+
+  GDPHP_RETURN_BOOL(gd_madd_phase(D, parent, field_code, in_field, shift));
+}
+
+PHP_FUNCTION(gd_madd_polynom)
+{
+  char *field_code, *in_field, *parent;
+  int field_code_len, in_field_len, parent_len;
+  zval *za;
+
+  double a[2 * (GD_MAX_POLYORD + 1)];
+  int o;
+
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,3);
+
+  dtracephp();
+
+  GDPHP_PARSED("sssa", &parent, &parent_len, &field_code, &field_code_len,
+      &in_field, &in_field_len, &za);
+
+  /* doesn't return on error */
+  o = gdphp_convert_cmparray(a, za, 2, GD_MAX_POLYORD + 1, 0, &ctx) - 1;
+
+  GDPHP_RETURN_BOOL(gd_madd_cpolynom(D, parent, field_code, o, in_field,
+        (GD_DCOMPLEXP_t)a));
+}
+
+PHP_FUNCTION(gd_madd_recip)
+{
+  char *field_code, *in_field, *parent;
+  int field_code_len, in_field_len, parent_len;
+  zval *zdividend;
+
+  double dividend[2];
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,4);
+
+  dtracephp();
+
+  GDPHP_PARSED("sssz", &parent, &parent_len, &field_code, &field_code_len,
+      &in_field, &in_field_len, &zdividend);
+
+  gdphp_to_datum(dividend, GD_COMPLEX128, zdividend, 1, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_madd_crecip89(D, parent, field_code, in_field,
+        dividend));
+}
+
+PHP_FUNCTION(gd_madd_sbit)
+{
+  char *field_code, *in_field, *parent;
+  int field_code_len, in_field_len, parent_len;
+  long bitnum, numbits = 1;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sssll", &parent, &parent_len, &field_code, &field_code_len,
+      &in_field, &in_field_len, &bitnum, &numbits);
+
+  GDPHP_RETURN_BOOL(gd_madd_sbit(D, parent, field_code, in_field, bitnum,
+        numbits));
+}
+
+PHP_FUNCTION(gd_madd_spec)
+{
+  char *spec, *parent;
+  int spec_len, parent_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ss", &spec, &spec_len, &parent, &parent_len);
+
+  GDPHP_RETURN_BOOL(gd_madd_spec(D, spec, parent));
+}
+
+PHP_FUNCTION(gd_madd_string)
+{
+  char *field_code, *value, *parent;
+  int field_code_len, value_len, parent_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sss", &parent, &parent_len, &field_code, &field_code_len,
+      &value, &value_len);
+
+  GDPHP_RETURN_BOOL(gd_madd_string(D, parent, field_code, value));
+}
+
+PHP_FUNCTION(gd_madd_window)
+{
+  char *field_code, *in1, *in2, *parent;
+  int field_code_len, in1_len, in2_len, parent_len;
+  long windop;
+  zval *zthreshold;
+
+  gd_triplet_t threshold;
+  DIRFILE *D;
+  GDPHP_CONTEXTp(ctx,6);
+
+  dtracephp();
+
+  GDPHP_PARSED("sssslz", &parent, &parent_len, &field_code, &field_code_len,
+      &in1, &in1_len, &in2, &in2_len, &windop, &zthreshold);
+
+  gdphp_to_threshold(&threshold, windop, zthreshold, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_madd_window(D, parent, field_code, in1, in2, windop,
+        threshold));
+}
+
+PHP_FUNCTION(gd_malter_spec)
+{
+  char *spec, *parent;
+  int spec_len, parent_len;
+  zend_bool recode = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ss|b", &spec, &spec_len, &parent, &parent_len, &recode);
+
+  GDPHP_RETURN_BOOL(gd_malter_spec(D, spec, parent, recode));
+}
+
+PHP_FUNCTION(gd_mcarrays)
+{
+  char *parent;
+  int parent_len;
+  zval *zunpack = NULL;
+  long data_type;
+
+  DIRFILE *D;
+  int unpack, i;
+  const gd_carray_t *c;
+
+  dtracephp();
+
+  GDPHP_PARSED("sl|z", &parent, &parent_len, &data_type, &zunpack);
+
+  unpack = gdphp_unpack(zunpack);
+
+  c = gd_mcarrays(D, parent, data_type);
+
+  if (c == NULL)
+    GDPHP_RETURN_F;
+
+  /* convert */
+  array_init(return_value);
+
+  for (i = 0; c[i].n; ++i)
+    add_index_zval(return_value, i, gdphp_from_data(NULL, c[i].n, data_type,
+          c[i].d, 1, unpack));
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_mconstants)
+{
+  char *parent;
+  int parent_len;
+  long data_type;
+  zval *zunpack = NULL;
+
+  void *data;
+  unsigned n;
+  DIRFILE *D;
+  zend_bool unpack;
+  GDPHP_CONTEXTp(ctx,2);
+
+  dtracephp();
+
+  GDPHP_PARSED("sl|z", &parent, &parent_len, &data_type, &zunpack);
+
+  unpack = gdphp_unpack(zunpack);
+  gdphp_validate_type(data_type, &ctx);
+
+  data = (void*)gd_mconstants(D, parent, data_type);
+  
+  GDPHP_CHECK_ERROR(D);
+
+  n = gd_nmfields_by_type(D, parent, GD_CONST_ENTRY);
+
+  GDPHP_CHECK_ERROR(D);
+
+  gdphp_from_data(return_value, n, data_type, data, 1, unpack);
+  dreturn("%i", n);
+}
+
+PHP_FUNCTION(gd_metaflush)
+{
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  GDPHP_RETURN_BOOL(gd_metaflush(D));
+}
+
+PHP_FUNCTION(gd_mfield_list)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char **fl;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  fl = gd_mfield_list(D, field_code);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_mfield_list_by_type)
+{
+  long type;
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char **fl;
+
+  dtracephp();
+
+  GDPHP_PARSED("sl", &field_code, &field_code_len, &type);
+
+  fl = gd_mfield_list_by_type(D, field_code, type);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_move)
+{
+  char *field_code;
+  int field_code_len;
+  long new_fragment;
+  long flags = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sl|l", &field_code, &field_code_len, &new_fragment, &flags);
+
+  GDPHP_RETURN_BOOL(gd_move(D, field_code, new_fragment, flags));
+}
+
+PHP_FUNCTION(gd_mplex_lookback)
+{
+  long lookback;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("l", &lookback);
+
+  gd_mplex_lookback(D, lookback);
+
+  GDPHP_RETURN_T;
+}
+
+PHP_FUNCTION(gd_mstrings)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char **l;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  l = gd_mstrings(D, field_code);
+
+  if (l == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, l, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_mvector_list)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char **fl;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  fl = gd_mvector_list(D, field_code);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_naliases)
+{
+  char *field_code;
+  int field_code_len;
+
+  long n;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  n = gd_naliases(D, field_code);
+
+  if (n == 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_native_type)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  gd_type_t t;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  t = gd_native_type(D, field_code);
+
+  if (t == GD_UNKNOWN)
+    GDPHP_RETURN_F;
+
+  dreturn("%u", t);
+  RETURN_LONG(t);
+}
+
+PHP_FUNCTION(gd_nentries)
+{
+  char *parent;
+  int parent_len;
+  long n, type = 0, flags = 0;
+  DIRFILE *D;
+
+  char *parentp;
+  dtracephp();
+
+  GDPHP_PARSED("|sll", &parent, &parent_len, &type, &flags);
+
+  parentp = gdphp_check_null_string(parent);
+
+  n = gd_nentries(D, parentp, type, flags);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nfields)
+{
+  long n;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  n = gd_nfields(D);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nfields_by_type)
+{
+  long n, type;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("l", &type);
+
+  n = gd_nfields_by_type(D, type);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nfragments)
+{
+  long n;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  n = gd_nfragments(D);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nframes)
+{
+  long n;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  n = gd_nframes(D);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nmfields)
+{
+  char *field_code;
+  int field_code_len;
+
+  long n;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  n = gd_nmfields(D, field_code);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nmfields_by_type)
+{
+  char *field_code;
+  int field_code_len;
+
+  long n, type;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("sl", &field_code, &field_code_len, &type);
+
+  n = gd_nmfields_by_type(D, field_code, type);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nmvectors)
+{
+  char *field_code;
+  int field_code_len;
+
+  long n;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  n = gd_nmvectors(D, field_code);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_nvectors)
+{
+  long n;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  n = gd_nvectors(D);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%li", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_open)
+{
+  long flags = GD_RDONLY;
+  char *dirfilename;
+  int len;
+  gdphp_dirfile *r;
+  char *callback = NULL;
+  int callback_len = -1;
+  zval **callback_data = NULL;
+
+  dtracephp();
+
+  /* parse input */
+  GDPHP_PARSE("s|lsZ", &dirfilename, &len, &flags, &callback, &callback_len,
+      &callback_data);
+
+  r = gdphp_open(dirfilename, len, flags, callback, callback_len, callback_data,
+      0);
+
+  /* return */
+  ZEND_REGISTER_RESOURCE(return_value, r, le_gdphp_dirfile);
+  dreturn("%p", r);
+}
+
+PHP_FUNCTION(gd_parent_fragment)
+{
+  long i;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("l", &i);
+
+  i = gd_parent_fragment(D, i);
+
+  if (i < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%lx", i);
+  RETURN_LONG(i);
+}
+
+PHP_FUNCTION(gd_popen)
+{
+  long flags = GD_RDONLY;
+  char *dirfilename;
+  int len;
+  gdphp_dirfile *r;
+  zend_rsrc_list_entry *le, new_le;
+  char *callback = NULL;
+  int callback_len;
+  zval **callback_data = NULL;
+
+  dtracephp();
+
+  /* parse input */
+  GDPHP_PARSE("s|lsz", &dirfilename, &len, &flags, &callback, &callback_len,
+      &callback_data);
+
+  /* look for an existing dirfile */
+  if (zend_hash_find(&EG(persistent_list), dirfilename, len, (void**)&le)
+      == SUCCESS)
+  {
+    ZEND_REGISTER_RESOURCE(return_value, le->ptr, le_gdphp_dirfile_persist);
+    dreturn("%p", le->ptr);
+    return;
+  }
+
+  /* nope, open */
+  r = gdphp_open(dirfilename, len, flags, callback, callback_len, callback_data,
+      1);
+
+  /* register and store */
+  ZEND_REGISTER_RESOURCE(return_value, r, le_gdphp_dirfile_persist);
+  new_le.ptr = r;
+  new_le.type = le_gdphp_dirfile_persist;
+  zend_hash_add(&EG(persistent_list), dirfilename, len, &new_le,
+      sizeof(zend_rsrc_list_entry), NULL);
+
+  dreturn("%p", r);
+}
+
+PHP_FUNCTION(gd_protection)
+{
+  long i;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("l", &i);
+
+  i = gd_protection(D, i);
+
+  if (i == 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%lx", i);
+  RETURN_LONG(i);
+}
+
+PHP_FUNCTION(gd_put_carray)
+{
+  char *field_code;
+  int field_code_len;
+  zval *z1, *z2 = NULL, *z3 = NULL;
+
+  DIRFILE *D;
+  int r;
+  long start = 0;
+  struct gdphp_din din = { NULL, GD_NULL, 0, 0};
+
+  dtracephp();
+
+  GDPHP_PARSED("sz|zz", &field_code, &field_code_len, &z1, &z2, &z3);
+
+  /* allowed types for the last three parameters:
+   *
+   * 1: anything: just data
+   * 2: long, string: just data
+   * 3: long, other, [anything]: start and data
+   * 4: null, anything, [anything]: just data
+   * 5: other, anything, anything: forbidden
+   * 6: other, anything: just data
+   */
+  if (z2 == NULL)  /* 1 */
+    din = gdphp_convert_data(z1, NULL, 2, 3);
+  else if (Z_TYPE_P(z1) == IS_LONG) {
+    if (z2 && Z_TYPE_P(z2) == IS_STRING && z3 == NULL) { /* 2 */
+      din = gdphp_convert_data(z1, z2, 2, 3);
+    } else { /* 3 */
+      start = Z_LVAL_P(z1);
+      din = gdphp_convert_data(z2, z3, 3, 4);
+    }
+  } else if (Z_TYPE_P(z1) == IS_NULL) /* 4 */
+    din = gdphp_convert_data(z2, z3, 3, 4);
+  else if (z3) { /* 5 */
+    GDPHP_CONTEXTp(ctx, 2);
+    GDPHP_DIE(&ctx, "expected starting index or input data");
+  } else /* 6 */
+    din = gdphp_convert_data(z1, z2, 2, 3);
+
+  r = gd_put_carray_slice(D, field_code, start, din.ns, din.type, din.data);
+
+  if (din.free_din)
+    efree(din.data);
+
+  GDPHP_RETURN_BOOL(r);
+}
+
+PHP_FUNCTION(gd_put_constant)
+{
+  char *field_code;
+  int field_code_len;
+  zval *z;
+
+  DIRFILE *D;
+  char datum[16];
+  gd_type_t t;
+  GDPHP_CONTEXTp(ctx, 2);
+
+  dtracephp();
+
+  GDPHP_PARSED("sz", &field_code, &field_code_len, &z);
+
+  t = gdphp_to_datum_and_type(datum, z, &ctx);
+
+  GDPHP_RETURN_BOOL(gd_put_constant(D, field_code, t, datum));
+}
+
+PHP_FUNCTION(gd_put_string)
+{
+  char *field_code, *value;
+  int field_code_len, value_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ss", &field_code, &field_code_len, &value, &value_len);
+
+  gd_put_string(D, field_code, value);
+  GDPHP_RETURN_ERROR(D);
+}
+
+PHP_FUNCTION(gd_putdata)
+{
+  char *field_code;
+  int field_code_len;
+  long first_frame, first_sample;
+  zval *zdata1, *zdata2 = NULL;
+  DIRFILE *D;
+  size_t n;
+
+  struct gdphp_din din;
+
+  dtracephp();
+
+  GDPHP_PARSED("sllz|z", &field_code, &field_code_len, &first_frame,
+      &first_sample, &zdata1, &zdata2);
+
+  din = gdphp_convert_data(zdata1, zdata2, 4, 5);
+
+  n = gd_putdata(D, field_code, first_frame, first_sample, 0, din.ns, din.type,
+      din.data);
+
+  if (din.free_din)
+    efree(din.data);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("%zu", n);
+  RETURN_LONG(n);
+}
+
+PHP_FUNCTION(gd_raw_close)
+{
+  char *field_code = NULL;
+  int field_code_len;
+
+  char *field_codep;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|s", &field_code, &field_code_len);
+
+  field_codep = gdphp_check_null_string(field_code);
+
+  GDPHP_RETURN_BOOL(gd_raw_close(D, field_codep));
+}
+
+PHP_FUNCTION(gd_raw_filename)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char *s;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  if ((s = gd_raw_filename(D, field_code)) == NULL)
+    GDPHP_RETURN_F;
+
+  dreturn("\"%s\"", s);
+  RETURN_STRING(s, 1);
+}
+
+PHP_FUNCTION(gd_reference)
+{
+  const char *field_code = NULL;
+  int field_code_len;
+
+  DIRFILE *D;
+  const char *s;
+
+  dtracephp();
+
+  GDPHP_PARSED("|s", &field_code, &field_code_len);
+  s = gd_reference(D, field_code);
+
+  GDPHP_CHECK_ERROR(D);
+
+  dreturn("\"%s\"", s);
+  if (s == NULL)
+    RETURN_NULL();
+
+  RETURN_STRING(s, 1);
+}
+
+PHP_FUNCTION(gd_rename)
+{
+  const char *old_code, *new_name;
+  int old_code_len, new_name_len;
+  long flags = 0;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("ss|l", &old_code, &old_code_len, &new_name, &new_name_len,
+      &flags);
+
+  GDPHP_RETURN_BOOL(gd_rename(D, old_code, new_name, flags));
+}
+
+PHP_FUNCTION(gd_rewrite_fragment)
+{
+  zval *zi = NULL;
+
+  long i;
+
+  DIRFILE *D;
+
+  dtracephp();
+  
+  GDPHP_PARSED("|z", &zi);
+
+  i = gdphp_long_from_zval_null(zi, GD_ALL_FRAGMENTS);
+
+  GDPHP_RETURN_BOOL(gd_rewrite_fragment(D, i));
+}
+
+PHP_FUNCTION(gd_seek)
+{
+  char *field_code;
+  int field_code_len;
+  long frame_num, sample_num, flags = 0;
+
+  DIRFILE *D;
+  long pos;
+
+  dtracephp();
+
+  GDPHP_PARSED("sll|l", &field_code, &field_code_len, &frame_num, &sample_num,
+      &flags);
+
+  pos = gd_seek(D, field_code, frame_num, sample_num, flags);
+
+  if (pos < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", pos);
+  RETURN_LONG(pos);
+}
+
+PHP_FUNCTION(gd_spf)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  unsigned spf;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  spf = gd_spf(D, field_code);
+
+  if (spf == 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%u", spf);
+  RETURN_LONG(spf);
+}
+
+PHP_FUNCTION(gd_strings)
+{
+  DIRFILE *D;
+  const char **l;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  l = gd_strings(D);
+
+  if (l == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, l, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_strtok)
+{
+  char *s, *p;
+  int slen, i = 0;
+  
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &s, &slen);
+
+  array_init(return_value);
+
+  for (p = gd_strtok(D, s); p; p = gd_strtok(D, NULL)) {
+    add_index_string(return_value, i++, p, 1);
+    free(p);
+  }
+
+  GDPHP_CHECK_ERROR(D);
+  dreturn("%i", i);
+}
+
+PHP_FUNCTION(gd_sync)
+{
+  char *field_code = NULL;
+  int field_code_len;
+
+  char *field_codep;
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("|s", &field_code, &field_code_len);
+
+  field_codep = gdphp_check_null_string(field_code);
+
+  GDPHP_RETURN_BOOL(gd_sync(D, field_codep));
+}
+
+PHP_FUNCTION(gd_tell)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+  long pos;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  pos = gd_tell(D, field_code);
+
+  if (pos < 0)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", pos);
+  RETURN_LONG(pos);
+}
+
+PHP_FUNCTION(gd_unhide)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  GDPHP_RETURN_BOOL(gd_unhide(D, field_code));
+}
+
+PHP_FUNCTION(gd_uninclude)
+{
+  DIRFILE *D;
+  long i;
+  zend_bool del = 0;
+
+  dtracephp();
+
+  GDPHP_PARSED("l|b", &i, &del);
+
+  GDPHP_RETURN_BOOL(gd_uninclude(D, i, del));
+}
+
+PHP_FUNCTION(gd_validate)
+{
+  char *field_code;
+  int field_code_len;
+
+  DIRFILE *D;
+
+  dtracephp();
+
+  GDPHP_PARSED("s", &field_code, &field_code_len);
+
+  GDPHP_RETURN_BOOL(gd_validate(D, field_code));
+}
+
+PHP_FUNCTION(gd_vector_list)
+{
+  DIRFILE *D;
+  const char **fl;
+
+  dtracephp();
+
+  GDPHP_PARSED_ONLY();
+
+  fl = gd_vector_list(D);
+
+  if (fl == NULL)
+    GDPHP_RETURN_F;
+
+  gdphp_to_string_array(return_value, fl, 0);
+
+  dreturnvoid();
+}
+
+PHP_FUNCTION(gd_verbose_prefix)
+{
+  char *prefix = NULL;
+  int prefix_len;
+
+  char *prefixp;
+  DIRFILE *D;
+  
+  dtracephp();
+
+  GDPHP_PARSED("|s", &prefix, &prefix_len);
+
+  prefixp = gdphp_check_null_string(prefix);
+
+  GDPHP_RETURN_BOOL(gd_verbose_prefix(D, prefixp));
+}
+
+PHP_FUNCTION(gd_encoding_support)
+{
+  unsigned long e;
+  long r;
+
+  dtracephp();
+
+  GDPHP_PARSE("l", &e);
+
+  r = gd_encoding_support(e);
+
+  if (r == -1)
+    GDPHP_RETURN_F;
+
+  dreturn("%li", r);
+  RETURN_LONG(r);
+}
+
+
+/* MODULE DECLARATIONS */
+static const zend_function_entry getdata_functions[] = {
+  PHP_FE(gd_add, NULL)
+    PHP_FE(gd_add_alias, NULL)
+    PHP_FE(gd_add_bit, NULL)
+    PHP_FE(gd_add_carray, NULL)
+    PHP_FE(gd_add_const, NULL)
+    PHP_FE(gd_add_divide, NULL)
+    PHP_FE(gd_add_lincom, NULL)
+    PHP_FE(gd_add_linterp, NULL)
+    PHP_FE(gd_add_mplex, NULL)
+    PHP_FE(gd_add_multiply, NULL)
+    PHP_FE(gd_add_phase, NULL)
+    PHP_FE(gd_add_polynom, NULL)
+    PHP_FE(gd_add_raw, NULL)
+    PHP_FE(gd_add_recip, NULL)
+    PHP_FE(gd_add_sbit, NULL)
+    PHP_FE(gd_add_spec, NULL)
+    PHP_FE(gd_add_string, NULL)
+    PHP_FE(gd_add_window, NULL)
+    PHP_FE(gd_alias_target, NULL)
+    PHP_FE(gd_aliases, NULL)
+    PHP_FE(gd_alter_affixes, NULL)
+    PHP_FE(gd_alter_bit, NULL)
+    PHP_FE(gd_alter_carray, NULL)
+    PHP_FE(gd_alter_const, NULL)
+    PHP_FE(gd_alter_divide, NULL)
+    PHP_FE(gd_alter_encoding, NULL)
+    PHP_FE(gd_alter_endianness, NULL)
+    PHP_FE(gd_alter_entry, NULL)
+    PHP_FE(gd_alter_frameoffset, NULL)
+    PHP_FE(gd_alter_lincom, NULL)
+    PHP_FE(gd_alter_linterp, NULL)
+    PHP_FE(gd_alter_mplex, NULL)
+    PHP_FE(gd_alter_multiply, NULL)
+    PHP_FE(gd_alter_phase, NULL)
+    PHP_FE(gd_alter_polynom, NULL)
+    PHP_FE(gd_alter_protection, NULL)
+    PHP_FE(gd_alter_raw, NULL)
+    PHP_FE(gd_alter_recip, NULL)
+    PHP_FE(gd_alter_sbit, NULL)
+    PHP_FE(gd_alter_spec, NULL)
+    PHP_FE(gd_alter_window, NULL)
+    PHP_FE(gd_array_len, NULL)
+    PHP_FE(gd_bof, NULL)
+    PHP_FE(gd_carrays, NULL)
+    PHP_FE(gd_carray_len, NULL)
+    PHP_FE(gd_close, NULL)
+    PHP_FE(gd_constants, NULL)
+    PHP_FE(gd_delete, NULL)
+    PHP_FE(gd_desync, NULL)
+    PHP_FE(gd_dirfile_standards, NULL)
+    PHP_FE(gd_dirfilekey, NULL)
+    PHP_FE(gd_dirfilename, NULL)
+    PHP_FE(gd_discard, NULL)
+    PHP_FE(gd_encoding, NULL)
+    PHP_FE(gd_encoding_support, NULL)
+    PHP_FE(gd_endianness, NULL)
+    PHP_FE(gd_entry, NULL)
+    PHP_FE(gd_entry_list, NULL)
+    PHP_FE(gd_entry_type, NULL)
+    PHP_FE(gd_eof, NULL)
+    PHP_FE(gd_error, NULL)
+    PHP_FE(gd_error_string, NULL)
+    PHP_FE(gd_field_list, NULL)
+    PHP_FE(gd_field_list_by_type, NULL)
+    PHP_FE(gd_flags, NULL)
+    PHP_FE(gd_flush, NULL)
+    PHP_FE(gd_fragment_affixes, NULL)
+    PHP_FE(gd_fragment_index, NULL)
+    PHP_FE(gd_fragmentname, NULL)
+    PHP_FE(gd_framenum, NULL)
+    PHP_FE(gd_frameoffset, NULL)
+    PHP_FE(gd_get_carray, NULL)
+    PHP_FE(gd_get_constant, NULL)
+    PHP_FE(gd_get_string, NULL)
+    PHP_FE(gd_getdata, NULL)
+    PHP_FE(gd_hidden, NULL)
+    PHP_FE(gd_hide, NULL)
+    PHP_FE(gd_include, NULL)
+    PHP_FE(gd_invalid_dirfile, NULL)
+    PHP_FE(gd_linterp_tablename, NULL)
+    PHP_FE(gd_madd, NULL)
+    PHP_FE(gd_madd_alias, NULL)
+    PHP_FE(gd_madd_bit, NULL)
+    PHP_FE(gd_madd_carray, NULL)
+    PHP_FE(gd_madd_const, NULL)
+    PHP_FE(gd_madd_divide, NULL)
+    PHP_FE(gd_madd_lincom, NULL)
+    PHP_FE(gd_madd_linterp, NULL)
+    PHP_FE(gd_madd_mplex, NULL)
+    PHP_FE(gd_madd_multiply, NULL)
+    PHP_FE(gd_madd_phase, NULL)
+    PHP_FE(gd_madd_polynom, NULL)
+    PHP_FE(gd_madd_recip, NULL)
+    PHP_FE(gd_madd_sbit, NULL)
+    PHP_FE(gd_madd_spec, NULL)
+    PHP_FE(gd_madd_string, NULL)
+    PHP_FE(gd_madd_window, NULL)
+    PHP_FE(gd_malter_spec, NULL)
+    PHP_FE(gd_mcarrays, NULL)
+    PHP_FE(gd_mconstants, NULL)
+    PHP_FE(gd_metaflush, NULL)
+    PHP_FE(gd_mfield_list, NULL)
+    PHP_FE(gd_mfield_list_by_type, NULL)
+    PHP_FE(gd_move, NULL)
+    PHP_FE(gd_mplex_lookback, NULL)
+    PHP_FE(gd_mstrings, NULL)
+    PHP_FE(gd_mvector_list, NULL)
+    PHP_FE(gd_naliases, NULL)
+    PHP_FE(gd_native_type, NULL)
+    PHP_FE(gd_nentries, NULL)
+    PHP_FE(gd_nfields, NULL)
+    PHP_FE(gd_nfields_by_type, NULL)
+    PHP_FE(gd_nfragments, NULL)
+    PHP_FE(gd_nframes, NULL)
+    PHP_FE(gd_nmfields, NULL)
+    PHP_FE(gd_nmfields_by_type, NULL)
+    PHP_FE(gd_nmvectors, NULL)
+    PHP_FE(gd_nvectors, NULL)
+    PHP_FE(gd_open, NULL)
+    PHP_FE(gd_parent_fragment, NULL)
+    PHP_FE(gd_popen, NULL)
+    PHP_FE(gd_protection, NULL)
+    PHP_FE(gd_put_carray, NULL)
+    PHP_FE(gd_put_constant, NULL)
+    PHP_FE(gd_put_string, NULL)
+    PHP_FE(gd_putdata, NULL)
+    PHP_FE(gd_raw_close, NULL)
+    PHP_FE(gd_raw_filename, NULL)
+    PHP_FE(gd_reference, NULL)
+    PHP_FE(gd_rename, NULL)
+    PHP_FE(gd_rewrite_fragment, NULL)
+    PHP_FE(gd_seek, NULL)
+    PHP_FE(gd_spf, NULL)
+    PHP_FE(gd_strings, NULL)
+    PHP_FE(gd_strtok, NULL)
+    PHP_FE(gd_sync, NULL)
+    PHP_FE(gd_tell, NULL)
+    PHP_FE(gd_unhide, NULL)
+    PHP_FE(gd_uninclude, NULL)
+    PHP_FE(gd_validate, NULL)
+    PHP_FE(gd_vector_list, NULL)
+    PHP_FE(gd_verbose_prefix, NULL)
+    PHP_FE_END
+};
+
+zend_module_entry getdata_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+  STANDARD_MODULE_HEADER,
+#endif
+  "GetData",
+  getdata_functions,
+  PHP_MINIT(getdata),
+  PHP_MSHUTDOWN(getdata),
+  NULL,
+  NULL,
+  PHP_MINFO(getdata),
+#if ZEND_MODULE_API_NO >= 20010901
+  PACKAGE_VERSION,
+#endif
+  STANDARD_MODULE_PROPERTIES
+};
+
+ZEND_GET_MODULE(getdata);
diff --git a/bindings/php/php_getdata.h b/bindings/php/php_getdata.h
new file mode 100644
index 0000000..a442161
--- /dev/null
+++ b/bindings/php/php_getdata.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifndef PHP_GETDATA_H
+#define PHP_GETDATA_H
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+
+/* undefine cruft */
+#undef NDEBUG
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_URL
+#undef PACKAGE_VERSION
+#undef restrict
+#include "internal.h"
+
+extern zend_module_entry getdata_module_entry;
+#define phpext_getdata_ptr &getdata_module_entry
+
+#ifdef PHP_WIN32
+# define PHP_GETDATA_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_GETDATA_API __attribute__ ((visibility("default")))
+#else
+# define PHP_GETDATA_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+#ifndef PHP_FE_END
+#define PHP_FE_END ZEND_FE_END
+#endif
+
+#ifndef ZEND_FE_END
+#define ZEND_FE_END { NULL, NULL, NULL, 0, 0 }
+#endif
+
+void gdphp_register_constants(int module_number);
+
+#endif
diff --git a/bindings/php/test/Makefile.am b/bindings/php/test/Makefile.am
new file mode 100644
index 0000000..6161add
--- /dev/null
+++ b/bindings/php/test/Makefile.am
@@ -0,0 +1,50 @@
+# Copyright (C) 2013, 2014, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+
+if TEST_PHP
+TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} \
+	${PHP} -n -d "output_handler=" -d "open_basedir=" -d "safe_mode=0" \
+	-d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" \
+	-d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" \
+	-d "html_errors=0" -d "track_errors=1" -d "report_memleaks=1" \
+	-d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" \
+	-d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" \
+	-d "auto_append_file=" -d "magic_quotes_runtime=0" \
+	-d "ignore_repeated_errors=0" -d "precision=14" -d "memory_limit=128M" \
+	-d "extension_dir=@top_builddir@/bindings/php/.libs" \
+	-d "extension=getdata.so" -d "session.auto_start=0" -f
+phpTESTS=big_test.php
+TESTS=$(addprefix ${srcdir}/,$(phpTESTS))
+endif
+
+EXTRA_DIST=${phpTESTS}
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	echo rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~ 
diff --git a/bindings/php/test/Makefile.in b/bindings/php/test/Makefile.in
new file mode 100644
index 0000000..3a5acd2
--- /dev/null
+++ b/bindings/php/test/Makefile.in
@@ -0,0 +1,700 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bindings/php/test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
+DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
+DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
+DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
+DEFINE_gd_int64_t = @DEFINE_gd_int64_t@
+DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@
+DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIFF = @DIFF@
+DLLTOOL = @DLLTOOL@
+DL_LIBRARY_PATH = @DL_LIBRARY_PATH@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+F95GETDATA_VERSION = @F95GETDATA_VERSION@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FFLAGS = @FFLAGS@
+FGETDATA_VERSION = @FGETDATA_VERSION@
+FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
+FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
+GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
+GD_FDIRSEP = @GD_FDIRSEP@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_DEBUG = @GETDATA_DEBUG@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GETDATA_MAJOR = @GETDATA_MAJOR@
+GETDATA_MINOR = @GETDATA_MINOR@
+GETDATA_REVISION = @GETDATA_REVISION@
+GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+GZIP_LIBS = @GZIP_LIBS@
+IDL = @IDL@
+IDL_CFLAGS = @IDL_CFLAGS@
+IDL_LIBS = @IDL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JOT = @JOT@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBLTDL = @LIBLTDL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTDLINCL = @LTDLINCL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+LZMA_LIBS = @LZMA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATLAB = @MATLAB@
+MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@
+MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@
+MEX = @MEX@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+SLIM_LIBS = @SLIM_LIBS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@
+ZZIP_LDFLAGS = @ZZIP_LDFLAGS@
+ZZIP_LIBS = @ZZIP_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+absolute_docdir = @absolute_docdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+idldir = @idldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+matlabbasedir = @matlabbasedir@
+mexext = @mexext@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+path_bunzip2 = @path_bunzip2@
+path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
+path_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slimdata = @path_slimdata@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+phpdir = @phpdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2013, 2014, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+ at TEST_PHP_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} \
+ at TEST_PHP_TRUE@	${PHP} -n -d "output_handler=" -d "open_basedir=" -d "safe_mode=0" \
+ at TEST_PHP_TRUE@	-d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" \
+ at TEST_PHP_TRUE@	-d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" \
+ at TEST_PHP_TRUE@	-d "html_errors=0" -d "track_errors=1" -d "report_memleaks=1" \
+ at TEST_PHP_TRUE@	-d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" \
+ at TEST_PHP_TRUE@	-d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" \
+ at TEST_PHP_TRUE@	-d "auto_append_file=" -d "magic_quotes_runtime=0" \
+ at TEST_PHP_TRUE@	-d "ignore_repeated_errors=0" -d "precision=14" -d "memory_limit=128M" \
+ at TEST_PHP_TRUE@	-d "extension_dir=@top_builddir@/bindings/php/.libs" \
+ at TEST_PHP_TRUE@	-d "extension=getdata.so" -d "session.auto_start=0" -f
+
+ at TEST_PHP_TRUE@phpTESTS = big_test.php
+ at TEST_PHP_TRUE@TESTS = $(addprefix ${srcdir}/,$(phpTESTS))
+EXTRA_DIST = ${phpTESTS}
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/php/test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/php/test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am check-local clean \
+	clean-generic clean-libtool clean-local cscopelist-am ctags-am \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am
+
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	echo rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~ 
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/php/test/big_test.php b/bindings/php/test/big_test.php
new file mode 100644
index 0000000..66f10d0
--- /dev/null
+++ b/bindings/php/test/big_test.php
@@ -0,0 +1,1694 @@
+<?php
+# Copyright (C) 2013, 2014, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+$ne = 0;
+
+ini_set('getdata.unpack', false);
+ini_set('getdata.degrade_complex', true);
+
+# clean up 
+if (is_file('dirfile/data')) {
+  unlink('dirfile/data');
+}
+if (is_file('dirfile/new1')) {
+  unlink('dirfile/new1');
+}
+if (is_file('dirfile/new135')) {
+  unlink('dirfile/new135');
+}
+if (is_file('dirfile/format')) {
+  unlink('dirfile/format');
+}
+if (is_file('dirfile/format1')) {
+  unlink('dirfile/format1');
+}
+if (is_file('dirfile/form2')) {
+  unlink('dirfile/form2');
+}
+
+if (is_dir('dirfile')) {
+  rmdir('dirfile');
+}
+
+function check_var2($t, $n, $v, $g)
+{
+  global $ne;
+
+  if ($v !== $g) {
+    $ne = $ne + 1;
+    echo "v[" . $t . ", " . $n . "] = ";
+    var_dump($v);
+    echo "\nexpected: ";
+    var_dump($g);
+    echo "\n";
+  }
+}
+
+function check_var($t, $v, $g)
+{
+  global $ne;
+
+  if ($v !== $g) {
+    $ne = $ne + 1;
+    echo "v[" . $t . "] = ";
+    var_dump($v);
+    echo "\nexpected: ";
+    var_dump($g);
+    echo "\n";
+  }
+}
+
+function check_complex2($t, $n, $v, $r, $i)
+{
+  check_var2($t, $n, $v, array($r, $i));
+}
+
+function check_complex($t, $v, $r, $i)
+{
+  check_var($t, $v, array($r, $i));
+}
+
+function check_eostring($t, $v, $g)
+{
+  global $ne;
+
+  if (substr($v, strlen($v) - strlen($g)) == $v) {
+    $ne = $ne + 1;
+    echo "s[", $t, "] = ", $v, " (expected [...]", $g, ")\n";
+  }
+}
+
+function check_error2($t, $n, $D, $e)
+{
+  global $ne;
+
+  $v = gd_error($D);
+  if ($v != $e) {
+    $ne = $ne + 1;
+    echo "e[", $t, ", ", $n, "] = ", $v, " (expected ", $e, ")\n";
+  }
+}
+
+function check_error($t, $D, $e)
+{
+  global $ne;
+
+  $v = gd_error($D);
+  if ($v != $e) {
+    $ne = $ne + 1;
+    echo "e[", $t, "] = ", $v, " (expected ", $e, ")\n";
+  }
+}
+
+function check_ok2($t, $n, $D)
+{
+  check_error2($t, $n, $D, 0);
+}
+function check_ok($t, $D)
+{
+  check_error($t, $D, 0);
+}
+
+$nfields = 17;
+$fields = array('INDEX', 'alias', 'bit', 'carray', 'const', 'data', 'div',
+  'lincom', 'linterp', 'mplex', 'mult', 'phase', 'polynom', 'recip', 'sbit',
+  'string', 'window');
+
+# make the dirfile
+mkdir('dirfile', 0700);
+file_put_contents('dirfile/format',
+'/ENDIAN little
+data RAW INT8 8
+lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const
+/META data mstr STRING "This is a string constant."
+/META data mconst CONST COMPLEX128 3.3;4.4
+/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5
+/META data mlut LINTERP DATA ./lut
+const CONST FLOAT64 5.5
+carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6
+linterp LINTERP data ./lut
+polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const
+bit BIT data 3 4
+sbit SBIT data 5 6
+mplex MPLEX data sbit 1 10
+mult MULTIPLY data sbit
+div DIVIDE mult bit
+recip RECIP div 6.5;4.3
+phase PHASE data 11
+window WINDOW linterp mult LT 4.1
+ALIAS alias data
+string STRING "Zaphod Beeblebrox"
+');
+file_put_contents('dirfile/form2', "const2 CONST INT8 -19\n");
+
+$data_data='';
+for ($i = 0; $i < 80; ++$i) {
+  $data_data .= chr($i + 1);
+}
+$handle = fopen('dirfile/data', 'wb');
+fwrite($handle, $data_data, 80);
+fclose($handle);
+
+# 1: gd_error
+$D = gd_open('');
+check_error(1, $D, GD_E_IO);
+
+# 2: gd_open
+$D = gd_open("dirfile\0extra", GD_RDWR);
+check_ok(2, $D);
+
+# 3: getdata
+$v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT8);
+check_ok(3, $D);
+check_var(3, $v, chr(41) . chr(42) . chr(43) . chr(44) . chr(45) . chr(46) .
+  chr(47) . chr(48));
+
+# 4: getdata (unpacked)
+$v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT16, TRUE);
+check_ok(4, $D);
+check_var(4, $v, range(41, 48));
+
+# 10: getdata (complex unpacked)
+$v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_COMPLEX128, TRUE);
+check_ok(10, $D);
+check_var(10, $v, array(41., 42., 43., 44., 45., 46., 47., 48.));
+
+# 12: gd_get_constant (INT8)
+$v = gd_get_constant($D, 'const', GD_UINT8);
+check_ok(12, $D);
+check_var(12, $v, 5);
+
+# 19: gd_get_constant (COMPLEX128)
+$v = gd_get_constant($D, 'const', GD_COMPLEX128);
+check_ok(19, $D);
+check_var(19, $v, 5.5);
+
+# 23: nfields
+$v = gd_nfields($D);
+check_ok(23, $D);
+check_var(23, $v, $nfields);
+
+# 25: field_list
+$v = gd_field_list($D);
+check_ok(25, $D);
+check_var(25, $v, $fields);
+
+# 26: nmfields
+$v = gd_nmfields($D, 'data');
+check_ok(26, $D);
+check_var(26, $v, 4);
+
+# 27: mfield_list
+$v = gd_mfield_list($D, 'data');
+check_ok(27, $D);
+check_var(27, $v, array('mstr', 'mconst', 'mcarray', 'mlut'));
+
+# 28: nframes
+$v = gd_nframes($D);
+check_ok(28, $D);
+check_var(28, $v, 10);
+
+# 29: spf
+$v = gd_spf($D, 'data');
+check_ok(29, $D);
+check_var(29, $v, 8);
+
+# 30: putdata (packed)
+$v = gd_putdata($D, 'data', 5, 1, GD_UINT8, "\x13\x14\x15\x16");
+check_ok2(30, 1, $D);
+check_var2(30, 2, $v, 4);
+
+$v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT8);
+check_ok2(30, 3, $D);
+check_var2(30, 4, $v, chr(41) . chr(0x13) . chr(0x14) . chr(0x15) . chr(0x16)
+  . chr(46) . chr(47) . chr(48));
+
+# 33: putdata (type array)
+$v = gd_putdata($D, 'data', 5, 1, GD_INT64, array(23, 24, 25, array(26, 0)));
+check_ok2(33, 1, $D);
+check_var2(33, 2, $v, 4);
+
+$v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT8, TRUE);
+check_ok2(33, 3, $D);
+check_var2(33, 4, $v, array(41, 23, 24, 25, 26, 46, 47, 48));
+
+# 35: putdata (untyped array)
+$v = gd_putdata($D, 'data', 5, 1, array(2 => 35., 0 => 33, 3 => array(36, 0),
+  4 => array(37, 0)));
+check_ok2(35, 1, $D);
+check_var2(35, 2, $v, 5);
+
+$v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT8, TRUE);
+check_ok2(35, 3, $D);
+check_var2(35, 4, $v, array(41, 33, 0, 35, 36, 37, 47, 48));
+
+# 37: putdata (complex)
+$v = gd_putdata($D, 'data', 5, 1, GD_COMPLEX128, array(53, 54., array(55., 0),
+  array(56, 0)));
+check_ok2(37, 1, $D);
+check_var2(37, 2, $v, 4);
+
+$v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT8, TRUE);
+check_ok2(37, 3, $D);
+check_var2(37, 4, $v, array(41, 53, 54, 55, 56, 37, 47, 48));
+
+# 38: error_string
+gd_getdata($D, 'x', 5, 0, 1, 0, GD_UINT8);
+check_error(38, $D, GD_E_BAD_CODE);
+check_var(38, gd_error_string($D), 'Field not found: x');
+
+# 39: entry_type
+$v = gd_entry_type($D, 'data');
+check_ok(39, $D);
+check_var(39, $v, GD_RAW_ENTRY);
+
+# 40: raw entry
+$v = gd_entry($D, 'data');
+check_ok(40, $D);
+check_var(40, $v, array('field' => 'data', 'field_type' => GD_RAW_ENTRY,
+  'fragment_index' => 0, 'spf' => 8, 'data_type' => GD_INT8,
+  'scalar' => array()));
+
+# 42: lincom entry
+$v = gd_entry($D, 'lincom');
+check_ok(42, $D);
+check_var(42, $v, array('field' => 'lincom', 'field_type' => GD_LINCOM_ENTRY,
+  'fragment_index' => 0, 'n_fields' => 3, 'in_fields' => array('data', 'INDEX',
+  'linterp'), 'm' => array(1.1, 2.2, 5.5), 'b' => array(2.2, array(3.3, 4.4),
+  5.5), 'scalar' => array(2 => array('const', -1), 5 => array('const', -1))));
+
+# 44: polynom entry
+$v = gd_entry($D, 'polynom');
+check_ok(44, $D);
+check_var(44, $v, array('field' => 'polynom',
+  'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('data'), 'poly_ord' => 5, 'a' => array(1.1, 2.2, 2.2,
+  array(3.3, 4.4), 5.5, 5.5), 'scalar' => array(4 => array('const', -1),
+  5 => array('const', -1))));
+
+# 45: linterp entry
+$v = gd_entry($D, 'linterp');
+check_ok(45, $D);
+check_var(45, $v, array('field' => 'linterp',
+  'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('data'), 'table' => './lut'));
+
+# 46: bit entry
+$v = gd_entry($D, 'bit');
+check_ok(46, $D);
+check_var(46, $v, array('field' => 'bit', 'field_type' => GD_BIT_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('data'), 'bitnum' => 3,
+  'numbits' => 4, 'scalar' => array()));
+
+# 47: sbit entry
+$v = gd_entry($D, 'sbit');
+check_ok(47, $D);
+check_var(47, $v, array('field' => 'sbit', 'field_type' => GD_SBIT_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('data'), 'bitnum' => 5,
+  'numbits' => 6, 'scalar' => array()));
+
+# 48: multiply entry
+$v = gd_entry($D, 'mult');
+check_ok(48, $D);
+check_var(48, $v, array('field' => 'mult', 'field_type' => GD_MULTIPLY_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('data', 'sbit')));
+
+# 49: phase entry
+$v = gd_entry($D, 'phase');
+check_ok(49, $D);
+check_var(49, $v, array('field' => 'phase', 'field_type' => GD_PHASE_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('data'), 'shift' => 11,
+  'scalar' => array()));
+
+# 50: const entry
+$v = gd_entry($D, 'const');
+check_ok(50, $D);
+check_var(50, $v, array('field' => 'const', 'field_type' => GD_CONST_ENTRY,
+  'fragment_index' => 0, 'const_type' => GD_FLOAT64));
+
+# 51: string entry
+$v = gd_entry($D, 'string');
+check_ok(51, $D);
+check_var(51, $v, array('field' => 'string', 'field_type' => GD_STRING_ENTRY,
+  'fragment_index' => 0));
+
+# 52: fragment_index
+$v = gd_fragment_index($D, 'data');
+check_ok(52, $D);
+check_var(52, $v, 0);
+
+# 53: add raw
+$v = gd_add_raw($D, 'new1', GD_FLOAT64, 3);
+check_ok2(53, 0, $D);
+check_var2(53, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new1');
+check_ok2(53, 2, $D);
+check_var2(53, 3, $v, array('field' => 'new1', 'field_type' => GD_RAW_ENTRY,
+  'fragment_index' => 0, 'spf' => 3, 'data_type' => GD_FLOAT64,
+  'scalar' => array()));
+
+# 55: add lincom
+$v = gd_add_lincom($D, 'new3', array('in1', 'in2'), array(array(1.1, 1.2),
+  array(1.4, 1.5)), array(array(1.3, 1.4), 1.6));
+check_ok2(55, 0, $D);
+check_var2(55, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new3');
+check_ok2(55, 2, $D);
+check_var2(55, 3, $v, array('field' => 'new3', 'field_type' => GD_LINCOM_ENTRY,
+  'fragment_index' => 0, 'n_fields' => 2, 'in_fields' => array('in1', 'in2'),
+  'm' => array(array(1.1, 1.2), array(1.4, 1.5)), 'b' => array(array(1.3, 1.4),
+  1.6), 'scalar' => array()));
+
+# 56: add polynom
+$v = gd_add_polynom($D, 'new4', 'in2', array(3.9, 4.8, 5.7, 6.6));
+check_ok2(56, 0, $D);
+check_var2(56, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new4');
+check_ok2(56, 2, $D);
+check_var2(56, 3, $v, array('field' => 'new4', 'field_type' => GD_POLYNOM_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in2'), 'poly_ord' => 3,
+  'a' => array(3.9, 4.8, 5.7, 6.6), 'scalar' => array()));
+
+# 58: add linterp
+$v = gd_add_linterp($D, 'new6', 'in', './some/table');
+check_ok2(58, 0, $D);
+check_var2(58, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new6');
+check_ok2(58, 2, $D);
+check_var2(58, 3, $v, array('field' => 'new6', 'field_type' => GD_LINTERP_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in'),
+  'table' => './some/table'));
+
+# 59: add bit
+$v = gd_add_bit($D, 'new7', 'in1', 11, 22);
+check_ok2(59, 0, $D);
+check_var2(59, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new7');
+check_ok2(59, 2, $D);
+check_var2(59, 3, $v, array('field' => 'new7', 'field_type' => GD_BIT_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in1'), 'bitnum' => 11,
+  'numbits' => 22, 'scalar' => array()));
+
+# 60: add sbit
+$v = gd_add_sbit($D, 'new8', 'in2', 5, 10);
+check_ok2(60, 0, $D);
+check_var2(60, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new8');
+check_ok2(60, 2, $D);
+check_var2(60, 3, $v, array('field' => 'new8', 'field_type' => GD_SBIT_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in2'), 'bitnum' => 5,
+  'numbits' => 10, 'scalar' => array()));
+
+# 61: add multiply
+$v = gd_add_multiply($D, 'new9', 'in2', 'in3');
+check_ok2(61, 0, $D);
+check_var2(61, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new9');
+check_ok2(61, 2, $D);
+check_var2(61, 3, $v, array('field' => 'new9',
+  'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2', 'in3')));
+
+# 62: add phase
+$v = gd_add_phase($D, 'new10', 'in6', 62);
+check_ok2(62, 0, $D);
+check_var2(62, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new10');
+check_ok2(62, 2, $D);
+check_var2(62, 3, $v, array('field' => 'new10', 'field_type' => GD_PHASE_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in6'), 'shift' => 62,
+  'scalar' => array()));
+
+# 63: add const
+$v = gd_add_const($D, 'new11', GD_FLOAT64, 33.3);
+check_ok2(63, 0, $D);
+check_var2(63, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new11');
+check_ok2(63, 2, $D);
+check_var2(63, 3, $v, array('field' => 'new11', 'field_type' => GD_CONST_ENTRY,
+  'fragment_index' => 0, 'const_type' => GD_FLOAT64));
+
+$v = gd_get_constant($D, 'new11', GD_FLOAT64);
+check_ok2(63, 4, $D);
+check_var2(63, 5, $v, 33.3);
+
+# 64: fragmentname
+$v = gd_fragmentname($D, 0);
+check_ok(64, $D);
+check_eostring(64, $v, "dirfile/format");
+
+# 65: nfragments
+$v = gd_nfragments($D);
+check_ok(65, $D);
+check_var(65, $v, 1);
+
+# 66: gd_include
+$v = gd_include($D, 'form2', 0);
+check_ok2(66, 0, $D);
+check_var2(66, 1, $v, 1);
+
+$v = gd_get_constant($D, 'const2', GD_INT);
+check_ok2(66, 2, $D);
+check_var2(66, 3, $v, -19);
+
+# 67: nfields by type
+$v = gd_nfields_by_type($D, GD_LINCOM_ENTRY);
+check_ok(67, $D);
+check_var(67, $v, 2);
+
+# 68: field list by type
+$v = gd_field_list_by_type($D, GD_LINCOM_ENTRY);
+check_ok(68, $D);
+check_var(68, $v, array('lincom', 'new3'));
+
+# 69: nfields by type
+$v = gd_nvectors($D);
+check_ok(69, $D);
+check_var(69, $v, 22);
+
+# 70: field list by type
+$v = gd_vector_list($D);
+check_ok(70, $D);
+check_var(70, $v, array('INDEX', 'alias', 'bit', 'data', 'div', 'lincom',
+  'linterp', 'mplex', 'mult', 'new1', 'new10', 'new3', 'new4', 'new6', 'new7',
+  'new8', 'new9', 'phase', 'polynom', 'recip', 'sbit', 'window'));
+
+# 72: madd lincom
+$v = gd_madd_lincom($D, 'data', 'mnew3', array('in1', 'in2'),
+  array(array(1.1, 1.2), array(1.4, 1.5)), array(array(1.3, 1.4), 1.6));
+check_ok2(72, 0, $D);
+check_var2(72, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew3');
+check_ok2(72, 2, $D);
+check_var2(72, 3, $v, array('field' => 'data/mnew3',
+  'field_type' => GD_LINCOM_ENTRY,
+  'fragment_index' => 0, 'n_fields' => 2, 'in_fields' => array('in1', 'in2'),
+  'm' => array(array(1.1, 1.2), array(1.4, 1.5)), 'b' => array(array(1.3, 1.4),
+  1.6), 'scalar' => array()));
+
+# 73: madd polynom
+$v = gd_madd_polynom($D, 'data', 'mnew4', 'in2', array(3.9, 4.8, 5.7, 6.6));
+check_ok2(73, 0, $D);
+check_var2(73, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew4');
+check_ok2(73, 2, $D);
+check_var2(73, 3, $v, array('field' => 'data/mnew4',
+  'field_type' => GD_POLYNOM_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in2'), 'poly_ord' => 3,
+  'a' => array(3.9, 4.8, 5.7, 6.6), 'scalar' => array()));
+
+# 75: madd linterp
+$v = gd_madd_linterp($D, 'data', 'mnew6', 'in', './some/table');
+check_ok2(75, 0, $D);
+check_var2(75, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew6');
+check_ok2(75, 2, $D);
+check_var2(75, 3, $v, array('field' => 'data/mnew6',
+  'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in'), 'table' => './some/table'));
+
+# 76: madd bit
+$v = gd_madd_bit($D, 'data', 'mnew7', 'in1', 11, 22);
+check_ok2(76, 0, $D);
+check_var2(76, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew7');
+check_ok2(76, 2, $D);
+check_var2(76, 3, $v, array('field' => 'data/mnew7',
+  'field_type' => GD_BIT_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1'), 'bitnum' => 11, 'numbits' => 22,
+  'scalar' => array()));
+
+# 77: madd sbit
+$v = gd_madd_sbit($D, 'data', 'mnew8', 'in2', 5, 10);
+check_ok2(77, 0, $D);
+check_var2(77, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew8');
+check_ok2(77, 2, $D);
+check_var2(77, 3, $v, array('field' => 'data/mnew8',
+  'field_type' => GD_SBIT_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2'), 'bitnum' => 5, 'numbits' => 10,
+  'scalar' => array()));
+
+# 78: madd multiply
+$v = gd_madd_multiply($D, 'data', 'mnew9', 'in2', 'in3');
+check_ok2(78, 0, $D);
+check_var2(78, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew9');
+check_ok2(78, 2, $D);
+check_var2(78, 3, $v, array('field' => 'data/mnew9',
+  'field_type' => GD_MULTIPLY_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in2', 'in3')));
+
+# 79: madd phase
+$v = gd_madd_phase($D, 'data', 'mnew10', 'in6', 79);
+check_ok2(79, 1, $D);
+check_var2(79, 2, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew10');
+check_ok2(79, 3, $D);
+check_var2(79, 4, $v, array('field' => 'data/mnew10',
+  'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in6'), 'shift' => 79, 'scalar' => array()));
+
+# 80: madd const
+$v = gd_madd_const($D, 'data', 'mnew11', GD_FLOAT64, 33.3);
+check_ok2(80, 0, $D);
+check_var2(80, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew11');
+check_ok2(80, 2, $D);
+check_var2(80, 3, $v, array('field' => 'data/mnew11',
+  'field_type' => GD_CONST_ENTRY,
+  'fragment_index' => 0, 'const_type' => GD_FLOAT64));
+
+$v = gd_get_constant($D, 'data/mnew11', GD_FLOAT64);
+check_ok2(80, 4, $D);
+check_var2(80, 5, $v, 33.3);
+
+# 81: get_string
+$v = gd_get_string($D, 'string');
+check_ok(81, $D);
+check_var(81, $v, 'Zaphod Beeblebrox');
+
+# 82: add string
+$v = gd_add_string($D, 'new12', 'a string');
+check_ok2(82, 0, $D);
+check_var2(82, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new12');
+check_ok2(82, 2, $D);
+check_var2(82, 3, $v, array('field' => 'new12', 'field_type' => GD_STRING_ENTRY,
+  'fragment_index' => 0));
+
+$v = gd_get_string($D, 'new12');
+check_ok2(82, 4, $D);
+check_var2(82, 5, $v, 'a string');
+
+# 83: add string
+$v = gd_madd_string($D, 'data', 'mnew12', 'another string');
+check_ok2(83, 0, $D);
+check_var2(83, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew12');
+check_ok2(83, 2, $D);
+check_var2(83, 3, $v, array('field' => 'data/mnew12',
+  'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0));
+
+$v = gd_get_string($D, 'data/mnew12');
+check_ok2(83, 4, $D);
+check_var2(83, 5, $v, 'another string');
+
+# 84: add spec
+$v = gd_add_spec($D, 'lorem STRING "Lorem ipsum"', 0);
+check_ok2(84, 0, $D);
+check_var2(84, 1, $v, TRUE);
+
+$v = gd_entry($D, 'lorem');
+check_ok2(84, 2, $D);
+check_var2(84, 3, $v, array('field' => 'lorem', 'field_type' => GD_STRING_ENTRY,
+  'fragment_index' => 0));
+
+$v = gd_get_string($D, 'lorem');
+check_ok2(84, 4, $D);
+check_var2(84, 5, $v, 'Lorem ipsum');
+
+# 85: madd spec
+$v = gd_madd_spec($D, 'ipsum STRING "dolor sit amet."', 'lorem');
+check_ok2(85, 0, $D);
+check_var2(85, 1, $v, TRUE);
+
+$v = gd_entry($D, 'lorem/ipsum');
+check_ok2(85, 2, $D);
+check_var2(85, 3, $v, array('field' => 'lorem/ipsum',
+  'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0));
+
+$v = gd_get_string($D, 'lorem/ipsum');
+check_ok2(85, 4, $D);
+check_var2(85, 5, $v, 'dolor sit amet.');
+
+# 86: put_constant (int)
+$v = gd_put_constant($D, 'const', 86);
+check_ok2(86, 0, $D);
+check_var2(86, 1, $v, TRUE);
+
+$v = gd_get_constant($D, 'const', GD_INT);
+check_ok2(86, 2, $D);
+
+# 91: put_constant (float)
+$v = gd_put_constant($D, 'const', 13.1);
+check_ok2(91, 0, $D);
+check_var2(91, 1, $v, TRUE);
+
+$v = gd_get_constant($D, 'const', GD_FLOAT);
+check_ok2(91, 2, $D);
+check_var2(91, 3, $v, 13.1);
+
+# 93: put_constant (complex)
+$v = gd_put_constant($D, 'const', array(93., 13.4));
+check_ok2(93, 0, $D);
+check_var2(93, 1, $v, TRUE);
+
+$v = gd_get_constant($D, 'const', GD_COMPLEX128);
+check_ok2(93, 2, $D);
+check_var2(93, 3, $v, 93.);
+
+# 94: put string
+$v = gd_put_string($D, 'string', 'Arthur Dent');
+check_ok2(94, 0, $D);
+check_var2(94, 1, $v, TRUE);
+
+$v = gd_get_string($D, 'string');
+check_ok2(94, 2, $D);
+check_var2(94, 3, $v, 'Arthur Dent');
+
+# 95: nmfields by type
+$v = gd_nmfields_by_type($D, 'data', GD_LINCOM_ENTRY);
+check_ok(95, $D);
+check_var(95, $v, 1);
+
+# 96: mfield list by type
+$v = gd_mfield_list_by_type($D, 'data', GD_LINCOM_ENTRY);
+check_ok(96, $D);
+check_var(96, $v, array('mnew3'));
+
+# 97: nmvectors
+$v = gd_nmvectors($D, 'data');
+check_ok(97, $D);
+check_var(97, $v, 8);
+
+# 98: mvector list
+$v = gd_mvector_list($D, 'data');
+check_ok(98, $D);
+check_var(98, $v, array('mlut', 'mnew3', 'mnew4', 'mnew6', 'mnew7', 'mnew8',
+  'mnew9', 'mnew10'));
+
+# 99: alter raw
+$v = gd_alter_raw($D, 'new1', GD_INT32, null);
+check_ok2(99, 0, $D);
+check_var2(99, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new1');
+check_ok2(99, 2, $D);
+check_var2(99, 3, $v, array('field' => 'new1', 'field_type' => GD_RAW_ENTRY,
+  'fragment_index' => 0, 'spf' => 3, 'data_type' => GD_INT32,
+  'scalar' => array()));
+
+# 101: alter lincom
+$v = gd_alter_lincom($D, 'new3', null, array('in3', 'in4'), array(3.,
+  array(4., 5.)));
+check_ok2(101, 0, $D);
+check_var2(101, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new3');
+check_ok2(101, 1, $D);
+check_var2(101, 2, $v, array('field' => 'new3',
+  'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 2,
+  'in_fields' => array('in3', 'in4'), 'm' => array(3., array(4., 5.)),
+  'b' => array(array(1.3, 1.4), 1.6), 'scalar' => array()));
+
+# 103: alter polynom
+$v = gd_alter_polynom($D, 'new4', 4, null, array(array(0, 1.), array(0, 2.),
+  array(0, 3.), array(0, 4.), array(0, 5.)));
+check_ok2(103, 0, $D);
+check_var2(103, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new4');
+check_ok2(103, 2, $D);
+check_var2(103, 3, $v, array('field' => 'new4',
+  'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2'), 'poly_ord' => 4, 'a' => array(array(0., 1.),
+  array(0., 2.), array(0., 3.), array(0., 4.), array(0., 5.)),
+  'scalar' => array()));
+
+# 104: alter linterp
+$v = gd_alter_linterp($D, 'new6', null, './other/table');
+check_ok2(104, 0, $D);
+check_var2(104, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new6');
+check_ok2(104, 2, $D);
+check_var2(104, 3, $v, array('field' => 'new6',
+  'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in'), 'table' => './other/table'));
+
+# 105: alter_bit
+$v = gd_alter_bit($D, 'new7', 'in3', null, 8);
+check_ok2(105, 0, $D);
+check_var2(105, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new7');
+check_ok2(105, 2, $D);
+check_var2(105, 3, $v, array('field' => 'new7', 'field_type' => GD_BIT_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in3'), 'bitnum' => 11,
+  'numbits' => 8, 'scalar' => array()));
+
+# 106: alter_bit
+$v = gd_alter_sbit($D, 'new8', 'in1', 7);
+check_ok2(106, 0, $D);
+check_var2(106, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new8');
+check_ok2(106, 2, $D);
+check_var2(106, 3, $v, array('field' => 'new8', 'field_type' => GD_SBIT_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in1'), 'bitnum' => 7,
+  'numbits' => 10, 'scalar' => array()));
+
+# 107: alter_multiply
+$v = gd_alter_multiply($D, 'new9', 'in1');
+check_ok2(107, 0, $D);
+check_var2(107, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new9');
+check_ok2(107, 2, $D);
+check_var2(107, 3, $v, array('field' => 'new9',
+  'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1', 'in3')));
+
+# 108: alter_phase
+$v = gd_alter_phase($D, 'new10', 'in5');
+check_ok2(108, 0, $D);
+check_var2(108, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new10');
+check_ok2(108, 2, $D);
+check_var2(108, 3, $v, array('field' => 'new10', 'field_type' => GD_PHASE_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in5'), 'shift' => 62,
+  'scalar' => array()));
+
+# 109: alter_const
+$v = gd_alter_const($D, 'new11', GD_FLOAT32);
+check_ok2(109, 0, $D);
+check_var2(109, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new11');
+check_ok2(109, 2, $D);
+check_var2(109, 3, $v, array('field' => 'new11', 'field_type' => GD_CONST_ENTRY,
+  'fragment_index' => 0, 'const_type' => GD_FLOAT32));
+
+# 110: encoding
+$v = gd_encoding($D, 0);
+check_ok(110, $D);
+check_var(110, $v, GD_UNENCODED);
+
+# 111: endianness
+$v = gd_endianness($D, 0);
+check_ok(111, $D);
+check_var(111, $v, GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
+
+# 112: dirfilename
+$v = gd_dirfilename($D);
+check_ok(112, $D);
+check_eostring(112, $v, "dirfile");
+
+# 113: parent fragment
+$v = gd_parent_fragment($D, 1);
+check_ok(113, $D);
+check_var(113, $v, 0);
+
+# 114: alter protection
+$v = gd_alter_protection($D, GD_PROTECT_DATA, 1);
+check_ok(114, $D);
+check_var(114, $v, TRUE);
+
+# 115: protection
+$v = gd_protection($D, 1);
+check_ok(115, $D);
+check_var(115, $v, GD_PROTECT_DATA);
+
+# 116: raw filename
+$v = gd_raw_filename($D, 'data');
+check_ok(116, $D);
+check_eostring(116, $v, 'dirfile/data');
+
+# 117: reference
+$v = gd_reference($D, 'new1');
+check_ok(117, $D);
+check_var(117, $v, 'new1');
+
+# 118: eof
+$v = gd_eof($D, 'lincom');
+check_ok(118, $D);
+check_var(118, $v, 80);
+
+# 119: alter_encoding
+$v = gd_alter_encoding($D, GD_SLIM_ENCODED, 1);
+check_ok2(119, 0, $D);
+check_var2(119, 1, $v, TRUE);
+
+$v = gd_encoding($D, 1);
+check_ok2(119, 2, $D);
+check_var2(119, 3, $v, GD_SLIM_ENCODED);
+
+# 120: alter_encoding
+$v = gd_alter_endianness($D, GD_BIG_ENDIAN, 1);
+check_ok2(120, 0, $D);
+check_var2(120, 1, $v, TRUE);
+
+$v = gd_endianness($D, 1);
+check_ok2(120, 2, $D);
+check_var2(120, 3, $v, GD_BIG_ENDIAN | GD_NOT_ARM_ENDIAN);
+
+# 121: alter spec
+$v = gd_alter_spec($D, 'new10 PHASE in const');
+check_ok2(121, 0, $D);
+check_var2(121, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new10');
+check_ok2(121, 2, $D);
+check_var2(121, 3, $v, array('field' => 'new10', 'field_type' => GD_PHASE_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in'), 'shift' => 93,
+  'scalar' => array(array('const', -1))));
+
+# 122: delete
+$v = gd_delete($D, 'new10');
+check_ok2(122, 0, $D);
+check_var2(122, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new10');
+check_error2(122, 2, $D, GD_E_BAD_CODE);
+check_var2(122, 3, $v, FALSE);
+
+# 123: malter spec
+$v = gd_malter_spec($D, 'mnew10 PHASE in4 11', 'data');
+check_ok2(123, 0, $D);
+check_var2(123, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew10');
+check_ok2(123, 2, $D);
+check_var2(123, 3, $v, array('field' => 'data/mnew10',
+  'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in4'), 'shift' => 11, 'scalar' => array()));
+
+# 124: move
+$v = gd_move($D, 'new9', 1);
+check_ok2(124, 0, $D);
+check_var2(124, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new9');
+check_ok2(124, 2, $D);
+check_var2(124, 3, $v, array('field' => 'new9',
+  'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 1,
+  'in_fields' => array('in1', 'in3')));
+
+# 125: rename
+$v = gd_rename($D, 'new9', 'newer');
+check_ok2(125, 0, $D);
+check_var2(125, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new9');
+check_error2(125, 2, $D, GD_E_BAD_CODE);
+check_var2(125, 3, $v, FALSE);
+
+$v = gd_entry($D, 'newer');
+check_ok2(125, 4, $D);
+check_var2(125, 5, $v, array('field' => 'newer',
+  'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 1,
+  'in_fields' => array('in1', 'in3')));
+
+# 126: uninclude
+$v = gd_uninclude($D, 1);
+check_ok2(126, 0, $D);
+check_var2(126, 1, $v, TRUE);
+
+$v = gd_entry($D, 'newer');
+check_error2(126, 2, $D, GD_E_BAD_CODE);
+check_var2(126, 3, $v, FALSE);
+
+# 127: frameoffset
+$v = gd_frameoffset($D, 0);
+check_ok(127, $D);
+check_var(127, $v, 0);
+
+# 128: alter frameoffset
+$v = gd_alter_frameoffset($D, 33, 0);
+check_ok2(128, 0, $D);
+check_var2(128, 1, $v, TRUE);
+
+$v = gd_frameoffset($D, 0);
+check_ok2(128, 2, $D);
+check_var2(128, 3, $v, 33);
+
+# 129: native type
+$v = gd_native_type($D, 'data');
+check_ok(129, $D);
+check_var(129, $v, GD_INT8);
+
+# 131: validate
+$v = gd_validate($D, 'new7');
+check_error(131, $D, GD_E_BAD_CODE);
+check_var(131, $v, FALSE);
+
+# 133: framenum_subset
+$v = gd_framenum($D, 'data', 33.3, 6);
+check_ok(133, $D);
+check_var(133, $v, 37.0375);
+
+# 135: gd_add
+$v = gd_add($D, array('field' => 'new135', 'field_type' => GD_RAW_ENTRY,
+  'fragment_index' => 0, 'data_type' => GD_FLOAT32, 'spf' => 5));
+check_ok2(135, 0, $D);
+check_var2(135, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new135');
+check_ok2(135, 2, $D);
+check_var2(135, 3, $v, array('field' => 'new135', 'field_type' => GD_RAW_ENTRY,
+  'fragment_index' => 0, 'spf' => 5, 'data_type' => GD_FLOAT32,
+  'scalar' => array()));
+
+# 136: madd
+$v = gd_madd($D, array('field' => 'mnew136',
+  'field_type' => GD_PHASE_ENTRY, 'in_fields' => 'data',
+  'shift' => 23), 'data');
+check_ok2(136, 0, $D);
+check_var2(136, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew136');
+check_ok2(136, 2, $D);
+check_var2(136, 3, $v, array('field' => 'data/mnew136',
+  'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('data'), 'shift' => 23, 'scalar' => array()));
+
+# 141: alter_entry
+$v = gd_alter_entry($D, 'new135', array('field_type' => GD_RAW_ENTRY,
+  'data_type' => GD_FLOAT64, 'spf' => 141));
+check_ok2(141, 0, $D);
+check_var2(141, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new135');
+check_ok2(141, 2, $D);
+check_var2(141, 3, $v, array('field' => 'new135', 'field_type' => GD_RAW_ENTRY,
+  'fragment_index' => 0, 'spf' => 141, 'data_type' => GD_FLOAT64,
+  'scalar' => array()));
+
+# 142: bof
+$v = gd_bof($D, 'lincom');
+check_ok(142, $D);
+check_var(142, $v, 264);
+
+# 143: divide entry
+$v = gd_entry($D, 'div');
+check_ok(143, $D);
+check_var(143, $v, array('field' => 'div', 'field_type' => GD_DIVIDE_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('mult', 'bit')));
+
+# 145: recip entry
+$v = gd_entry($D, 'recip');
+check_ok(145, $D);
+check_var(145, $v, array('field' => 'recip', 'field_type' => GD_RECIP_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('div'),
+  'dividend' => array(6.5, 4.3), 'scalar' => array()));
+
+# 146: add divide
+$v = gd_add_divide($D, 'new14', 'in2', 'in3');
+check_ok2(146, 0, $D);
+check_var2(146, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new14');
+check_ok2(146, 2, $D);
+check_var2(146, 3, $v, array('field' => 'new14',
+  'field_type' => GD_DIVIDE_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2', 'in3')));
+
+# 148: add recip
+$v = gd_add_recip($D, 'new16', 'in2', array(33.3, 44.4));
+check_ok2(148, 0, $D);
+check_var2(148, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new16');
+check_ok2(148, 2, $D);
+check_var2(148, 3, $v, array('field' => 'new16', 'field_type' => GD_RECIP_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in2'),
+  'dividend' => array(33.3, 44.4), 'scalar' => array()));
+
+# 149: madd divide
+$v = gd_madd_divide($D, 'data', 'mnew14', 'in2', 'in3');
+check_ok2(149, 0, $D);
+check_var2(149, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew14');
+check_ok2(149, 2, $D);
+check_var2(149, 3, $v, array('field' => 'data/mnew14',
+  'field_type' => GD_DIVIDE_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2', 'in3')));
+
+# 151: madd recip
+$v = gd_madd_recip($D, 'data', 'mnew16', 'in2', 151);
+check_ok2(148, 0, $D);
+check_var2(148, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew16');
+check_ok2(148, 2, $D);
+check_var2(148, 3, $v, array('field' => 'data/mnew16',
+  'field_type' => GD_RECIP_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2'), 'dividend' => 151.,
+  'scalar' => array()));
+
+# 152: alter_divide
+$v = gd_alter_divide($D, 'new14', 'in1');
+check_ok2(152, 0, $D);
+check_var2(152, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new14');
+check_ok2(152, 2, $D);
+check_var2(152, 3, $v, array('field' => 'new14',
+  'field_type' => GD_DIVIDE_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1', 'in3')));
+
+# 154: alter recip
+$v = gd_alter_recip($D, 'new16', 'in6');
+check_ok2(154, 0, $D);
+check_var2(154, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new16');
+check_ok2(154, 2, $D);
+check_var2(154, 3, $v, array('field' => 'new16', 'field_type' => GD_RECIP_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in6'),
+  'dividend' => array(33.3, 44.4), 'scalar' => array()));
+
+# 155: rewrite fragment
+$v = gd_rewrite_fragment($D);
+check_ok(155, $D);
+check_var(155, $v, TRUE);
+
+# 156: invalid dirfile
+$v = gd_invalid_dirfile();
+check_ok2(156, 0, $v);
+
+gd_nfragments($v);
+check_error(156, $v, GD_E_BAD_DIRFILE);
+
+gd_close($v);
+
+# 157: dirfile standards
+$v = gd_dirfile_standards($D);
+check_ok2(157, 0, $D);
+check_var2(157, 1, $v, GD_DIRFILE_STANDARDS_VERSION);
+
+$v = gd_dirfile_standards($D, 0);
+check_error2(157, 2, $D, GD_E_ARGUMENT);
+check_var2(157, 3, $v, FALSE);
+
+# 158: get carray
+$v = gd_get_carray($D, 'carray', GD_INT, null, null, TRUE);
+check_ok(158, $D);
+check_var(158, $v, array(1, 2, 3, 4, 5, 6));
+
+# 159: get carray slice
+$v = gd_get_carray($D, 'carray', GD_INT8, 2, 2);
+check_ok(159, $D);
+check_var(159, $v, "\03\04");
+
+# 167: gd_carrays
+$v = gd_carrays($D, GD_INT8, TRUE);
+check_ok(167, $D);
+check_var(167, $v, array(array(1, 2, 3, 4, 5, 6)));
+
+# 168: gd_put_carray
+$v = gd_put_carray($D, 'carray', array(9, 8, 7, 6, 5, 4));
+check_ok2(168, 0, $D);
+check_var2(168, 1, $v, TRUE);
+
+$v = gd_get_carray($D, 'carray', GD_INT8);
+check_ok2(168, 2, $D);
+check_var2(168, 3, $v, "\011\010\07\06\05\04");
+
+# 169: gd_put_carray_slice
+$v = gd_put_carray($D, 'carray', 2, array(169, 169));
+check_ok2(169, 0, $D);
+check_var2(169, 1, $v, TRUE);
+
+$v = gd_get_carray($D, 'carray', GD_INT, null, null, TRUE);
+check_ok2(169, 2, $D);
+check_var2(169, 3, $v, array(9, 8, 169, 169, 5, 4));
+
+# 177: array len
+$v = gd_array_len($D, 'carray');
+check_ok(177, $D);
+check_var(177, $v, 6);
+
+# 178: carray entry
+$v = gd_entry($D, 'carray');
+check_ok(178, $D);
+check_var(178, $v, array('field' => 'carray', 'field_type' => GD_CARRAY_ENTRY,
+  'fragment_index' => 0, 'array_len' => 6, 'const_type' => GD_FLOAT64));
+
+# 179: add carray
+$v = gd_add_carray($D, 'new17', GD_INT32, GD_INT8, "\x1\x7\x9");
+check_ok2(179, 0, $D);
+check_var2(179, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new17');
+check_ok2(179, 2, $D);
+check_var2(179, 3, $v, array('field' => 'new17',
+  'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 3,
+  'const_type' => GD_INT32));
+
+$v = gd_get_carray($D, 'new17', GD_INT8);
+check_ok2(179, 4, $D);
+check_var2(179, 5, $v, "\x1\x7\x9");
+
+# 180: madd carray
+$v = gd_madd_carray($D, 'data', 'mnew17', GD_COMPLEX128, array(array(1, 8),
+  18));
+check_ok2(180, 0, $D);
+check_var2(180, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew17');
+check_ok2(180, 2, $D);
+check_var2(180, 3, $v, array('field' => 'data/mnew17',
+  'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 2,
+  'const_type' => GD_COMPLEX128));
+
+$v = gd_get_carray($D, 'data/mnew17', GD_COMPLEX128, null, null, TRUE);
+check_ok2(180, 4, $D);
+check_var2(180, 5, $v, array(array(1., 8.), 18.));
+
+# 181: alter carray
+$v = gd_alter_carray($D, 'new17', null, 12);
+check_ok2(181, 0, $D);
+check_var2(181, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new17');
+check_ok2(181, 2, $D);
+check_var2(181, 3, $v, array('field' => 'new17',
+  'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 12,
+  'const_type' => GD_INT32));
+
+# 183: constants
+$v = gd_constants($D, GD_FLOAT64, TRUE);
+check_ok(183, $D);
+check_var(183, $v, array(93., 33.3));
+
+# 191: mconstants
+$v = gd_mconstants($D, 'data', GD_FLOAT64, TRUE);
+check_ok(191, $D);
+check_var(191, $v, array(3.3, 33.3)); # what's this weird obsession with three?
+
+# 199: strings
+$v = gd_strings($D);
+check_ok(199, $D);
+check_var(199, $v, array('Lorem ipsum', 'a string', 'Arthur Dent'));
+
+# 200: mstrings
+$v = gd_mstrings($D, 'data');
+check_ok(200, $D);
+check_var(200, $v, array('This is a string constant.', 'another string'));
+
+# 203: seek
+$v = gd_seek($D, 'data', 35, 0, GD_SEEK_SET);
+check_ok2(203, 0, $D);
+check_var2(203, 1, $v, 280);
+
+$v = gd_getdata($D, 'data', GD_HERE, 0, 1, 0, GD_UINT8);
+check_ok2(203, 2, $D);
+check_var2(203, 3, $v, "\x11\x12\x13\x14\x15\x16\x17\x18");
+
+# 204: tell
+$v = gd_tell($D, 'data');
+check_ok(204, $D);
+check_var(204, $v, 288);
+
+# 205: hide
+$v = gd_hide($D, 'data');
+check_ok(205, $D);
+check_var(205, $v, TRUE);
+
+# 206: hidden
+$v = gd_hidden($D, 'data');
+check_ok(206, $D);
+check_var(206, $v, TRUE);
+
+# 207: unhide
+$v = gd_unhide($D, 'data');
+check_ok2(207, 0, $D);
+check_var2(207, 1, $v, TRUE);
+
+$v = gd_hidden($D, 'data');
+check_ok2(207, 2, $D);
+check_var2(207, 3, $v, FALSE);
+
+# 208: sync
+$v = gd_sync($D, 'data');
+check_ok(208, $D);
+check_var(208, $v, TRUE);
+
+# 209: flush
+$v = gd_flush($D, 'data');
+check_ok(209, $D);
+check_var(209, $v, TRUE);
+
+# 210: metaflush
+$v = gd_metaflush($D);
+check_ok(210, $D);
+check_var(210, $v, TRUE);
+
+# 211: window entry
+$v = gd_entry($D, 'window');
+check_ok(211, $D);
+check_var(211, $v, array('field' => 'window', 'field_type' => GD_WINDOW_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('linterp', 'mult'),
+  'windop' => GD_WINDOP_LT, 'threshold' => 4.1, 'scalar' => array()));
+
+# 212: add window
+$v = gd_add_window($D, 'new18', 'in1', 'in2', GD_WINDOP_NE, 32);
+check_ok2(212, 0, $D);
+check_var2(212, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new18');
+check_ok2(212, 2, $D);
+check_var2(212, 3, $v, array('field' => 'new18',
+  'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1', 'in2'), 'windop' => GD_WINDOP_NE,
+  'threshold' => 32, 'scalar' => array()));
+
+# 214: madd window
+$v = gd_madd_window($D, 'data', 'mnew18', 'in1', 'in2', GD_WINDOP_SET, 0x214);
+check_ok2(214, 0, $D);
+check_var2(214, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew18');
+check_ok2(214, 2, $D);
+check_var2(214, 3, $v, array('field' => 'data/mnew18',
+  'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1', 'in2'), 'windop' => GD_WINDOP_SET,
+  'threshold' => 0x214, 'scalar' => array()));
+
+# 217: alter window
+$v = gd_alter_window($D, 'new18', 'in3', null, GD_WINDOP_EQ);
+check_ok2(217, 0, $D);
+check_var2(217, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new18');
+check_ok2(217, 2, $D);
+check_var2(217, 3, $v, array('field' => 'new18',
+  'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in3', 'in2'), 'windop' => GD_WINDOP_EQ,
+  'threshold' => 32, 'scalar' => array()));
+
+# 218: alias target
+$v = gd_alias_target($D, 'alias');
+check_ok(218, $D);
+check_var(218, $v, 'data');
+
+# 219: add alias
+$v = gd_add_alias($D, 'new20', 'data');
+check_ok2(219, 0, $D);
+check_var2(219, 1, $v, TRUE);
+
+$v = gd_alias_target($D, 'new20');
+check_ok2(219, 2, $D);
+check_var2(219, 3, $v, 'data');
+
+# 220: add alias
+$v = gd_madd_alias($D, 'data', 'mnew20', 'data');
+check_ok2(220, 0, $D);
+check_var2(220, 1, $v, TRUE);
+
+$v = gd_alias_target($D, 'data/mnew20');
+check_ok2(220, 2, $D);
+check_var2(220, 3, $v, 'data');
+
+# 221: naliases
+$v = gd_naliases($D, 'data');
+check_ok(221, $D);
+check_var(221, $v, 4);
+
+# 222: aliases
+$v = gd_aliases($D, 'data');
+check_ok(222, $D);
+check_var(222, $v, array('data', 'alias', 'data/mnew20', 'new20'));
+
+# 223: gd_include_affix
+$v = gd_include($D, 'format1', 0, GD_CREAT | GD_EXCL, 'A', 'Z');
+check_ok2(223, 0, $D);
+check_var2(223, 1, $v, 1);
+
+# 226: fragment affixes
+$v = gd_fragment_affixes($D, 1);
+check_ok(226, $D);
+check_var(226, $v, array('A', 'Z'));
+
+# 227: alter affixes
+$v = gd_alter_affixes($D, 1, "B", "");
+check_ok2(227, 0, $D);
+check_var2(227, 1, $v, TRUE);
+
+$v = gd_fragment_affixes($D, 1);
+check_ok2(227, 2, $D);
+check_var2(227, 3, $v, array('B', ''));
+
+# 228: mplex entry
+$v = gd_entry($D, 'mplex');
+check_ok(228, $D);
+check_var(228, $v, array('field' => 'mplex', 'field_type' => GD_MPLEX_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('data', 'sbit'), 'count_val' => 1,
+  'period' => 10, 'scalar' => array()));
+
+# 229: add mplex
+$v = gd_add_mplex($D, 'new21', 'in1', 'in2', 5, 6);
+check_ok2(229, 0, $D);
+check_var2(229, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new21');
+check_ok2(229, 2, $D);
+check_var2(229, 3, $v, array('field' => 'new21', 'field_type' => GD_MPLEX_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in1', 'in2'), 'count_val' => 5,
+  'period' => 6, 'scalar' => array()));
+
+# 230: add mplex
+$v = gd_madd_mplex($D, 'data', 'mnew21', 'in1', 'in2', 5, 6);
+check_ok2(230, 0, $D);
+check_var2(230, 1, $v, TRUE);
+
+$v = gd_entry($D, 'data/mnew21');
+check_ok2(230, 2, $D);
+check_var2(230, 3, $v, array('field' => 'data/mnew21',
+  'field_type' => GD_MPLEX_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1', 'in2'), 'count_val' => 5, 'period' => 6,
+  'scalar' => array()));
+
+# 231: alter mplex
+$v = gd_alter_mplex($D, 'new21', 'in3', null, null, null);
+check_ok2(231, 0, $D);
+check_var2(231, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new21');
+check_ok2(231, 2, $D);
+check_var2(231, 3, $v, array('field' => 'new21', 'field_type' => GD_MPLEX_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in3', 'in2'), 'count_val' => 5,
+  'period' => 6, 'scalar' => array()));
+
+# 232: strtok
+$v = gd_strtok($D, '"test1 test2" test3\ test4 test5');
+check_ok(232, $D);
+check_var(232, $v, array('test1 test2', 'test3 test4', 'test5'));
+
+# 233: raw_close
+$v = gd_raw_close($D, 'data');
+check_ok(233, $D);
+check_var(233, $v, TRUE);
+
+# 234: desync
+$v = gd_desync($D);
+check_ok(234, $D);
+check_var(234, $v, FALSE);
+
+# 235: flags
+$v = gd_flags($D, GD_PRETTY_PRINT);
+check_ok(235, $D);
+check_var(235, $v, GD_PRETTY_PRINT);
+
+# 236: verbose_prefix
+$v = gd_verbose_prefix($D, 'big_test: ');
+check_ok(236, $D);
+check_var(236, $v, TRUE);
+
+# 237: nentries
+$v = gd_nentries($D, 'data', GD_SCALAR_ENTRIES,
+  GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS);
+check_ok(237, $D);
+check_var(237, $v, 6);
+
+# 239: entry_list
+$v = gd_entry_list($D, null, GD_VECTOR_ENTRIES, GD_ENTRIES_NOALIAS);
+check_ok(239, $D);
+check_var(239, $v, array('INDEX', 'bit', 'data', 'div', 'lincom', 'linterp',
+  'mplex', 'mult', 'new1', 'new135', 'new14', 'new16', 'new18', 'new21', 'new3',
+  'new4', 'new6', 'new7', 'new8', 'phase', 'polynom', 'recip', 'sbit',
+  'window'));
+
+# 240: mplex lookback
+$v = gd_mplex_lookback($D, GD_LOOKBACK_ALL);
+check_ok(240, $D);
+check_var(240, $v, true);
+
+# 241: linterp tablename
+$v = gd_linterp_tablename($D, 'linterp');
+check_ok(241, $D);
+check_eostring(241, $v, 'dirfile/lut');
+
+# 242: mcarrays
+$v = gd_mcarrays($D, 'data', GD_FLOAT64, TRUE);
+check_ok(242, $D);
+check_var(242, $v, array(array(1.9, 2.8, 3.7, 4.6, 5.5), array(1., 18.)));
+
+# 243: add lincom
+$v = gd_add($D, array('field' => 'new243', 'field_type' => GD_LINCOM_ENTRY,
+  'in_fields' => array('in1', 'in2', 'in3'), 'm' => array(1.1, 2 => 1.4),
+  'scalar' => array(1 => array('const'), null, array('carray', 3),
+  array('carray', 4), array('carray', 5)), 'fragment_index' => 0));
+check_ok2(243, 0, $D);
+check_var2(243, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new243');
+check_ok2(243, 2, $D);
+check_var2(243, 3, $v, array('field' => 'new243',
+  'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 3,
+  'in_fields' => array('in1', 'in2', 'in3'), 'm' => array(1.1, 93., 1.4),
+  'b' => array(169., 5., 4.), 'scalar' => array(1 => array('const', -1),
+  3 => array('carray', 3), array('carray', 4), array('carray', 5))));
+
+# 244: add polynom
+$v = gd_add($D, array('field' => 'new244', 'in_fields' => 'in2',
+  'field_type' => GD_POLYNOM_ENTRY, 'a' => array(33., array(44., 55.), 66.),
+  'scalar' => array(3 => array('carray', 0)), 'fragment_index' => 0));
+check_ok2(244, 0, $D);
+check_var2(244, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new244');
+check_ok2(244, 2, $D);
+check_var2(244, 3, $v, array('field' => 'new244',
+  'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2'), 'poly_ord' => 3, 'a' => array(33.,
+  array(44., 55.), 66., 9.), 'scalar' => array(3 => array('carray', 0))));
+
+# 245: add linterp
+$v = gd_add($D, array('field' => 'new245', 'field_type' => GD_LINTERP_ENTRY,
+  'in_fields' => 'in', 'table' => './some/table', 'fragment_index' => 0));
+check_ok2(245, 0, $D);
+check_var2(245, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new245');
+check_ok2(245, 2, $D);
+check_var2(245, 3, $v, array('field' => 'new245',
+  'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in'), 'table' => './some/table'));
+
+# 246: add bit
+$v = gd_add($D, array('field' => 'new246', 'field_type' => GD_BIT_ENTRY,
+  'in_fields' => array('in1'), 'bitnum' => 11, 'fragment_index' => 0));
+check_ok2(246, 0, $D);
+check_var2(246, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new246');
+check_ok2(246, 2, $D);
+check_var2(246, 3, $v, array('field' => 'new246', 'field_type' => GD_BIT_ENTRY,
+  'fragment_index' => 0, 'in_fields' => array('in1'), 'bitnum' => 11,
+  'numbits' => 1, 'scalar' => array()));
+
+# 247: add multiply
+$v = gd_add($D, array('field' => 'new247', 'fragment_index' => 0,
+  'field_type' => GD_MULTIPLY_ENTRY, 'in_fields' => array('in2', 'in3')));
+check_ok2(247, 0, $D);
+check_var2(247, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new247');
+check_ok2(247, 2, $D);
+check_var2(247, 3, $v, array('field' => 'new247',
+  'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in2', 'in3')));
+
+# 248: add phase
+$v = gd_add($D, array('field' => 'new248', 'in_fields' =>  'in6',
+  'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0,
+  'scalar' => array(array('carray', 1))));
+check_ok2(248, 0, $D);
+check_var2(248, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new248');
+check_ok2(248, 2, $D);
+check_var2(248, 3, $v, array('field' => 'new248',
+  'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in6'), 'shift' => 8,
+  'scalar' => array(array('carray', 1))));
+
+# 249: add const
+$v = gd_add($D, array('field' => 'new249', 'field_type' => GD_CONST_ENTRY,
+  'fragment_index' => 0, 'const_type' => GD_UINT8));
+check_ok2(249, 0, $D);
+check_var2(249, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new249');
+check_ok2(249, 2, $D);
+check_var2(249, 3, $v, array('field' => 'new249',
+  'field_type' => GD_CONST_ENTRY,
+  'fragment_index' => 0, 'const_type' => GD_UINT8));
+
+$v = gd_get_constant($D, 'new249', GD_FLOAT64);
+check_ok2(249, 4, $D);
+check_var2(249, 5, $v, 0.);
+
+# 250: add string
+$v = gd_add($D, array('field' => 'new250', 'field_type' => GD_STRING_ENTRY,
+  'fragment_index' => 0));
+check_ok2(250, 0, $D);
+check_var2(250, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new250');
+check_ok2(250, 2, $D);
+check_var2(250, 3, $v, array('field' => 'new250',
+  'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0));
+
+$v = gd_get_string($D, 'new250');
+check_ok2(250, 4, $D);
+check_var2(250, 5, $v, '');
+
+# 251: add recip
+$v = gd_add($D, array('field' => 'Bnew251', 'field_type' => GD_RECIP_ENTRY,
+  'in_fields' => 'Bin2', 'dividend' => array(33.3, 44.4),
+  'fragment_index' => 1, 'scalar' => null));
+check_ok2(251, 0, $D);
+check_var2(251, 1, $v, TRUE);
+
+$v = gd_entry($D, 'Bnew251');
+check_ok2(251, 2, $D);
+check_var2(251, 3, $v, array('field' => 'Bnew251',
+  'field_type' => GD_RECIP_ENTRY,
+  'fragment_index' => 1, 'in_fields' => array('Bin2'),
+  'dividend' => array(33.3, 44.4), 'scalar' => array()));
+
+# 252: add carray
+$v = gd_add($D, array('field' => 'new252', 'field_type' => GD_CARRAY_ENTRY,
+  'fragment_index' => 0, 'const_type' => GD_INT32, 'array_len' => 5));
+check_ok2(252, 0, $D);
+check_var2(252, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new252');
+check_ok2(252, 2, $D);
+check_var2(252, 3, $v, array('field' => 'new252',
+  'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 5,
+  'const_type' => GD_INT32));
+
+$v = gd_get_carray($D, 'new252', GD_INT8);
+check_ok2(252, 4, $D);
+check_var2(252, 5, $v, "\0\0\0\0\0");
+
+# 253: add window
+$v = gd_add($D, array('field' => 'new253', 'in_fields' => array('in1', 'in2'),
+  'windop' => GD_WINDOP_NE, 'threshold' => 32, 'fragment_index' => 0,
+  'field_type' => GD_WINDOW_ENTRY));
+check_ok2(253, 0, $D);
+check_var2(253, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new253');
+check_ok2(253, 2, $D);
+check_var2(253, 3, $v, array('field' => 'new253',
+  'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1', 'in2'), 'windop' => GD_WINDOP_NE,
+  'threshold' => 32, 'scalar' => array()));
+
+# 254: add mplex
+$v = gd_add($D, array('field' => 'new254', 'in_fields' => array('in1', 'in2'),
+  'fragment_index' => 0, 'field_type' => GD_MPLEX_ENTRY, 'count_val' =>  5));
+check_ok2(254, 0, $D);
+check_var2(254, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new254');
+check_ok2(254, 2, $D);
+check_var2(254, 3, $v, array('field' => 'new254',
+  'field_type' => GD_MPLEX_ENTRY, 'fragment_index' => 0,
+  'in_fields' => array('in1', 'in2'), 'count_val' => 5,
+  'period' => 0, 'scalar' => array()));
+
+# 259: alter_entry with scalar
+$v = gd_alter_entry($D, 'new243', array('field_type' => GD_LINCOM_ENTRY,
+  'scalar' => array(null, array(''), array('const'), array('carray', 4),
+  null, array('const', -1)), 'fragment_index' => 0));
+check_ok2(259, 0, $D);
+check_var2(259, 1, $v, TRUE);
+
+$v = gd_entry($D, 'new243');
+check_ok2(259, 2, $D);
+check_var2(259, 3, $v, array('field' => 'new243',
+  'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 3,
+  'in_fields' => array('in1', 'in2', 'in3'), 'm' => array(1.1, 93., 93.),
+  'b' => array(5., 5., 93.), 'scalar' => array(1 => array('const', -1),
+  array('const', -1), array('carray', 4), 5 => array('const', -1))));
+
+# 270: dirfilekey
+$v = gd_dirfilekey($D);
+check_ok(270, $D);
+check_var(270, $v, "dirfile\0extra");
+
+# 271: encoding_support
+$v = gd_encoding_support(GD_SIE_ENCODED);
+check_var(271, $v, GD_RDWR);
+
+# 272: NULL return from gd_reference
+$D2 = gd_open('dirfile/empty', GD_RDWR | GD_CREAT | GD_EXCL);
+check_ok2(272, 1, $D2);
+
+$v = gd_reference($D2);
+check_ok2(272, 2, $D2);
+check_var(272, $v, null);
+
+gd_discard($D2);
+
+
+
+
+
+# ===========================================
+
+gd_discard($D);
+unlink('dirfile/empty/format');
+rmdir('dirfile/empty');
+unlink('dirfile/data');
+unlink('dirfile/new1');
+unlink('dirfile/new135');
+unlink('dirfile/format');
+unlink('dirfile/format1');
+unlink('dirfile/form2');
+rmdir('dirfile');
+
+if ($ne > 0) {
+  echo "ne = ", $ne, "\n";
+  exit(1);
+}
+
+exit(0);
+?>
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 33b5755..757a787 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2011, 2015 D. V. Wiebe
+# Copyright (C) 2009, 2013, 2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -20,28 +20,20 @@
 #
 AUTOMAKE_OPTIONS = foreign
 
-if CC_WALL
-WALL=-Wall
-endif
-
-if GETDATA_DEBUG
-DEBUG_C = ../../src/debug.c
-endif
-
 SUBDIRS=test
 
-python_LTLIBRARIES = pygetdata.la
-LIBS=
+nodist_python_SCRIPTS = pygetdata.so
 
 BUILT_SOURCES = pyconstants.c
-AM_CFLAGS = ${WALL} ${PYTHON_CFLAGS}
-AM_CPPFLAGS = $(CPPFLAGS) $(PYTHON_CPPFLAGS) $(NUMPY_CPPFLAGS) -I$(top_srcdir)/src
-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
+
+EXTRA_DIST = pydirfile.c pygetdata.c pyentry.c pygetdata.h pyfragment.c
+
+distutils_path=build/lib.${PYTHON_PLATFORM}-${PYTHON_VERSION}
+pygetdata.so: ${distutils_path}/pygetdata.so
+	cp $< $@
+
+${distutils_path}/pygetdata.so: setup.py ${BUILT_SOURCES} ${EXTRA_DIST}
+	${PYTHON} setup.py build
 
 pyconstants.c: ../make_parameters
 	../make_parameters p > $@
@@ -50,5 +42,8 @@ pyconstants.c: ../make_parameters
 	cd .. && ${MAKE} make_parameters
 
 clean-local:
-	rm -rf ${BUILT_SOURCES} *~ 
+if MAKE_PYBINDINGS
+	if [ -e setup.py ]; then ${PYTHON} setup.py clean; fi
+endif
+	rm -rf build pygetdata.so ${BUILT_SOURCES} debug.c *~ 
 
diff --git a/bindings/python/Makefile.in b/bindings/python/Makefile.in
index 6531811..2ca68d8 100644
--- a/bindings/python/Makefile.in
+++ b/bindings/python/Makefile.in
@@ -80,15 +80,13 @@ build_triplet = @build@
 host_triplet = @host@
 subdir = bindings/python
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
+	$(srcdir)/setup.py.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -96,7 +94,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
 	$(top_builddir)/src/getdata.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = setup.py
 CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -126,25 +124,7 @@ am__uninstall_files_from_dir = { \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 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)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-pygetdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(pygetdata_la_LDFLAGS) $(LDFLAGS) -o $@
+SCRIPTS = $(nodist_python_SCRIPTS)
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -157,30 +137,8 @@ AM_V_at = $(am__v_at_ at AM_V@)
 am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
 am__v_at_0 = @
 am__v_at_1 = 
-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) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(pygetdata_la_SOURCES) $(nodist_pygetdata_la_SOURCES)
-DIST_SOURCES = $(am__pygetdata_la_SOURCES_DIST)
+SOURCES =
+DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
 	ctags-recursive dvi-recursive html-recursive info-recursive \
 	install-data-recursive install-dvi-recursive \
@@ -274,6 +232,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -299,8 +259,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -328,7 +299,7 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBLTDL = @LIBLTDL@
 LIBOBJS = @LIBOBJS@
-LIBS = 
+LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
@@ -348,7 +319,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -363,12 +333,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -432,9 +406,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -442,6 +417,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -455,7 +431,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2009-2011, 2015 D. V. Wiebe
+# Copyright (C) 2009, 2013, 2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -476,26 +452,15 @@ top_srcdir = @top_srcdir@
 # 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
+nodist_python_SCRIPTS = pygetdata.so
 BUILT_SOURCES = pyconstants.c
-AM_CFLAGS = ${WALL} ${PYTHON_CFLAGS}
-AM_CPPFLAGS = $(CPPFLAGS) $(PYTHON_CPPFLAGS) $(NUMPY_CPPFLAGS) -I$(top_srcdir)/src
-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
+EXTRA_DIST = pydirfile.c pygetdata.c pyentry.c pygetdata.h pyfragment.c
+distutils_path = build/lib.${PYTHON_PLATFORM}-${PYTHON_VERSION}
 all: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -526,85 +491,43 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-
-install-pythonLTLIBRARIES: $(python_LTLIBRARIES)
+setup.py: $(top_builddir)/config.status $(srcdir)/setup.py.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-nodist_pythonSCRIPTS: $(nodist_python_SCRIPTS)
 	@$(NORMAL_INSTALL)
-	@list='$(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" || { \
+	@list='$(nodist_python_SCRIPTS)'; test -n "$(pythondir)" || list=; \
+	if test -n "$$list"; then \
 	  echo " $(MKDIR_P) '$(DESTDIR)$(pythondir)'"; \
 	  $(MKDIR_P) "$(DESTDIR)$(pythondir)" || exit 1; \
-	  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=; \
+	fi; \
 	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)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-pygetdata.la: $(pygetdata_la_OBJECTS) $(pygetdata_la_DEPENDENCIES) $(EXTRA_pygetdata_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(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@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-debug.lo: ../../src/debug.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(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_V_at)$(am__mv) $(DEPDIR)/debug.Tpo $(DEPDIR)/debug.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)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@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --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
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pythondir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pythondir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-nodist_pythonSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_python_SCRIPTS)'; test -n "$(pythondir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	dir='$(DESTDIR)$(pythondir)'; $(am__uninstall_files_from_dir)
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -769,7 +692,7 @@ distdir: $(DISTFILES)
 check-am: all-am
 check: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) check-recursive
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile $(SCRIPTS)
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(pythondir)"; do \
@@ -809,14 +732,11 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 clean: clean-recursive
 
-clean-am: clean-generic clean-libtool clean-local \
-	clean-pythonLTLIBRARIES mostlyclean-am
+clean-am: clean-generic 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
+distclean-am: clean-am distclean-generic distclean-tags
 
 dvi: dvi-recursive
 
@@ -830,7 +750,7 @@ info: info-recursive
 
 info-am:
 
-install-data-am: install-pythonLTLIBRARIES
+install-data-am: install-nodist_pythonSCRIPTS
 
 install-dvi: install-dvi-recursive
 
@@ -859,14 +779,12 @@ 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
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-recursive
 
@@ -876,27 +794,31 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-pythonLTLIBRARIES
+uninstall-am: uninstall-nodist_pythonSCRIPTS
 
 .MAKE: $(am__recursive_targets) all check install install-am \
 	install-strip
 
 .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
 	check-am clean clean-generic clean-libtool clean-local \
-	clean-pythonLTLIBRARIES cscopelist-am ctags ctags-am distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
+	cscopelist-am ctags ctags-am distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-nodist_pythonSCRIPTS \
 	install-pdf install-pdf-am install-ps install-ps-am \
-	install-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-am uninstall uninstall-am \
-	uninstall-pythonLTLIBRARIES
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-nodist_pythonSCRIPTS
+
+pygetdata.so: ${distutils_path}/pygetdata.so
+	cp $< $@
 
+${distutils_path}/pygetdata.so: setup.py ${BUILT_SOURCES} ${EXTRA_DIST}
+	${PYTHON} setup.py build
 
 pyconstants.c: ../make_parameters
 	../make_parameters p > $@
@@ -905,7 +827,8 @@ pyconstants.c: ../make_parameters
 	cd .. && ${MAKE} make_parameters
 
 clean-local:
-	rm -rf ${BUILT_SOURCES} *~ 
+ at MAKE_PYBINDINGS_TRUE@	if [ -e setup.py ]; then ${PYTHON} setup.py clean; fi
+	rm -rf build pygetdata.so ${BUILT_SOURCES} debug.c *~ 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/bindings/python/pydirfile.c b/bindings/python/pydirfile.c
index 2faa928..e80c92e 100644
--- a/bindings/python/pydirfile.c
+++ b/bindings/python/pydirfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2014 D. V. Wiebe
+/* Copyright (C) 2009-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -124,6 +124,9 @@ static void gdpy_dirfile_delete(struct gdpy_dirfile_t *self)
 
   gd_close(self->D);
   free(self->verbose_prefix);
+  Py_XDECREF(self->callback);
+  Py_XDECREF(self->callback_data);
+  PyObject_Del(self);
 
   dreturnvoid();
 }
@@ -377,9 +380,7 @@ static PyObject *gdpy_dirfile_getcarray(struct gdpy_dirfile_t *self,
   int as_list = 0;
   gd_type_t return_type;
   PyObject *pyobj = NULL;
-#ifdef USE_NUMPY
   npy_intp dims[] = { 0 };
-#endif
 
   dtrace("%p, %p, %p", self, args, keys);
 
@@ -392,7 +393,7 @@ static PyObject *gdpy_dirfile_getcarray(struct gdpy_dirfile_t *self,
   }
 
   if (len == 0) {
-    len = gd_carray_len(self->D, field_code);
+    len = gd_array_len(self->D, field_code);
     if (len > start)
       len -= start;
     else
@@ -400,32 +401,25 @@ static PyObject *gdpy_dirfile_getcarray(struct gdpy_dirfile_t *self,
   }
 
   if (len == 0) {
-#ifdef USE_NUMPY
     if (!as_list)
       pyobj = PyArray_ZEROS(1, dims, NPY_INT, 0);
     else
-#endif
       pyobj = Py_BuildValue("[]");
   } else {
     void *data;
-#ifdef USE_NUMPY
     if (!as_list) {
       dims[0] = (npy_intp)len;
       pyobj = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type));
       data = PyArray_DATA(pyobj);
     } 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
-    {
+    else {
       PYGD_CHECK_ERROR2(self->D, NULL, free(data));
       pyobj = gdpy_convert_to_pylist(data, return_type, len);
 
@@ -466,7 +460,7 @@ static PyObject *gdpy_dirfile_getconstant(struct gdpy_dirfile_t *self,
   return pyobj;
 }
 
-static PyObject *gdpy_dirfile_carraylen(struct gdpy_dirfile_t *self,
+static PyObject *gdpy_dirfile_arraylen(struct gdpy_dirfile_t *self,
     PyObject *args, PyObject *keys)
 {
   char *keywords[] = { "field_code", NULL };
@@ -476,13 +470,13 @@ static PyObject *gdpy_dirfile_carraylen(struct gdpy_dirfile_t *self,
 
   dtrace("%p, %p, %p", self, args, keys);
 
-  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.carray_len",
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.array_len",
         keywords, &field_code)) {
     dreturn ("%p", NULL);
     return NULL;
   }
 
-  len = gd_carray_len(self->D, field_code);
+  len = gd_array_len(self->D, field_code);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -491,6 +485,22 @@ static PyObject *gdpy_dirfile_carraylen(struct gdpy_dirfile_t *self,
   return pyobj;
 }
 
+static PyObject *gdpy_dirfile_carraylen(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  PyErr_WarnEx(PyExc_DeprecationWarning, "pygetdata.dirfile.carray_len is "
+      "deprecated; use pygetdata.dirfile.array_len instead.", 1);
+
+  pyobj = gdpy_dirfile_arraylen(self, args, keys);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
 static PyObject *gdpy_dirfile_carrays(struct gdpy_dirfile_t *self,
     void *args, void *keys)
 {
@@ -500,9 +510,7 @@ static PyObject *gdpy_dirfile_carrays(struct gdpy_dirfile_t *self,
   gd_type_t return_type;
   const gd_carray_t *carrays;
   PyObject *pyobj;
-#ifdef USE_NUMPY
   npy_intp dims[] = { 0 };
-#endif
 
   dtrace("%p, %p, %p", self, args, keys);
 
@@ -523,14 +531,12 @@ static PyObject *gdpy_dirfile_carrays(struct gdpy_dirfile_t *self,
 
   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);
 
     gdpylist_append(pyobj, Py_BuildValue("sN", fields[i], pydata));
@@ -590,12 +596,10 @@ static PyObject *gdpy_dirfile_getdata(struct gdpy_dirfile_t *self,
   long int num_frames = 0, num_samples = 0;
   size_t ns;
   int as_list = 0, read_to_end = 0;
-  gd_type_t return_type;
+  gd_type_t return_type = GD_NULL;
   unsigned int spf = 1;
   PyObject *pyobj = NULL;
-#ifdef USE_NUMPY
   npy_intp dims[] = { 0 };
-#endif
 
   dtrace("%p, %p, %p", self, args, keys);
 
@@ -608,6 +612,8 @@ static PyObject *gdpy_dirfile_getdata(struct gdpy_dirfile_t *self,
     return NULL;
   }
 
+  PYGD_CHECK_ERROR(self->D, NULL);
+
   /* get return type */
   if (return_type_obj) {
     return_type = (gd_type_t)PyInt_AsLong(return_type_obj);
@@ -657,7 +663,7 @@ static PyObject *gdpy_dirfile_getdata(struct gdpy_dirfile_t *self,
     PYGD_CHECK_ERROR(self->D, NULL);
 
     if (read_to_end) {
-      num_samples = gd_nframes(self->D) * spf;
+      num_samples = gd_nframes64(self->D) * spf;
       PYGD_CHECK_ERROR(self->D, NULL);
 
       /* don't read past the frame indicated by nframes */
@@ -669,27 +675,22 @@ static PyObject *gdpy_dirfile_getdata(struct gdpy_dirfile_t *self,
   }
 
   if (num_samples == 0) {
-#ifdef USE_NUMPY
     if (!as_list)
       pyobj = PyArray_ZEROS(1, dims, gdpy_npytype_from_type(return_type), 0);
     else
-#endif
       pyobj = Py_BuildValue("[]");
   } else {
     void *data;
-#ifdef USE_NUMPY
     if (!as_list) {
       dims[0] = (npy_intp)num_samples;
       pyobj = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type));
       data = PyArray_DATA(pyobj);
     } else
-#endif
       data = malloc(num_samples * GD_SIZE(return_type));
 
-    ns = gd_getdata(self->D, field_code, first_frame, first_sample, 0, (size_t)num_samples,
-        return_type, data);
+    ns = gd_getdata64(self->D, field_code, first_frame, first_sample, 0,
+        (size_t)num_samples, return_type, data);
 
-#ifdef USE_NUMPY
     if (!as_list) {
       PYGD_CHECK_ERROR(self->D, NULL);
       /* resize, if necessary */
@@ -700,16 +701,15 @@ static PyObject *gdpy_dirfile_getdata(struct gdpy_dirfile_t *self,
         new_dims.ptr = dims;
         new_dims.len = 1;
         dims[0] = (npy_intp)ns;
-        check = PyArray_Resize((PyArrayObject*)pyobj, &new_dims, 0, NPY_ANYORDER);
+        check = PyArray_Resize((PyArrayObject*)pyobj, &new_dims, 0,
+            NPY_ANYORDER);
 
         if (check == NULL) /* error -- exception already raised */
           return NULL;
-        Py_DECREF(check); /* Despite the docs, PyArray_Resize returns an INCREF'd Py_None on
-                             success */
+        Py_DECREF(check); /* Despite the docs, PyArray_Resize returns an
+                             INCREF'd Py_None on success */
       }
-    } else
-#endif
-    {
+    } else {
       PYGD_CHECK_ERROR2(self->D, NULL, free(data));
       pyobj = gdpy_convert_to_pylist(data, return_type, ns);
 
@@ -756,7 +756,6 @@ static PyObject *gdpy_dirfile_getentry(struct gdpy_dirfile_t *self,
     return NULL;
   }
 
-
   obj = (struct gdpy_entry_t*)gdpy_entry.tp_alloc(&gdpy_entry, 0);
 
   if (obj == NULL) {
@@ -911,7 +910,7 @@ static PyObject *gdpy_dirfile_getfieldlist(struct gdpy_dirfile_t *self,
   if (type == GD_NO_ENTRY)
     fields = gd_field_list(self->D);
   else
-    fields = gd_field_list_by_type(self->D, (gd_type_t)type);
+    fields = gd_field_list_by_type(self->D, (gd_entype_t)type);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -1119,9 +1118,7 @@ static PyObject *gdpy_dirfile_mcarrays(struct gdpy_dirfile_t *self,
   gd_type_t return_type;
   const gd_carray_t *carrays;
   PyObject *pyobj;
-#ifdef USE_NUMPY
   npy_intp dims[] = { 0 };
-#endif
 
   dtrace("%p, %p, %p", self, args, keys);
 
@@ -1143,14 +1140,12 @@ static PyObject *gdpy_dirfile_mcarrays(struct gdpy_dirfile_t *self,
 
   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);
 
     gdpylist_append(pyobj, Py_BuildValue("sN", fields[i], pydata));
@@ -1233,7 +1228,7 @@ static PyObject *gdpy_dirfile_getmfieldlist(struct gdpy_dirfile_t *self,
   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);
+    fields = gd_mfield_list_by_type(self->D, parent, (gd_entype_t)type);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -1329,7 +1324,7 @@ static PyObject *gdpy_dirfile_getrawfilename(struct gdpy_dirfile_t *self,
 {
   char *keywords[] = { "field_code", NULL };
   const char *field_code;
-  const char *filename;
+  char *filename;
   PyObject *pyobj;
 
   dtrace("%p, %p, %p", self, args, keys);
@@ -1346,6 +1341,7 @@ static PyObject *gdpy_dirfile_getrawfilename(struct gdpy_dirfile_t *self,
   PYGD_CHECK_ERROR(self->D, NULL);
 
   pyobj = PyString_FromString(filename);
+  free(filename);
   dreturn("%p", pyobj);
   return pyobj;
 }
@@ -1460,12 +1456,12 @@ static PyObject *gdpy_dirfile_getnfragments(struct gdpy_dirfile_t *self,
 static PyObject *gdpy_dirfile_getnframes(struct gdpy_dirfile_t *self,
     void *closure)
 {
-  off_t nframes;
+  gd_off64_t nframes;
   PyObject *pyobj;
 
   dtrace("%p, %p", self, closure);
 
-  nframes = gd_nframes(self->D);
+  nframes = gd_nframes64(self->D);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -1496,7 +1492,7 @@ static PyObject *gdpy_dirfile_getnmfields(struct gdpy_dirfile_t *self,
   if (type == GD_NO_ENTRY)
     nmfields = gd_nmfields(self->D, parent);
   else
-    nmfields = gd_nmfields_by_type(self->D, parent, (gd_type_t)type);
+    nmfields = gd_nmfields_by_type(self->D, parent, (gd_entype_t)type);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -1538,7 +1534,7 @@ static PyObject *gdpy_dirfile_getbof(struct gdpy_dirfile_t *self,
 {
   char *keywords[] = { "field_code", NULL };
   const char *field_code;
-  off_t bof;
+  gd_off64_t bof;
   PyObject *pyobj;
 
   dtrace("%p, %p, %p", self, args, keys);
@@ -1550,7 +1546,7 @@ static PyObject *gdpy_dirfile_getbof(struct gdpy_dirfile_t *self,
     return NULL;
   }
 
-  bof = gd_bof(self->D, field_code);
+  bof = gd_bof64(self->D, field_code);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -1566,7 +1562,7 @@ static PyObject *gdpy_dirfile_geteof(struct gdpy_dirfile_t *self,
   char *keywords[] = { "field_code", NULL };
   const char *field_code;
   PyObject *pyobj;
-  off_t eof;
+  gd_off64_t eof;
 
   dtrace("%p, %p, %p", self, args, keys);
 
@@ -1577,7 +1573,7 @@ static PyObject *gdpy_dirfile_geteof(struct gdpy_dirfile_t *self,
     return NULL;
   }
 
-  eof = gd_eof(self->D, field_code);
+  eof = gd_eof64(self->D, field_code);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -1683,7 +1679,7 @@ static PyObject *gdpy_dirfile_getstring(struct gdpy_dirfile_t *self,
 
   gd_get_string(self->D, field_code, len, data);
 
-  PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+  PYGD_CHECK_ERROR(self->D, NULL);
 
   pyobj = PyString_FromString(data);
 
@@ -1770,21 +1766,18 @@ static PyObject *gdpy_dirfile_putcarray(struct gdpy_dirfile_t *self,
   unsigned int start = 0, len;
   gd_type_t type = GD_UNKNOWN;
   PyObject *pyobj;
-#ifdef USE_NUMPY
   int have_ndarray = 0;
-#endif
 
   dtrace("%p, %p, %p", self, args, keys);
 
   if (!PyArg_ParseTupleAndKeywords(args, keys,
-        "sO|iI:pygetdata.dirfile.putdata", keywords, &field_code, &pyobj,
+        "sO|iI:pygetdata.dirfile.put_carray", keywords, &field_code, &pyobj,
         &type, &start)) {
     dreturn ("%p", NULL);
     return NULL;
   }
 
   /* we only handle list or ndarray data */
-#ifdef USE_NUMPY
   if (PyArray_Check(pyobj)) {
     if (PyArray_NDIM(pyobj) != 1) {
       PyErr_SetString(PyExc_ValueError,
@@ -1794,16 +1787,11 @@ static PyObject *gdpy_dirfile_putcarray(struct gdpy_dirfile_t *self,
     }
     have_ndarray = 1;
     len = PyArray_DIM(pyobj, 0);
-  } else
-#endif
-  {
+  } else {
     if (!PyList_Check(pyobj)) {
       PyErr_SetString(PyExc_TypeError,
-          "pygetdata.dirfile.put_carray() argument 2 must be list"
-#ifdef USE_NUMPY
-          " or NumPy array"
-#endif
-          ".");
+          "pygetdata.dirfile.put_carray() argument 2 must be list or NumPy "
+          "array.");
       dreturn("%p", NULL);
       return NULL;
     }
@@ -1814,7 +1802,6 @@ static PyObject *gdpy_dirfile_putcarray(struct gdpy_dirfile_t *self,
   if (len > 0) {
     void *data;
 
-#ifdef USE_NUMPY
     if (have_ndarray) {
       type = gdpy_type_from_npytype(PyArray_TYPE(pyobj));
 
@@ -1840,9 +1827,7 @@ static PyObject *gdpy_dirfile_putcarray(struct gdpy_dirfile_t *self,
       }
 
       data = PyArray_DATA(pyobj);
-    } else
-#endif
-    {
+    } else {
       data = malloc(len * 16);
       type = gdpy_convert_from_pylist(pyobj, data, type, len);
 
@@ -1857,12 +1842,9 @@ static PyObject *gdpy_dirfile_putcarray(struct gdpy_dirfile_t *self,
 
     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
-    {
+    else {
       PYGD_CHECK_ERROR2(self->D, NULL, free(data));
 
       free(data);
@@ -1880,13 +1862,11 @@ static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self,
   char *keywords[] = { "field_code", "data", "type", "first_frame",
     "first_sample", NULL };
   const char *field_code;
-  off_t first_frame = 0, first_sample = 0;
+  PY_LONG_LONG first_frame = 0, first_sample = 0;
   gd_type_t type = GD_UNKNOWN;
   PyObject *pyobj;
   size_t ns;
-#ifdef USE_NUMPY
   int have_ndarray = 0;
-#endif
 
   dtrace("%p, %p, %p", self, args, keys);
 
@@ -1898,7 +1878,6 @@ static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self,
   }
 
   /* we only handle list or ndarray data */
-#ifdef USE_NUMPY
   if (PyArray_Check(pyobj)) {
     if (PyArray_NDIM(pyobj) != 1) {
       PyErr_SetString(PyExc_ValueError,
@@ -1908,16 +1887,11 @@ static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self,
     }
     have_ndarray = 1;
     ns = PyArray_DIM(pyobj, 0);
-  } else
-#endif
-  {
+  } else {
     if (!PyList_Check(pyobj)) {
       PyErr_SetString(PyExc_TypeError,
-          "pygetdata.dirfile.putdata() argument 2 must be list"
-#ifdef USE_NUMPY
-          " or NumPy array"
-#endif
-          ".");
+          "pygetdata.dirfile.putdata() argument 2 must be list or NumPy "
+          "array.");
       dreturn("%p", NULL);
       return NULL;
     }
@@ -1928,7 +1902,6 @@ static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self,
   if (ns > 0) {
     void *data;
 
-#ifdef USE_NUMPY
     if (have_ndarray) {
       type = gdpy_type_from_npytype(PyArray_TYPE(pyobj));
 
@@ -1954,9 +1927,7 @@ static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self,
       }
 
       data = PyArray_DATA(pyobj);
-    } else
-#endif
-    {
+    } else {
       data = malloc(ns * 16);
       type = gdpy_convert_from_pylist(pyobj, data, type, ns);
 
@@ -1969,15 +1940,12 @@ static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self,
       }
     }
 
-    ns = gd_putdata(self->D, field_code, first_frame, first_sample, 0, ns, type,
-        data);
+    ns = gd_putdata64(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
-    {
+    else {
       PYGD_CHECK_ERROR2(self->D, NULL, free(data));
 
       free(data);
@@ -2069,21 +2037,22 @@ static PyObject *gdpy_dirfile_getframenum(struct gdpy_dirfile_t *self,
   char *keywords[] = { "field_code", "value", "start", "end", NULL };
   const char *field_code;
   double value, frame;
-  off_t frame_start = 0;
-  off_t frame_end = 0;
+  PY_LONG_LONG frame_start = 0;
+  PY_LONG_LONG frame_end = 0;
   PyObject *pyobj;
 
   dtrace("%p, %p, %p", self, args, keys);
 
   if (!PyArg_ParseTupleAndKeywords(args, keys,
-        "sd|KK:pygetdata.dirfile.framenum", keywords, &field_code, &value,
+        "sd|LL:pygetdata.dirfile.framenum", keywords, &field_code, &value,
         &frame_start, &frame_end))
   {
     dreturn ("%p", NULL);
     return NULL;
   }
 
- frame = gd_framenum_subset(self->D, field_code, value, frame_start, frame_end);
+ frame = gd_framenum_subset64(self->D, field_code, value, frame_start,
+     frame_end);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -2160,20 +2129,20 @@ static PyObject *gdpy_dirfile_uninclude(struct gdpy_dirfile_t *self,
 static PyObject *gdpy_dirfile_move(struct gdpy_dirfile_t *self, PyObject *args,
     PyObject *keys)
 {
-  char *keywords[] = { "field_code", "new_fragment", "move_data", NULL };
+  char *keywords[] = { "field_code", "new_fragment", "flags", NULL };
   const char *field_code;
   int new_fragment;
-  int move_data = 0;
+  unsigned flags = 0;
 
   dtrace("%p, %p, %p", self, args, keys);
 
-  if (!PyArg_ParseTupleAndKeywords(args, keys, "si|i:pygetdata.dirfile.move",
-        keywords, &field_code, &new_fragment, &move_data)) {
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "si|I:pygetdata.dirfile.move",
+        keywords, &field_code, &new_fragment, &flags)) {
     dreturn ("%p", NULL);
     return NULL;
   }
 
-  gd_move(self->D, field_code, new_fragment, move_data);
+  gd_move(self->D, field_code, new_fragment, flags);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -2254,7 +2223,7 @@ static PyObject *gdpy_dirfile_seek(struct gdpy_dirfile_t *self, PyObject *args,
   const char *field_code;
   PY_LONG_LONG frame_num = 0, sample_num = 0;
   int flags;
-  off_t pos;
+  gd_off64_t pos;
   PyObject *pyobj;
 
   dtrace("%p, %p, %p", self, args, keys);
@@ -2266,8 +2235,7 @@ static PyObject *gdpy_dirfile_seek(struct gdpy_dirfile_t *self, PyObject *args,
     return NULL;
   }
 
-  pos = gd_seek(self->D, field_code, (off_t)frame_num, (off_t)sample_num,
-      flags);
+  pos = gd_seek64(self->D, field_code, frame_num, sample_num, flags);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -2282,7 +2250,7 @@ static PyObject *gdpy_dirfile_tell(struct gdpy_dirfile_t *self, PyObject *args,
 {
   char *keywords[] = { "field_code", NULL };
   const char *field_code;
-  off_t pos;
+  gd_off64_t pos;
   PyObject *pyobj;
 
   dtrace("%p, %p, %p", self, args, keys);
@@ -2294,7 +2262,7 @@ static PyObject *gdpy_dirfile_tell(struct gdpy_dirfile_t *self, PyObject *args,
     return NULL;
   }
 
-  pos = gd_tell(self->D, field_code);
+  pos = gd_tell64(self->D, field_code);
 
   PYGD_CHECK_ERROR(self->D, NULL);
 
@@ -2432,57 +2400,6 @@ static PyObject *gdpy_dirfile_hidden(struct gdpy_dirfile_t *self,
   return pyobj;
 }
 
-static PyObject *gdpy_dirfile_movealias(struct gdpy_dirfile_t *self,
-    PyObject *args, PyObject *keys)
-{
-  char *keywords[] = { "field_code", "new_fragment", NULL };
-  const char *field_code;
-  int new_fragment;
-
-  dtrace("%p, %p, %p", self, args, keys);
-
-  if (!PyArg_ParseTupleAndKeywords(args, keys,
-        "si:pygetdata.dirfile.move_alias", keywords, &field_code,
-        &new_fragment))
-  {
-    dreturn ("%p", NULL);
-    return NULL;
-  }
-
-  gd_move_alias(self->D, field_code, new_fragment);
-
-  PYGD_CHECK_ERROR(self->D, NULL);
-
-  Py_INCREF(Py_None);
-  dreturn("%p", Py_None);
-  return Py_None;
-}
-
-static PyObject *gdpy_dirfile_deletealias(struct gdpy_dirfile_t *self,
-    void *args, void *keys)
-{
-  char *keywords[] = {"field_code", "flags", NULL};
-  const char *field_code;
-  unsigned flags = 0;
-
-  dtrace("%p, %p, %p", self, args, keys);
-
-  if (!PyArg_ParseTupleAndKeywords(args, keys,
-        "s|I:pygetdata.dirfile.delete", keywords, &field_code, &flags))
-  {
-    dreturn("%p", NULL);
-    return NULL;
-  }
-
-  gd_delete_alias(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_aliaslist(struct gdpy_dirfile_t *self,
     void *args, void *keys)
 {
@@ -2848,7 +2765,6 @@ static PyGetSetDef gdpy_dirfile_getset[] = {
     "The reference field for the dirfile, which may be set to any existing\n"
       "RAW field.  If no RAW fields are defined in the dirfile, this will\n"
       "be None.  See gd_reference(3).",
-      /* ------- handy ruler ---------------------------------------------| */
     NULL },
   { "standards", (getter)gdpy_dirfile_getstandards,
     (setter)gdpy_dirfile_setstandards,
@@ -2978,11 +2894,16 @@ static PyMethodDef gdpy_dirfile_methods[] = {
       "See gd_constants(3), but note that this method returns both names\n"
       "and values, unlike the C API counterpart."
   },
+  {"array_len", (PyCFunction)gdpy_dirfile_arraylen, METH_VARARGS |
+    METH_KEYWORDS,
+    "array_len(field_code)\n\n"
+      "Returns the length of the CARRAY or SARRAY specified by\n"
+      "'field_code'.  See gd_array_len(3)."
+  },
   {"carray_len", (PyCFunction)gdpy_dirfile_carraylen, METH_VARARGS |
     METH_KEYWORDS,
     "carray_len(field_code)\n\n"
-      "Returns the length of the CARRAY specified by 'field_code'.  See\n"
-      "gd_carray_len(3)."
+      "This method is deprecated.  Use array_len() instead."
   },
   {"carrays", (PyCFunction)gdpy_dirfile_carrays, METH_VARARGS | METH_KEYWORDS,
     "carrays(return_type [, as_list])\n\n"
@@ -3270,12 +3191,11 @@ static PyMethodDef gdpy_dirfile_methods[] = {
       "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(field_code, new_fragment [, flags])\n\n"
       "Move the specification of the field given by 'field_code' to the\n"
-      "format file fragment indexed by 'new_fragment'.  If '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)."
+      "format file fragment indexed by 'new_fragment'.  If 'flags' is given\n"
+      "and is non-zero, it should be a bitwise or'd collection of the\n"
+      "pygetdat.REN_* symbols.  See gd_move(3)."
   },
   {"put_carray", (PyCFunction)gdpy_dirfile_putcarray,
     METH_VARARGS | METH_KEYWORDS,
@@ -3285,6 +3205,7 @@ static PyMethodDef gdpy_dirfile_methods[] = {
       "same type.  The parameter 'start' indicates where the first sample\n"
       "in which the data will be stored.  Zero is assumed if not given.\n"
       "See gd_put_carray_slice(3)."
+      /* ------- handy ruler ---------------------------------------------| */
   },
   {"put_constant", (PyCFunction)gdpy_dirfile_putconstant,
     METH_VARARGS | METH_KEYWORDS,
@@ -3335,7 +3256,7 @@ static PyMethodDef gdpy_dirfile_methods[] = {
       "If they are both omitted, the field pointer is set to sample zero.\n"
       "The 'flags' parameter must contain one of pygetdata.SEEK_SET,\n"
       "pygetdata.SEEK_CUR and pygetdata.SEEK_END, which may be bitwise or'd\n"
-      "with pygetdata.SEEK_PAD.  See gd_seek(3)."
+      "with pygetdata.SEEK_WRITE.  See gd_seek(3)."
   },
   {"set_callback", (PyCFunction)gdpy_dirfile_callback,
     METH_VARARGS | METH_KEYWORDS,
@@ -3391,21 +3312,6 @@ static PyMethodDef gdpy_dirfile_methods[] = {
       "field.  If field_code is valid, this will be at least one.  See\n"
       "gd_naliases(3)."
   },
-  {"move_alias", (PyCFunction)gdpy_dirfile_movealias,
-    METH_VARARGS | METH_KEYWORDS,
-    "move_alias(field_code, new_fragment)\n\n"
-      "This moves the alias specified by 'field_code' to the fragment\n"
-      "indexed by 'new_fragment'.  See gd_move_alias(3)."
-  },
-  {"delete_alias", (PyCFunction)gdpy_dirfile_deletealias,
-    METH_VARARGS | METH_KEYWORDS,
-    "delete_alias(field_code[, flags])\n\n"
-      "Delete the alias '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_alias(3)."
-  },
   {"alias_target", (PyCFunction)gdpy_dirfile_aliastarget,
     METH_VARARGS | METH_KEYWORDS,
     "alias_target(field_code)\n\n"
diff --git a/bindings/python/pyentry.c b/bindings/python/pyentry.c
index 19494bb..c9ced75 100644
--- a/bindings/python/pyentry.c
+++ b/bindings/python/pyentry.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2014 D. V. Wiebe
+/* Copyright (C) 2009-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,14 +37,13 @@ static const char *gdpy_entry_type_names[] =
   "RECIP_ENTRY",    /* 0x0B */
   "WINDOW_ENTRY",   /* 0x0C */
   "MPLEX_ENTRY",    /* 0x0D */
-  NULL,             /* 0x0E - unused */
-  NULL,             /* 0x0F - unused */
+  NULL,             /* 0x0E */
+  NULL,             /* 0x0F */
   "CONST_ENTRY",    /* 0x10 */
   "STRING_ENTRY",   /* 0x11 */
   "CARRAY_ENTRY",   /* 0x12 */
 };
 
-/* Entry */
 static char *gdpy_dup_pystring(PyObject *obj)
 {
   char *s;
@@ -70,6 +69,7 @@ static void gdpy_entry_delete(struct gdpy_entry_t *self)
 
   gd_free_entry_strings(self->E);
   free(self->E);
+  PyObject_Del(self);
 
   dreturnvoid();
 }
@@ -254,9 +254,9 @@ static void gdpy_set_entry_from_tuple(gd_entry_t *E, PyObject *tuple,
 
         obj = PyTuple_GetItem(parm2, i);
         if (PyComplex_Check(obj)) {
-          E->comp_scal = 1;
+          E->flags |= GD_EN_COMPSCAL;
           gdpy_as_complex(gd_csp_(E->EN(lincom,cm)[i]), obj);
-        } else if (E->comp_scal)
+        } else if (E->flags & GD_EN_COMPSCAL)
           gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
               &E->EN(lincom,cm)[i]);
         else {
@@ -272,9 +272,9 @@ static void gdpy_set_entry_from_tuple(gd_entry_t *E, PyObject *tuple,
 
         obj = PyTuple_GetItem(parm3, i);
         if (PyComplex_Check(obj)) {
-          E->comp_scal = 1;
+          E->flags |= GD_EN_COMPSCAL;
           gdpy_as_complex(gd_csp_(E->EN(lincom,cb)[i]), obj);
-        } else if (E->comp_scal)
+        } else if (E->flags & GD_EN_COMPSCAL)
           gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128,
               &E->scalar[i + GD_MAX_LINCOM], &E->EN(lincom,cb)[i]);
         else {
@@ -349,9 +349,9 @@ static void gdpy_set_entry_from_tuple(gd_entry_t *E, PyObject *tuple,
 
       obj = PyTuple_GetItem(tuple, 1);
       if (PyComplex_Check(obj)) {
-        E->comp_scal = 1;
+        E->flags |= GD_EN_COMPSCAL;
         gdpy_as_complex(gd_csp_(E->EN(recip,cdividend)), obj);
-      } else if (E->comp_scal)
+      } else if (E->flags & GD_EN_COMPSCAL)
         gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[0],
             &E->EN(recip,cdividend));
       else {
@@ -399,10 +399,10 @@ static void gdpy_set_entry_from_tuple(gd_entry_t *E, PyObject *tuple,
       for (i = 0; i <= count; ++i) {
         obj = PyTuple_GetItem(parm2, i);
         if (PyComplex_Check(obj)) {
-          E->comp_scal = 1;
+          E->flags |= GD_EN_COMPSCAL;
           gdpy_as_complex(gd_csp_(E->EN(polynom,ca)[i]), obj);
           E->scalar[i] = NULL;
-        } else if (E->comp_scal)
+        } else if (E->flags & GD_EN_COMPSCAL)
           gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
               &E->EN(polynom,ca)[i]);
         else {
@@ -659,7 +659,7 @@ static int gdpy_entry_init(struct gdpy_entry_t *self, PyObject *args,
   }
 
   /* check for valid field type */
-  if (E.field_type > 0x12 || E.field_type <= 0 ||
+  if (E.field_type > 0x13 || E.field_type <= 0 ||
       gdpy_entry_type_names[E.field_type] == NULL) {
     PyErr_SetString(PyExc_ValueError,
         "'pygetdata.entry.__init__' invalid entry type");
@@ -972,7 +972,7 @@ static PyObject *gdpy_entry_getdatatypename(struct gdpy_entry_t *self,
 
   if (t != -1) {
     sprintf(buffer, "%s%i", (t & GD_COMPLEX) ? "COMPLEX" :
-        (t & GD_IEEE754) ? "FLOAT" : (t & GD_SIGNED) ?  "INT" : "UINT",
+        (t & GD_IEEE754) ? "FLOAT" : (t & GD_SIGNED) ? "INT" : "UINT",
         8 * GD_SIZE(t));
     obj = PyString_FromString(buffer);
   }
@@ -1066,7 +1066,7 @@ static PyObject *gdpy_entry_getspf(struct gdpy_entry_t *self, void *closure)
 static int gdpy_entry_setspf(struct gdpy_entry_t *self, PyObject *value,
     void *closure)
 {
-  unsigned int spf;
+  unsigned int spf = 0;
   char *scalar;
 
   dtrace("%p, %p, %p", self, value, closure);
@@ -1102,9 +1102,9 @@ static PyObject *gdpy_entry_getarraylen(struct gdpy_entry_t *self,
 
   dtrace("%p, %p", self, closure);
 
-  if (self->E->field_type == GD_CARRAY_ENTRY)
+  if (self->E->field_type == GD_CARRAY_ENTRY) {
       obj = PyLong_FromUnsignedLong(self->E->EN(scalar,array_len));
-  else
+  } else
     PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
         "attribute 'array_len' not available for entry type %s",
         gdpy_entry_type_names[self->E->field_type]);
@@ -1211,7 +1211,8 @@ static PyObject *gdpy_entry_getm(struct gdpy_entry_t *self, void *closure)
     obj = PyTuple_New(self->E->EN(lincom,n_fields));
     for (i = 0; i < self->E->EN(lincom,n_fields); ++i)
       PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
-          (self->E->comp_scal) ?  gdpy_from_complex(self->E->EN(lincom,cm)[i]) :
+          (self->E->flags & GD_EN_COMPSCAL) ?
+          gdpy_from_complex(self->E->EN(lincom,cm)[i]) :
           PyFloat_FromDouble(self->E->EN(lincom,m)[i]) :
           PyString_FromString(self->E->scalar[i]));
   } else
@@ -1259,7 +1260,7 @@ static int gdpy_entry_setm(struct gdpy_entry_t *self, PyObject *value,
   for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
     PyObject *obj = PyTuple_GetItem(value, i);
     if (PyComplex_Check(obj)) {
-      comp_scal = 1;
+      comp_scal = GD_EN_COMPSCAL;
       gdpy_as_complex(gd_csp_(cm[i]), obj);
       m[i] = creal(cm[i]);
       scalar[i] = NULL;
@@ -1282,13 +1283,13 @@ static int gdpy_entry_setm(struct gdpy_entry_t *self, PyObject *value,
   for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
     /* check whether the corresponding cb is complex */
     if (!comp_scal && cimag(self->E->EN(lincom,cb)[i]))
-      comp_scal = 1;
+      comp_scal = GD_EN_COMPSCAL;
     gd_cs2cs_(self->E->EN(lincom,cm)[i], cm[i]);
     self->E->EN(lincom,m)[i] = m[i];
     free(self->E->scalar[i]);
     self->E->scalar[i] = scalar[i];
   }
-  self->E->comp_scal = comp_scal;
+  self->E->flags |= comp_scal;
 
   dreturn("%i", 0);
   return 0;
@@ -1305,7 +1306,8 @@ static PyObject *gdpy_entry_getb(struct gdpy_entry_t *self, void *closure)
     obj = PyTuple_New(self->E->EN(lincom,n_fields));
     for (i = 0; i < self->E->EN(lincom,n_fields); ++i)
       PyTuple_SetItem(obj, i, (self->E->scalar[i + GD_MAX_LINCOM] == NULL) ?
-          (self->E->comp_scal) ?  gdpy_from_complex(self->E->EN(lincom,cb)[i]) :
+          (self->E->flags & GD_EN_COMPSCAL) ?
+          gdpy_from_complex(self->E->EN(lincom,cb)[i]) :
           PyFloat_FromDouble(self->E->EN(lincom,b)[i]) :
           PyString_FromString(self->E->scalar[i + GD_MAX_LINCOM]));
   } else
@@ -1353,7 +1355,7 @@ static int gdpy_entry_setb(struct gdpy_entry_t *self, PyObject *value,
   for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
     PyObject *obj = PyTuple_GetItem(value, i);
     if (PyComplex_Check(obj)) {
-      comp_scal = 1;
+      comp_scal = GD_EN_COMPSCAL;
       gdpy_as_complex(gd_csp_(cb[i]), obj);
       b[i] = creal(cb[i]);
       scalar[i] = NULL;
@@ -1376,13 +1378,13 @@ static int gdpy_entry_setb(struct gdpy_entry_t *self, PyObject *value,
   for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
     /* check whether the corresponding cm is complex */
     if (!comp_scal && cimag(self->E->EN(lincom,cm)[i]))
-      comp_scal = 1;
+      comp_scal = GD_EN_COMPSCAL;
     gd_cs2cs_(self->E->EN(lincom,cb)[i], cb[i]);
     self->E->EN(lincom,b)[i] = b[i];
     free(self->E->scalar[i + GD_MAX_LINCOM]);
     self->E->scalar[i + GD_MAX_LINCOM] = scalar[i];
   }
-  self->E->comp_scal = comp_scal;
+  self->E->flags |= comp_scal;
 
   dreturn("%i", 0);
   return 0;
@@ -1457,7 +1459,7 @@ static PyObject *gdpy_entry_getbitnum(struct gdpy_entry_t *self, void *closure)
 static int gdpy_entry_setbitnum(struct gdpy_entry_t *self, PyObject *value,
     void *closure)
 {
-  int bitnum;
+  int bitnum = 0;
   char *scalar;
   dtrace("%p, %p, %p", self, value, closure);
 
@@ -1511,7 +1513,7 @@ static PyObject *gdpy_entry_getnumbits(struct gdpy_entry_t *self, void *closure)
 static int gdpy_entry_setnumbits(struct gdpy_entry_t *self, PyObject *value,
     void *closure)
 {
-  int numbits;
+  int numbits = 0;
   char *scalar;
 
   dtrace("%p, %p, %p", self, value, closure);
@@ -1551,7 +1553,7 @@ static PyObject *gdpy_entry_getdividend(struct gdpy_entry_t *self,
   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)
+    else if (self->E->flags & GD_EN_COMPSCAL)
       obj = gdpy_from_complex(self->E->EN(recip,cdividend));
     else
       obj = PyFloat_FromDouble(self->E->EN(recip,dividend));
@@ -1585,7 +1587,7 @@ static int gdpy_entry_setdividend(struct gdpy_entry_t *self, PyObject *value,
   }
 
   if (PyComplex_Check(value) || PyString_Check(value))
-    comp_scal = 1;
+    comp_scal = GD_EN_COMPSCAL;
 
   if (comp_scal) {
     gdpy_set_scalar_from_pyobj(value, GD_COMPLEX128, &scalar, &cdividend);
@@ -1600,7 +1602,7 @@ static int gdpy_entry_setdividend(struct gdpy_entry_t *self, PyObject *value,
     return -1;
   }
 
-  self->E->comp_scal = comp_scal;
+  self->E->flags |= comp_scal;
   gd_cs2cs_(self->E->EN(recip,cdividend), cdividend);
   self->E->EN(recip,dividend) = dividend;
   free(self->E->scalar[0]);
@@ -1633,7 +1635,7 @@ static PyObject *gdpy_entry_getshift(struct gdpy_entry_t *self, void *closure)
 static int gdpy_entry_setshift(struct gdpy_entry_t *self, PyObject *value,
     void *closure)
 {
-  int64_t shift;
+  int64_t shift = 0;
   char *scalar;
 
   dtrace("%p, %p, %p", self, value, closure);
@@ -1685,7 +1687,7 @@ static PyObject *gdpy_entry_getcountval(struct gdpy_entry_t *self,
 static int gdpy_entry_setcountval(struct gdpy_entry_t *self, PyObject *value,
     void *closure)
 {
-  int count_val;
+  int count_val = 0;
   char *scalar;
 
   dtrace("%p, %p, %p", self, value, closure);
@@ -1737,7 +1739,7 @@ static PyObject *gdpy_entry_getperiod(struct gdpy_entry_t *self,
 static int gdpy_entry_setperiod(struct gdpy_entry_t *self, PyObject *value,
     void *closure)
 {
-  int period;
+  int period = 0;
   char *scalar;
 
   dtrace("%p, %p, %p", self, value, closure);
@@ -1776,7 +1778,8 @@ static PyObject *gdpy_entry_geta(struct gdpy_entry_t *self, void *closure)
     obj = PyTuple_New(self->E->EN(polynom,poly_ord) + 1);
     for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i)
       PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
-          (self->E->comp_scal) ? gdpy_from_complex(self->E->EN(polynom,ca)[i]) :
+          (self->E->flags & GD_EN_COMPSCAL) ?
+          gdpy_from_complex(self->E->EN(polynom,ca)[i]) :
           PyFloat_FromDouble(self->E->EN(polynom,a)[i]) :
           PyString_FromString(self->E->scalar[i]));
   } else
@@ -1824,7 +1827,7 @@ static int gdpy_entry_seta(struct gdpy_entry_t *self, PyObject *value,
   for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) {
     PyObject *obj = PyTuple_GetItem(value, i);
     if (PyComplex_Check(obj)) {
-      comp_scal = 1;
+      comp_scal = GD_EN_COMPSCAL;
       gdpy_as_complex(gd_csp_(ca[i]), obj);
       a[i] = creal(ca[i]);
       scalar[i] = NULL;
@@ -1848,7 +1851,7 @@ static int gdpy_entry_seta(struct gdpy_entry_t *self, PyObject *value,
     free(self->E->scalar[i]);
     self->E->scalar[i] = scalar[i];
   }
-  self->E->comp_scal = comp_scal;
+  self->E->flags |= comp_scal;
 
   dreturn("%i", 0);
   return 0;
@@ -1940,7 +1943,7 @@ static PyObject *gdpy_entry_getparms(struct gdpy_entry_t *self, void *closure)
           self->E->in_fields[1]);
       break;
     case GD_RECIP_ENTRY:
-      if (self->E->comp_scal)
+      if (self->E->flags & GD_EN_COMPSCAL)
         tuple = Py_BuildValue("(sO)", self->E->in_fields[0],
             gdpy_from_complex(self->E->EN(recip,cdividend)));
       else
@@ -1953,7 +1956,7 @@ static PyObject *gdpy_entry_getparms(struct gdpy_entry_t *self, void *closure)
       break;
     case GD_POLYNOM_ENTRY:
       a = PyTuple_New(self->E->EN(polynom,poly_ord) + 1);
-      if (self->E->comp_scal)
+      if (self->E->flags & GD_EN_COMPSCAL)
         for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i)
           PyTuple_SetItem(a, i, gdpy_from_complex(self->E->EN(polynom,ca)[i]));
       else
@@ -1964,7 +1967,7 @@ static PyObject *gdpy_entry_getparms(struct gdpy_entry_t *self, void *closure)
     case GD_LINCOM_ENTRY:
       switch (self->E->EN(lincom,n_fields)) {
         case 1:
-          if (self->E->comp_scal)
+          if (self->E->flags & GD_EN_COMPSCAL)
             tuple = Py_BuildValue("((s)(O)(O))", self->E->in_fields[0],
                 gdpy_from_complex(self->E->EN(lincom,cm)[0]),
                 gdpy_from_complex(self->E->EN(lincom,cb)[0]));
@@ -1973,7 +1976,7 @@ static PyObject *gdpy_entry_getparms(struct gdpy_entry_t *self, void *closure)
                 self->E->EN(lincom,m)[0], self->E->EN(lincom,b)[0]);
           break;
         case 2:
-          if (self->E->comp_scal)
+          if (self->E->flags & GD_EN_COMPSCAL)
             tuple = Py_BuildValue("((ss)(OO)(OO))", self->E->in_fields[0],
                 self->E->in_fields[1],
                 gdpy_from_complex(self->E->EN(lincom,cm)[0]),
@@ -1987,7 +1990,7 @@ static PyObject *gdpy_entry_getparms(struct gdpy_entry_t *self, void *closure)
                 self->E->EN(lincom,b)[1]);
           break;
         case 3:
-          if (self->E->comp_scal)
+          if (self->E->flags & GD_EN_COMPSCAL)
             tuple = Py_BuildValue("((sss)(OOO)(OOO))", self->E->in_fields[0],
                 self->E->in_fields[1], self->E->in_fields[2],
                 gdpy_from_complex(self->E->EN(lincom,cm)[0]),
diff --git a/bindings/python/pyfragment.c b/bindings/python/pyfragment.c
index faca1cb..26aaab2 100644
--- a/bindings/python/pyfragment.c
+++ b/bindings/python/pyfragment.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
+/* Copyright (C) 2009-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -27,6 +27,7 @@ static void gdpy_fragment_delete(struct gdpy_fragment_t *self)
   dtrace("%p", self);
 
   Py_XDECREF(self->dirfile);
+  PyObject_Del(self);
 
   dreturnvoid();
 }
@@ -201,12 +202,12 @@ static PyObject *gdpy_fragment_rewrite(struct gdpy_fragment_t *self)
 static PyObject *gdpy_fragment_getoffset(struct gdpy_fragment_t *self,
     void *closure)
 {
-  off_t offset;
+  gd_off64_t offset;
   PyObject *pyobj;
 
   dtrace("%p, %p", self, closure);
 
-  offset = gd_frameoffset(self->dirfile->D, self->n);
+  offset = gd_frameoffset64(self->dirfile->D, self->n);
 
   PYGD_CHECK_ERROR(self->dirfile->D, NULL);
 
@@ -232,7 +233,7 @@ static PyObject *gdpy_fragment_setoffset(struct gdpy_fragment_t *self,
     return NULL;
   }
 
-  gd_alter_frameoffset(self->dirfile->D, (off_t)offset, self->n,
+  gd_alter_frameoffset64(self->dirfile->D, (gd_off64_t)offset, self->n,
       recode);
 
   PYGD_CHECK_ERROR(self->dirfile->D, NULL);
@@ -320,6 +321,7 @@ static PyObject *gdpy_fragment_getprefix(struct gdpy_fragment_t *self,
   }
 
   pyobj = PyString_FromString(prefix);
+  free(prefix);
 
   dreturn("%p", pyobj);
   return pyobj;
@@ -367,6 +369,7 @@ static PyObject *gdpy_fragment_getsuffix(struct gdpy_fragment_t *self,
   }
 
   pyobj = PyString_FromString(suffix);
+  free(suffix);
 
   dreturn("%p", pyobj);
   return pyobj;
diff --git a/bindings/python/pygetdata.c b/bindings/python/pygetdata.c
index 3f23fef..738c01d 100644
--- a/bindings/python/pygetdata.c
+++ b/bindings/python/pygetdata.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2013 D. V. Wiebe
+/* Copyright (C) 2009-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -23,18 +23,18 @@
 static PyObject *GdPy_DirfileError;
 static const char *gdpy_exception_list[GD_N_ERROR_CODES] = {
   NULL,
-  "Open",
+  NULL, /* 1 */
   "Format",
-  "Truncate",
+  NULL, /* 3 */
   "Creation",
   "BadCode",
   "BadType",
-  "RawIO",
-  "OpenFragment",
+  "IO",
+  NULL, /* 8 */
   "Internal",
   "Alloc",
   "Range",
-  "OpenLinfile",
+  "LUT",
   "RecurseLevel",
   "BadDirfile",
   "BadFieldType",
@@ -55,13 +55,33 @@ static const char *gdpy_exception_list[GD_N_ERROR_CODES] = {
   "UncleanDatabase",
   "Domain",
   "BadRepr",
-  NULL,
-  "Flush",
+  NULL, /* 33 */
+  NULL, /* 34 */
   "Bounds",
   "LineTooLong"
 };
 PyObject *gdpy_exceptions[GD_N_ERROR_CODES];
 
+/* These are unused but for backwards compatibility are defined as aliases of
+ * current exceptions */
+static struct {
+  const char *name;
+  int e;
+} gdpy_dead_exceptions[] = {
+  { "BadEndianness", GD_E_ARGUMENT },
+  { "BadProtection", GD_E_ARGUMENT },
+  { "BadVersion", GD_E_ARGUMENT },
+  { "OpenLinfile", GD_E_LUT },
+  { "Flush", GD_E_IO },
+  { "Open", GD_E_IO },
+  { "OpenFragment", GD_E_IO },
+  { "OpenFragment", GD_E_IO },
+  { "OpenInclude", GD_E_IO },
+  { "RawIO", GD_E_IO },
+  { "Trunc", GD_E_IO },
+  { NULL, 0}
+};
+
 /* Like PyList_Append, but steal the object's reference */
 int gdpylist_append(PyObject *list, PyObject *item)
 {
@@ -263,7 +283,6 @@ gd_type_t gdpy_convert_from_pylist(PyObject *value, void *data, gd_type_t type,
 }
 
 /* generic utitily functions */
-#ifdef USE_NUMPY
 gd_type_t gdpy_type_from_npytype(int npytype)
 {
   gd_type_t type;
@@ -387,7 +406,6 @@ int gdpy_npytype_from_type(gd_type_t type)
   dreturn("%i", npytype);
   return npytype;
 }
-#endif
 
 PyObject *gdpy_convert_to_pylist(const void *data, gd_type_t type, size_t ns)
 {
@@ -396,14 +414,14 @@ PyObject *gdpy_convert_to_pylist(const void *data, gd_type_t type, size_t ns)
 
   dtrace("%p, %02x, %zi", data, type, ns);
 
-  if (type != GD_NULL)
-    pyobj = PyList_New(0);
+  if (type == GD_NULL) {
+    Py_INCREF(Py_None);
+    dreturn("%p", Py_None);
+    return Py_None;
+  }
+  pyobj = 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 (gdpylist_append(pyobj, PyInt_FromLong((long)((uint8_t*)data)[i])))
@@ -468,6 +486,7 @@ PyObject *gdpy_convert_to_pylist(const void *data, gd_type_t type, size_t ns)
         if (gdpylist_append(pyobj, gdpy_from_complexp(((double*)data) + 2 * i)))
           return NULL;
       break;
+    case GD_NULL:
     case GD_UNKNOWN: /* prevent compiler warning */
       break;
   }
@@ -531,8 +550,48 @@ PyObject *gdpy_convert_to_pyobj(const void *data, gd_type_t type)
   return pyobj;
 }
 
+static PyObject *gdpy_encoding_support(struct gdpy_fragment_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "encoding", NULL };
+  unsigned long enc;
+  PyObject *pyobj;
+  int n;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "k:pygetdata.encoding_support",
+        keywords, &enc))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  n = gd_encoding_support(enc);
+
+  if (n == 0) {
+    Py_INCREF(Py_None);
+    dreturn("%p", Py_None);
+    return Py_None;
+  }
+
+  pyobj = PyInt_FromLong(n);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
 /* GetData */
 static PyMethodDef GetDataMethods[] = {
+  { "encoding_support", (PyCFunction)gdpy_encoding_support,
+    METH_VARARGS | METH_KEYWORDS, "encoding_support(encoding)\n\n"
+      "The 'encoding' parameter should be one of the pygetdata.*_ENCODED\n"
+      "symbols.  This method will return pygetdata.RDWR if the library can\n"
+      "read and write the encoding, pygetdata.RDONLY if the library can\n"
+      /* ------- handy ruler ---------------------------------------------| */
+      "only read the encodin, or None otherwise.  See\n"
+      "gd_encoding_support(3)."
+  },
   { NULL, NULL, 0, NULL }
 };
 
@@ -540,27 +599,22 @@ PyMODINIT_FUNC initpygetdata(void)
 {
   int i;
   PyObject *mod;
+  PyObject *mdict;
 
   dtracevoid();
 
   if (PyType_Ready(&gdpy_dirfile) < 0)
     return;
-  dprintf("gdpy_dirfile ready");
 
   if (PyType_Ready(&gdpy_entry) < 0)
     return;
-  dprintf("gdpy_entry ready");
 
   if (PyType_Ready(&gdpy_fragment) < 0)
     return;
-  dprintf("gdpy_fragment ready");
 
-#ifdef USE_NUMPY
   /* The following macro will cause this function to return if importing numpy
    * fails */
   import_array()
-  dprintf("imported NumPy");
-#endif
 
   mod = Py_InitModule3("pygetdata", GetDataMethods,
       "Bindings to the GetData library for Dirfile access\n\n"
@@ -612,44 +666,30 @@ PyMODINIT_FUNC initpygetdata(void)
 
   if (mod == NULL)
     return;
-  dprintf("module init");
 
   Py_INCREF(&gdpy_dirfile);
   PyModule_AddObject(mod, "dirfile", (PyObject *)&gdpy_dirfile);
-  dprintf("gdpy_dirfile added");
 
   Py_INCREF(&gdpy_entry);
   PyModule_AddObject(mod, "entry", (PyObject *)&gdpy_entry);
-  dprintf("gdpy_entry added");
 
   Py_INCREF(&gdpy_fragment);
   PyModule_AddObject(mod, "fragment", (PyObject *)&gdpy_fragment);
-  dprintf("gdpy_fragment added");
 
   /* version */
   PyModule_AddObject(mod, "__version__", Py_BuildValue("(iiis)", GETDATA_MAJOR,
         GETDATA_MINOR, GETDATA_REVISION, GETDATA_VERSION_SUFFIX));
-  dprintf(".__version__ added");
 
   /* author */
   PyModule_AddStringConstant(mod, "__author__",
-      "D. V. Wiebe <getdata at ketiltrout.net>");
-  dprintf(".__author__ added");
+      "The GetData Project <http://getdata.sourceforge.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);
-  dprintf("constants added");
 
-  PyModule_AddIntConstant(mod, "__numpy_supported__",
-#ifdef USE_NUMPY
-      1
-#else
-      0
-#endif
-      );
-  dprintf(".__numpy_supported__ added");
+  PyModule_AddIntConstant(mod, "__numpy_supported__", 1);
 
   /* add exceptions */
   GdPy_DirfileError = PyErr_NewException("pygetdata.DirfileError",
@@ -667,7 +707,17 @@ PyMODINIT_FUNC initpygetdata(void)
     } else
       gdpy_exceptions[i] = GdPy_DirfileError;
   }
-  dprintf("Exceptions added");
+
+  /* add dead exceptions -- we do this through manual dictionary editing */
+  mdict = PyModule_GetDict(mod);
+  if (mdict)
+    for (i = 0; gdpy_dead_exceptions[i].name; ++i) {
+      char name[40];
+      sprintf(name, "%sError", gdpy_dead_exceptions[i].name);
+      Py_INCREF(gdpy_exceptions[gdpy_dead_exceptions[i].e]);
+      PyDict_SetItemString(mdict, name,
+          gdpy_exceptions[gdpy_dead_exceptions[i].e]);
+    }
 
   dreturnvoid();
 }
diff --git a/bindings/python/pygetdata.h b/bindings/python/pygetdata.h
index d0cec8b..d3d66ac 100644
--- a/bindings/python/pygetdata.h
+++ b/bindings/python/pygetdata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2013 D. V. Wiebe
+/* Copyright (C) 2009-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -19,9 +19,7 @@
  * 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
@@ -85,9 +83,10 @@
       PyErr_SetString(gdpy_exceptions[e], buffer); \
       free(buffer); \
     } else \
-    PyErr_SetString(gdpy_exceptions[e], "Unspecified error"); \
+      PyErr_SetString(gdpy_exceptions[e], "Unspecified error"); \
   } while (0)
 
+
 extern PyObject *gdpy_exceptions[GD_N_ERROR_CODES];
 extern PyTypeObject gdpy_dirfile;
 extern PyTypeObject gdpy_entry;
diff --git a/bindings/python/setup.py.in b/bindings/python/setup.py.in
new file mode 100644
index 0000000..1e5bebb
--- /dev/null
+++ b/bindings/python/setup.py.in
@@ -0,0 +1,101 @@
+# Copyright (C) 2012, 2015 D. V. Wiebe
+#
+# @configure_input@
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+from distutils.core import setup
+from distutils.extension import Extension
+from distutils.command.clean import clean as clean
+from distutils.command.build import build as build
+from os.path import join
+from os.path import exists
+from os import unlink
+from shutil import copy
+
+libsrc_dir = '@top_srcdir@/src'
+libbuild_dir = '../../src'
+srcdir = '@srcdir@'
+
+#include paths
+includes = [ libbuild_dir, libsrc_dir ]
+
+import numpy
+includes.append(numpy.get_include())
+
+sources = [ 'pydirfile.c', 'pyentry.c', 'pyfragment.c', 'pygetdata.c' ]
+
+# clean copied source files in out-of-place builds; see below
+cmdclass = {}
+
+class gd_clean(clean):
+  def run(self):
+    if srcdir != '.':
+      for x in sources:
+        unlink(x)
+    clean.run(self)
+
+class gd_build(build):
+  def run(self):
+    # if we don't do this, the object files will end up in
+    #   @top_builddir@/bindings/bindings/python,
+    # instead of
+    #   @builddir@/build/temp.<whatever>
+    # like they're supposed to.  It seems to work, but it's a little crazier
+    # than we're willing to deal with.
+    for x in sources:
+      if not exists(x):
+        copy(join(srcdir, x), x)
+    build.run(self)
+
+# deal with out-of-place (VPATH) builds
+if srcdir != '.':
+  includes.append(srcdir) # to find pygetdata.h
+
+  # handle set up and clean up
+  cmdclass['build'] = gd_build
+  cmdclass['clean'] = gd_clean
+
+# now add this built source; it always ends up where distutils wants it to be
+sources.append('pyconstants.c')
+
+# add debug sources
+if @GETDATA_DEBUG@:
+  copy(join(libsrc_dir, 'debug.c'), 'debug.c') # see comment above
+  sources.append('debug.c')
+
+setup(
+    name = 'pygetdata',
+    version = '@VERSION@',
+    cmdclass = cmdclass,
+    ext_modules = [
+      Extension('pygetdata',
+        sources = sources,
+        depends = [
+          join(srcdir, 'pygetdata.h'),
+          join(libbuild_dir, 'gd_config.h'),
+          join(libbuild_dir, 'getdata.h')
+          ],
+        include_dirs = includes,
+        library_dirs = [ join(libbuild_dir, '.libs') ],
+        libraries = [ 'getdata' ],
+        define_macros = [ ('HAVE_CONFIG_H','1') ]
+        )
+      ]
+    )
diff --git a/bindings/python/test/Makefile.am b/bindings/python/test/Makefile.am
index 92e69cb..32d786f 100644
--- a/bindings/python/test/Makefile.am
+++ b/bindings/python/test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2010, 2015 D. V. Wiebe
+# Copyright (C) 2009, 2010, 2012, 2014, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -21,7 +21,7 @@
 AUTOMAKE_OPTIONS = foreign serial-tests
 
 if TEST_PYTHON
-TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=${PYTHONPATH}:../.libs/ ${PYTHON}
+TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=..:${PYTHONPATH} ${PYTHON}
 pyTESTS=callback.py big_test.py
 TESTS=$(addprefix ${srcdir}/,$(pyTESTS))
 endif
diff --git a/bindings/python/test/Makefile.in b/bindings/python/test/Makefile.in
index e257119..75d371b 100644
--- a/bindings/python/test/Makefile.in
+++ b/bindings/python/test/Makefile.in
@@ -83,10 +83,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -165,6 +163,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -190,8 +190,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -239,7 +250,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -254,12 +264,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -323,9 +337,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -333,6 +348,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -346,7 +362,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2009-2010, 2015 D. V. Wiebe
+# Copyright (C) 2009, 2010, 2012, 2014, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -367,7 +383,7 @@ top_srcdir = @top_srcdir@
 # 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 AUTOMAKE_OPTIONS = foreign serial-tests
- at TEST_PYTHON_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=${PYTHONPATH}:../.libs/ ${PYTHON}
+ at TEST_PYTHON_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=..:${PYTHONPATH} ${PYTHON}
 @TEST_PYTHON_TRUE at pyTESTS = callback.py big_test.py
 @TEST_PYTHON_TRUE at TESTS = $(addprefix ${srcdir}/,$(pyTESTS))
 EXTRA_DIST = ${pyTESTS}
diff --git a/bindings/python/test/big_test.py b/bindings/python/test/big_test.py
index 35e5b25..3726162 100644
--- a/bindings/python/test/big_test.py
+++ b/bindings/python/test/big_test.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2012 D. V. Wiebe
+# Copyright (C) 2009-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -124,1083 +124,1083 @@ file=open("dirfile/form2", 'w')
 file.write("const2 CONST INT8 -19\n")
 file.close()
 
-# 0: error check
+# 1: error check
 try:
   d = pygetdata.dirfile("x", pygetdata.RDONLY)
 except:
-  CheckException(0, pygetdata.OpenError)
+  CheckException(1, pygetdata.IOError)
 
-# 1: dirfile check
+# 2: dirfile check
 try:
   d = pygetdata.dirfile("dirfile", pygetdata.RDWR)
 except:
-  CheckOK(1)
+  CheckOK(2)
 
-# 2: getdata (int) check
+# 3: getdata (int) check
 try:
   n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1)
 except:
-  CheckOK(2)
-CheckSimple(2,len(n),8)
+  CheckOK(3)
+CheckSimple(3,len(n),8)
 if (pygetdata.__numpy_supported__):
-  CheckNumpy(2,n,numpy.arange(41,49))
+  CheckNumpy(3,n,numpy.arange(41,49))
 else:
-  CheckSimple(2,n,range(41,49))
+  CheckSimple(3,n,range(41,49))
 
-# 104: getdata (long) check
+# 6: getdata (long) check
 try:
   n = d.getdata("data", pygetdata.LONG, first_frame=5, num_frames=1)
 except:
-  CheckOK(104)
-CheckSimple(104,len(n),8)
+  CheckOK(6)
+CheckSimple(6,len(n),8)
 if (pygetdata.__numpy_supported__):
-  CheckNumpy(104,n,numpy.arange(41L,49L))
+  CheckNumpy(6,n,numpy.arange(41L,49L))
 else:
-  CheckSimple(104,n,range(41L,49L))
+  CheckSimple(6,n,range(41L,49L))
 
-# 106: getdata (float) check
+# 8: getdata (float) check
 try:
   n = d.getdata("data", pygetdata.FLOAT, first_frame=5, num_frames=1)
 except:
-  CheckOK(106)
-CheckSimple(106,len(n),8)
+  CheckOK(8)
+CheckSimple(8,len(n),8)
 if (pygetdata.__numpy_supported__):
-  CheckNumpy(106,n,numpy.arange(41.,49.))
+  CheckNumpy(8,n,numpy.arange(41.,49.))
 else:
-  CheckSimple(106,n,[41.,42.,43.,44.,45.,46.,47.,48.])
+  CheckSimple(8,n,[41.,42.,43.,44.,45.,46.,47.,48.])
 
-# 108: getdata (complex) check
+# 10: getdata (complex) check
 try:
   n = d.getdata("data", pygetdata.COMPLEX, first_frame=5, num_frames=1)
 except:
-  CheckOK(108)
-CheckSimple(108,len(n),8)
+  CheckOK(10)
+CheckSimple(10,len(n),8)
 if (pygetdata.__numpy_supported__):
-  CheckNumpy(108,n,numpy.arange(41,49,dtype=numpy.complex128))
+  CheckNumpy(10,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])
+  CheckSimple(10,n,[41.+0j,42.+0j,43.+0j,44.+0j,45.+0j,46.+0j,47.+0j,48.+0j])
 
-# 3: constant (int) check
+# 12: constant (int) check
 try:
   n = d.get_constant("const", pygetdata.INT)
 except:
-  CheckOK(3)
-CheckSimple(3,n,5)
+  CheckOK(12)
+CheckSimple(12,n,5)
 
-# 112: constant (long) check
+# 15: constant (long) check
 try:
   n = d.get_constant("const", pygetdata.LONG)
 except:
-  CheckOK(112)
-CheckSimple(112,n,5L)
+  CheckOK(15)
+CheckSimple(15,n,5L)
 
-# 114: constant (float) check
+# 17: constant (float) check
 try:
   n = d.get_constant("const", pygetdata.FLOAT)
 except:
-  CheckOK(114)
-CheckSimple(114,n,5.5)
+  CheckOK(17)
+CheckSimple(17,n,5.5)
 
-# 116: constant (float) check
+# 19: constant (float) check
 try:
   n = d.get_constant("const", pygetdata.COMPLEX)
 except:
-  CheckOK(116)
-CheckSimple(116,n,5.5+0j)
+  CheckOK(19)
+CheckSimple(19,n,5.5+0j)
 
-# 6: nfields check
+# 23: nfields check
 try:
   n = d.nfields()
 except:
-  CheckOK(6)
-CheckSimple(6,n,nfields)
+  CheckOK(23)
+CheckSimple(23,n,nfields)
 
-# 8: field_list check
+# 25: field_list check
 try:
   n = d.field_list()
 except:
-  CheckOK(8)
-CheckSimple(8,n,fields)
+  CheckOK(25)
+CheckSimple(25,n,fields)
 
-# 9: nmfields check
+# 26: nmfields check
 try:
   n = d.nmfields("data")
 except:
-  CheckOK(9)
-CheckSimple(9,n,4)
+  CheckOK(26)
+CheckSimple(26,n,4)
 
-# 10: mfield_list check
+# 27: mfield_list check
 try:
   n = d.mfield_list("data")
 except:
-  CheckOK(10)
-CheckSimple(10,n,["mstr", "mconst", "mcarray", "mlut"])
+  CheckOK(27)
+CheckSimple(27,n,["mstr", "mconst", "mcarray", "mlut"])
 
-# 11: nframes check
+# 28: nframes check
 try:
   n = d.nframes
 except:
-  CheckOK(11)
-CheckSimple(11,n,10)
+  CheckOK(28)
+CheckSimple(28,n,10)
 
-# 12: spf check
+# 29: spf check
 try:
   n = d.spf("data")
 except:
-  CheckOK(12)
-CheckSimple(12,n,8)
+  CheckOK(29)
+CheckSimple(29,n,8)
 
-# 13: putdata (int) check
+# 30: putdata (int) check
 p = [ 13, 14, 15, 16 ]
 try:
   n = d.putdata("data", p, pygetdata.INT, first_frame=5, first_sample=1)
 except:
-  CheckOK2(13,1)
-CheckSimple2(13,1,n,4)
+  CheckOK2(30,1)
+CheckSimple2(30,1,n,4)
 
 try:
   n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
 except:
-  CheckOK(13,2)
-CheckSimple2(13,2,n,[41, 13, 14, 15, 16, 46, 47, 48])
+  CheckOK(30,2)
+CheckSimple2(30,2,n,[41, 13, 14, 15, 16, 46, 47, 48])
 
-# 119: putdata (numpy) check
+# 32: putdata (numpy) check
 if (pygetdata.__numpy_supported__):
   p = numpy.array([ 73, 74, 75, 76 ])
   try:
     n = d.putdata("data", p, first_frame=5, first_sample=1)
   except:
-    CheckOK2(13,1)
-  CheckSimple2(13,1,n,4)
+    CheckOK2(32,1)
+  CheckSimple2(32,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]))
+    CheckOK(32,2)
+  CheckNumpy2(32,2,n,numpy.array([41, 73, 74, 75, 76, 46, 47, 48]))
 
-# 120: putdata (long) check
+# 33: putdata (long) check
 p = [ 23L, 24L, 25L, 26L ]
 try:
   n = d.putdata("data", p, pygetdata.LONG, first_frame=5, first_sample=1)
 except:
-  CheckOK2(120,1)
-CheckSimple2(120,1,n,4)
+  CheckOK2(33,1)
+CheckSimple2(33,1,n,4)
 
 try:
   n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
 except:
-  CheckOK(120,2)
-CheckSimple2(120,2,n,[41, 23, 24, 25, 26, 46, 47, 48])
+  CheckOK(33,2)
+CheckSimple2(33,2,n,[41, 23, 24, 25, 26, 46, 47, 48])
 
-# 122: putdata (float) check
+# 35: putdata (float) check
 p = [ 33., 34., 35., 36. ]
 try:
   n = d.putdata("data", p, pygetdata.FLOAT, first_frame=5, first_sample=1)
 except:
-  CheckOK2(122,1)
-CheckSimple2(122,1,n,4)
+  CheckOK2(35,1)
+CheckSimple2(35,1,n,4)
 
 try:
   n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
 except:
-  CheckOK(122,2)
-CheckSimple2(122,2,n,[41, 33, 34, 35, 36, 46, 47, 48])
+  CheckOK(35,2)
+CheckSimple2(35,2,n,[41, 33, 34, 35, 36, 46, 47, 48])
 
-# 124: putdata (complex) check
+# 37: putdata (complex) check
 p = [ 124.+1j, 125.+2j, 126.+3j, 127.+4j ]
 try:
   n = d.putdata("data", p, pygetdata.COMPLEX, first_frame=5, first_sample=1)
 except:
-  CheckOK2(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, 124, 125, 126, 127, 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)
+  CheckOK2(37,1)
+CheckSimple2(37,1,n,4)
 
 try:
   n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
 except:
-  CheckOK2(136,2)
-CheckSimple2(136,2,n,[41, 53, 54, 55, 56, 46, 47, 48])
+  CheckOK2(37,2)
+CheckSimple2(37,2,n,[41, 124, 125, 126, 127, 46, 47, 48])
 
-# 14: error_string check
+# 38: 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")
+  CheckException(38,pygetdata.BadCodeError)
+  CheckSimple(38,d.error_string,"Field not found: x")
 
-# 16: entry (raw) check
+# 40: 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)
+  CheckOK(40)
+CheckSimple2(40,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(40,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(40,3,ent.fragment,0)
+CheckSimple2(40,4,ent.data_type,pygetdata.INT8)
+CheckSimple2(40,5,ent.data_type_name,"INT8")
+CheckSimple2(40,6,ent.spf,8)
 
-# 18: entry (lincom) check
+# 42: 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"))
+  CheckOK(42)
+CheckSimple2(42,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(42,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(42,3,ent.fragment,0)
+CheckSimple2(42,4,ent.n_fields,3)
+CheckSimple2(42,5,ent.in_fields,( "data", "INDEX", "linterp" ))
+CheckSimple2(42,6,ent.m,(1.1, 2.2, "const"))
+CheckSimple2(42,7,ent.b,(2.2, 3.3 + 4.4j, "const"))
 
-# 20: entry (polynom) check
+# 44: 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"))
+  CheckOK(44)
+CheckSimple2(44,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(44,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(44,3,ent.fragment,0)
+CheckSimple2(44,4,ent.poly_ord,5)
+CheckSimple2(44,5,ent.in_fields,( "data", ))
+CheckSimple2(44,6,ent.a,(1.1, 2.2, 2.2, 3.3 + 4.4j, "const", "const"))
 
-# 21: entry (linterp) check
+# 45: 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,"./lut")
+  CheckOK(45)
+CheckSimple2(45,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(45,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(45,3,ent.fragment,0)
+CheckSimple2(45,4,ent.in_fields,( "data", ))
+CheckSimple2(45,5,ent.table,"./lut")
 
-# 22: entry (bit) check
+# 46: 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)
+  CheckOK(46)
+CheckSimple2(46,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(46,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(46,3,ent.fragment,0)
+CheckSimple2(46,4,ent.in_fields,( "data", ))
+CheckSimple2(46,5,ent.numbits,4)
+CheckSimple2(46,6,ent.bitnum,3)
 
-# 23: entry (sbit) check
+# 47: 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)
+  CheckOK(47)
+CheckSimple2(47,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(47,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(47,3,ent.fragment,0)
+CheckSimple2(47,4,ent.in_fields,( "data", ))
+CheckSimple2(47,5,ent.numbits,6)
+CheckSimple2(47,6,ent.bitnum,5)
 
-# 24: entry (mult) check
+# 48: 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"))
+  CheckOK(48)
+CheckSimple2(48,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(48,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(48,3,ent.fragment,0)
+CheckSimple2(48,4,ent.in_fields,( "data", "sbit"))
 
-# 25: entry (phase) check
+# 49: 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)
+  CheckOK(49)
+CheckSimple2(49,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(49,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(49,3,ent.fragment,0)
+CheckSimple2(49,4,ent.in_fields,( "data", ))
+CheckSimple2(49,5,ent.shift,11)
 
-# 26: entry (const) check
+# 50: 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")
+  CheckOK(50)
+CheckSimple2(50,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(50,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(50,3,ent.fragment,0)
+CheckSimple2(50,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(50,5,ent.data_type_name,"FLOAT64")
 
-# 134: entry (string) check
+# 51: 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)
+  CheckOK(51)
+CheckSimple2(51,1,ent.field_type,pygetdata.STRING_ENTRY)
+CheckSimple2(51,2,ent.field_type_name,"STRING_ENTRY")
+CheckSimple2(51,3,ent.fragment,0)
 
-# 27: fragment_index check
+# 52: fragment_index check
 try:
   n = d.fragment_index("data")
 except:
-  CheckOK(27)
-CheckSimple(27,n,0)
+  CheckOK(52)
+CheckSimple(52,n,0)
 
-# 28: add / entry (raw) check
+# 53: add / entry (raw) check
 ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0, (pygetdata.FLOAT64, 3))
 try:
   d.add(ent)
 except:
-  CheckOK2(28,1)
+  CheckOK2(53,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)
+  CheckOK(53,2)
+CheckSimple2(53,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(53,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(53,3,ent.fragment,0)
+CheckSimple2(53,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(53,5,ent.data_type_name,"FLOAT64")
+CheckSimple2(53,6,ent.spf,3)
 
-# 29: add / entry (lincom) check
+# 54: add / entry (lincom) check
 ent = pygetdata.entry(pygetdata.LINCOM_ENTRY, "new2", 0,
     (("in1", "in2"), (9.9, 7.7), (8.8, 6.6)))
 try:
   d.add(ent)
 except:
-  CheckOK2(29,1)
+  CheckOK2(54,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))
+  CheckOK(54,2)
+CheckSimple2(54,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(54,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(54,3,ent.fragment,0)
+CheckSimple2(54,4,ent.n_fields,2)
+CheckSimple2(54,5,ent.in_fields,( "in1", "in2" ))
+CheckSimple2(54,6,ent.m,(9.9, 7.7))
+CheckSimple2(54,7,ent.b,(8.8, 6.6))
 
-# 31: add / entry (polynom) check
+# 56: add / entry (polynom) check
 ent = pygetdata.entry(pygetdata.POLYNOM_ENTRY, "new4", 0,
     ("in1", (3.9, 4.8, 5.7, 6.6)))
 try:
   d.add(ent)
 except:
-  CheckOK2(31,1)
+  CheckOK2(56,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))
+  CheckOK2(56,2)
+CheckSimple2(56,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(56,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(56,3,ent.fragment,0)
+CheckSimple2(56,4,ent.poly_ord,3)
+CheckSimple2(56,5,ent.in_fields,( "in1", ))
+CheckSimple2(56,6,ent.a,(3.9, 4.8, 5.7, 6.6))
 
-# 33: add / entry (linterp) check
+# 58: add / entry (linterp) check
 ent = pygetdata.entry(pygetdata.LINTERP_ENTRY, "new6", 0,
     ("in", "./some/table"))
 try:
   d.add(ent)
 except:
-  CheckOK2(33,1)
+  CheckOK2(58,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")
+  CheckOK2(58,2)
+CheckSimple2(58,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(58,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(58,3,ent.fragment,0)
+CheckSimple2(58,4,ent.in_fields,( "in", ))
+CheckSimple2(58,5,ent.table,"./some/table")
 
-# 34: add / entry (bit) check
+# 59: add / entry (bit) check
 ent = pygetdata.entry(pygetdata.BIT_ENTRY, "new7", 0, ("in", 13, 12))
 try:
   d.add(ent)
 except:
-  CheckOK2(34,1)
+  CheckOK2(59,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)
+  CheckOK2(59,1)
+CheckSimple2(59,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(59,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(59,3,ent.fragment,0)
+CheckSimple2(59,4,ent.in_fields,( "in", ))
+CheckSimple2(59,5,ent.numbits,12)
+CheckSimple2(59,6,ent.bitnum,13)
 
-# 35: add / entry (sbit) check
+# 60: add / entry (sbit) check
 ent = pygetdata.entry(pygetdata.SBIT_ENTRY, "new8", 0, ("in2", 14, 15))
 try:
   d.add(ent)
 except:
-  CheckOK2(35,1)
+  CheckOK2(60,1)
 
 try:
   ent = d.entry("new8")
 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,( "in2", ))
-CheckSimple2(35,5,ent.bitnum,14)
-CheckSimple2(35,6,ent.numbits,15)
-
-# 36: add / entry (mult) check
+  CheckOK2(60,2)
+CheckSimple2(60,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(60,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(60,3,ent.fragment,0)
+CheckSimple2(60,4,ent.in_fields,( "in2", ))
+CheckSimple2(60,5,ent.bitnum,14)
+CheckSimple2(60,6,ent.numbits,15)
+
+# 61: add / entry (mult) check
 ent = pygetdata.entry(pygetdata.MULTIPLY_ENTRY, "new9", 0, ("in1", "in2"))
 try:
   d.add(ent)
 except:
-  CheckOK2(36,1)
+  CheckOK2(61,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"))
+  CheckOK2(61,2)
+CheckSimple2(61,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(61,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(61,3,ent.fragment,0)
+CheckSimple2(61,4,ent.in_fields,( "in1", "in2"))
 
-# 37: add / entry (phase) check
+# 62: add / entry (phase) check
 ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "new10", 0, ("in1", 22))
 try:
   d.add(ent)
 except:
-  CheckOK2(37,1)
+  CheckOK2(62,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)
+  CheckOK2(62,2)
+CheckSimple2(62,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(62,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(62,3,ent.fragment,0)
+CheckSimple2(62,4,ent.in_fields,( "in1", ))
+CheckSimple2(62,5,ent.shift,22)
 
-# 38: add / entry (const) check
+# 63: add / entry (const) check
 ent = pygetdata.entry(pygetdata.CONST_ENTRY, "new11", 0, (pygetdata.FLOAT64,))
 try:
   d.add(ent)
 except:
-  CheckOK2(38,1)
+  CheckOK2(63,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")
+  CheckOK2(63,2)
+CheckSimple2(63,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(63,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(63,3,ent.fragment,0)
+CheckSimple2(63,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(63,5,ent.data_type_name,"FLOAT64")
 
-# 39: fragment check
+# 64: fragment check
 try:
   f = d.fragment(0)
 except:
-  CheckOK(39)
-CheckEOS(39,f.name,"dirfile/format")
+  CheckOK(64)
+CheckEOS(64,f.name,"dirfile/format")
 
-# 40: nfragments check
+# 65: nfragments check
 try:
   n  = d.nfragments
 except:
-  CheckOK(40)
-CheckSimple(40,n,1)
+  CheckOK(65)
+CheckSimple(65,n,1)
 
-# 41: include check
+# 66: include check
 try:
   n = d.include("form2")
 except:
-  CheckOK2(41,1)
-CheckSimple2(41,1,n,1)
+  CheckOK2(66,1)
+CheckSimple2(66,1,n,1)
 
 try:
   n = d.get_constant("const2", pygetdata.INT)
 except:
-  CheckOK2(41,2)
-CheckSimple2(41,2,n,-19)
+  CheckOK2(66,2)
+CheckSimple2(66,2,n,-19)
 
-# 42: nfields_by_type check
+# 67: nfields_by_type check
 try:
   n = d.nfields(pygetdata.LINCOM_ENTRY)
 except:
-  CheckOK(42)
-CheckSimple(42,n,2)
+  CheckOK(67)
+CheckSimple(67,n,2)
 
-# 43: field_list_by_type check
+# 68: field_list_by_type check
 try:
   n = d.field_list(pygetdata.LINCOM_ENTRY)
 except:
-  CheckOK(43)
-CheckSimple(43,n,["lincom", "new2"])
+  CheckOK(68)
+CheckSimple(68,n,["lincom", "new2"])
 
-# 44: nvectors check
+# 69: nvectors check
 try:
   n = d.nvectors()
 except:
-  CheckOK(44)
-CheckSimple(44,n,22)
+  CheckOK(69)
+CheckSimple(69,n,22)
 
-# 45: field_list check
+# 70: field_list check
 try:
   n = d.vector_list()
 except:
-  CheckOK(45)
-CheckSimple(45,n,['INDEX', 'alias', 'bit', 'data', 'div', 'lincom', 'linterp',
+  CheckOK(70)
+CheckSimple(70,n,['INDEX', 'alias', 'bit', 'data', 'div', 'lincom', 'linterp',
   'mplex', 'mult', 'new1', 'new10', 'new2', 'new4', 'new6', 'new7', 'new8',
   'new9', 'phase', 'polynom', 'recip', 'sbit', 'window'])
 
-# 46: add / entry (lincom) check
+# 71: add / entry (lincom) check
 ent = pygetdata.entry(pygetdata.LINCOM_ENTRY, "mnew1", 0,
     {"in_fields": ("in1", "in2"), "m": (9.9, 7.7), "b": (8.8, 6.6)})
 try:
   d.madd(ent, "data")
 except:
-  CheckOK2(46,1)
+  CheckOK2(71,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))
+  CheckOK(71,2)
+CheckSimple2(71,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(71,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(71,3,ent.fragment,0)
+CheckSimple2(71,4,ent.n_fields,2)
+CheckSimple2(71,5,ent.in_fields,( "in1", "in2" ))
+CheckSimple2(71,6,ent.m,(9.9, 7.7))
+CheckSimple2(71,7,ent.b,(8.8, 6.6))
 
-# 48: add / entry (polynom) check
+# 73: add / entry (polynom) check
 ent = pygetdata.entry(pygetdata.POLYNOM_ENTRY, "mnew3", 0,
     {"in_field": "in1", "a": (3.9, 4.8, 5.7, 6.6)})
 try:
   d.madd(ent, "data")
 except:
-  CheckOK2(48,1)
+  CheckOK2(73,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))
+  CheckOK2(73,2)
+CheckSimple2(73,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(73,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(73,3,ent.fragment,0)
+CheckSimple2(73,4,ent.poly_ord,3)
+CheckSimple2(73,5,ent.in_fields,( "in1", ))
+CheckSimple2(73,6,ent.a,(3.9, 4.8, 5.7, 6.6))
 
-# 50: add / entry (linterp) check
+# 75: add / entry (linterp) check
 ent = pygetdata.entry(pygetdata.LINTERP_ENTRY, "mnew6", 0,
     {"in_field": "in", "table": "./more/table"})
 try:
   d.madd(ent, "data")
 except:
-  CheckOK2(50,1)
+  CheckOK2(75,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")
+  CheckOK2(75,2)
+CheckSimple2(75,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(75,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(75,3,ent.fragment,0)
+CheckSimple2(75,4,ent.in_fields,( "in", ))
+CheckSimple2(75,5,ent.table,"./more/table")
 
-# 51: add / entry (bit) check
+# 76: add / entry (bit) check
 ent = pygetdata.entry(pygetdata.BIT_ENTRY, "mnew7", 0,
     {"in_field": "in1", "bitnum": 3, "numbits": 2})
 try:
   d.madd(ent,"data")
 except:
-  CheckOK2(51,1)
+  CheckOK2(76,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)
+  CheckOK2(76,1)
+CheckSimple2(76,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(76,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(76,3,ent.fragment,0)
+CheckSimple2(76,4,ent.in_fields,( "in1", ))
+CheckSimple2(76,5,ent.numbits,2)
+CheckSimple2(76,6,ent.bitnum,3)
 
-# 52: add / entry (sbit) check
+# 77: add / entry (sbit) check
 ent = pygetdata.entry(pygetdata.SBIT_ENTRY, "mnew8", 0,
     {"in_field": "in2", "bitnum": 4, "numbits": 5})
 try:
   d.madd(ent,"data")
 except:
-  CheckOK2(52,1)
+  CheckOK2(77,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)
+  CheckOK2(77,2)
+CheckSimple2(77,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(77,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(77,3,ent.fragment,0)
+CheckSimple2(77,4,ent.in_fields,( "in2", ))
+CheckSimple2(77,5,ent.numbits,5)
+CheckSimple2(77,6,ent.bitnum,4)
 
-# 53: add / entry (mult) check
+# 78: add / entry (mult) check
 ent = pygetdata.entry(pygetdata.MULTIPLY_ENTRY, "mnew9", 0,
     {"in_field1": "in3", "in_field2": "in2"})
 try:
   d.madd(ent,"data")
 except:
-  CheckOK2(53,1)
+  CheckOK2(78,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"))
+  CheckOK2(78,2)
+CheckSimple2(78,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(78,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(78,3,ent.fragment,0)
+CheckSimple2(78,4,ent.in_fields,( "in3", "in2"))
 
-# 54: add / entry (phase) check
+# 79: add / entry (phase) check
 ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "mnew10", 0,
     {"in_field": "in3", "shift": 44})
 try:
   d.madd(ent,"data")
 except:
-  CheckOK2(54,1)
+  CheckOK2(79,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)
+  CheckOK2(79,2)
+CheckSimple2(79,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(79,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(79,3,ent.fragment,0)
+CheckSimple2(79,4,ent.in_fields,( "in3", ))
+CheckSimple2(79,5,ent.shift,44)
 
-# 55: add / entry (const) check
+# 80: add / entry (const) check
 ent = pygetdata.entry(pygetdata.CONST_ENTRY, "mnew11", 0,
     {"type": pygetdata.FLOAT64})
 try:
   d.madd(ent,"data")
 except:
-  CheckOK2(55,1)
+  CheckOK2(80,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")
+  CheckOK2(80,2)
+CheckSimple2(80,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(80,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(80,3,ent.fragment,0)
+CheckSimple2(80,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(80,5,ent.data_type_name,"FLOAT64")
 
-#56: string check
+#81: string check
 try:
   n = d.get_string("string")
 except:
-  CheckOK(56)
-CheckSimple(56,n,"Zaphod Beeblebrox")
+  CheckOK(81)
+CheckSimple(81,n,"Zaphod Beeblebrox")
 
-# 57: entry (string) check
+# 82: entry (string) check
 ent = pygetdata.entry(pygetdata.STRING_ENTRY, "new12", 0)
 try:
   d.add(ent)
 except:
-  CheckOK2(57,1)
+  CheckOK2(82,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)
+  CheckOK(82)
+CheckSimple2(82,1,ent.field_type,pygetdata.STRING_ENTRY)
+CheckSimple2(82,2,ent.field_type_name,"STRING_ENTRY")
+CheckSimple2(82,3,ent.fragment,0)
 
-# 59: add_spec check
+# 84: add_spec check
 try:
   d.add_spec("lorem STRING \"Lorem ipsum\"", 0)
 except:
-  CheckOK2(58,1)
+  CheckOK2(84,1)
 
 try:
   n = d.get_string("lorem")
 except:
-  CheckOK2(59,2)
-CheckSimple(59,n,"Lorem ipsum")
+  CheckOK2(84,2)
+CheckSimple(84,n,"Lorem ipsum")
 
-# 60: madd_spec check
+# 85: madd_spec check
 try:
   d.madd_spec("ipsum STRING \"dolor sit amet.\"", "lorem")
 except:
-  CheckOK2(60,1)
+  CheckOK2(85,1)
 
 try:
   n = d.get_string("lorem/ipsum")
 except:
-  CheckOK2(60,2)
-CheckSimple(60,n,"dolor sit amet.")
+  CheckOK2(85,2)
+CheckSimple(85,n,"dolor sit amet.")
 
-# 61: put_constant / int check
+# 86: put_constant / int check
 try:
-  d.put_constant("const", 61)
+  d.put_constant("const", 86)
 except:
-  CheckOK2(61,1)
+  CheckOK2(86,1)
 
 try:
   n = d.get_constant("const",pygetdata.INT)
 except:
-  CheckOK2(61,2)
-CheckSimple(61,n,61)
+  CheckOK2(86,2)
+CheckSimple(86,n,86)
 
-# 128: put_constant / int check
+# 88: put_constant / int check
 try:
   d.put_constant("const", 128L)
 except:
-  CheckOK2(128,1)
+  CheckOK2(88,1)
 
 try:
   n = d.get_constant("const",pygetdata.ULONG)
 except:
-  CheckOK2(128,2)
-CheckSimple(128,n,128L)
+  CheckOK2(88,2)
+CheckSimple(88,n,128L)
 
-# 129: put_constant / int check
+# 89: put_constant / int check
 try:
-  d.put_constant("const", 129L)
+  d.put_constant("const", 89L)
 except:
-  CheckOK2(129,1)
+  CheckOK2(89,1)
 
 try:
   n = d.get_constant("const",pygetdata.LONG)
 except:
-  CheckOK2(129,2)
-CheckSimple(129,n,129L)
+  CheckOK2(89,2)
+CheckSimple(89,n,89L)
 
-# 131: put_constant / float check
+# 91: put_constant / float check
 try:
-  d.put_constant("const", 131.)
+  d.put_constant("const", 91.)
 except:
-  CheckOK2(131,1)
+  CheckOK2(91,1)
 
 try:
   n = d.get_constant("const",pygetdata.FLOAT)
 except:
-  CheckOK2(131,2)
-CheckSimple(131,n,131.)
+  CheckOK2(91,2)
+CheckSimple(91,n,91.)
 
-# 133: put_constant / complex check
+# 93: put_constant / complex check
 try:
-  d.put_constant("const", 133.+0j)
+  d.put_constant("const", 93.+0j)
 except:
-  CheckOK2(133,1)
+  CheckOK2(93,1)
 
 try:
   n = d.get_constant("const",pygetdata.COMPLEX)
 except:
-  CheckOK2(133,2)
-CheckSimple(133,n,133.+0j)
+  CheckOK2(93,2)
+CheckSimple(93,n,93.+0j)
 
-# 62: put_string
+# 94: put_string
 try:
   d.put_string("string", "Arthur Dent")
 except:
-  CheckOK2(62,1)
+  CheckOK2(94,1)
 
 try:
   n = d.get_string("string")
 except:
-  CheckOK2(62,2)
-CheckSimple(62,n,"Arthur Dent")
+  CheckOK2(94,2)
+CheckSimple(94,n,"Arthur Dent")
 
-# 63: nmfields_by_type check
+# 95: nmfields_by_type check
 try:
   n = d.nmfields("data",pygetdata.LINCOM_ENTRY)
 except:
-  CheckOK(63)
-CheckSimple(63,n,1)
+  CheckOK(95)
+CheckSimple(95,n,1)
 
-# 64: mfield_list_by_type check
+# 96: mfield_list_by_type check
 try:
   n = d.mfield_list("data",pygetdata.LINCOM_ENTRY)
 except:
-  CheckOK(64)
-CheckSimple(64,n,["mnew1"])
+  CheckOK(96)
+CheckSimple(96,n,["mnew1"])
 
-# 65: nmvectors check
+# 97: nmvectors check
 try:
   n = d.nmvectors("data")
 except:
-  CheckOK(65)
-CheckSimple(65,n,8)
+  CheckOK(97)
+CheckSimple(97,n,8)
 
-# 66: mvector_list check
+# 98: mvector_list check
 try:
   n = d.mvector_list("data")
 except:
-  CheckOK(66)
-CheckSimple(66,n,['mlut', 'mnew1', 'mnew3', 'mnew6', 'mnew7', 'mnew8', 'mnew9',
+  CheckOK(98)
+CheckSimple(98,n,['mlut', 'mnew1', 'mnew3', 'mnew6', 'mnew7', 'mnew8', 'mnew9',
   'mnew10'])
 
-# 67: alter / raw check
+# 99: alter / raw check
 ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0,
     {"type": pygetdata.FLOAT32, "spf": 4})
 try:
   n = d.alter("new1", ent)
 except:
-  CheckOK2(67,1)
+  CheckOK2(99,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)
+  CheckOK(99,2)
+CheckSimple2(99,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(99,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(99,3,ent.fragment,0)
+CheckSimple2(99,4,ent.data_type,pygetdata.FLOAT32)
+CheckSimple2(99,5,ent.data_type_name,"FLOAT32")
+CheckSimple2(99,6,ent.spf,4)
 
-# 78: encoding check
+# 110: encoding check
 try:
   f = d.fragment(0)
-  CheckSimple(78,f.encoding,pygetdata.UNENCODED)
+  CheckSimple(110,f.encoding,pygetdata.UNENCODED)
 except:
-  CheckOK(78)
+  CheckOK(110)
 
-# 79: endianness check
+# 111: endianness check
 try:
-  CheckSimple(79,f.endianness,pygetdata.LITTLE_ENDIAN |
+  CheckSimple(111,f.endianness,pygetdata.LITTLE_ENDIAN |
 		  pygetdata.NOT_ARM_ENDIAN)
 except:
-  CheckOK(79)
+  CheckOK(111)
 
-# 80: dirfilename check
+# 112: dirfilename check
 try:
-  CheckEOS(80,d.name,"dirfile")
+  CheckEOS(112,d.name,"dirfile")
 except:
-  CheckOK(80)
+  CheckOK(112)
 
-# 81: parent_fragment check
+# 113: parent_fragment check
 try:
   f = d.fragment(1)
-  CheckSimple(81,f.parent,0)
+  CheckSimple(113,f.parent,0)
 except:
-  CheckOK(81)
+  CheckOK(113)
 
-# 82: dirfile_protect check
+# 114: dirfile_protect check
 try:
   f.protection = pygetdata.PROTECT_DATA
 except:
-  CheckOK(82)
+  CheckOK(114)
   
-# 83: protection check
+# 115: protection check
 try:
   f = d.fragment(1)
-  CheckSimple(83,f.protection,pygetdata.PROTECT_DATA)
+  CheckSimple(115,f.protection,pygetdata.PROTECT_DATA)
 except:
-  CheckOK(83)
+  CheckOK(115)
 
-# 84: raw_filename check
+# 116: raw_filename check
 try:
   n = d.raw_filename("data")
 except:
-  CheckOK(84)
-CheckEOS(84,n,"dirfile/data")
+  CheckOK(116)
+CheckEOS(116,n,"dirfile/data")
 
-# 85: reference check
+# 117: reference check
 try:
   d.reference = "new1"
 except:
-  CheckOK2(85,1)
+  CheckOK2(117,1)
 
 try:
-  CheckSimple(85,d.reference,"new1")
+  CheckSimple(117,d.reference,"new1")
 except:
-  CheckOK2(85,2)
+  CheckOK2(117,2)
 
-# 87: alter_encoding check
+# 118: eof check
+try:
+  n = d.eof("lincom")
+except:
+  CheckOK(118)
+CheckSimple(118,n,80)
+
+# 119: alter_encoding check
 try:
   f = d.fragment(1)
   f.alter_encoding(pygetdata.SLIM_ENCODED,0)
 except:
-  CheckOK(87)
+  CheckOK(119)
 
-# 88: alter_endianness check
+# 120: alter_endianness check
 try:
   f.alter_endianness(pygetdata.BIG_ENDIAN,0)
 except:
-  CheckOK(88)
+  CheckOK(120)
 
-# 89: alter_spec check
+# 121: alter_spec check
 try:
   d.alter_spec("new10 PHASE in5 3", 0)
 except:
-  CheckOK2(89,1)
+  CheckOK2(121,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)
+  CheckOK2(121,2)
+CheckSimple2(121,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(121,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(121,3,ent.fragment,0)
+CheckSimple2(121,4,ent.in_fields,( "in5", ))
+CheckSimple2(121,5,ent.shift,3)
 
-# 90: delete check
+# 122: delete check
 try:
   d.delete("new10",0)
 except:
-  CheckOK2(90,1)
+  CheckOK2(122,1)
 
 try:
   ent = d.entry("new10")
 except:
-  CheckException2(90,2,pygetdata.BadCodeError)
+  CheckException2(122,2,pygetdata.BadCodeError)
 
-# 91: malter_spec check
+# 123: malter_spec check
 try:
   d.malter_spec("mnew10 PHASE in4 11", "data", 0)
 except:
-  CheckOK2(91,1)
+  CheckOK2(123,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)
+  CheckOK2(123,2)
+CheckSimple2(123,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(123,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(123,3,ent.fragment,0)
+CheckSimple2(123,4,ent.in_fields,( "in4", ))
+CheckSimple2(123,5,ent.shift,11)
 
-# 92: move check
+# 124: move check
 try:
   d.move("new9", 1, 0)
 except:
-  CheckOK2(92,1)
+  CheckOK2(124,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"))
+  CheckOK2(124,2)
+CheckSimple2(124,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(124,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(124,3,ent.fragment,1)
+CheckSimple2(124,4,ent.in_fields,( "in1", "in2"))
 
-# 93: rename check
+# 125: rename check
 try:
   d.rename("new9", "newer", 0)
 except:
-  CheckOK2(93,1)
+  CheckOK2(125,1)
 
 try:
   ent = d.entry("new9")
 except:
-  CheckException2(93,2,pygetdata.BadCodeError)
+  CheckException2(125,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"))
+  CheckOK2(125,3)
+CheckSimple2(125,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(125,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(125,3,ent.fragment,1)
+CheckSimple2(125,4,ent.in_fields,( "in1", "in2"))
 
-# 94: uninclude check
+# 126: uninclude check
 try:
   d.uninclude(1,0)
 except:
-  CheckOK2(94,1)
+  CheckOK2(126,1)
 
 try:
   ent = d.entry("newer")
 except:
-  CheckException2(93,2,pygetdata.BadCodeError)
+  CheckException2(126,2,pygetdata.BadCodeError)
 
-# 95: frameoffset check
+# 127: frameoffset check
 try:
   f = d.fragment(0)
-  CheckSimple(95,f.frameoffset,0)
+  CheckSimple(127,f.frameoffset,0)
 except:
-  CheckOK(95)
+  CheckOK(127)
 
-# 96: alter_frameoffset check
+# 128: alter_frameoffset check
 try:
   f.alter_frameoffset(33, 0)
-  CheckSimple(96,f.frameoffset,33)
+  CheckSimple(128,f.frameoffset,33)
 except:
-  CheckOK(96)
+  CheckOK(128)
 
-# 97: native_type check
+# 129: native_type check
 try:
   n = d.native_type("data")
 except:
-  CheckOK(97)
-CheckSimple(97,n,pygetdata.INT8)
+  CheckOK(129)
+CheckSimple(129,n,pygetdata.INT8)
 
-# 137: native_type_name check
+# 131: validate check
 try:
-  n = d.native_type_name("data")
+  d.validate("new7")
 except:
-  CheckOK(137)
-CheckSimple(137,n,"INT8")
+  CheckException(131,pygetdata.BadCodeError)
 
-# 99: validate check
+# 133: framenum check
 try:
-  d.validate("new7")
+  n = d.framenum("data", 33.3, start=6)
 except:
-  CheckException(99,pygetdata.BadCodeError)
+  CheckOK(133)
+CheckSimple(133,n,37.0375)
 
-# 101: framenum check
+# 138: putdata (auto) check
+p = [ 53.+0j, 54.+0j, 55.+0j, 56.+0j ]
 try:
-  n = d.framenum("data", 33.3, start=6)
+  n = d.putdata("data", p, first_frame=38, first_sample=1)
 except:
-  CheckOK(101)
-CheckSimple(101,n,37.0375)
+  CheckOK2(138,1)
+CheckSimple2(138,1,n,4)
 
-# 86: eof check
 try:
-  n = d.eof("lincom")
+  n = d.getdata("data", pygetdata.INT, first_frame=38, num_frames=1, as_list=1)
 except:
-  CheckOK(86)
-CheckSimple(86,n,344)
+  CheckOK2(138,2)
+CheckSimple2(138,2,n,[41, 53, 54, 55, 56, 46, 47, 48])
+
+# 139: native_type_name check
+try:
+  n = d.native_type_name("data")
+except:
+  CheckOK(139)
+CheckSimple(139,n,"INT8")
 
 # 142: bof check
 try:
@@ -1321,7 +1321,7 @@ try:
   n = d.standards
 except:
   CheckOK2(157,1)
-CheckSimple(157,n,9)
+CheckSimple(157,n,pygetdata.DIRFILE_STANDARDS_VERSION)
 
 try:
   d.standards = 0
@@ -1538,28 +1538,28 @@ try:
   n = d.constants(pygetdata.INT)
 except:
   CheckOK(183)
-CheckSimple(183,n,[('const', 133), ('new11', 0)])
+CheckSimple(183,n,[('const', 93), ('new11', 0)])
 
 # 186: gd_constants (long)
 try:
   n = d.constants(pygetdata.LONG)
 except:
   CheckOK(186)
-CheckSimple(186,n,[('const', 133L), ('new11', 0L)])
+CheckSimple(186,n,[('const', 93L), ('new11', 0L)])
 
 # 188: gd_constants (float)
 try:
   n = d.constants(pygetdata.FLOAT)
 except:
   CheckOK(188)
-CheckSimple(188,n,[('const', 133.0), ('new11', 0.0)])
+CheckSimple(188,n,[('const', 93.0), ('new11', 0.0)])
 
 # 190: gd_constants (complex)
 try:
   n = d.constants(pygetdata.COMPLEX)
 except:
   CheckOK(190)
-CheckSimple(190,n,[('const', 133.0), ('new11', 0.0)])
+CheckSimple(190,n,[('const', 93.0), ('new11', 0.0)])
 
 # 191: gd_constants (int)
 try:
@@ -1794,29 +1794,6 @@ try:
 except:
   CheckOK(223)
 
-# 224: gd_move_alias check
-try:
-  d.move_alias('new20', 1)
-except:
-  CheckOK2(224, 1)
-
-try:
-  n = d.fragment_index('Anew20Z')
-except:
-  CheckOK2(224, 2)
-CheckSimple(224, n, 1)
-
-# 225: gd_delete_alias check
-try:
-  d.delete_alias('Anew20Z', 0)
-except:
-  CheckOK2(225, 1)
-
-try:
-  n = d.fragment_index('Anew20Z')
-except:
-  CheckException2(255, 2, pygetdata.BadCodeError)
-
 # 226: gd_fragment_affixes check
 try:
   n = d.fragment(1).prefix
@@ -2011,18 +1988,25 @@ if (pygetdata.__numpy_supported__):
 else:
   CheckSimple(242,n,[("mcarray", [1.9, 2.8, 3.7, 4.6, 5.5]), ("mnew17", [0,0])])
 
-# 243: check NULL return from gd_reference
+# 271: encoding_support
+n = pygetdata.encoding_support(pygetdata.SIE_ENCODED)
+CheckSimple(271,n,pygetdata.RDWR)
+
+# 272: check NULL return from gd_reference
 try:
   m = pygetdata.dirfile("dirfile/empty",
       pygetdata.RDWR | pygetdata.CREAT | pygetdata.EXCL)
 except:
-  CheckOK2(243, 1)
+  CheckOK2(272, 1)
 
 try:
   n = m.reference;
-  CheckSimple(243, n, None);
+  CheckSimple(272, n, None);
 except:
-  CheckOK2(243, 2)
+  CheckOK2(272, 2)
+
+
+
 
 
 
diff --git a/bindings/python/test/callback.py b/bindings/python/test/callback.py
index 3aa58ac..640fa0d 100644
--- a/bindings/python/test/callback.py
+++ b/bindings/python/test/callback.py
@@ -1,3 +1,23 @@
+# Copyright (C) 2009, 2011 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
 import sys
 import os
 import re
diff --git a/configure b/configure
index 79cb9ce..d01bbe2 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GetData 0.8.9.
+# Generated by GNU Autoconf 2.69 for GetData 0.9.0.
 #
 # Report bugs to <getdata-devel at lists.sourceforge.net>.
 #
@@ -598,8 +598,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='GetData'
 PACKAGE_TARNAME='getdata'
-PACKAGE_VERSION='0.8.9'
-PACKAGE_STRING='GetData 0.8.9'
+PACKAGE_VERSION='0.9.0'
+PACKAGE_STRING='GetData 0.9.0'
 PACKAGE_BUGREPORT='getdata-devel at lists.sourceforge.net'
 PACKAGE_URL='http://getdata.sourceforge.net/'
 
@@ -650,6 +650,8 @@ USE_ZZSLIM_FALSE
 USE_ZZSLIM_TRUE
 HAVE_DIFF_FALSE
 HAVE_DIFF_TRUE
+TEST_PHP_FALSE
+TEST_PHP_TRUE
 TEST_MATLAB_FALSE
 TEST_MATLAB_TRUE
 TEST_PERL_FALSE
@@ -660,6 +662,8 @@ TEST_PYTHON_FALSE
 TEST_PYTHON_TRUE
 USE_MODULES_FALSE
 USE_MODULES_TRUE
+MAKE_PHPBINDINGS_FALSE
+MAKE_PHPBINDINGS_TRUE
 MAKE_MATLABBINDINGS_FALSE
 MAKE_MATLABBINDINGS_TRUE
 MAKE_PERLBINDINGS_FALSE
@@ -680,24 +684,8 @@ INTEL_FC_COMPILER_FALSE
 INTEL_FC_COMPILER_TRUE
 INTEL_F77_COMPILER_FALSE
 INTEL_F77_COMPILER_TRUE
-FC_WEXTRA_FALSE
-FC_WEXTRA_TRUE
-F77_FNO_BACKSLASH_FALSE
-F77_FNO_BACKSLASH_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
+HAVE_SED_FALSE
+HAVE_SED_TRUE
 GETDATA_DEBUG_FALSE
 GETDATA_DEBUG_TRUE
 absolute_docdir
@@ -712,7 +700,7 @@ ZZIP_CPPFLAGS
 USE_SLIM_FALSE
 USE_SLIM_TRUE
 path_unslim
-path_slim
+path_slimdata
 SLIM_LIBS
 SLIM_LDFLAGS
 SLIM_CPPFLAGS
@@ -729,6 +717,12 @@ path_gzip
 GZIP_LIBS
 GZIP_LDFLAGS
 GZIP_CPPFLAGS
+USE_FLAC_FALSE
+USE_FLAC_TRUE
+path_flac
+FLAC_LIBS
+FLAC_LDFLAGS
+FLAC_CPPFLAGS
 USE_BZIP2_FALSE
 USE_BZIP2_TRUE
 path_bunzip2
@@ -736,30 +730,42 @@ path_bzip2
 BZIP2_LIBS
 BZIP2_LDFLAGS
 BZIP2_CPPFLAGS
+pythondir
+PYTHON_PLATFORM
+PYTHON_VERSION
+PYTHON
+PHP_libs
+PHP_ldflags
+PHP_CPPFLAGS
+phpdir
+PHP
+PHP_CONFIG
+PERL_MAN3EXT
+perlmandir
+perldir
+PERL
 MATLAB_CPPFLAGS
 mexext
 matlabbasedir
 MATLAB
 MEX
-PERL_MAN3EXT
-perlmandir
-perldir
-PERL
 IDL_LIBS
 IDL_CFLAGS
 idldir
 IDL
-NUMPY_CPPFLAGS
-pythondir
-PYTHON_LIBS
-PYTHON_CPPFLAGS
-PYTHON_CFLAGS
-PYTHON
 DEFINE_gd_uint64_t
 DEFINE_gd_int64_t
 DEFINE_gd_uint16_t
 DEFINE_gd_int16_t
+GD_FC_WEXTRA
+GD_FC_WALL
 FLIBS
+GD_F77_WEXTRA
+GD_F77_WALL
+GD_CXX_WEXTRA
+GD_CXX_WALL
+GD_CC_WEXTRA
+GD_CC_WALL
 LTDLINCL
 LIBLTDL
 LIBTOOL_DEPS
@@ -819,8 +825,11 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+DL_LIBRARY_PATH
 GD_DIRSEP
 GD_FDIRSEP
+DEFINE_GD_GETDATA_INT_VERSION
+DEFINE_GD_GETDATA_VERSION
 SEQ
 PRINTF
 JOT
@@ -857,7 +866,6 @@ INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
 moduledir
-DL_LIBRARY_PATH
 GETDATA_DEBUG
 DEFINE_GD_LEGACY_API
 host_os
@@ -929,10 +937,11 @@ enable_bindings
 enable_cplusplus
 enable_fortran
 enable_fortran95
-enable_python
 enable_idl
-enable_perl
 enable_matlab
+enable_perl
+enable_php
+enable_python
 enable_modules
 with_module_dir
 with_ltdl
@@ -948,17 +957,19 @@ with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
-enable_largefile
-with_python
-with_python_module_dir
 with_idl
 with_idl_dlm_dir
-with_perl
-with_perl_dir
 with_matlab
 with_mex
 with_matlab_dir
+with_perl
+with_perl_dir
+with_php_config
+with_php_dir
+with_python
+with_python_module_dir
 with_libbz2
+with_libFLAC
 with_libz
 with_liblzma
 with_libslim
@@ -1531,7 +1542,7 @@ 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.8.9 to adapt to many kinds of systems.
+\`configure' configures GetData 0.9.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1601,7 +1612,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GetData 0.8.9:";;
+     short | recursive ) echo "Configuration of GetData 0.9.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1609,20 +1620,21 @@ 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
+  --enaable-legacy-api    include the legacy API wrapper in the library
   --enable-assert         enable assertions
   --enable-debug          enable debugging messages
   --enable-ansi-c         use ANSI C (C89) work-arounds for C99 code
-  --disable-bindings      don't build any bindings, just build the C library
+  --disable-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)
-  --disable-perl          don't build the Perl bindings (GetData)
   --disable-matlab        don't build the MATLAB bindings
+  --disable-perl          don't build the Perl bindings (GetData)
+  --disable-php           don't build the PHP bindings
+  --disable-python        don't build the Python bindings (pygetdata)
   --enable-modules        build external encodings in dynamically loaded
                           modules instead of directly into the core GetData
                           library
@@ -1633,6 +1645,11 @@ Optional Features:
                           support fast unaligned memory access may cause the
                           library to silently corrupt data. [default:
                           autodetect]
+  --disable-fast-unaligned
+                          don't use fast loads and stores with non-aligned
+                          data, even if it looks like they should work. This
+                          is always safe, but can result in significant
+                          slow-down. [default: autodetect]
   --enable-dependency-tracking
                           do not reject slow dependency extractors
   --disable-dependency-tracking
@@ -1642,11 +1659,10 @@ Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
-  --disable-largefile     omit support for large files
   --enable-zzslim         skip probing for zzslim required features and enable
-                          the zzslim encoding. The default is to autodetect
-                          support. Note: zzslim encoding support requires both
-                          slim and zzip encoding support.
+                          the zzslim encoding. Note: zzslim encoding support
+                          requires both slim and zzip encoding support.
+                          [default: autodetect]
   --disable-zzslim        disable zzslim encodings support
 
 Optional Packages:
@@ -1667,15 +1683,16 @@ Optional Packages:
   --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 [default:
-                          autodetect]
-  --with-python-module-dir=PATH
-                          install the Python bindings into PATH [default:
-                          autodetect]
   --with-idl=PATH         use the IDL interpreter located in PATH [default:
                           autodetect]
   --with-idl-dlm-dir=PATH install the IDL bindings into PATH [default:
                           autodetect]
+  --with-matlab=PATH      use the MATLAB interpreter located at PATH.
+                          [default: autodetect]
+  --with-mex=PATH         use the MATLAB MEX compiler located at PATH.
+                          [default: autodetect]
+  --with-matlab-dir=PATH  Install Matlab bindings in PATH/getdata. [default:
+                          LIBDIR/getdata/matlab]
   --with-perl=PATH        use the Perl interpreter located in PATH. [default:
                           autodetect]
   --with-perl-dir=PATH    Install Perl bindings in PATH. If PATH is the
@@ -1684,16 +1701,22 @@ Optional Packages:
                           present). If PATH is the special word `site',
                           install Perl bindings into the default site-specific
                           module directory. [default: site]
-  --with-matlab=PATH      use the MATLAB interpreter located at PATH.
-                          [default: autodetect]
-  --with-mex=PATH         use the MATLAB MEX compiler located at PATH.
-                          [default: autodetect]
-  --with-matlab-dir=PATH  Install Matlab bindings in PATH/getdata. [default:
-                          LIBDIR/getdata/matlab]
+  --with-php-config=PATH  use PATH as php-config. [default: autodetect]
+  --with-php-dir=DIR      install the GetData PHP extension into DIR [default:
+                          autodetect]
+  --with-python=PATH      use the Python interpreter located in PATH [default:
+                          autodetect]
+  --with-python-module-dir=PATH
+                          install the Python bindings into PATH [default:
+                          autodetect]
   --with-libbz2=PREFIX    use the libbz2 installed in PREFIX [default:
                           autodetect]
   --without-libbz2        disable encodings supported by libbz2, even if the
                           library is present
+  --with-libFLAC=PREFIX   use the libFLAC installed in PREFIX [default:
+                          autodetect]
+  --without-libFLAC       disable encodings supported by libFLAC, even if the
+                          library is present
   --with-libz=PREFIX      use the libz installed in PREFIX [default:
                           autodetect]
   --without-libz          disable encodings supported by libz, even if the
@@ -1712,7 +1735,7 @@ Optional Packages:
                           library is present
 
 Some influential environment variables:
-  BUILDCC     C compiler command on the build system (only needed if
+  BUILDCC     C compiler command targetting the build system (only needed if
               cross-compiling)
   DATE        a date program which supports '+%...' conversion specifiers
   DIFF        a POSIX-compatible diff
@@ -1808,7 +1831,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-GetData configure 0.8.9
+GetData configure 0.9.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2471,22 +2494,27 @@ fi
 
 } # ac_fn_fc_try_link
 
-# 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 ()
+# 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 $2" >&5
-$as_echo_n "checking for $2... " >&6; }
+  { $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"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+     # 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.  */
-$4
+$ac_includes_default
+	     enum { N = $2 / 2 - 1 };
 #ifdef F77_DUMMY_MAIN
 
 #  ifdef __cplusplus
@@ -2498,8 +2526,10 @@ $4
 int
 main ()
 {
-if (sizeof ($2))
-	 return 0;
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0;
+return test_array [0];
+
   ;
   return 0;
 }
@@ -2507,7 +2537,8 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$4
+$ac_includes_default
+	        enum { N = $2 / 2 - 1 };
 #ifdef F77_DUMMY_MAIN
 
 #  ifdef __cplusplus
@@ -2519,8 +2550,11 @@ $4
 int
 main ()
 {
-if (sizeof (($2)))
-	    return 0;
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0;
+return test_array [0];
+
   ;
   return 0;
 }
@@ -2528,89 +2562,43 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
 else
-  eval "$3=yes"
+  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_check_type
+} # ac_fn_c_find_intX_t
 
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
+# 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
-  if test "$cross_compiling" = yes; then
-    # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#ifdef F77_DUMMY_MAIN
-
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-
-#endif
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#ifdef F77_DUMMY_MAIN
-
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-
-#endif
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid; break
-else
-  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+  { $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
@@ -2625,18 +2613,14 @@ $4
 int
 main ()
 {
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0;
-return test_array [0];
-
+if (sizeof ($2))
+	 return 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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 #ifdef F77_DUMMY_MAIN
@@ -2650,127 +2634,27 @@ $4
 int
 main ()
 {
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
+if (sizeof (($2)))
+	    return 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
+  eval "$3=yes"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#ifdef F77_DUMMY_MAIN
-
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-
-#endif
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid
-else
-  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
-  else
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <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 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
-  as_fn_set_status $ac_retval
 
-} # ac_fn_c_compute_int
+} # ac_fn_c_check_type
 
 # ac_fn_c_find_uintX_t LINENO BITS VAR
 # ------------------------------------
@@ -2834,27 +2718,19 @@ $as_echo "$ac_res" >&6; }
 
 } # 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 ()
+# 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
-  { $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
+  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.  */
-$ac_includes_default
-	     enum { N = $2 / 2 - 1 };
+$4
 #ifdef F77_DUMMY_MAIN
 
 #  ifdef __cplusplus
@@ -2866,7 +2742,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+static int test_array [1 - 2 * !(($2) >= 0)];
 test_array [0] = 0;
 return test_array [0];
 
@@ -2875,10 +2751,46 @@ return test_array [0];
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid; break
+else
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
-	        enum { N = $2 / 2 - 1 };
+$4
 #ifdef F77_DUMMY_MAIN
 
 #  ifdef __cplusplus
@@ -2890,8 +2802,7 @@ $ac_includes_default
 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))];
+static int test_array [1 - 2 * !(($2) < 0)];
 test_array [0] = 0;
 return test_array [0];
 
@@ -2900,31 +2811,143 @@ return test_array [0];
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=$ac_mid; break
 else
-  case $ac_type in #(
-  int$2_t) :
-    eval "$3=yes" ;; #(
-  *) :
-    eval "$3=\$ac_type" ;;
-esac
+  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
-       if eval test \"x\$"$3"\" = x"no"; then :
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
 
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid
 else
-  break
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
 fi
-     done
+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
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+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_find_intX_t
+} # ac_fn_c_compute_int
 
 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
 # ---------------------------------------------
@@ -2983,7 +3006,7 @@ 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.8.9, which was
+It was created by GetData $as_me 0.9.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3338,10 +3361,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 $as_echo "#define GETDATA_MAJOR 0" >>confdefs.h
 
 
-$as_echo "#define GETDATA_MINOR 8" >>confdefs.h
+$as_echo "#define GETDATA_MINOR 9" >>confdefs.h
 
 
-$as_echo "#define GETDATA_REVISION 9" >>confdefs.h
+$as_echo "#define GETDATA_REVISION 0" >>confdefs.h
 
 
 $as_echo "#define GETDATA_VERSION_SUFFIX \"\"" >>confdefs.h
@@ -3349,9 +3372,9 @@ $as_echo "#define GETDATA_VERSION_SUFFIX \"\"" >>confdefs.h
 
 GETDATA_MAJOR=0
 
-GETDATA_MINOR=8
+GETDATA_MINOR=9
 
-GETDATA_REVISION=9
+GETDATA_REVISION=0
 
 GETDATA_VERSION_SUFFIX=
 
@@ -3363,19 +3386,19 @@ GETDATA_VERSION_SUFFIX=
 
 
 
-GETDATA_IFACE_VERSION=6
+GETDATA_IFACE_VERSION=7
 
-GETDATA_IMPL_REVISION=7
+GETDATA_IMPL_REVISION=0
 
-GETDATA_IFACE_AGE=1
+GETDATA_IFACE_AGE=0
 
-GETDATAXX_VERSION=5:1:2
+GETDATAXX_VERSION=6:0:0
 
-FGETDATA_VERSION=4:4:2
+FGETDATA_VERSION=5:0:0
 
-F95GETDATA_VERSION=5:3:3
+F95GETDATA_VERSION=6:0:0
 
-MATLABGETDATA_VERSION=0:1:0
+MATLABGETDATA_VERSION=1:0:1
 
 
 
@@ -3501,7 +3524,7 @@ if test "${enable_legacy_api+set}" = set; then :
                esac
 
 else
-   include_legacy_api="yes"
+   include_legacy_api="no"
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the legacy API" >&5
@@ -3590,6 +3613,7 @@ make_pybindings="yes"
 make_idlbindings="yes"
 make_perlbindings="yes"
 make_matlabbindings="yes"
+make_phpbindings="yes"
 # Check whether --enable-bindings was given.
 if test "${enable_bindings+set}" = set; then :
   enableval=$enable_bindings;
@@ -3600,6 +3624,7 @@ if test "${enable_bindings+set}" = set; then :
                  make_idlbindings="no"
                  make_perlbindings="no"
                  make_matlabbindings="no"
+                 make_phpbindings="no"
                fi
 
 fi
@@ -3658,28 +3683,6 @@ $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; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_pybindings" >&5
-$as_echo "$make_pybindings" >&6; }
-
 # Check whether --enable-idl was given.
 if test "${enable_idl+set}" = set; then :
   enableval=$enable_idl;
@@ -3696,6 +3699,22 @@ $as_echo_n "checking whether to include the IDL bindings... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_idlbindings" >&5
 $as_echo "$make_idlbindings" >&6; }
 
+# Check whether --enable-matlab was given.
+if test "${enable_matlab+set}" = set; then :
+  enableval=$enable_matlab;
+               case "${enableval}" in
+                 no) make_matlabbindings="no" ;;
+                 *) make_matlabbindings="yes" ;;
+               esac
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the MATLAB bindings" >&5
+$as_echo_n "checking whether to include the MATLAB bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_matlabbindings" >&5
+$as_echo "$make_matlabbindings" >&6; }
+
 # Check whether --enable-perl was given.
 if test "${enable_perl+set}" = set; then :
   enableval=$enable_perl;
@@ -3712,21 +3731,37 @@ $as_echo_n "checking whether to include the Perl bindings... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_perlbindings" >&5
 $as_echo "$make_perlbindings" >&6; }
 
-# Check whether --enable-matlab was given.
-if test "${enable_matlab+set}" = set; then :
-  enableval=$enable_matlab;
+# Check whether --enable-php was given.
+if test "${enable_php+set}" = set; then :
+  enableval=$enable_php;
                case "${enableval}" in
-                 no) make_matlabbindings="no" ;;
-                 *) make_matlabbindings="yes" ;;
+                 no) make_phpbindings="no" ;;
+                 *) make_phpbindings="yes" ;;
                esac
 
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the MATLAB bindings" >&5
-$as_echo_n "checking whether to include the MATLAB bindings... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_matlabbindings" >&5
-$as_echo "$make_matlabbindings" >&6; }
+# Check whether --enable-python was given.
+if test "${enable_python+set}" = set; then :
+  enableval=$enable_python;
+               case "${enableval}" in
+                 no) make_pybindings="no" ;;
+                 *) make_pybindings="yes" ;;
+               esac
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Python bindings" >&5
+$as_echo_n "checking whether to include the Python bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_pybindings" >&5
+$as_echo "$make_pybindings" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the PHP bindings" >&5
+$as_echo_n "checking whether to include the PHP bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_phpbindings" >&5
+$as_echo "$make_phpbindings" >&6; }
 
 # Check whether --enable-modules was given.
 if test "${enable_modules+set}" = set; then :
@@ -4282,7 +4317,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='getdata'
- VERSION='0.8.9'
+ VERSION='0.9.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4811,6 +4846,10 @@ _ACEOF
 fi
 
 
+DEFINE_GD_GETDATA_VERSION="#define GD_GETDATA_VERSION \"0.9.0\""
+
+DEFINE_GD_GETDATA_INT_VERSION="#define GD_GETDATA_INT_VERSION `${PRINTF} %i%02i 9 0`"
+
 echo
 echo "*** Checking host environment"
 echo
@@ -4829,6 +4868,8 @@ else
 fi
 
 
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${host} supports fast unaligned memory access" >&5
 $as_echo_n "checking whether ${host} supports fast unaligned memory access... " >&6; }
 if test "x$gd_unaligned_override" = "xyes"; then
@@ -4870,6 +4911,8 @@ _ACEOF
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GD_FDIRSEP" >&5
 $as_echo "$GD_FDIRSEP" >&6; }
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra LDFLAGS needed on ${host}" >&5
+$as_echo_n "checking for extra LDFLAGS needed on ${host}... " >&6; }
 case "${host}" in
   *-pc-mingw*)
   NO_UNDEFINED=" -no-undefined"
@@ -4880,6 +4923,30 @@ case "${host}" in
   *) NO_DLOPEN_TESTS=0 ;;
 esac
 
+if test "x${NO_UNDEFINED}" = "x"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${NO_UNDEFINED}" >&5
+$as_echo "${NO_UNDEFINED}" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the test suite can dynamically load objects" >&5
+$as_echo_n "checking whether the test suite can dynamically load objects... " >&6; }
+if test "x${NO_DLOPEN_TESTS}" = "x1"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+
+case "${host}" in
+  *-apple-darwin*) DL_LIBRARY_PATH="DYLD_LIBRARY_PATH" ;;
+  *) DL_LIBRARY_PATH="LD_LIBRARY_PATH" ;;
+esac
+
+
 echo
 echo "*** Checking C compiler characteristics"
 echo
@@ -8718,6 +8785,12 @@ fi
 done
 
   fi
+  # bindings requiring interpreters aren't built when cross compiling
+  make_idlbindings=no
+  make_phpbindings=no
+  make_pybindings=no
+  make_perlbindings=no
+  make_matlabbindings=no
 else
   if test -z "$BUILDCC"; then
     BUILDCC=$CC
@@ -12536,10 +12609,6 @@ _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=
@@ -26069,7 +26138,7 @@ Usage: $0 [OPTIONS]
 Report bugs to <bug-libtool at gnu.org>."
 
 lt_cl_version="\
-GetData config.lt 0.8.9
+GetData config.lt 0.9.0
 configured by $0, generated by GNU Autoconf 2.69.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -27754,6 +27823,10 @@ fi
   fi
 
   if test "x$ltdl_prefix" != "x"; then
+    LIBLTDL="-L${ltdl_prefix}/lib -lltdl"
+    LTDLINCL="-I${ltdl_prefix}/include"
+    saved_cppflags=$CPPFLAGS
+    CPPFLAGS="${CPPFLAGS} ${LTDLINCL}"
     for ac_header in ltdl.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default"
@@ -27766,8 +27839,7 @@ fi
 
 done
 
-    LIBLTDL="-L${ltdl_prefix}/lib -lltdl"
-    LTDLINC="-I${ltdl_prefix}/include"
+    CPPFLAGS=$saved_cppflags
   else
     for ac_header in ltdl.h
 do :
@@ -27878,206 +27950,6 @@ fi
 echo
 echo "*** Checking additional compiler characteristics"
 echo
-# Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
-  enableval=$enable_largefile;
-fi
-
-if test "$enable_largefile" != no; then
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_sys_largefile_CC=no
-     if test "$GCC" != yes; then
-       ac_save_CC=$CC
-       while :; do
-	 # IRIX 6.2 and later do not support large files by default,
-	 # so use the C compiler's -n32 option if that helps.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-	 if ac_fn_c_try_compile "$LINENO"; then :
-  break
-fi
-rm -f core conftest.err conftest.$ac_objext
-	 CC="$CC -n32"
-	 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_largefile_CC=' -n32'; break
-fi
-rm -f core conftest.err conftest.$ac_objext
-	 break
-       done
-       CC=$ac_save_CC
-       rm -f conftest.$ac_ext
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
-  if test "$ac_cv_sys_largefile_CC" != no; then
-    CC=$CC$ac_cv_sys_largefile_CC
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if ${ac_cv_sys_file_offset_bits+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  while :; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_file_offset_bits=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_file_offset_bits=64; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_cv_sys_file_offset_bits=unknown
-  break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
-  no | unknown) ;;
-  *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-;;
-esac
-rm -rf conftest*
-  if test $ac_cv_sys_file_offset_bits = unknown; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if ${ac_cv_sys_large_files+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  while :; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_large_files=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_large_files=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_cv_sys_large_files=unknown
-  break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
-case $ac_cv_sys_large_files in #(
-  no | unknown) ;;
-  *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-;;
-esac
-rm -rf conftest*
-  fi
-
-
-fi
-
 { $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 :
@@ -28233,6 +28105,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cc_wall" >&5
 $as_echo "$gd_cv_prog_cc_wall" >&6; }
 CFLAGS=$gd_saved_CFLAGS
+if test "x$gd_cv_prog_cc_wall" = "xyes"; then
+  GD_CC_WALL=-Wall
+fi
+
+
 gd_saved_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wextra" >&5
 $as_echo_n "checking whether $CC accepts -Wextra... " >&6; }
@@ -28261,6 +28138,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cc_wextra" >&5
 $as_echo "$gd_cv_prog_cc_wextra" >&6; }
 CFLAGS=$gd_saved_CFLAGS
+if test "x$gd_cv_prog_cc_wextra" = "xyes"; then
+  GD_CC_WEXTRA=-Wextra
+fi
+
+
 
 if test "x$make_cxxbindings" != "xno"; then
   gd_saved_CXXFLAGS=$CXXFLAGS
@@ -28303,6 +28185,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cxx_wall" >&5
 $as_echo "$gd_cv_prog_cxx_wall" >&6; }
 CXXFLAGS=$gd_saved_CXXFLAGS
+if test "x$gd_cv_prog_cxx_wall" = "xyes"; then
+  GD_CXX_WALL=-Wall
+fi
+
+
   gd_saved_CXXFLAGS=$CXXFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wextra" >&5
 $as_echo_n "checking whether $CXX accepts -Wextra... " >&6; }
@@ -28343,6 +28230,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cxx_wextra" >&5
 $as_echo "$gd_cv_prog_cxx_wextra" >&6; }
 CXXFLAGS=$gd_saved_CXXFLAGS
+if test "x$gd_cv_prog_cxx_wextra" = "xyes"; then
+  GD_CXX_WEXTRA=-Wextra
+fi
+
+
 fi
 
 if test "x$make_f77bindings" != "xno"; then
@@ -28379,6 +28271,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_f77_wall" >&5
 $as_echo "$gd_cv_prog_f77_wall" >&6; }
 FFLAGS=$gd_saved_FFLAGS
+if test "x$gd_cv_prog_f77_wall" = "xyes"; then
+  GD_F77_WALL=-Wall
+fi
+
+
   gd_saved_FFLAGS=$FFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -Wextra" >&5
 $as_echo_n "checking whether $F77 accepts -Wextra... " >&6; }
@@ -28412,39 +28309,11 @@ 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
-  gd_saved_FFLAGS=$FFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -fno-backslash" >&5
-$as_echo_n "checking whether $F77 accepts -fno-backslash... " >&6; }
-if ${gd_cv_prog_f77_fno_backslash+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  FFLAGS="-fno-backslash"
-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_fno_backslash=yes
-else
-  gd_cv_prog_f77_fno_backslash=no
+if test "x$gd_cv_prog_f77_wextra" = "xyes"; then
+  GD_F77_WEXTRA=-Wextra
 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_fno_backslash" >&5
-$as_echo "$gd_cv_prog_f77_fno_backslash" >&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 :
@@ -29186,6 +29055,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_fc_wall" >&5
 $as_echo "$gd_cv_prog_fc_wall" >&6; }
 FCFLAGS=$gd_saved_FCFLAGS
+if test "x$gd_cv_prog_fc_wall" = "xyes"; then
+  GD_FC_WALL=-Wall
+fi
+
+
   gd_saved_FCFLAGS=$FCFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -Wextra" >&5
 $as_echo_n "checking whether $FC accepts -Wextra... " >&6; }
@@ -29219,6 +29093,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_fc_wextra" >&5
 $as_echo "$gd_cv_prog_fc_wextra" >&6; }
 FCFLAGS=$gd_saved_FCFLAGS
+if test "x$gd_cv_prog_fc_wextra" = "xyes"; then
+  GD_FC_WEXTRA=-Wextra
+fi
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Intel Fortran compiler" >&5
 $as_echo_n "checking whether we are using the Intel Fortran compiler... " >&6; }
 if ${gd_cv_fc_compiler_intel+:} false; then :
@@ -29348,7 +29227,8 @@ echo
 for ac_header in asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \
                   float.h inttypes.h io.h libgen.h libkern/OSByteOrder.h \
                   math.h stddef.h stdint.h sys/endian.h sys/file.h sys/param.h \
-                  sys/stat.h sys/types.h sys/wait.h unistd.h
+                  sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h \
+                  unistd.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -30025,58 +29905,59 @@ 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
+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 size_t unsigned int
+#define int8_t $ac_cv_c_int8_t
 _ACEOF
+;;
+esac
 
-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 :
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+  no|yes) ;; #(
+  *)
 
-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
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
-$as_echo "$ac_cv_sizeof_size_t" >&6; }
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+  no|yes) ;; #(
+  *)
 
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
 
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+  no|yes) ;; #(
+  *)
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+#define int64_t $ac_cv_c_int64_t
 _ACEOF
+;;
+esac
 
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = xyes; then :
 
-ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
-if test "x$ac_cv_type_ssize_t" = xyes; then :
+else
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SSIZE_T 1
+#define mode_t int
 _ACEOF
 
-
 fi
 
 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
@@ -30090,38 +29971,27 @@ _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 :
+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
-  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
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
-$as_echo "$ac_cv_sizeof_off_t" >&6; }
 
+ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
+if test "x$ac_cv_type_ssize_t" = xyes; then :
 
+else
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+#define ssize_t int
 _ACEOF
 
+fi
 
 ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
 case $ac_cv_c_uint8_t in #(
@@ -30137,17 +30007,6 @@ _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) ;; #(
@@ -30160,17 +30019,6 @@ _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) ;; #(
@@ -30185,17 +30033,6 @@ _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) ;; #(
@@ -30210,17 +30047,6 @@ _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"
@@ -30286,6 +30112,72 @@ fi
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_off_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_off_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if ${ac_cv_sizeof_size_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_size_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (size_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_size_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5
 $as_echo_n "checking size of short int... " >&6; }
 if ${ac_cv_sizeof_short_int+:} false; then :
@@ -30642,9 +30534,9 @@ for ac_func in basename _chsize _chsize_s _commit fchmod _fdopen fdopendir \
                 fstatat fstatat64 fsync ftello ftello64 ftruncate ftruncate64 \
                 getcwd _getcwd getdelim gmtime_r isnan _isnan lseek64 \
                 _lseeki64 lstat lstat64 _mkdir mkfifo nan _open openat \
-                pathconf _read readdir_r readlink renameat _rmdir snprintf \
-                _snprintf stat64 _stat64 _strtoi64 strtoll strtoq _strtoui64 \
-                strtoull strtouq symlink _unlink unlinkat _write
+                pathconf _read readdir_r readlink renameat _rmdir setrlimit \
+                snprintf _snprintf stat64 _stat64 _strtoi64 strtoll strtoq \
+                _strtoui64 strtoull strtouq symlink _unlink unlinkat _write
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -31077,6 +30969,38 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_ISFINITE $ac_have_decl
 _ACEOF
 
+ac_fn_c_check_decl "$LINENO" "_strtoi64" "ac_cv_have_decl__strtoi64" "
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl__strtoi64" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__STRTOI64 $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "_strtoui64" "ac_cv_have_decl__strtoui64" "
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl__strtoui64" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__STRTOUI64 $ac_have_decl
+_ACEOF
+
+
 ac_fn_c_check_decl "$LINENO" "bswap16" "ac_cv_have_decl_bswap16" "
 #ifdef HAVE_BYTESWAP_H
 #include <byteswap.h>
@@ -31174,260 +31098,6 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-if test "x$make_pybindings" = "xyes"; then
-  echo
-  echo "*** Configuring python bindings"
-  echo
-
-last_python=2.7
-first_python=2.3
-
-if test "x$SEQ" == "xnot found"; then
-  if test "x$JOT" == "xnot found"; then
-    python_prog_list="python python2"
-  else
-    python_prog_list="python python2     `$JOT -w 'python%.1f' - $last_python $first_python -0.1`" #'
-  fi
-else
-  python_prog_list="python python2   `$SEQ -f 'python%.1f' $last_python -0.1 $first_python`" #'
-fi
-
-
-# Check whether --with-python was given.
-if test "${with_python+set}" = set; then :
-  withval=$with_python;
-              case "${withval}" in
-                no) have_python="no" ;;
-                yes) user_python= ; have_python= ;;
-                *) user_python="${withval}"; have_python= ;;
-              esac
-
-else
-   user_python=; have_python=
-fi
-
-
-
-# Check whether --with-python-module-dir was given.
-if test "${with_python_module_dir+set}" = set; then :
-  withval=$with_python_module_dir;
-        case "${withval}" in
-          no) local_python_modpath= ;;
-          *) local_python_modpath="${withval}"
-        esac
-
-else
-   local_python_modpath=
-fi
-
-
-if test "x${have_python}" != "xno"; then
-
-if test "x$user_python" != "x"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $user_python version >= $first_python" >&5
-$as_echo_n "checking whether $user_python version >= $first_python... " >&6; }
-  prog="import sys
-# split strings by '.' and convert to numeric.  Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '$first_python'.split('.'))) + [0, 0, 0]
-minverhex = 0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
-sys.exit(sys.hexversion < minverhex)"
-  if { echo "$as_me:$LINENO: $user_python -c "$prog"" >&5
-   ($user_python -c "$prog") >&5 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  PYTHON=$user_python
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  PYTHON="not found"
-fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python interpreter version >= $first_python" >&5
-$as_echo_n "checking for Python interpreter version >= $first_python... " >&6; }
-  PYTHON="not found"
-  for py in $python_prog_list; do
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for exec_ext in '' $ac_executable_extensions; do
-    if as_fn_executable_p "$as_dir/$py$exec_ext"; then
-      prog="import sys
-# split strings by '.' and convert to numeric.  Append some zeros
-# because we need at least 4 digits for the hex conversion.
-# map returns an iterator in Python 3.0 and a list in 2.x
-minver = list(map(int, '$first_python'.split('.'))) + [0, 0, 0]
-minverhex = 0
-# xrange is not present in Python 3.0 and range returns an iterator
-for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
-sys.exit(sys.hexversion < minverhex)"
-  if { echo "$as_me:$LINENO: "$as_dir/$py$exec_ext" -c "$prog"" >&5
-   ("$as_dir/$py$exec_ext" -c "$prog") >&5 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then :
-   PYTHON="$as_dir/$py$exec_ext"; break 3
-fi
-    fi
-  done
-  done
-IFS=$as_save_IFS
-
-  done
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
-$as_echo "$PYTHON" >&6; }
-fi
-
-if test "x$PYTHON" = "xnot found"; then
-  have_python="no"
-  PYTHON=
-fi
-
-
-fi
-
-if test "x${have_python}" != "xno"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $PYTHON version" >&5
-$as_echo_n "checking $PYTHON version... " >&6; }
-PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_VERSION" >&5
-$as_echo "$PYTHON_VERSION" >&6; }
-
-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_CFLAGS=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('CFLAGS')"`
-
-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_modlib"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python CFLAGS" >&5
-$as_echo_n "checking Python CFLAGS... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CFLAGS" >&5
-$as_echo "$PYTHON_CFLAGS" >&6; }
-
-{ $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; }
-
-
-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"
@@ -31640,9 +31310,9 @@ $as_echo "$IDL_CFLAGS" >&6; }
 
 
 
+IDL_LIBS=`(echo 'print,"@@@"+!MAKE_DLL.LD' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@[^ ]* \(.*\?\) -o.*/\1/' | sed -e 's/-m \?\w*//g'`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking IDL linker flags" >&5
 $as_echo_n "checking IDL linker flags... " >&6; }
-IDL_LIBS=`(echo 'print,"@@@"+!MAKE_DLL.LD' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@[^ ]* \(.*\?\) -o.*/\1/' | sed -e 's/-m \?\w*//g'`
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL_LIBS" >&5
 $as_echo "$IDL_LIBS" >&6; }
 
@@ -31672,6 +31342,236 @@ fi
   fi
 fi
 
+if test "x$make_matlabbindings" = "xyes"; then
+  echo
+  echo "*** Configuring MATLAB bindings"
+  echo
+
+
+# Check whether --with-matlab was given.
+if test "${with_matlab+set}" = set; then :
+  withval=$with_matlab;
+              case "${withval}" in
+                no) have_matlab="no" ;;
+                yes) user_matlab= ; have_matlab= ;;
+                *) user_matlab="${withval}"; have_matlab= ;;
+              esac
+
+else
+   user_matlab=; have_matlab=
+fi
+
+
+if test "x${have_matlab}" != "xno"; then
+
+
+# Check whether --with-mex was given.
+if test "${with_mex+set}" = set; then :
+  withval=$with_mex;
+              case "${withval}" in
+                no) have_matlab="no" ;;
+                yes) user_mex= ;;
+                *) user_mex="${withval}";;
+              esac
+
+else
+   user_mex=
+fi
+
+
+MEX="not found"
+if test "x$user_mex" != "x"; then
+  MEX=$user_mex
+else
+  # Extract the first word of "mex", so it can be a program name with args.
+set dummy mex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MEX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MEX="$MEX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_MEX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_MEX" && ac_cv_path_MEX="not found"
+  ;;
+esac
+fi
+MEX=$ac_cv_path_MEX
+if test -n "$MEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEX" >&5
+$as_echo "$MEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+
+if test "x$MEX" != "xnot found"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MEX is a MATLAB mex compiler" >&5
+$as_echo_n "checking if $MEX is a MATLAB mex compiler... " >&6; }
+  mex_out=`$MEX 2>&1`
+  mex_status=$?
+  if test $mex_status -eq 1; then
+    if ! echo $mex_out | grep -q 'consult the MATLAB External Interfaces Guide'; then
+      MEX="not found";
+    fi
+  fi
+  if test "x$MEX" = "xnot found"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  fi
+fi
+
+if test "x$MEX" = "xnot found"; then
+  have_matlab="no"
+  MEX=
+fi
+
+
+
+fi
+
+if test "x${have_matlab}" != "xno"; then
+    if test "x$user_matlab" != "x"; then
+    MATLAB=$user_matlab;
+  else
+    # Extract the first word of "matlab", so it can be a program name with args.
+set dummy matlab; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MATLAB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MATLAB in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MATLAB="$MATLAB" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_MATLAB="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_MATLAB" && ac_cv_path_MATLAB="not found"
+  ;;
+esac
+fi
+MATLAB=$ac_cv_path_MATLAB
+if test -n "$MATLAB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB" >&5
+$as_echo "$MATLAB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+
+  if test "x$MATLAB" != "xnot found"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking $MATLAB version" >&5
+$as_echo_n "checking $MATLAB version... " >&6; }
+
+matlab_int=$MATLAB
+MATLAB_VERSION=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', version); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print $2 }'`
+
+    if test "x$MATLAB_VERSION" = "x"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+      MATLAB="not found"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB_VERSION" >&5
+$as_echo "$MATLAB_VERSION" >&6; }
+    fi
+  fi
+
+  if test "x$MATLAB" = "xnot found"; then
+    have_matlab=no
+    MATLAB=
+  fi
+
+fi
+
+if test "x${have_matlab}" != "xno"; then
+    default_matlabbasedir=$libdir/getdata/matlab
+
+# Check whether --with-matlab-dir was given.
+if test "${with_matlab_dir+set}" = set; then :
+  withval=$with_matlab_dir;
+      case "${withval}" in
+      no) matlabbasedir=$default_matlabbasedir ;;
+      *) matlabbasedir="${withval}" ;;
+      esac
+
+else
+   matlabbasedir=$default_matlabbasedir
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking matlab install directory" >&5
+$as_echo_n "checking matlab install directory... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $matlabbasedir" >&5
+$as_echo "$matlabbasedir" >&6; }
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking MEX extension" >&5
+$as_echo_n "checking MEX extension... " >&6; }
+
+matlab_int=$MATLAB
+mexext=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', mexext); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print $2 }'`
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: .$mexext" >&5
+$as_echo ".$mexext" >&6; }
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking MatLab CPPFLAGS" >&5
+$as_echo_n "checking MatLab CPPFLAGS... " >&6; }
+
+matlab_prefix=`$MEX -v 2>/dev/null | ${AWK} '/MATLAB *=/ { print $4 }'`
+
+  MATLAB_CPPFLAGS="-I${matlab_prefix}/extern/include"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB_CPPFLAGS" >&5
+$as_echo "$MATLAB_CPPFLAGS" >&6; }
+
+fi
+
+  if test "x$have_matlab" = "xno"; then
+    make_matlabbindings=no
+  fi
+fi
+
 if test "x$make_perlbindings" = "xyes"; then
   echo
   echo "*** Configuring Perl bindings"
@@ -31923,7 +31823,7 @@ perl_int=$PERL
 # 3=
 perlmandir=`$perl_int -V::vendorman3direxp: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
 
-    if test $perldir = "UNKNOWN"; then
+    if test perldir = "UNKNOWN"; then
       perl_inst_type = "site";
     fi
   fi
@@ -31944,7 +31844,7 @@ perlmandir=`$perl_int -V::siteman3direxp: | sed -e "s/'//g" | sed -e "s/ \t*$//"
     perlmandir="${man3dir}"
   fi
 
-  if test "x$perlmandir" = "xUNKNOWN"; then
+  if test $perlmandir = "UNKNOWN"; then
     perlmandir="${mandir}"
   fi
 
@@ -31973,72 +31873,53 @@ fi
   fi
 fi
 
-if test "x$make_matlabbindings" = "xyes"; then
+if test "x$make_phpbindings" = "xyes"; then
   echo
-  echo "*** Configuring MATLAB bindings"
+  echo "*** Configuring PHP bindings"
   echo
-
-
-# Check whether --with-matlab was given.
-if test "${with_matlab+set}" = set; then :
-  withval=$with_matlab;
-              case "${withval}" in
-                no) have_matlab="no" ;;
-                yes) user_matlab= ; have_matlab= ;;
-                *) user_matlab="${withval}"; have_matlab= ;;
-              esac
-
-else
-   user_matlab=; have_matlab=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C99 is supported" >&5
+$as_echo_n "checking whether C99 is supported... " >&6; }
+  if test "x$disable_c99" = "xno"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    make_phpbindings=no
+  fi
 fi
+if test "x$make_phpbindings" = "xyes"; then
 
 
-if test "x${have_matlab}" != "xno"; then
-
+have_php="yes"
 
-# Check whether --with-mex was given.
-if test "${with_mex+set}" = set; then :
-  withval=$with_mex;
+# Check whether --with-php-config was given.
+if test "${with_php_config+set}" = set; then :
+  withval=$with_php_config;
               case "${withval}" in
-                no) have_matlab="no" ;;
-                yes) user_mex= ;;
-                *) user_mex="${withval}";;
+                no) have_php="no" ;;
+                yes) user_php_config= ;;
+                *) user_php_config="${withval}" ;;
               esac
 
 else
-   user_mex=
+   user_php_config=
 fi
 
 
-MEX="not found"
-if test "x$user_mex" != "x"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $user_mex is a MATLAB mex compiler" >&5
-$as_echo_n "checking if $user_mex is a MATLAB mex compiler... " >&6; }
-  mex_out=`$user_mex 2>&1`
-  mex_status=$?
-  if test $mex_status -eq 1; then
-    if echo $mex_out | grep -q 'consult the MATLAB External Interfaces Guide'; then
-      MEX=$user_mex
-    fi
-  fi
-  if test "x$MEX" = "xnot found"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  fi
-else
-  # Extract the first word of "mex", so it can be a program name with args.
-set dummy mex; ac_word=$2
+if test "x${have_php}" != "xno"; then
+    for ac_prog in $user_php_config php5-config php-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MEX+:} false; then :
+if ${ac_cv_path_PHP_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $MEX in
+  case $PHP_CONFIG in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_MEX="$MEX" # Let the user override the test with a path.
+  ac_cv_path_PHP_CONFIG="$PHP_CONFIG" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -32048,7 +31929,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MEX="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_PHP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -32056,143 +31937,336 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_MEX" && ac_cv_path_MEX="not found"
   ;;
 esac
 fi
-MEX=$ac_cv_path_MEX
-if test -n "$MEX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEX" >&5
-$as_echo "$MEX" >&6; }
+PHP_CONFIG=$ac_cv_path_PHP_CONFIG
+if test -n "$PHP_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_CONFIG" >&5
+$as_echo "$PHP_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
+  test -n "$PHP_CONFIG" && break
+done
+test -n "$PHP_CONFIG" || PHP_CONFIG="not found"
+
+
+  if test "x$PHP_CONFIG" = "xnot found"; then
+    have_php="no"
+    PHP_CONFIG=
+  fi
+
 fi
 
-if test "x$MEX" = "xnot found"; then
-  have_matlab="no"
-  MEX=
+
+# Check whether --with-php-dir was given.
+if test "${with_php_dir+set}" = set; then :
+  withval=$with_php_dir;
+      if test "x${withval}" = "xno"; then
+        phpdir=UNKNOWN;
+      else
+        phpdir=${withval};
+      fi
+
+else
+  phpdir=UNKNOWN
 fi
 
 
+if test "x${have_php}" != "xno"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP interpreter path" >&5
+$as_echo_n "checking PHP interpreter path... " >&6; }
+
+  PHP=`${PHP_CONFIG} --php-binary`
+
+  if test "x${PHP}" = "x"; then
+    PHP="UNKNOWN";
+    have_php="no";
+  elif test "x${PHP}" = "xNONE"; then
+    have_php="no";
+  fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP" >&5
+$as_echo "$PHP" >&6; }
 fi
 
-if test "x${have_matlab}" != "xno"; then
-    MATLAB="not found"
-  if test "x$user_matlab" != "x"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $user_matlab is a MATLAB interpreter" >&5
-$as_echo_n "checking if $user_matlab is a MATLAB interpreter... " >&6; }
+if test "x${have_php}" != "xno"; then
 
-matlab_int=$user_matlab
-matlab_ver=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', version); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print $2 }'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking the PHP extension directory" >&5
+$as_echo_n "checking the PHP extension directory... " >&6; }
+  if test "x${phpdir}" = "xUNKNOWN"; then
 
-    if test "x$matlab_ver" = "x"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-      MATLAB=$user_matlab
-      MATLAB_VERSION=$matlab_ver
-    fi
+  phpdir=`${PHP_CONFIG} --extension-dir`
+
+  if test "x${phpdir}" = "x"; then
+    phpdir="UNKNOWN";
+    have_php="no";
+  elif test "x${phpdir}" = "xNONE"; then
+    have_php="no";
+  fi
+
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $phpdir" >&5
+$as_echo "$phpdir" >&6; }
+  if test "x${phpdir}" = "xUNKNOWN"; then
+    have_php=no
+  fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP CPPFLAGS" >&5
+$as_echo_n "checking PHP CPPFLAGS... " >&6; }
+
+  PHP_CPPFLAGS=`${PHP_CONFIG} --includes`
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_CPPFLAGS" >&5
+$as_echo "$PHP_CPPFLAGS" >&6; }
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP LDFLAGS" >&5
+$as_echo_n "checking PHP LDFLAGS... " >&6; }
+
+  PHP_LDFLAGS=`${PHP_CONFIG} --ldflags`
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_LDFLAGS" >&5
+$as_echo "$PHP_LDFLAGS" >&6; }
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP LIBS" >&5
+$as_echo_n "checking PHP LIBS... " >&6; }
+
+  PHP_LIBS=`${PHP_CONFIG} --libs`
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_LIBS" >&5
+$as_echo "$PHP_LIBS" >&6; }
+
+fi
+
+  if test "x$have_php" = "xno"; then
+    make_phpbindings=no
+  fi
+fi
+
+if test "x$make_pybindings" = "xyes"; then
+  echo
+  echo "*** Configuring python bindings"
+  echo
+
+last_python=2.7
+first_python=2.3
+
+if test "x$SEQ" == "xnot found"; then
+  if test "x$JOT" == "xnot found"; then
+    python_prog_list="python python2"
   else
-    # Extract the first word of "matlab", so it can be a program name with args.
-set dummy matlab; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MATLAB+:} false; then :
-  $as_echo_n "(cached) " >&6
+    python_prog_list="python python2     `$JOT -w 'python%.1f' - $last_python $first_python -0.1`" #'
+  fi
 else
-  case $MATLAB in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MATLAB="$MATLAB" # Let the user override the test with a path.
-  ;;
-  *)
+  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 ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MATLAB="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
+    for exec_ext in '' $ac_executable_extensions; do
+    if as_fn_executable_p "$as_dir/$py$exec_ext"; then
+      prog="import sys
+# split strings by '.' and convert to numeric.  Append some zeros
+# because we need at least 4 digits for the hex conversion.
+# map returns an iterator in Python 3.0 and a list in 2.x
+minver = list(map(int, '$first_python'.split('.'))) + [0, 0, 0]
+minverhex = 0
+# xrange is not present in Python 3.0 and range returns an iterator
+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
+sys.exit(sys.hexversion < minverhex)"
+  if { echo "$as_me:$LINENO: "$as_dir/$py$exec_ext" -c "$prog"" >&5
+   ("$as_dir/$py$exec_ext" -c "$prog") >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; then :
+   PYTHON="$as_dir/$py$exec_ext"; break 3
+fi
+    fi
+  done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_MATLAB" && ac_cv_path_MATLAB="not found"
-  ;;
-esac
-fi
-MATLAB=$ac_cv_path_MATLAB
-if test -n "$MATLAB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB" >&5
-$as_echo "$MATLAB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  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$MATLAB" = "xnot found"; then
-    have_matlab=no
-    MATLAB=
-  fi
 
 fi
 
-if test "x${have_matlab}" != "xno"; then
-    default_matlabbasedir=$libdir/getdata/matlab
+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; }
 
-# Check whether --with-matlab-dir was given.
-if test "${with_matlab_dir+set}" = set; then :
-  withval=$with_matlab_dir;
-      case "${withval}" in
-      no) matlabbasedir=$default_matlabbasedir ;;
-      *) matlabbasedir="${withval}" ;;
-      esac
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python includes" >&5
+$as_echo_n "checking Python includes... " >&6; }
+if test -x $PYTHON-config; then
+  PYTHON_CPPFLAGS=`$PYTHON-config --includes 2>/dev/null`
 else
-   matlabbasedir=$default_matlabbasedir
+  python_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+  python_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+  PYTHON_CPPFLAGS="-I${python_prefix}/include/python${PYTHON_VERSION} -I${python_exec_prefix}/include/python${PYTHON_VERSION}"
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5
+$as_echo "$PYTHON_CPPFLAGS" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking matlab install directory" >&5
-$as_echo_n "checking matlab install directory... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $matlabbasedir" >&5
-$as_echo "$matlabbasedir" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python platform name" >&5
+$as_echo_n "checking Python platform name... " >&6; }
+PYTHON_PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_PLATFORM" >&5
+$as_echo "$PYTHON_PLATFORM" >&6; }
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking MEX extension" >&5
-$as_echo_n "checking MEX extension... " >&6; }
+pyexec_prefix=$exec_prefix
+test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix
+test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix
 
-matlab_int=$MATLAB
-mexext=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', mexext); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print $2 }'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: 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: .$mexext" >&5
-$as_echo ".$mexext" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythondir" >&5
+$as_echo "$pythondir" >&6; }
 
+fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking MatLab CPPFLAGS" >&5
-$as_echo_n "checking MatLab CPPFLAGS... " >&6; }
+  have_numpy="no (required for python bindings)"
+  if test "x$have_python" = "xno"; then
+    make_pybindings="no"
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NumPy" >&5
+$as_echo_n "checking for NumPy... " >&6; }
+    cat > conftest.py << EOF
+import sys
+try:
+  import numpy
+except ImportError:
+  sys.exit(1)
+EOF
+    if $PYTHON conftest.py > /dev/null 2>&1; then
+      have_numpy="yes"
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_numpy" >&5
+$as_echo "$have_numpy" >&6; }
+  fi
+  if test "x$have_numpy" = "xyes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking NumPy includes" >&5
+$as_echo_n "checking NumPy includes... " >&6; }
+    NUMPY_CPPFLAGS=-I`$PYTHON -c "import numpy; print numpy.get_include()"`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUMPY_CPPFLAGS" >&5
+$as_echo "$NUMPY_CPPFLAGS" >&6; }
 
-matlab_prefix=`$MEX -v 2>/dev/null | ${AWK} '/MATLAB *=/ { print $4 }'`
+    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>
 
-  MATLAB_CPPFLAGS="-I${matlab_prefix}/extern/include"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB_CPPFLAGS" >&5
-$as_echo "$MATLAB_CPPFLAGS" >&6; }
+"
+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
 
-  if test "x$have_matlab" = "xno"; then
-    make_matlabbindings=no
+done
+
+    CPPFLAGS=$saved_cppflags
+  else
+    make_pybindings=no
   fi
 fi
 
@@ -32479,6 +32553,228 @@ have_this_header=
 have_this_lib=
 
 
+# Check whether --with-libFLAC was given.
+if test "${with_libFLAC+set}" = set; then :
+  withval=$with_libFLAC;
+             case "${withval}" in
+               no) use_flac="no" ;;
+               yes) use_flac="yes"; flac_prefix= ;;
+               *) use_flac="yes"; flac_prefix="${withval}" ;;
+             esac
+
+else
+   use_flac="yes"; flac_prefix=;
+fi
+
+
+
+echo
+echo "*** Configuring flac support"
+echo
+
+if test "x$no_extern" = "xyes"; then
+  use_flac="no";
+fi
+
+if test "x$use_flac" = "xyes"; then
+    saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$flac_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$flac_prefix/lib"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLAC__stream_decoder_init_FILE in -lFLAC" >&5
+$as_echo_n "checking for FLAC__stream_decoder_init_FILE in -lFLAC... " >&6; }
+if ${ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lFLAC  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char FLAC__stream_decoder_init_FILE ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return FLAC__stream_decoder_init_FILE ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE=yes
+else
+  ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE" >&5
+$as_echo "$ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE" >&6; }
+if test "x$ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE" = xyes; then :
+  have_this_lib=yes
+  LIBS="$LIBS -lFLAC"
+
+$as_echo "#define HAVE_LIBFLAC 1" >>confdefs.h
+
+fi
+
+
+
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  saved_cppflags=$CPPFLAGS
+  if test "x$flac_prefix" != "x"; then
+    CPPFLAGS="$CPPFLAGS -I$flac_prefix/include"
+  fi
+  for ac_header in FLAC/all.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "FLAC/all.h" "ac_cv_header_FLAC_all_h" "$ac_includes_default"
+if test "x$ac_cv_header_FLAC_all_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_FLAC_ALL_H 1
+_ACEOF
+ have_this_header=yes
+fi
+
+done
+
+  CPPFLAGS=$saved_cppflags
+fi
+
+FLAC_CPPFLAGS=
+FLAC_LDFLAGS=
+FLAC_LIBS=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+  if test "x$flac_prefix" = "x"; then
+    FLAC_LIBS="-lFLAC"
+    FLAC_SEARCHPATH="$PATH"
+  else
+    FLAC_CPPFLAGS="-I$flac_prefix/include"
+    FLAC_LDFLAGS="-L$flac_prefix/lib"
+    FLAC_LIBS="-lFLAC"
+    FLAC_SEARCHPATH="$flac_prefix/bin:$PATH"
+  fi
+
+$as_echo "#define USE_FLAC /**/" >>confdefs.h
+
+else
+  use_flac="no";
+  FLAC_SEARCHPATH="$PATH"
+fi
+
+
+
+
+
+for ac_prog in flac
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_flac+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_flac in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_flac="$path_flac" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $FLAC_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_flac="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_flac=$ac_cv_path_path_flac
+if test -n "$path_flac"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_flac" >&5
+$as_echo "$path_flac" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_flac" && break
+done
+test -n "$path_flac" || path_flac="not found"
+
+
+if test "x$path_flac" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define FLAC "$path_flac"
+_ACEOF
+
+fi
+
+
+ if test "x$use_flac" = "xyes"; then
+  USE_FLAC_TRUE=
+  USE_FLAC_FALSE='#'
+else
+  USE_FLAC_TRUE='#'
+  USE_FLAC_FALSE=
+fi
+
+
+if test "x$path_flac" != "xnot found" -a \
+  "x$path_bunzip2" != "xnot found"; then
+
+$as_echo "#define TEST_FLAC /**/" >>confdefs.h
+
+fi
+
+if test "x$use_flac" != "xno"; then
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} flac";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} flac";
+    if test -z "$PRIVATE_LIBS"; then
+      PRIVATE_LIBS="$FLAC_LDFLAGS $FLAC_LIBS"
+    else
+      PRIVATE_LIBS="$FLAC_LDFLAGS $PRIVATE_LIBS $FLAC_LIBS"
+    fi
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} flac";
+fi
+
+
+have_this_header=
+have_this_lib=
+
+
 # Check whether --with-libz was given.
 if test "${with_libz+set}" = set; then :
   withval=$with_libz;
@@ -32562,6 +32858,19 @@ fi
 
 
 
+  for ac_func in gzseek64 gztell64
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
   LDFLAGS=$saved_ldflags
   LIBS=$saved_libs
 
@@ -33062,12 +33371,13 @@ fi
 
 
 
-  for ac_func in slimdopen
+  for ac_func in slimdopen slimdrawsize
 do :
-  ac_fn_c_check_func "$LINENO" "slimdopen" "ac_cv_func_slimdopen"
-if test "x$ac_cv_func_slimdopen" = xyes; then :
+  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 HAVE_SLIMDOPEN 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33121,18 +33431,18 @@ fi
 
 
 
-for ac_prog in slim slimdata
+for ac_prog in slimdata slim
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_path_slim+:} false; then :
+if ${ac_cv_path_path_slimdata+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $path_slim in
+  case $path_slimdata in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_path_slim="$path_slim" # Let the user override the test with a path.
+  ac_cv_path_path_slimdata="$path_slimdata" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -33142,7 +33452,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_path_slim="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_path_slimdata="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -33153,25 +33463,25 @@ 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; }
+path_slimdata=$ac_cv_path_path_slimdata
+if test -n "$path_slimdata"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_slimdata" >&5
+$as_echo "$path_slimdata" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$path_slim" && break
+  test -n "$path_slimdata" && break
 done
-test -n "$path_slim" || path_slim="not found"
+test -n "$path_slimdata" || path_slimdata="not found"
 
 
-if test "x$path_slim" != "xnot found"; then
+if test "x$path_slimdata" != "xnot found"; then
 
 cat >>confdefs.h <<_ACEOF
-#define SLIM "$path_slim"
+#define SLIMDATA "$path_slimdata"
 _ACEOF
 
 fi
@@ -33242,7 +33552,7 @@ else
 fi
 
 
-if test "x$path_slim" != "xnot found" -a \
+if test "x$path_slimdata" != "xnot found" -a \
   "x$path_unslim" != "xnot found"; then
 
 $as_echo "#define TEST_SLIM /**/" >>confdefs.h
@@ -33719,8 +34029,14 @@ ac_config_files="$ac_config_files bindings/perl/Makefile"
 
 ac_config_files="$ac_config_files bindings/perl/Build.PL"
 
+ac_config_files="$ac_config_files bindings/php/Makefile"
+
+ac_config_files="$ac_config_files bindings/php/test/Makefile"
+
 ac_config_files="$ac_config_files bindings/python/Makefile"
 
+ac_config_files="$ac_config_files bindings/python/setup.py"
+
 ac_config_files="$ac_config_files bindings/python/test/Makefile"
 
 ac_config_files="$ac_config_files doc/Makefile"
@@ -33735,9 +34051,9 @@ 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_files="$ac_config_files src/getdata.h.in2:src/getdata.h.in"
 
-ac_config_headers="$ac_config_headers src/getdata.h:src/getdata.ah"
+ac_config_headers="$ac_config_headers src/getdata.h:src/getdata.h.in2"
 
 ac_config_files="$ac_config_files src/getdata.pc"
 
@@ -33754,76 +34070,12 @@ else
   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_f77_fno_backslash" == "xyes"; then
-  F77_FNO_BACKSLASH_TRUE=
-  F77_FNO_BACKSLASH_FALSE='#'
-else
-  F77_FNO_BACKSLASH_TRUE='#'
-  F77_FNO_BACKSLASH_FALSE=
-fi
-
- if test "x$gd_cv_prog_fc_wextra" == "xyes"; then
-  FC_WEXTRA_TRUE=
-  FC_WEXTRA_FALSE='#'
+ if  test "x${SED}" != 'x' ; then
+  HAVE_SED_TRUE=
+  HAVE_SED_FALSE='#'
 else
-  FC_WEXTRA_TRUE='#'
-  FC_WEXTRA_FALSE=
+  HAVE_SED_TRUE='#'
+  HAVE_SED_FALSE=
 fi
 
  if test "x$gd_cv_f77_compiler_intel" == "xyes"; then
@@ -33906,6 +34158,14 @@ else
   MAKE_MATLABBINDINGS_FALSE=
 fi
 
+ if test "x$make_phpbindings" = "xyes"; then
+  MAKE_PHPBINDINGS_TRUE=
+  MAKE_PHPBINDINGS_FALSE='#'
+else
+  MAKE_PHPBINDINGS_TRUE='#'
+  MAKE_PHPBINDINGS_FALSE=
+fi
+
  if test "x$use_modules" != "xno"; then
   USE_MODULES_TRUE=
   USE_MODULES_FALSE='#'
@@ -33946,6 +34206,14 @@ else
   TEST_MATLAB_FALSE=
 fi
 
+ if test "x$NO_DLOPEN_TESTS" = "x0"; then
+  TEST_PHP_TRUE=
+  TEST_PHP_FALSE='#'
+else
+  TEST_PHP_TRUE='#'
+  TEST_PHP_FALSE=
+fi
+
  if test "x$DIFF" != "x"; then
   HAVE_DIFF_TRUE=
   HAVE_DIFF_FALSE='#'
@@ -34124,6 +34392,10 @@ if test -z "${USE_BZIP2_TRUE}" && test -z "${USE_BZIP2_FALSE}"; then
   as_fn_error $? "conditional \"USE_BZIP2\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${USE_FLAC_TRUE}" && test -z "${USE_FLAC_FALSE}"; then
+  as_fn_error $? "conditional \"USE_FLAC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${USE_GZIP_TRUE}" && test -z "${USE_GZIP_FALSE}"; then
   as_fn_error $? "conditional \"USE_GZIP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -34144,40 +34416,8 @@ 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 "${F77_FNO_BACKSLASH_TRUE}" && test -z "${F77_FNO_BACKSLASH_FALSE}"; then
-  as_fn_error $? "conditional \"F77_FNO_BACKSLASH\" 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.
+if test -z "${HAVE_SED_TRUE}" && test -z "${HAVE_SED_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_SED\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${INTEL_F77_COMPILER_TRUE}" && test -z "${INTEL_F77_COMPILER_FALSE}"; then
@@ -34220,6 +34460,10 @@ if test -z "${MAKE_MATLABBINDINGS_TRUE}" && test -z "${MAKE_MATLABBINDINGS_FALSE
   as_fn_error $? "conditional \"MAKE_MATLABBINDINGS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${MAKE_PHPBINDINGS_TRUE}" && test -z "${MAKE_PHPBINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_PHPBINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${USE_MODULES_TRUE}" && test -z "${USE_MODULES_FALSE}"; then
   as_fn_error $? "conditional \"USE_MODULES\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -34240,6 +34484,10 @@ if test -z "${TEST_MATLAB_TRUE}" && test -z "${TEST_MATLAB_FALSE}"; then
   as_fn_error $? "conditional \"TEST_MATLAB\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${TEST_PHP_TRUE}" && test -z "${TEST_PHP_FALSE}"; then
+  as_fn_error $? "conditional \"TEST_PHP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_DIFF_TRUE}" && test -z "${HAVE_DIFF_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_DIFF\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -34649,7 +34897,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # 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.8.9, which was
+This file was extended by GetData $as_me 0.9.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -34716,7 +34964,7 @@ _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.8.9
+GetData config.status 0.9.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -35417,7 +35665,10 @@ do
     "bindings/matlab/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/matlab/test/Makefile" ;;
     "bindings/perl/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/perl/Makefile" ;;
     "bindings/perl/Build.PL") CONFIG_FILES="$CONFIG_FILES bindings/perl/Build.PL" ;;
+    "bindings/php/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/php/Makefile" ;;
+    "bindings/php/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/php/test/Makefile" ;;
     "bindings/python/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/Makefile" ;;
+    "bindings/python/setup.py") CONFIG_FILES="$CONFIG_FILES bindings/python/setup.py" ;;
     "bindings/python/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/test/Makefile" ;;
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
     "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
@@ -35425,8 +35676,8 @@ do
     "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.h.in2") CONFIG_FILES="$CONFIG_FILES src/getdata.h.in2:src/getdata.h.in" ;;
+    "src/getdata.h") CONFIG_HEADERS="$CONFIG_HEADERS src/getdata.h:src/getdata.h.in2" ;;
     "src/getdata.pc") CONFIG_FILES="$CONFIG_FILES src/getdata.pc" ;;
     "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
     "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;;
@@ -37204,6 +37455,12 @@ else
   BINDINGS_LEFT="${BINDINGS_LEFT} MATLAB"
 fi
 
+if test "x$make_phpbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} PHP"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} PHP"
+fi
+
 if test "x$make_perlbindings" != "xno"; then
   BINDINGS_BUILT="${BINDINGS_BUILT} Perl"
 else
@@ -37238,6 +37495,10 @@ fi
 
 echo
 echo "Configuration summary: "
+echo "  Build platform:                ${build}"
+if test "x${cross_compiling}" != "xno"; then
+  echo "  Cross compiling for:           ${host}"
+fi
 echo "  ANSI C compatibility mode:     ${disable_c99}"
 echo "  Legacy API:                    ${include_legacy_api}"
 echo "  Verbose debugging:             ${enable_debug}"
@@ -37255,7 +37516,4 @@ 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
index f3a9ca7..f3c5c59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,10 +47,11 @@ AC_SUBST([GETDATA_VERSION_SUFFIX], [getdata_extra])
 AC_PREREQ([2.65])
 AC_CONFIG_MACRO_DIR([m4])
 
-LT_PREREQ([2.2.6b])
+LT_PREREQ([2.2.7b])
 
 AC_ARG_VAR([BUILDCC],
-           [C compiler command on the build system (only needed if cross-compiling)])
+           [C compiler command targetting the build system ]
+           [(only needed if cross-compiling)])
 
 dnl export version information from m4/version.m4
 AC_SUBST(GETDATA_IFACE_VERSION, [getdata_iface_version])
@@ -79,14 +80,14 @@ AC_CANONICAL_BUILD
 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'
+AC_ARG_ENABLE(legacy-api, AS_HELP_STRING([--enaable-legacy-api],
+              [include the legacy API wrapper in the library]), dnl'
               [
                case "${enableval}" in
                  no) include_legacy_api="no" ;;
                  *) include_legacy_api="yes" ;;
                esac
-              ], [ include_legacy_api="yes" ])
+              ], [ include_legacy_api="no" ])
 AC_MSG_CHECKING([whether to include the legacy API])
 AC_MSG_RESULT([$include_legacy_api])
 
@@ -153,8 +154,9 @@ make_pybindings="yes"
 make_idlbindings="yes"
 make_perlbindings="yes"
 make_matlabbindings="yes"
+make_phpbindings="yes"
 AC_ARG_ENABLE(bindings, AS_HELP_STRING([--disable-bindings],
-              [don't build any bindings, just build the C library]),
+              [don't build any bindings; just build the C library]),
               [
                if test "x${enableval}" = "xno"; then
                  make_cxxbindings="no"
@@ -163,6 +165,7 @@ AC_ARG_ENABLE(bindings, AS_HELP_STRING([--disable-bindings],
                  make_idlbindings="no"
                  make_perlbindings="no"
                  make_matlabbindings="no"
+                 make_phpbindings="no"
                fi
               ])
 
@@ -180,8 +183,8 @@ 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)]),
+              [don't build the Fortran 77 bindings (libfgetdata) nor ]dnl'
+              [the Fortran 95 bindings (libf95getdata)]),
               [
                case "${enableval}" in
                  no) make_f77bindings="no" ;;
@@ -191,7 +194,7 @@ AC_ARG_ENABLE(fortran, AS_HELP_STRING([--disable-fortran],
 
 dnl Fortran 95 bindings
 AC_ARG_ENABLE(fortran95, AS_HELP_STRING([--disable-fortran95],
-              [don't build the Fortran 95 bindings (libf95getdata)]),
+              [don't build the Fortran 95 bindings (libf95getdata)]),dnl'
               [
                case "${enableval}" in
                  no) make_f95bindings="no" ;;
@@ -209,29 +212,10 @@ 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])
-AC_MSG_RESULT([$make_pybindings])
-
 dnl IDL bindings
 AC_ARG_ENABLE(idl, AS_HELP_STRING([--disable-idl],
-       [don't build the Interactive Data Language (IDL) bindings (IDL_GetData)]),
+              [don't build the Interactive Data Language (IDL) bindings ]dnl'
+              [(IDL_GetData)]),
               [
                case "${enableval}" in
                  no) make_idlbindings="no" ;;
@@ -242,9 +226,22 @@ AC_ARG_ENABLE(idl, AS_HELP_STRING([--disable-idl],
 AC_MSG_CHECKING([whether to include the IDL bindings])
 AC_MSG_RESULT([$make_idlbindings])
 
+dnl MATLAB bindings
+AC_ARG_ENABLE(matlab, AS_HELP_STRING([--disable-matlab],
+              [don't build the MATLAB bindings]),dnl'
+              [
+               case "${enableval}" in
+                 no) make_matlabbindings="no" ;;
+                 *) make_matlabbindings="yes" ;;
+               esac
+              ])
+
+AC_MSG_CHECKING([whether to include the MATLAB bindings])
+AC_MSG_RESULT([$make_matlabbindings])
+
 dnl Perl bindings
 AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl],
-              [don't build the Perl bindings (GetData)]),
+              [don't build the Perl bindings (GetData)]),dnl'
               [
                case "${enableval}" in
                  no) make_perlbindings="no" ;;
@@ -255,18 +252,31 @@ AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl],
 AC_MSG_CHECKING([whether to include the Perl bindings])
 AC_MSG_RESULT([$make_perlbindings])
 
-dnl MATLAB bindings
-AC_ARG_ENABLE(matlab, AS_HELP_STRING([--disable-matlab],
-              [don't build the MATLAB bindings]),
+dnl PHP bindings
+AC_ARG_ENABLE(php, AS_HELP_STRING([--disable-php],
+              [don't build the PHP bindings]),dnl'
               [
                case "${enableval}" in
-                 no) make_matlabbindings="no" ;;
-                 *) make_matlabbindings="yes" ;;
+                 no) make_phpbindings="no" ;;
+                 *) make_phpbindings="yes" ;;
                esac
               ])
 
-AC_MSG_CHECKING([whether to include the MATLAB bindings])
-AC_MSG_RESULT([$make_matlabbindings])
+dnl Python bindings
+AC_ARG_ENABLE(python, AS_HELP_STRING([--disable-python],
+              [don't build the Python bindings (pygetdata)]),dnl'
+              [
+               case "${enableval}" in
+                 no) make_pybindings="no" ;;
+                 *) make_pybindings="yes" ;;
+               esac
+              ])
+
+AC_MSG_CHECKING([whether to include the Python bindings])
+AC_MSG_RESULT([$make_pybindings])
+
+AC_MSG_CHECKING([whether to include the PHP bindings])
+AC_MSG_RESULT([$make_phpbindings])
 
 dnl Modules
 AC_ARG_ENABLE(modules, AS_HELP_STRING([--enable-modules],
@@ -346,6 +356,15 @@ AC_CHECK_PROGS([SEQ], [seq], [not found])
 
 GD_MSYS_SHELL
 
+dnl verion info
+AC_SUBST([DEFINE_GD_GETDATA_VERSION], ["#define GD_GETDATA_VERSION \"]dnl"
+getdata_version[\""])
+[DEFINE_GD_GETDATA_INT_VERSION="#define GD_GETDATA_INT_VERSION `${PRINTF} ]dnl
+ifelse(`getdata_major', `0',dnl"
+[%i%02i getdata_minor getdata_revision`"],dnl`
+[%i%02i%02i getdata_major getdata_minor getdata_revision`"])dnl`
+AC_SUBST([DEFINE_GD_GETDATA_INT_VERSION])
+
 echo
 echo "*** Checking host environment"
 echo
@@ -364,6 +383,12 @@ AC_ARG_ENABLE([fast-unaligned], AS_HELP_STRING([--enable-fast-unaligned],
    esac
    ], [gd_unaligned_override="check"])
 
+m4_divert_once([HELP_ENABLE], AS_HELP_STRING([--disable-fast-unaligned],
+               [don't use fast loads and stores with non-aligned data, ]dnl'
+               [even if it looks like they should work.  This is always ]
+               [safe, but can result in significant slow-down.]
+               [ [default: autodetect]]))
+
 AC_MSG_CHECKING([whether ${host} supports fast unaligned memory access])
 if test "x$gd_unaligned_override" = "xyes"; then
   gd_unaligned_ok=yes
@@ -396,6 +421,7 @@ AC_DEFINE_UNQUOTED([GD_DIRSEP], ['$GD_DIRSEP'],
                    [ The directory separator between path elements ])
 AC_MSG_RESULT([$GD_FDIRSEP])
 
+AC_MSG_CHECKING([for extra LDFLAGS needed on ${host}])
 case "${host}" in
   *-pc-mingw*)
   NO_UNDEFINED=" -no-undefined"
@@ -406,6 +432,26 @@ case "${host}" in
   *) NO_DLOPEN_TESTS=0 ;;
 esac
 
+if test "x${NO_UNDEFINED}" = "x"; then
+  AC_MSG_RESULT([none needed])
+else
+  AC_MSG_RESULT([${NO_UNDEFINED}])
+fi
+
+AC_MSG_CHECKING([whether the test suite can dynamically load objects])
+if test "x${NO_DLOPEN_TESTS}" = "x1"; then
+  AC_MSG_RESULT([no])
+else
+  AC_MSG_RESULT([yes])
+fi
+
+dnl DL library path munging for test suite
+case "${host}" in
+  *-apple-darwin*) DL_LIBRARY_PATH="DYLD_LIBRARY_PATH" ;;
+  *) DL_LIBRARY_PATH="LD_LIBRARY_PATH" ;;
+esac
+AC_SUBST([DL_LIBRARY_PATH])
+
 echo
 echo "*** Checking C compiler characteristics"
 echo
@@ -470,6 +516,12 @@ if test "x${cross_compiling}" != "xno"; then
   if test -z "$BUILDCC"; then
     AC_CHECK_PROGS([BUILDCC], [gcc cc cl])
   fi
+  # bindings requiring interpreters aren't built when cross compiling
+  make_idlbindings=no
+  make_phpbindings=no
+  make_pybindings=no
+  make_perlbindings=no
+  make_matlabbindings=no
 else
   if test -z "$BUILDCC"; then
     BUILDCC=$CC
@@ -504,9 +556,12 @@ if test "x${use_modules}" != "xno"; then
   fi
 
   if test "x$ltdl_prefix" != "x"; then
-    AC_CHECK_HEADERS(ltdl.h)
     LIBLTDL="-L${ltdl_prefix}/lib -lltdl"
-    LTDLINC="-I${ltdl_prefix}/include"
+    LTDLINCL="-I${ltdl_prefix}/include"
+    saved_cppflags=$CPPFLAGS
+    CPPFLAGS="${CPPFLAGS} ${LTDLINCL}"
+    AC_CHECK_HEADERS(ltdl.h)
+    CPPFLAGS=$saved_cppflags
   else
     AC_CHECK_HEADERS(ltdl.h)
     LIBLTDL="-lltdl"
@@ -545,7 +600,6 @@ dnl compiler checks
 echo
 echo "*** Checking additional compiler characteristics"
 echo
-AC_SYS_LARGEFILE
 AC_C_INLINE
 AC_C_RESTRICT
 GD_C_RESTRICT_ARRAY
@@ -560,7 +614,6 @@ fi
 if test "x$make_f77bindings" != "xno"; then
   GD_PROG_F77_WALL
   GD_PROG_F77_WEXTRA
-  GD_PROG_F77_FNO_BACKSLASH
   GD_LANG_F77_COMPILER_INTEL
 fi
 
@@ -608,7 +661,8 @@ echo
 AC_CHECK_HEADERS([asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \
                   float.h inttypes.h io.h libgen.h libkern/OSByteOrder.h \
                   math.h stddef.h stdint.h sys/endian.h sys/file.h sys/param.h \
-                  sys/stat.h sys/types.h sys/wait.h unistd.h])
+                  sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h \
+                  unistd.h])
 if test "x$disable_c99" = "xno"; then
 AC_CHECK_HEADERS([complex.h])
 fi
@@ -621,19 +675,18 @@ 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_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_MODE_T
 AC_TYPE_OFF_T
-AC_CHECK_SIZEOF([off_t])
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_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])
@@ -642,6 +695,8 @@ fi
 AC_CHECK_TYPES([struct stat64, struct _stat64, struct __stat64, off64_t])
 
 dnl integer sizes
+AC_CHECK_SIZEOF([off_t])
+AC_CHECK_SIZEOF([size_t])
 AC_CHECK_SIZEOF([short int])
 AC_CHECK_SIZEOF([int])
 AC_CHECK_SIZEOF([long int])
@@ -717,9 +772,9 @@ AC_CHECK_FUNCS([basename _chsize _chsize_s _commit fchmod _fdopen fdopendir \
                 fstatat fstatat64 fsync ftello ftello64 ftruncate ftruncate64 \
                 getcwd _getcwd getdelim gmtime_r isnan _isnan lseek64 \
                 _lseeki64 lstat lstat64 _mkdir mkfifo nan _open openat \
-                pathconf _read readdir_r readlink renameat _rmdir snprintf \
-                _snprintf stat64 _stat64 _strtoi64 strtoll strtoq _strtoui64 \
-                strtoull strtouq symlink _unlink unlinkat _write])
+                pathconf _read readdir_r readlink renameat _rmdir setrlimit \
+                snprintf _snprintf stat64 _stat64 _strtoi64 strtoll strtoq \
+                _strtoui64 strtoull strtouq symlink _unlink unlinkat _write])
 if test "x$disable_c99" = "xno"; then
   AC_CHECK_FUNCS([cabs])
 fi
@@ -759,6 +814,13 @@ AC_CHECK_DECLS([isfinite],,,
 #include <math.h>
 #endif
 ])
+AC_CHECK_DECLS([_strtoi64, _strtoui64],,,
+               [
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+])
+
 AC_CHECK_DECLS([bswap16, bswap_16, OSSwapInt16],,,
               [
 #ifdef HAVE_BYTESWAP_H
@@ -779,13 +841,75 @@ AC_CHECK_DECLS([get_unaligned, put_unaligned],,,
 #endif
 ])
 
+dnl idl
+if test "x$make_idlbindings" = "xyes"; then
+  echo
+  echo "*** Configuring interactive data language (IDL) bindings"
+  echo
+  AC_MSG_CHECKING([whether C99 is supported])
+  if test "x$disable_c99" = "xno"; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+    make_idlbindings=no
+  fi
+fi
+if test "x$make_idlbindings" = "xyes"; then
+  GD_IDL([5.5])
+  if test "x$have_idl" = "xno"; then
+    make_idlbindings="no"
+  fi
+fi
+
+dnl matlab
+if test "x$make_matlabbindings" = "xyes"; then
+  echo
+  echo "*** Configuring MATLAB bindings"
+  echo
+  GD_MATLAB
+  if test "x$have_matlab" = "xno"; then
+    make_matlabbindings=no
+  fi
+fi
+
+dnl perl
+if test "x$make_perlbindings" = "xyes"; then
+  echo
+  echo "*** Configuring Perl bindings"
+  echo
+  GD_PERL
+  if test "x$have_perl" = "xno"; then
+    make_perlbindings=no
+  fi
+fi
+
+dnl php
+if test "x$make_phpbindings" = "xyes"; then
+  echo
+  echo "*** Configuring PHP bindings"
+  echo
+  AC_MSG_CHECKING([whether C99 is supported])
+  if test "x$disable_c99" = "xno"; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+    make_phpbindings=no
+  fi
+fi
+if test "x$make_phpbindings" = "xyes"; then
+  GD_PHP
+  if test "x$have_php" = "xno"; then
+    make_phpbindings=no
+  fi
+fi
+
 dnl python
 if test "x$make_pybindings" = "xyes"; then
   echo
   echo "*** Configuring python bindings"
   echo
   GD_PYTHON([2.3])
-  have_numpy="no"
+  have_numpy="no (required for python bindings)"
   if test "x$have_python" = "xno"; then
     make_pybindings="no"
   else
@@ -806,7 +930,6 @@ EOF
     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}"
@@ -814,69 +937,27 @@ EOF
 #include<Python.h>
 ])
     CPPFLAGS=$saved_cppflags
-  fi
-
-  if test "x$have_numpy" = "xyes"; then
-    AC_DEFINE([USE_NUMPY], [],
-              [ Define 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
-  AC_MSG_CHECKING([whether C99 is supported])
-  if test "x$disable_c99" = "xno"; then
-    AC_MSG_RESULT([yes])
   else
-    AC_MSG_RESULT([no])
-    make_idlbindings=no
-  fi
-fi
-if test "x$make_idlbindings" = "xyes"; then
-  GD_IDL([5.5])
-  if test "x$have_idl" = "xno"; then
-    make_idlbindings="no"
-  fi
-fi
-
-dnl perl
-if test "x$make_perlbindings" = "xyes"; then
-  echo
-  echo "*** Configuring Perl bindings"
-  echo
-  GD_PERL
-  if test "x$have_perl" = "xno"; then
-    make_perlbindings=no
-  fi
-fi
-
-dnl matlab
-if test "x$make_matlabbindings" = "xyes"; then
-  echo
-  echo "*** Configuring MATLAB bindings"
-  echo
-  GD_MATLAB
-  if test "x$have_matlab" = "xno"; then
-    make_matlabbindings=no
+    make_pybindings=no
   fi
 fi
 
 dnl external encodings
 GD_CHECK_ENCODING([bzip2],[bz2],[BZ2_bzReadOpen],[bzlib.h],[bzip2],[bunzip2],[])
-GD_CHECK_ENCODING([gzip],[z],[gzopen],[zlib.h],[gzip],[gunzip],[])
+GD_CHECK_ENCODING([flac],[FLAC],[FLAC__stream_decoder_init_FILE],[FLAC/all.h],
+                  [flac],[],[])
+GD_CHECK_ENCODING([gzip],[z],[gzopen],[zlib.h],[gzip],[gunzip],
+                  [gzseek64 gztell64])
 GD_CHECK_ENCODING([lzma],[lzma],[lzma_auto_decoder],[lzma.h],[xz],[],[])
-GD_CHECK_ENCODING([slim],[slim],[slimopen],[slimlib.h], [slim slimdata],
-                  [unslim],[slimdopen])
+GD_CHECK_ENCODING([slim],[slim],[slimopen],[slimlib.h], [slimdata slim],
+                  [unslim],[slimdopen slimdrawsize])
 GD_CHECK_ENCODING([zzip],[zzip],[zzip_open],[zzip/lib.h],[zip],[unzip],[])
 
 dnl zzslim hackery -- there's no easy way to check whether slim supports zzip
 AC_ARG_ENABLE(zzslim, AS_HELP_STRING([--enable-zzslim],
               [skip probing for zzslim required features and enable the zzslim
-               encoding.  The default is to autodetect support.  Note: zzslim
-               encoding support requires both slim and zzip encoding support.]),
+               encoding.  Note: zzslim encoding support requires both slim and
+               zzip encoding support.  [default: autodetect]]),
               [
                case "${enableval}" in
                  no) zzslim_override="no" ;;
@@ -992,7 +1073,10 @@ AC_CONFIG_FILES([bindings/matlab/make_contents.sh])
 AC_CONFIG_FILES([bindings/matlab/test/Makefile])
 AC_CONFIG_FILES([bindings/perl/Makefile])
 AC_CONFIG_FILES([bindings/perl/Build.PL])
+AC_CONFIG_FILES([bindings/php/Makefile])
+AC_CONFIG_FILES([bindings/php/test/Makefile])
 AC_CONFIG_FILES([bindings/python/Makefile])
+AC_CONFIG_FILES([bindings/python/setup.py])
 AC_CONFIG_FILES([bindings/python/test/Makefile])
 AC_CONFIG_FILES([doc/Makefile])
 AC_CONFIG_FILES([man/Makefile])
@@ -1002,24 +1086,15 @@ AC_CONFIG_FILES([man/gd_alter_frameoffset.3])
 AC_CONFIG_FILES([src/Makefile])
 dnl This doubling allows us to build getdata.h as a normal AC_CONFIG_FILE, but
 dnl use AC_CONFIG_HEADERS to check whether it has changed.
-AC_CONFIG_FILES([src/getdata.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.h.in2:src/getdata.h.in])
+AC_CONFIG_HEADERS([src/getdata.h:src/getdata.h.in2], [chmod a-w src/getdata.h])
 AC_CONFIG_FILES([src/getdata.pc])
 AC_CONFIG_FILES([test/Makefile])
 AC_CONFIG_FILES([util/Makefile])
 
 dnl Automake conditionals
 AM_CONDITIONAL(GETDATA_DEBUG, [test "x$enable_debug" == "xyes"])
-AM_CONDITIONAL(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(F77_FNO_BACKSLASH,
-               [test "x$gd_cv_prog_f77_fno_backslash" == "xyes"])
-AM_CONDITIONAL(FC_WEXTRA, [test "x$gd_cv_prog_fc_wextra" == "xyes"])
+AM_CONDITIONAL(HAVE_SED, [ test "x${SED}" != 'x' ])
 AM_CONDITIONAL(INTEL_F77_COMPILER,
                [test "x$gd_cv_f77_compiler_intel" == "xyes"])
 AM_CONDITIONAL(INTEL_FC_COMPILER, [test "x$gd_cv_fc_compiler_intel" == "xyes"])
@@ -1031,11 +1106,13 @@ AM_CONDITIONAL(MAKE_PYBINDINGS, [test "x$make_pybindings" = "xyes"])
 AM_CONDITIONAL(MAKE_IDLBINDINGS, [test "x$make_idlbindings" = "xyes"])
 AM_CONDITIONAL(MAKE_PERLBINDINGS, [test "x$make_perlbindings" = "xyes"])
 AM_CONDITIONAL(MAKE_MATLABBINDINGS, [test "x$make_matlabbindings" = "xyes"])
+AM_CONDITIONAL(MAKE_PHPBINDINGS, [test "x$make_phpbindings" = "xyes"])
 AM_CONDITIONAL(USE_MODULES, [test "x$use_modules" != "xno"])
 AM_CONDITIONAL(TEST_PYTHON, [test "x$NO_DLOPEN_TESTS" = "x0"])
 AM_CONDITIONAL(TEST_IDL, [test "x$NO_DLOPEN_TESTS" = "x0"])
 AM_CONDITIONAL(TEST_PERL, [test "x$HAVE_Test__Harness" = "xyes"])
 AM_CONDITIONAL(TEST_MATLAB, [test "x$NO_DLOPEN_TESTS" = "x0"])
+AM_CONDITIONAL(TEST_PHP, [test "x$NO_DLOPEN_TESTS" = "x0"])
 AM_CONDITIONAL(HAVE_DIFF, [test "x$DIFF" != "x"])
 AM_CONDITIONAL(USE_ZZSLIM, [test "x$use_zzslim" = "xyes"])
 AM_CONDITIONAL(GD_EXTERNAL, [false])
@@ -1077,6 +1154,12 @@ else
   BINDINGS_LEFT="${BINDINGS_LEFT} MATLAB"
 fi
 
+if test "x$make_phpbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} PHP"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} PHP"
+fi
+
 if test "x$make_perlbindings" != "xno"; then
   BINDINGS_BUILT="${BINDINGS_BUILT} Perl"
 else
@@ -1111,6 +1194,10 @@ fi
 
 echo
 echo "Configuration summary: "
+echo "  Build platform:                ${build}"
+if test "x${cross_compiling}" != "xno"; then
+  echo "  Cross compiling for:           ${host}"
+fi
 echo "  ANSI C compatibility mode:     ${disable_c99}"
 echo "  Legacy API:                    ${include_legacy_api}"
 echo "  Verbose debugging:             ${enable_debug}"
@@ -1128,7 +1215,4 @@ 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/doc/Makefile.am b/doc/Makefile.am
index aa6e31d..dc8818e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2012 D. V. Wiebe
+# Copyright (C) 2008, 2009, 2012, 2013 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 6964a57..5745345 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -85,10 +85,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -177,6 +175,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -202,8 +202,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -251,7 +262,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -266,12 +276,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -335,9 +349,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -345,6 +360,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -358,7 +374,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008, 2012 D. V. Wiebe
+# Copyright (C) 2008, 2009, 2012, 2013 D. V. Wiebe
 #
 ##########################################################################
 #
diff --git a/doc/README.cxx b/doc/README.cxx
index a0956ba..56996d2 100644
--- a/doc/README.cxx
+++ b/doc/README.cxx
@@ -71,13 +71,31 @@ The GetData window operations (defined in getdata/entry.h):
 The GetData encoding schemes (defined in getdata/fragment.h):
 
   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,
-    SieEncoding   = GD_SIE_ENCODED,  ZzipEncoding  = GD_ZZIP_ENCODED,
-    ZzslimEncoding = GD_ZZSLIM_ENCODED, UnsupportedEncoding = GD_ENC_UNSUPPORTED
+    AutoEncoding   = GD_AUTO_ENCODED, 
+    Bzip2Encoding  = GD_BZIP2_ENCODED,
+    FlacEncoding   = GD_FLAC_ENCODED,
+    GzipEncoding   = GD_GZIP_ENCODED,
+    RawEncoding    = GD_UNENCODED,
+    SieEncoding    = GD_SIE_ENCODED,  
+    SlimEncoding   = GD_SLIM_ENCODED,
+    TextEncoding   = GD_TEXT_ENCODED,
+    ZzipEncoding   = GD_ZZIP_ENCODED,
+    ZzslimEncoding = GD_ZZSLIM_ENCODED, 
+    UnsupportedEncoding = GD_ENC_UNSUPPORTED
   };
 
+NON-MEMBER FUNCTIONS
+====================
+
+The following non-member functions in the GetData namespace are defined in
+getdata/dirfile.h:
+
+* GetData::EncodingSupport(GetData::EncodingScheme encoding)
+
+  This function returns GD_RDWR if the library supports both reading from and
+  writing to the specified encoding, GD_RDONLY, if the library can only read
+  from the encoding, or -1 if the library supports neither reading nor writing
+  for the specified encoding.  See gd_encoding_support(3).
 
 
 DIRFILE CLASS
@@ -213,11 +231,10 @@ are available:
 * const char** Dirfile::Aliases(const char* field_code)
 * const char* Dirfile::AliasTarget(const char* field_code)
 * int Dirfile::AlterSpec(const char *line, int recode = 0)
+* const size_t Dirfile::ArrayLen(const char *field_code)
 * const gd_carray_t *Dirfile::Carrays(GetData::DataType type = Float64)
-* const size_t Dirfile::CarrayLen(const char *field_code)
 * const void *Dirfile::Constants(GetData::DataType type = Float64)
-* int Dirfile::Delete(const char *field_code, int flags = 0)
-* int Dirfile::DeleteAlias(const char* field_code, int flags = 0)
+* int Dirfile::Delete(const char *field_code, unsigned flags = 0)
 * const char **Dirfile::EntryList(const char *parent = NULL, int type = 0,
     unsigned int flags = 0)
 * const char **Dirfile::FieldList()
@@ -251,7 +268,6 @@ are available:
 * const char **Dirfile::MFieldListByType(const char *parent,
     GetData::EntryType type)
 * void MplexLookback(int lookback)
-* int Dirfile::MoveAlias(const char* field_code, int new_fragment)
 * const char **Dirfile::MStrings(const char *parent)
 * const char **Dirfile::MVectorList(const char *parent)
 * int Dirfile::NAliases(const char* field_code)
@@ -365,26 +381,27 @@ The following methods are available:
   Entry types listed above in the CONSTANTS section.
 
 * int Entry::SetFragmentIndex(int fragment_index)
-* int Entry::Move(int new_fragment, int move_data = 0)
+* int Entry::Move(int new_fragment, unsigned flags = 0)
 
   These will update the fragment index of the entry.  If the entry is
   associated, these will call gd_move(3) to move the field to a different
   fragment.  These two functions are equivalent, except Entry::Move allows
-  specifying the move_data flag.  Entry::SetFragmentIndex always calls gd_move
-  with move_data = 0.
+  specifying flags for the move.  Entry::SetFragmentIndex always calls gd_move
+  with flags = 0.
 
 * const char *Entry::Name()
 
   This method returns the name of the field.  
 
 * int Entry::SetName(const char *new_name)
-* int Entry::Rename(const char *new_name, int move_data = 0)
+* int Entry::Rename(const char *new_name, unsigned flags = 0)
 
   These will change the name of the field of this entry.  If the entry object
   is associated, these will also call calling gd_rename(3).  These two functions
-  are equivalent, except Entry::Rename allows specifying the move_data flag
-  explicitly.  Entry::SetName always calls gd_rename with move_data = 0.
+  are equivalent, except Entry::Rename allows specifying the flags explicitly.
+  Entry::SetName always calls gd_rename with flags = 0.
 
+* unsigned int Entry::Flags()
 * virtual int Entry::ComplexScalars()
 * virtual int Entry::FragmentIndex()
 * virtual int Entry::PolyOrd()
@@ -406,20 +423,20 @@ The following methods are available:
   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::ScalaIndex(int index = 0)
+* virtual const char *Entry::Input(int index)
+* virtual double Entry::Scale(int index)
+* virtual std::complex<double> Entry::CScale(int index)
+* virtual double Entry::Offset(int index)
+* virtual std::complex<double> Entry::COffset(int index)
+* virtual double Entry::Coefficient(int index)
+* virtual std::complex<double> Entry::CCoefficient(int index)
+* virtual const char *Entry::Scalar(int index)
+* virtual int Entry::ScalaIndex(int index)
 
   These methods will return an element from the gd_entry_t members in_fields[],
   m[], or b[], indexed by the supplied parameter.  Attempts to access elements
-  out of range for the field that the Entry class describes will not return
-  meaningful results.
+  out of range for the field that the Entry class describes will return zero
+  or NULL.
 
 
 ENTRY CHILD CLASSES
@@ -450,7 +467,8 @@ Defined in getdata/rawentry.h
 
 * virtual unsigned int RawEntry::SamplesPerFrame()
 * virtual DataType RawEntry::RawType()
-* virtual const char *Scalar()
+* virtual const char *Scalar(int index = 0)
+* virtual int ScalarIndex(int index = 0)
 
   These methods, re-implemented from the Entry class, return the corresponding
   field parameter.
@@ -480,26 +498,26 @@ Defined in getdata/lincomentry.h
     const char **in_fields, std::complex<double> *m, std::complex<double> *b,
     int fragment_index = 0)
 
-* virtual const char *LincomEntry::Input(int index = 0)
+* virtual const char *LincomEntry::Input(int index)
 * 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)
+* virtual double LincomEntry::Scale(int index)
+* virtual std::complex<double> LincomEntry::CScale(int index)
+* virtual double LincomEntry::Offset(int index)
+* virtual std::complex<double> LincomEntry::COffset(int index)
+* virtual const char *LincomEntry::Scalar(int index)
+* virtual int LincomEntry::ScalarIndex(int index)
 
   These methods, re-implemented from the Entry class, return the corresponding
   field parameter.
 
-* int LincomEntry::SetInput(const char *field, int index = 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)
+* int LincomEntry::SetInput(const char *field, int index)
+* int LincomEntry::SetScale(double scale, int index)
+* int LincomEntry::SetScale(const char* scale, int index)
+* int LincomEntry::SetScale(std::complex<double> scale, int index)
+* int LincomEntry::SetOffset(double offset, int index)
+* int LincomEntry::SetOffset(const char* scale, int index)
+* int LincomEntry::SetOffset(std::complex<double> offset, int index)
 
   These functions will change the specified field parameter associated with the
   input field with the given index, which should be between zero and two.  To
@@ -526,7 +544,7 @@ Defined in getdata/linterpentry.h
 * LinterpEntry::LinterpEntry(const char *field_code, const char *in_field,
     const char *table, int fragment_index = 0)
 
-* virtual const char *Entry::Input()
+* virtual const char *Entry::Input(int index = 0)
 * virtual const char *LinterpEntry::Table()
 
   These methods, re-implemented from the Entry class, return the corresponding
@@ -555,10 +573,11 @@ Defined in getdata/bitentry.h and getdata/sbitentry.h
 * SBitEntry::SBitEntry(const char *field_code, const char *in_field, int bitnum,
     int numbits = 1, int fragment_index = 0)
 
-* virtual const char *Input(int __gd_unused index = 0)
+* virtual const char *Input(int index = 0)
 * virtual int FirstBit()
 * virtual int NumBits()
-* virtual const char *Scalar(int index = 0)
+* virtual const char *Scalar(int index)
+* virtual int ScalarIndex(int index)
 
   These methods, re-implemented from the Entry class, return the corresponding
   field parameter.
@@ -585,12 +604,12 @@ Defined in getdata/multiplyentry.h
 * MultiplyEntry::MultiplyEntry(const char *field_code, const char *in_field1,
     const char *in_field2, int fragment_index = 0)
 
-* virtual const char *MultiplyEntry::Input(int index = 0)
+* virtual const char *MultiplyEntry::Input(int index)
 
   This method, re-implemented from the Entry class, returns one of the input
   fields.
 
-* int MultiplyEntry::SetInput(const char *field, int index = 0)
+* int MultiplyEntry::SetInput(const char *field, int index)
 
   This function will change the specified input field with the given index,
   which should be zero or one.
@@ -608,8 +627,10 @@ Defined in getdata/phaseentry.h
 * PhaseEntry::PhaseEntry(const char *field_code, const char *in_field,
     int shift, int fragment_index = 0)
 
-* virtual const char *PhaseEntry::Input()
+* virtual const char *PhaseEntry::Input(int index = 0)
 * virtual long int PhaseEntry::Shift()
+* virtual const char *PhasEntry::Scalar(int index = 0)
+* virtual int PhaseEntry::ScalarIndex(int index = 0)
 
   These methods, re-implemented from the Entry class, return the corresponding
   field parameter.
@@ -639,18 +660,18 @@ Defined in getdata/lincomentry.h
 * 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)
+* virtual double PolynomEntry::Coefficient(int index)
+* virtual std::complex<double> PolynomEntry::CCoefficient(int index)
+* virtual const char *PolynomEntry::Scalar(int index)
+* virtual int PolynomEntry::ScalarIndex(int index)
 
   These methods, re-implemented from the Entry class, return the corresponding
   field parameter.
 
 * int PolynomEntry::SetInput(const char *field)
-* int PolynomEntry::SetCoefficient(double scale, int index = 0)
-* int PolynomEntry::SetCoefficient(const char* scale, int index = 0)
-* int PolynomEntry::SetCoefficient(std::complex<double> scale, int index = 0)
+* int PolynomEntry::SetCoefficient(double scale, int index)
+* int PolynomEntry::SetCoefficient(const char* scale, int index)
+* int PolynomEntry::SetCoefficient(std::complex<double> scale, int index)
 
   These functions will change the specified field parameter associated with the
   input field with the given index, which should be between zero and two.  To
@@ -677,12 +698,12 @@ Defined in getdata/divideentry.h
 * DivideEntry::DivideEntry(const char *field_code, const char *in_field1,
     const char *in_field2, int fragment_index = 0)
 
-* virtual const char *DivideEntry::Input(int index = 0)
+* virtual const char *DivideEntry::Input(int index)
 
   This method, re-implemented from the Entry class, returns one of the input
   fields.
 
-* int DivideEntry::SetInput(const char *field, int index = 0)
+* int DivideEntry::SetInput(const char *field, int index)
 
   This function will change the specified input field with the given index,
   which should be zero or one.
@@ -700,12 +721,12 @@ Defined in getdata/recipentry.h
 * RecipEntry::RecipEntry(const char *field_code, const char *in_field1,
     const char *in_field2, int fragment_index = 0)
 
-* virtual const char *RecipEntry::Input()
+* virtual const char *RecipEntry::Input(int index = 0)
 * virtual int RecipEntry::ComplexScalars()
 * virtual double RecipEntry::Dividend()
 * virtual std::complex<double> RecipEntry::CDividend()
 * virtual const char *RecipEntry::Scalar()
-* virtual int RecipEntry::ScalarIndex()
+* virtual int RecipEntry::ScalarIndex(int index = 0)
 
   These methods, re-implemented from the Entry class, return the corresponding
   field parameter.
@@ -731,9 +752,9 @@ Defined in getdata/windowentry.h
 * WindowEntry::WindowEntry(const char *field_code, const char *in_field,
     const char *check_field, int fragment_index = 0)
 
-* virtual const char *WindowEntry::Input(int index = 0)
-* virtual const char *WindowEntry::Scalar()
-* virtual int WindowEntry::ScalarIndex()
+* virtual const char *WindowEntry::Input(int index)
+* virtual const char *WindowEntry::Scalar(int index = 0)
+* virtual int WindowEntry::ScalarIndex(int index = 0)
 * virtual WindOpType WindowEntry::WindOp()
 * virtual gd_triplet_t WindowEntry::Threshold()
 
@@ -763,9 +784,9 @@ Defined in getdata/mplex.h
 * MplexEntry::MplexEntry(const char *field_code, const char *in_field,
     const char *check_field, int fragment_index = 0)
 
-* virtual const char *MplexEntry::Input(int index = 0)
-* virtual const char *MplexEntry::Scalar()
-* virtual int MplexEntry::ScalarIndex()
+* virtual const char *MplexEntry::Input(int index)
+* virtual const char *MplexEntry::Scalar(int index)
+* virtual int MplexEntry::ScalarIndex(int index)
 * virtual int MplexEntry::CountVal()
 * virtual int MplexEntry::Period()
 
diff --git a/doc/README.f77 b/doc/README.f77
index 5fe24f8..fd3a8ca 100644
--- a/doc/README.f77
+++ b/doc/README.f77
@@ -17,10 +17,10 @@ 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).
+on standard error and return an invalid dirfile unit number.  Passing an invalid
+dirfile unit number to a subroutines which requires one as input (other than
+GDCLOS, which will simply ignore it) will result in the call failing with error
+code GD_EBD (= GD_E_BAD_DIRFILE, see below).
 
 Including getdata.f (which will be installed in the same directory as getdata.h)
 will define several convenient parameters including the DIRFILE flags, the data
@@ -44,6 +44,19 @@ it outputs, as the C API does.
 Available Subroutines
 =====================
 
+* GDENCS(support, encoding)
+
+  Output:
+    INTEGER support
+  Input:
+    INTEGER encoding
+
+  This wraps gd_encoding_support(3).  When passed one of the GDE_xx encoding
+  parameters, this subroutine will return GD_RW if the library can read from
+  and write to that encoding, GD_RO if it can only read from the encoding,
+  or -1 if neither reading or writing is supported.
+  
+
 Subroutines interacting with the database
 -----------------------------------------
 
@@ -58,7 +71,8 @@ Subroutines interacting with the database
   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
+  (see below).  If no more dirfile unit numbers are available, it returns -1,
+  otherwise, this behaves analogously to gd_open() itself: it returns a valid
   dirfile unit even in case of error.
 
 * GDCOPN(dirfile_unit, dirfilename, dirfilename_len, flags, sehandler)
@@ -117,7 +131,8 @@ Subroutines interacting with the database
     INTEGER dirfile_unit
 
   This wraps gd_invalid_dirfile(3), and returns the unit number of a
-  newly-created, invalid dirfile.
+  newly-created, invalid dirfile.  If no dirfile unit numbers were available,
+  it returns -1.
 
 * GDCLOS(dirfile_unit)
 
@@ -677,9 +692,9 @@ Subroutines interacting with global metadata
   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.
+  This wraps gd_dirfilename(3).  The name of the dirfile will be returned in
+  name.  If the name of the dirfile is longer than name_len, it will return the
+  actual length of the name in name_len and not modify the name argument.
 
 * GDREFE(name, name_len, dirfile_unit, field_code, field_code_len)
 
@@ -1174,7 +1189,7 @@ Subroutines interacting with field metadata
   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)
+* GDARLN(array_len, dirfile_unit, field_code, field_code_len)
 
   Output:
     INTEGER array_len
@@ -1182,7 +1197,7 @@ Subroutines interacting with field metadata
     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
+  This wraps gd_array_len(3).  The field_code_len parameter should contain the
   string length of field_code.  The length of the field will be returned in
   array_len.
 
@@ -1284,6 +1299,22 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_eof(3), and returns the location of the end-of-field
   marker for the specified field.
 
+* GDLSRW(dirfile_unit, field_code, field_code_len, data_type, spf, spf_scalar,
+  spf_scalar_len, spf_scalar_index, recode)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, data_type, spf, spf_scalar_len
+    INTEGER spf_scalar_index, recode
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<spf_scalar_len> spf_scalar
+
+  This subroutine modifies the RAW field specified according to the supplied
+  parameters.  Passing -1 as one of the spf_scalar_len will delete an existing
+  scalar field code, if one is present.  Passing 0 for this parameter indicates
+  no change to the corresponding parameter field code.  If recode is non-zero,
+  the binary file associated with this field will be modified to account for the
+  changes.
+
 * GDALRW(dirfile_unit, field_code, field_code_len, data_type, spf, recode)
 
   Input:
@@ -1294,6 +1325,30 @@ Subroutines interacting with field metadata
   metadata.  If recode is non-zero, the binary file associated with this field
   will be modified to account for the changes.
 
+* GDLSCL(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar,
+  b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar,
+  m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index,
+  in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3,
+  b3_scalar, b3_scalar_len, b3_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len
+    INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len
+    INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index
+    INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len
+    INTEGER b3_scalar_index
+    COMPLEX*16 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+    CHARACTER*<in_field3_len> in_field3
+
+  This subroutine modifies the LINCOM field specified according to the supplied
+  parameters.  Passing -1 as one of the .._scalar_len parameters will delete
+  an existing scalar field code, if one is present.  Passing 0 for these
+  parameters indicates no change to the corresponding parameter field code.
+  
 * GDALCL(dirfile_unit, field_code, field_code_len, nfields, in_field1,
   in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
   in_field3_len, m3, b3)
@@ -1310,6 +1365,27 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_alter_lincom(3), and modifies the specified field
   metadata.
 
+* GDLSLC(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar,
+  b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar,
+  m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index,
+  in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3,
+  b3_scalar, b3_scalar_len, b3_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len
+    INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len
+    INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index
+    INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len
+    INTEGER b3_scalar_index
+    REAL*8 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_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 GDLSCL above, but takes purely real parameters.
+
 * GDALLC(dirfile_unit, field_code, field_code_len, nfields, in_field1,
   in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
   in_field3_len, m3, b3)
@@ -1338,6 +1414,24 @@ Subroutines interacting with field metadata
   metadata.  If move is non-zero, the look-up table will be moved to the path
   specified by table.
 
+* GDLSBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index,
+  numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, bitnum
+    INTEGER bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar_len
+    INTEGER numbits_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<bitnum_scalar_len> bitnum_scalar_len
+    CHARACTER*<numbits_scalar> numbits_scalar_len
+
+  This subroutine modifies the BIT field specified according to the supplied
+  parameters.  Passing -1 as bitnum_scalar_len or numbits_scalar_len will delete
+  an existing scalar field code, if one is present.  Passing 0 for these
+  parameters indicates no change to the corresponding parameter field code.
+
 * GDALBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   bitnum, numbits)
 
@@ -1373,6 +1467,19 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_alter_multiply(3), and modifies the specified field
   metadata.
 
+* GDLSPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  shift, shift_scalar, shift_scalar_len, shift_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, shift, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine modifies the PHASE field specified according to the supplied
+  parameters.  Passing -1 as shift_scalar_len will delete an existing scalar
+  field code, if one is present.  Passing 0 for this parameter indicates no
+  change to the corresponding parameter field code.
+
 * GDALPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
   shift)
 
@@ -1384,6 +1491,31 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_alter_phase(3), and modifies the specified field
   metadata.
 
+* GDLSCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar,
+  a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index,
+  a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len,
+  a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field_len, a0_scalar_len
+    INTEGER a0_scalar_index, a1_scalar_len, a1_scalar_index, a2_scalar_len
+    INTEGER a2_scalar_index, a3_scalar_len, a3_scalar_index, a4_scalar_len
+    INTEGER a4_scalar_index, a5_scalar_len, a5_scalar_index
+    COMPLEX*16 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<a0_scalar_len> a0_scalar
+    CHARACTER*<a1_scalar_len> a1_scalar
+    CHARACTER*<a2_scalar_len> a2_scalar
+    CHARACTER*<a3_scalar_len> a3_scalar
+    CHARACTER*<a4_scalar_len> a4_scalar
+    CHARACTER*<a5_scalar_len> a5_scalar
+
+  This subroutine modifies the POLYNOM field specified according to the supplied
+  parameters.  Passing -1 as one of the .._scalar_len parameters will delete
+  an existing scalar field code, if one is present.  Passing 0 for these
+  parameters indicates no change to the corresponding parameter field code.
+
 * GDALCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
   in_field_len, a0, a1, a2, a3, a4, a5)
 
@@ -1396,6 +1528,28 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_alter_polynom(3), and modifies the specified field
   metadata.
 
+* GDLSPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar,
+  a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index,
+  a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len,
+  a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field_len, a0_scalar_len
+    INTEGER a0_scalar_index, a1_scalar_len, a1_scalar_index, a2_scalar_len
+    INTEGER a2_scalar_index, a3_scalar_len, a3_scalar_index, a4_scalar_len
+    INTEGER a4_scalar_index, a5_scalar_len, a5_scalar_index
+    REAL*8 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<a0_scalar_len> a0_scalar
+    CHARACTER*<a1_scalar_len> a1_scalar
+    CHARACTER*<a2_scalar_len> a2_scalar
+    CHARACTER*<a3_scalar_len> a3_scalar
+    CHARACTER*<a4_scalar_len> a4_scalar
+    CHARACTER*<a5_scalar_len> a5_scalar
+
+  This is equivalent to GDLSCP, but with purely real parameters.
+
 * GDALPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
   in_field_len, a0, a1, a2, a3, a4, a5)
 
@@ -1408,6 +1562,24 @@ Subroutines interacting with field metadata
   This subroutine is equivalent to GDALCP above, but takes purely real
   parameters.
 
+* GDLSSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index,
+  numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, bitnum
+    INTEGER bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar_len
+    INTEGER numbits_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<bitnum_scalar_len> bitnum_scalar_len
+    CHARACTER*<numbits_scalar> numbits_scalar_len
+
+  This subroutine modifies the SBIT field specified according to the supplied
+  parameters.  Passing -1 as bitnum_scalar_len or numbits_scalar_len will delete
+  an existing scalar field code, if one is present.  Passing 0 for these
+  parameters indicates no change to the corresponding parameter field code.
+
 * GDALSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   bitnum, numbits)
 
@@ -1419,6 +1591,22 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_alter_sbit(3), and modifies the specified field
   metadata.
 
+* GDLSCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  dividend, dividend_scalar, dividend_scalar_len, dividend_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, dividend_scalar_len,
+    INTEGER dividend_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<dividend_scalar_len> dividend_scalar
+    COMPLEX*16 dividend
+
+  This subroutine modifies the RECIP field specified according to the supplied
+  parameters.  Passing -1 as dividend_scalar_len parameters will delete
+  an existing scalar field code, if one is present.  Passing 0 for this
+  parameter indicates no change to the corresponding parameter field code.
+
 * GDALCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   dividend)
 
@@ -1431,6 +1619,19 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_alter_crecip(3), and modifies the specified field
   metadata.
 
+* GDLSRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  dividend, dividend_scalar, dividend_scalar_len, dividend_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, dividend_scalar_len,
+    INTEGER dividend_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<dividend_scalar_len> dividend_scalar
+    REAL*16 dividend
+
+  This is equivalent to GDLSCR, but with purely real parameters.
+
 * GDALRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   dividend)
 
@@ -1443,6 +1644,28 @@ Subroutines interacting with field metadata
   This subroutine wraps gd_alter_recip(3), and modifies the specified field
   metadata.
 
+* GDLSWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  check_field, check_field_len, windop, threshold, threshold_scalar,
+  threshold_scalar_len, threshold_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len, windop
+    INTEGER threshold_scalar_len, threshold_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<check_field_len> check_field
+    CHARACTER*<threshold_scalar_len> threshold_scalar
+    INTEGER threshold
+      or
+    REAL*8 threshold
+
+  This subroutine modifies the WINDOW field specified according to the supplied
+  parameters.  Passing -1 as threshold_scalar_len will delete an existing scalar
+  field code, if one is present.  Passing 0 for this parameter indicates no
+  change to the corresponding parameter field code.  If windop is one of
+  GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, threshold should be of type integer,
+  otherwise it should be double precision.
+
 * GDALWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   check_field, check_field_len, windop, threshold)
 
@@ -1453,12 +1676,29 @@ Subroutines interacting with field metadata
     CHARACTER*<check_field_len> check_field
     INTEGER threshold
       or
-    DOUBLE PRECISION threshold
+    REAL*8 threshold
 
   This subroutine wraps gd_alter_windop(3), and modifies the specified field
   metadata.  If windop is one of GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, threshold
   should be of type integer, otherwise it should be double precision.
 
+* GDLSMX(dirfile_unit, field_code, field_code_len, infield, infield_len,
+  countfield, countfield_len, countval, countval_scalar, countval_scalar_len,
+  countval_scalar_index, period, period_scalar_len, period_scalar_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval
+    INTEGER countval_scalar_len, countval_scalar_index, period,
+    INTEGER period_scalar_len, period_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<infield_len> infield
+    CHARACTER*<countfield_len> countfield
+
+  This subroutine modifies the MPLEX field specified according to the supplied
+  parameters.  Passing -1 as one of the .._scalar_len parameters will delete
+  an existing scalar field code, if one is present.  Passing 0 for these
+  parameters indicates no change to the corresponding parameter field code.
+
 * GDALMX(dirfile_unit, field_code, field_code_len, infield, infield_len,
   countfield, countfield_len, countval, period)
 
@@ -1526,24 +1766,15 @@ Subroutines interacting with field metadata
   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)
+* GDMOVE(dirfile_unit, field_code, field_code_len, new_fragment, flags)
 
   Input:
-    INTEGER dirfile_unit, field_code_len, new_fragment, move_data
+    INTEGER dirfile_unit, field_code_len, new_fragment, flags
     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.
-
-* GDMOVA(dirfile_unit, field_code, field_code_len, new_fragment)
-
-  Input:
-    INTEGER dirfile_unit, field_code_len, new_fragment
-    CHARACTER*<field_code_len> field_code
-
-  This subroutine wraps gd_move_alias(3), and moves the specified alias to the
-  new fragment given.
+  This subroutine wraps gd_move(3), and moves the specified field or alias to
+  indicated fragment.  The flags parameter should be zero or more of the GDR_xx
+  parameters, bitwise or'd together.
 
 * GDRENM(dirfile_unit, field_code, field_code_len, new_name, new_name_len,
   flags)
@@ -1569,17 +1800,15 @@ Subroutines interacting with field metadata
   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)
+* GDENFL(flags, dirfile_unit, field_code, field_code_len)
 
   Output:
-    INTEGER comp_scal
+    INTEGER flags
   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.
+  This subroutine returns the flags member of the specified field.
 
 * GDGSCA(scalar, scalar_len, scalar_index, dirfile_unit, field_code,
   field_code_len, index)
@@ -1623,17 +1852,7 @@ Subroutines which add or delete fields and aliases
     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 bitwise or'd together.
-
-* GDDELA(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_alias(3).  It deletes the indicated alias.
+  This subroutine wraps gd_delete(3).  It deletes the indicated field or alias.
   The flags parameter should be either zero, or one or more of the delete flags
   listed below bitwise or'd together.
 
@@ -1648,6 +1867,21 @@ Subroutines which add or delete fields and aliases
   This subroutine wraps gd_add_alias(3).  It adds an alias named field_code
   pointing to targ in the fragment indexed by fragment_index.
 
+* GDASRW(dirfile_unit, field_code, field_code_len, data_type, spf,
+  spf_scalar, spf_scalar_len, spf_scalar_index, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, data_type, spf, spf_scalar_len
+    INTEGER spf_scalar_index, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<spf_scalar_len> spf_scalar
+
+  This subroutine adds a RAW field with the supplied parameters to the
+  specified fragment of the dirfile.  If spf_scalar_len is zero, spf_scalar and
+  spf_scalar_index are ignored, and the literal value spf is used for the
+  parameter.  If spf_scalar_len is non-zero, the literal spf is ignored and the
+  field code specified by spf_scalar and spf_scalar_index is used for the
+  parameter.
 
 * GDADRW(dirfile_unit, field_code, field_code_len, data_type, spf,
   fragment_index)
@@ -1656,8 +1890,43 @@ Subroutines which add or delete fields and aliases
     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.
+  This is equivalent to GDASRW with spf_scalar_len set to zero (i.e. with a
+  literal parameter only).
+
+* GDASCL(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar,
+  b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar,
+  m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index,
+  in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3,
+  b3_scalar, b3_scalar_len, b3_scalar_index, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len
+    INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len
+    INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index
+    INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len
+    INGEGER b3_scalar_index, fragment_index
+    COMPLEX*16 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<m1_scalar_len> m1_scalar
+    CHARACTER*<b1_scalar_len> b1_scalar
+    CHARACTER*<in_field2_len> in_field2
+    CHARACTER*<m2_scalar_len> m2_scalar
+    CHARACTER*<b2_scalar_len> b2_scalar
+    CHARACTER*<in_field3_len> in_field3
+    CHARACTER*<m3_scalar_len> m3_scalar
+    CHARACTER*<b3_scalar_len> b3_scalar
+
+  This subroutine adds a LINCOM field with the supplied parameters to the
+  specified format file fragment of the dirfile.  All three sets of input
+  parameters are required to be passed to the call, but only the first
+  nfields sets will be examined.  If a .._scalar_len parameter is zero, the
+  corresponding .._scalar and .._scalar_index parameters are ignored, and the
+  literal parameter (m1, b1, &c.) is used for that parameter.  If the
+  .._scalar_len parameter is non-zero, the literal parameter is ignored, and the
+  scalar is set to the field code specified by the corresponding .._scalar and
+  .._scalar_index parameters.
 
 * GDADCL(dirfile_unit, field_code, field_code_len, nfields, in_field1,
   in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
@@ -1672,10 +1941,35 @@ Subroutines which add or delete fields and aliases
     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.
+  This is equivalent to GDASCL with all the .._scalar_len parameters set to
+  zero. (i.e. using literal scalars only.)
+
+* GDASLC(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar,
+  b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar,
+  m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index,
+  in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3,
+  b3_scalar, b3_scalar_len, b3_scalar_index, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len
+    INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len
+    INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index
+    INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len
+    INGEGER b3_scalar_index, fragment_index
+    REAL*8 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<m1_scalar_len> m1_scalar
+    CHARACTER*<b1_scalar_len> b1_scalar
+    CHARACTER*<in_field2_len> in_field2
+    CHARACTER*<m2_scalar_len> m2_scalar
+    CHARACTER*<b2_scalar_len> b2_scalar
+    CHARACTER*<in_field3_len> in_field3
+    CHARACTER*<m3_scalar_len> m3_scalar
+    CHARACTER*<b3_scalar_len> b3_scalar
+
+  This is equivalent to GDASCL above, but takes purely real parameters.
 
 * GDADLC(dirfile_unit, field_code, field_code_len, nfields, in_field1,
   in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
@@ -1705,6 +1999,27 @@ Subroutines which add or delete fields and aliases
   This subroutine adds a LINTERP field with the supplied parameters to the
   specified format file fragment of the dirfile.
 
+* GDASBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index,
+  numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, fragment_index
+    INTEGER bitnum, bitnum_scalar_len, bitnum_scalar_index
+    INTEGER numbits, numbits_scalar_len, numbits_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<bitnum_scalar_len> bitnum_scalar
+    CHARACTER*<numbits_scalar_len> numbits_scalar
+    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.  If bitnum_scalar_len is zero,
+  the bitnum_scalar and bitnum_scalar_index values are ignored and the literal
+  value of bitnum is used.  If bitnum_scalar_len is non-zero, the value of
+  bitnum is ignored and bitnum_scalar and bitnum_scalar_index is used to form
+  a scalar field code for bitnum.  Similarly with numbits.  See also GDADBT.
+
 * GDADBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   bitnum, numbits, fragment_index)
 
@@ -1714,8 +2029,29 @@ Subroutines which add or delete fields and aliases
     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.
+  This function is equivalent to calling GDASBT (above) with bitnum_scalar_len
+  and numbits_scalar_len set to zero (i.e. with literal parameters only).
+
+* GDASSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index,
+  numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, fragment_index
+    INTEGER bitnum, bitnum_scalar_len, bitnum_scalar_index
+    INTEGER numbits, numbits_scalar_len, numbits_scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<bitnum_scalar_len> bitnum_scalar
+    CHARACTER*<numbits_scalar_len> numbits_scalar
+    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.  If bitnum_scalar_len is zero,
+  the bitnum_scalar and bitnum_scalar_index values are ignored and the literal
+  value of bitnum is used.  If bitnum_scalar_len is non-zero, the value of
+  bitnum is ignored and bitnum_scalar and bitnum_scalar_index is used to form
+  a scalar field code for bitnum.  Similarly with numbits.  See also GDADBT.
 
 * GDADSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   bitnum, numbits, fragment_index)
@@ -1726,8 +2062,27 @@ Subroutines which add or delete fields and aliases
     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.
+  This function is equivalent to calling GDASSB (above) with bitnum_scalar_len
+  and numbits_scalar_len set to zero (i.e. with literal parameters only).
+
+* GDASCR(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  divident, divident_scalar, divident_scalar_len, divident_scalar_index,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len
+    INTEGER dividend_scalar_len, dividend_scalar_index, fragment_index
+    COMPLEX*16 dividend
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<dividend_scalar_len> dividend_scalar.
+
+  This subroutine adds a PHASE field with the supplied parameters to the
+  specified fragment of the dirfile.  If dividend_scalar_len is zero,
+  dividend_scalar and dividend_scalar_index are ignored, and the literal value
+  dividend is used for the parameter.  If dividend_scalar_len is non-zero, the
+  literal dividend is ignored and the field code specified by dividend_scalar
+  and dividend_scalar_index is used for the parameter.
 
 * GDADCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   dividend, fragment_index)
@@ -1739,8 +2094,22 @@ Subroutines which add or delete fields and aliases
     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.
+  This is equivalent to GDASCR with dividend_scalar_len set to zero (i.e. with a
+  literal parameter only).
+
+* GDASRC(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  divident, divident_scalar, divident_scalar_len, divident_scalar_index,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len
+    INTEGER dividend_scalar_len, dividend_scalar_index, fragment_index
+    REAL*8 dividend
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<dividend_scalar_len> dividend_scalar.
+
+  This is equivalent to GDASCR, but with a purely real dividend.
 
 * GDADRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   dividend, fragment_index)
@@ -1752,8 +2121,8 @@ Subroutines which add or delete fields and aliases
     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.
+  This is equivalent to GDASRC with dividend_scalar_len set to zero (i.e. with a
+  literal parameter only).
 
 * GDADMT(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
   in_field2, in_field2_len, fragment_index)
@@ -1781,20 +2150,75 @@ Subroutines which add or delete fields and aliases
   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)
+* GDASCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar,
+  a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index,
+  a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len,
+  a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index,
+  fragment_index)
 
   Input:
     INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len
+    INTEGER a0_scalar_len, a0_scalar_index, a1_scalar_len, a1_scalar_index
+    INTEGER a2_scalar_len, a2_scalar_index, a3_scalar_len, a3_scalar_index
+    INTEGER a4_scalar_len, a4_scalar_index, a5_scalar_len, a5_scalar_index
     INTEGER fragment_index
     COMPLEX*16 a0, a1, a2, a3, a4, a5
     CHARACTER*<field_code_len> field_code
+    CHARACTER*<a0_scalar_len> a0_scalar_len
+    CHARACTER*<a1_scalar_len> a1_scalar_len
+    CHARACTER*<a2_scalar_len> a2_scalar_len
+    CHARACTER*<a3_scalar_len> a3_scalar_len
+    CHARACTER*<a4_scalar_len> a4_scalar_len
+    CHARACTER*<a5_scalar_len> a5_scalar_len
     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.
+  examined.  If a .._scalar_len parameter is zero, the corresponding .._scalar
+  and .._scalar_index parameters are ignored, and the literal parameter (a0, a1,
+  &c.) is used for that parameter.  If the .._scalar_len parameter is non-zero,
+  the literal parameter is ignored, and the scalar is set to the field code
+  specified by the corresponding .._scalar and .._scalar_index parameters.
+
+* GDADCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a1, a2, a3, a4, a5, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len
+    INTEGER fragment_index
+    COMPLEX*16 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This is equivalent to GDASCP with all the .._scalar_len parameters set to
+  zero. (i.e. using literal scalars only.)
+
+* GDASPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar,
+  a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index,
+  a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len,
+  a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len
+    INTEGER a0_scalar_len, a0_scalar_index, a1_scalar_len, a1_scalar_index
+    INTEGER a2_scalar_len, a2_scalar_index, a3_scalar_len, a3_scalar_index
+    INTEGER a4_scalar_len, a4_scalar_index, a5_scalar_len, a5_scalar_index
+    INTEGER fragment_index
+    REAL*8 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<a0_scalar_len> a0_scalar_len
+    CHARACTER*<a1_scalar_len> a1_scalar_len
+    CHARACTER*<a2_scalar_len> a2_scalar_len
+    CHARACTER*<a3_scalar_len> a3_scalar_len
+    CHARACTER*<a4_scalar_len> a4_scalar_len
+    CHARACTER*<a5_scalar_len> a5_scalar_len
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine is equivalent GDASCP, but takes purely real parameters.
 
 * GDADPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
   in_field_len, a0, a1, a2, a3, a4, a5, fragment_index)
@@ -1806,7 +2230,24 @@ Subroutines which add or delete fields and aliases
     CHARACTER*<field_code_len> field_code
     CHARACTER*<in_field_len> in_field
 
-  This subroutine is equivalent the GDADCP, but takes purely real parameters.
+  This subroutine is equivalent GDADCP, but takes purely real parameters.
+
+* GDASPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  shift, shift_scalar, shift_scalar_len, shift_scalar_index, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, shift
+    INTEGER shift_scalar_len, shift_scalar_index, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<shift_scalar_len> shift_scalar.
+
+  This subroutine adds a PHASE field with the supplied parameters to the
+  specified fragment of the dirfile.  If shift_scalar_len is zero, shift_scalar
+  and shift_scalar_index are ignored, and the literal value shift is used for
+  the parameter.  If shift_scalar_len is non-zero, the literal shift is ignored
+  and the field code specified by shift_scalar and shift_scalar_index is used
+  for the parameter.
 
 * GDADPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
   shift, fragment_index)
@@ -1816,25 +2257,69 @@ Subroutines which add or delete fields and aliases
     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 fragment of the dirfile.
+  This is equivalent to GDASPH above with shift_scalar_len set to zer (i.e. with
+  a literal parameter only).
+
+* GDASWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  check_field, check_field_len, windop, threshold, threshold_scalar,
+  threshold_scalar_len, threshold_scalar_index, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len
+    INTEGER threshold_scalar_len, threshold_scalar_index, windop
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<check_field_len> check_field
+    INTEGER threshold
+      or
+    REAL*8 threshold
+
+  This subroutine adds a WINDOW field with the supplied parameters to the
+  specified fragment of the dirfile.  If threshold_scalar_len is zero,
+  threshold_scalar and threshold_scalar_index are ignored, and the literal value
+  threshold is used for the parameter.  In this case, if windop is one of
+  GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, threshold should be an integer; otherwise,
+  threshold should be a real.  If threshold_scalar_len is non-zero, the literal
+  threshold is ignored and the field code specified by threshold_scalar and
+  threshold_scalar_index is used for the parameter.
 
 * GDADWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
   check_field, check_field_len, windop, threshold, fragment_index)
 
   Input:
     INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len, windop
+    INTEGER fragment_index
     CHARACTER*<field_code_len> field_code
     CHARACTER*<in_field_len> in_field
     CHARACTER*<check_field_len> check_field
     INTEGER threshold
       or
-    DOUBLE PRECISION threshold
+    REAL*8 threshold
+
+  This is equivalent to GDASWD with threshold_scalar_len set to zero (i.e. with
+  a literal parameter only).
+
+* GDASMX(dirfile_unit, field_code, field_code_len, infield, infield_len,
+  countfield, countfield_len, countval, countval_scalar, countval_scalar_len,
+  countval_scalar_index, period, period_scalar, period_scalar_len,
+  period_scalar_index, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval
+    INTEGER countval_scalar_len, countval_scalar_index, period
+    INTEGER period_scalar_len, period_scalar_index, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<infield_len> infield
+    CHARACTER*<countfield_len> countfield
+    CHARACTER*<countval_scalar_len> countval_scalar
+    CHARACTER*<period_scalar_len> period_scalar
 
-    This subroutine adds a WINDOW field with the supplied parameters to the
-    specified fragment of the dirfile.  If windop is one of GDW_EQ, GDW_NE,
-    GDW_ST, or GDW_CL, threshold should be an integer; otherwise, threshold
-    should be of type double precision.
+  This subroutine adds a MPLEX field with the supplied parameters to the
+  specified fragment of the dirfile.  If countval_scalar_len is zero,
+  countval_scalar and countval_scalar_index are ignored and the literal value
+  countval is used for the parameter.  If countval_scalar_len is non-zero, the
+  literal countval is ignored, and the field code specified by countval_scalar
+  and countval_scalar_index are used for the parameter.  Similarly with period.
 
 * GDADMX(dirfile_unit, field_code, field_code_len, infield, infield_len,
   countfield, countfield_len, countval, period, fragment_index)
@@ -1846,8 +2331,8 @@ Subroutines which add or delete fields and aliases
     CHARACTER*<infield_len> infield
     CHARACTER*<countfield_len> countfield
 
-  This subroutine adds a MPLEX field with the supplied parameters to the
-  specified fragment of the dirfile.
+  This subroutine is equivalent to GDASMX above with countval_scalar_len and
+  period_scalar_len set to zero (i.e. with literal parameters only).
 
 * GDADCA(dirfile_unit, field_code, field_code_len, const_type, array_len,
   data_type, data, fragment_index)
diff --git a/doc/README.f95 b/doc/README.f95
index 11d2735..cb1193f 100644
--- a/doc/README.f95
+++ b/doc/README.f95
@@ -15,10 +15,10 @@ 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.
+compatibility library will emit an error message on standard error and return
+and invalid dirfile unit number.  Passing an invalid dirfile unit number to a
+procedure which requires one as input (other than fgd_close, which will simply
+ignore it) will result in the call failing with error code GD_E_BAD_DIRFILE.
 
 The "getdata" module, which these bindings define, is described in
 `getdata.mod', which will be installed in the same directory as getdata.h.  The
@@ -165,7 +165,7 @@ unit numbers in place of C's DIRFILE pointers are:
   integer, intent(in) :: dirfile, fragment_index, flags
   character (len=*), intent(in) :: fragmentname, prefix, suffix
 
-* integer function fgd_carray_len (dirfile_unit, field_code)
+* integer function fgd_array_len (dirfile_unit, field_code)
   integer, intent(in) :: dirfile
   character (len=*), intent(in) :: field_code
 
@@ -460,12 +460,8 @@ unit numbers in place of C's DIRFILE pointers are:
   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_move_alias (dirfile, field_code, new_fragment)
-  integer, intent(in) :: dirfile, new_fragment
+* subroutine fgd_move (dirfile, field_code, new_fragment, flags)
+  integer, intent(in) :: dirfile, new_fragment, flags
   character (len=*), intent(in) :: field_code
 
 * subroutine fgd_alter_bit (dirfile, field_name, in_field, bitnum, numbits)
@@ -570,10 +566,6 @@ unit numbers in place of C's DIRFILE pointers are:
   integer, intent(in) :: dirfile, flags
   character (len=*), intent(in) :: field_code
 
-* subroutine fgd_delete_alias (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
@@ -654,6 +646,9 @@ unit numbers in place of C's DIRFILE pointers are:
   integer, intent(in) :: dirfile
   character (len=*), intent(in) :: field_code
 
+* integer function fgd_encoding_support (encoding)
+  integer, intent(in) :: encoding
+
 
 In order to respect type safety, the gd_getdata and gd_putdata analogues encode
 the data type of their array in their function name, rather than as a parameter.
@@ -871,7 +866,7 @@ function fgd_entry_name_max (dirfile, parent, entype, flags)
 
   type gd_entry
     integer :: field_type, n_fields, spf, data_type, bitnum, numbits, shift
-    integer :: fragment_index, comp_scal, poly_ord, array_len, windop
+    integer :: fragment_index, flags, poly_ord, array_len, windop
     integer :: ithreshold, count_val, period
     character (len=GD_FIELD_LEN), dimension(3) :: field
     character (len=GD_FIELD_LEN), dimension(6) :: scalar
diff --git a/doc/README.idl b/doc/README.idl
index 7e89b0d..26d31b4 100644
--- a/doc/README.idl
+++ b/doc/README.idl
@@ -105,9 +105,10 @@ The GD_ENTRY Structure
 The GD_ENTRY structure is used in place of the C API's gd_entry_t data type.  It
 is essentially equivalent and is defined as:
 
-** Structure GD_ENTRY, 30 tags, length=512, data length=502:
+** Structure GD_ENTRY, 30 tags, length=568, data length=546:
   FIELD        STRING
   FIELD_TYPE   INT
+  FLAGS        UINT
   FRAGMENT     INT
   IN_FIELDS    STRING     Array[3]
   A            DOUBLE     Array[6]
@@ -116,7 +117,6 @@ is essentially equivalent and is defined as:
   B            DOUBLE     Array[3]
   CB           DCOMPLEX   Array[3]
   BITNUM       INT
-  COMP_SCAL    INT
   COUNT_VAL    INT
   DATA_TYPE    INT
   DIVIDEND     DOUBLE
@@ -545,12 +545,11 @@ FUNCTION GD_CONSTANTS(dirfile_unit, PARENT=parent, TYPE=type)
   for the given parent field will be returned, otherwise all non-meta CONST
   fields will be returned.  See gd_constants(3) and gd_mconstants(3).
 
-PROCEDURE GD_DELETE, dirfile_unit, field_code, /DEL_DATA, /DEREF, /FORCE, /ALIAS
+PROCEDURE GD_DELETE, dirfile_unit, field_code, /DEL_DATA, /DEREF, /FORCE, /META
 
-  This procedure delete the field specified by 'field_code' from the database.
-  If /ALIAS is specified, the alias 'field_code' is deleted instead.  The
-  meanings of the three other keyword flags are discussed in the gd_delete(3)
-  manual page.  See gd_delete(3) and gd_delete_alias(3).
+  This procedure delete the field or alias specified by 'field_code' from the
+  database.  The meanings of the keyword flags are discussed in the gd_delete(3)
+  manual page (q.v.).
 
 FUNCTION GD_DESYNC(dirfile_unit, /PATHCHECK, /REOPEN)
 
@@ -579,6 +578,11 @@ FUNCTION GD_ENCODING(dirfile_unit, FRAGMENT=fragment)
   or of the primary format file, if FRAGMENT is omitted.  The return value will
   be one of the !GD.*_ENCODED constants.  See gd_encoding(3).
 
+FUNCTION GD_ENCODING_SUPPORT(encoding)
+
+  This function returns !GD.RDWR, !GD.RONLY, or -1 depending on the runtime
+  support for the specified encoding.  See gd_encoding_support(3).
+
 FUNCTION GD_ENDIANNESS(dirfile_unit, FRAGMENT=fragment)
 
   This function returns the byte sex of the fragment indexed by FRAGMENT, or of
@@ -759,13 +763,12 @@ 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, /ALIAS, /MOVE_DATA
+PROCEDURE GD_MOVE, dirfile_unit, field_code, new_fragment, /DANGLE, /FORCE,
+  /MOVE_DATA, /UPDATEDB
 
-  This procedure moves the field specified by 'field_code' to the new format
-  file fragment indexed by 'new_fragment'.  If ALIAS is specified, the alias
-  'field_code' is moved instead.  Otherwise, 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) and gd_move_alias(3).
+  This procedure moves the field or alias specified by 'field_code' to the 
+  format file fragment indexed by 'new_fragment'.  See gd_move(3) for the
+  meaning of the flags.
 
 PROCEDURE GD_MPLEX_LOOKBACK dirfile_unit, [lookback,] /ALL
 
@@ -879,18 +882,18 @@ 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)
+FUNCTION GD_REFERENCE(dirfile_unit, [new_reference])
 
   This function returns the name of the RAW field used as the reference field
-  for the dirfile.  See gd_reference(3).
+  for the dirfile, after optionally changing it to new_reference.  If the
+  dirfile contains no reference field, the empty string is returned.  See
+  gd_reference(3).
 
-PROCEDURE GD_RENAME, dirfile_unit, field_code, new_name, /MOVE_DATA, /UPDATEDB
+PROCEDURE GD_RENAME, dirfile_unit, field_code, new_name, /DANGLE, /FORCE,
+  /MOVE_DATA, /UPDATEDB
 
-  This function renames the field specified by 'field_code' to 'new_name'.  If
-  MOVE_DATA is specified, and the field is a RAW field, the data file on disk
-  is renamed as well.  If UPDATEDB is specified, fields whose definition depends
-  on this field are also updated to reflect the change in name.  See
-  gd_rename(3).
+  This function renames the field specified by 'field_code' to 'new_name'.  See
+  gd_rename(3) for the meaning of the flags.
 
 FUNCTION GD_SEEK(dirfile_unit, field_code, FRAME_NUM=frame_num,
   SAMPLE_NUM=sample_num, WHENCE=whence, /WRITE)
diff --git a/doc/README.python b/doc/README.python
index bdb332f..798981e 100644
--- a/doc/README.python
+++ b/doc/README.python
@@ -4,11 +4,9 @@ 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.
+Numerical Python (NumPy) is required to build and use the bindings.  By default,
+data returned from the bindings will be returned in NumPy arrays, but the
+bindings can be persuaded to return data as Python lists, if desired.
 
 Full documentation for the Python bindings to the GetData library is contained
 within the pygetdata module itself.  To read this documentation, execute
diff --git a/m4/compiler.m4 b/m4/compiler.m4
index 342547f..f6031c8 100644
--- a/m4/compiler.m4
+++ b/m4/compiler.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+dnl Copyright (C) 2008-2010, 2012, 2013, 2015 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
@@ -18,6 +18,35 @@ dnl You should have received a copy of the GNU Lesser General Public License
 dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
 dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+dnl GD_C_CAST_COMPLEX
+dnl -------------------------------------------------------------
+dnl Check wether the compiler requires explicit cast from real types to
+dnl _Complex
+AC_DEFUN([GD_C_CAST_COMPLEX],
+[AC_CACHE_CHECK([if implicit _Complex conversion works],
+[gd_cv_c_cast_complex],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+AC_INCLUDES_DEFAULT
+[[
+#ifdef HAVE__COMPLEX_DOUBLE
+extern double creal(_Complex double z);
+#else
+not applicable
+#endif
+]],
+[[
+double a;
+int b;
+a = creal(b);
+]])],
+[gd_cv_c_cast_complex=yes],
+[gd_cv_c_cast_complex=no])])
+if test "x$gd_cv_c_cast_complex" = "xyes"; then
+AC_DEFINE([GD_COMPLEX_CONV_OK], [1],
+[Define to 1 if implicit conversion from real to _Complex works])
+fi
+])
+
 dnl GD_LANG_COMPILER_INTEL
 dnl -------------------------------------------------------------
 dnl Check whether the compiler for the current language is Intel.
@@ -70,7 +99,12 @@ 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])
+CFLAGS=$gd_saved_CFLAGS
+if test "x$gd_cv_prog_cc_wextra" = "xyes"; then
+  GD_CC_WEXTRA=-Wextra
+fi
+AC_SUBST([GD_CC_WEXTRA])
+])
 
 
 dnl GD_PROG_CXX_WEXTRA
@@ -84,7 +118,12 @@ 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])
+CXXFLAGS=$gd_saved_CXXFLAGS
+if test "x$gd_cv_prog_cxx_wextra" = "xyes"; then
+  GD_CXX_WEXTRA=-Wextra
+fi
+AC_SUBST([GD_CXX_WEXTRA])
+])
 
 
 dnl GD_PROG_F77_WEXTRA
@@ -98,21 +137,12 @@ 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_F77_FNO_BACKSLASH
-dnl -------------------------------------------------------------
-dnl Check whether the Fotran-77 compiler accepts -fno-backslash
-AC_DEFUN([GD_PROG_F77_FNO_BACKSLASH],
-[gd_saved_FFLAGS=$FFLAGS
-AC_CACHE_CHECK([whether $F77 accepts -fno-backslash],
-gd_cv_prog_f77_fno_backslash, [FFLAGS="-fno-backslash"
-AC_LANG_PUSH([Fortran 77])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_f77_fno_backslash=yes],
-[gd_cv_prog_f77_fno_backslash=no])
-AC_LANG_POP([Fortran 77])])
-FFLAGS=$gd_saved_FFLAGS])
+FFLAGS=$gd_saved_FFLAGS
+if test "x$gd_cv_prog_f77_wextra" = "xyes"; then
+  GD_F77_WEXTRA=-Wextra
+fi
+AC_SUBST([GD_F77_WEXTRA])
+])
 
 
 dnl GD_PROG_FC_WEXTRA
@@ -126,7 +156,12 @@ 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])
+FCFLAGS=$gd_saved_FCFLAGS
+if test "x$gd_cv_prog_fc_wextra" = "xyes"; then
+  GD_FC_WEXTRA=-Wextra
+fi
+AC_SUBST([GD_FC_WEXTRA])
+])
 
 dnl GD_PROG_CC_WALL
 dnl -------------------------------------------------------------
@@ -137,7 +172,12 @@ 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])
+CFLAGS=$gd_saved_CFLAGS
+if test "x$gd_cv_prog_cc_wall" = "xyes"; then
+  GD_CC_WALL=-Wall
+fi
+AC_SUBST([GD_CC_WALL])
+])
 
 
 dnl GD_PROG_CXX_WALL
@@ -151,7 +191,12 @@ 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])
+CXXFLAGS=$gd_saved_CXXFLAGS
+if test "x$gd_cv_prog_cxx_wall" = "xyes"; then
+  GD_CXX_WALL=-Wall
+fi
+AC_SUBST([GD_CXX_WALL])
+])
 
 
 dnl GD_PROG_F77_WALL
@@ -165,7 +210,12 @@ 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])
+FFLAGS=$gd_saved_FFLAGS
+if test "x$gd_cv_prog_f77_wall" = "xyes"; then
+  GD_F77_WALL=-Wall
+fi
+AC_SUBST([GD_F77_WALL])
+])
 
 
 dnl GD_PROG_FC_WALL
@@ -179,7 +229,13 @@ 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])
+FCFLAGS=$gd_saved_FCFLAGS
+if test "x$gd_cv_prog_fc_wall" = "xyes"; then
+  GD_FC_WALL=-Wall
+fi
+AC_SUBST([GD_FC_WALL])
+])
+
 
 dnl GD_C_RESTRICT_ARRAY
 dnl -----------------------------------------------------------
diff --git a/m4/encoding.m4 b/m4/encoding.m4
index d93f919..3185939 100644
--- a/m4/encoding.m4
+++ b/m4/encoding.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2008-2010 D. V. Wiebe
+dnl Copyright (C) 2008-2013 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
diff --git a/m4/idl.m4 b/m4/idl.m4
index 3f5e64e..115e0c1 100644
--- a/m4/idl.m4
+++ b/m4/idl.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2009-2010 D. V. Wiebe
+dnl Copyright (C) 2009, 2011, 2012, 2013 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
@@ -119,8 +119,8 @@ AC_MSG_RESULT([$IDL_CFLAGS])
 AC_SUBST([IDL_CFLAGS])
 
 AC_SUBST([IDL_CFLAGS])
-AC_MSG_CHECKING([IDL linker flags])
 IDL_LIBS=`(echo 'print,"@@@"+!MAKE_DLL.LD' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@@<:@^ @:>@* \(.*\?\) -o.*/\1/' | sed -e 's/-m \?[\w]*//g'`
+AC_MSG_CHECKING([IDL linker flags])
 AC_MSG_RESULT([$IDL_LIBS])
 AC_SUBST([IDL_LIBS])
 
diff --git a/m4/libtool.m4 b/m4/libtool.m4
deleted file mode 100644
index a3bc337..0000000
--- a/m4/libtool.m4
+++ /dev/null
@@ -1,8369 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program or library that is built
-# using GNU Libtool, you may include this file under the  same
-# distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-])
-
-# serial 58 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
-       [m4_default([$3],
-		   [m4_fatal([Libtool version $1 or higher is required],
-		             63)])],
-       [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
-  *\ * | *\	*)
-    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS=$ltmain
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_PREPARE_CC_BASENAME
-# -----------------------
-m4_defun([_LT_PREPARE_CC_BASENAME], [
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
-    for cc_temp in @S|@*""; do
-      case $cc_temp in
-        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-        \-*) ;;
-        *) break;;
-      esac
-    done
-    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-])# _LT_PREPARE_CC_BASENAME
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
-# but that macro is also expanded into generated libtool script, which
-# arranges for $SED and $ECHO to be set by different means.
-m4_defun([_LT_CC_BASENAME],
-[m4_require([_LT_PREPARE_CC_BASENAME])dnl
-AC_REQUIRE([_LT_DECL_SED])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-func_cc_basename $1
-cc_basename=$func_cc_basename_result
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-m4_require([_LT_CMD_TRUNCATE])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options that allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}"; then
-   setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}"; then
-   setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test set != "${COLLECT_NAMES+set}"; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-old_CC=$CC
-old_CFLAGS=$CFLAGS
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    _LT_PATH_MAGIC
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from 'configure', and 'config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# 'config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain=$ac_aux_dir/ltmain.sh
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable.  If COMMENT is supplied, it is inserted after the
-# '#!' sequence but before initialization text begins.  After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script.  The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test 0 = "$lt_write_fail" && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
-  echo
-  AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-'$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
-  -h, --help      print this help, then exit
-  -V, --version   print version number, then exit
-  -q, --quiet     do not print progress messages
-  -d, --debug     don't remove temporary files
-
-Report bugs to <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) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test 0 != $[#]
-do
-  case $[1] in
-    --version | --v* | -V )
-      echo "$lt_cl_version"; exit 0 ;;
-    --help | --h* | -h )
-      echo "$lt_cl_help"; exit 0 ;;
-    --debug | --d* | -d )
-      debug=: ;;
-    --quiet | --q* | --silent | --s* | -q )
-      lt_cl_silent=: ;;
-
-    -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try '$[0] --help' for more information.]) ;;
-
-    *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try '$[0] --help' for more information.]) ;;
-  esac
-  shift
-done
-
-if $lt_cl_silent; then
-  exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure.  Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test yes = "$silent" &&
-  lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars.  Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
-  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
-  m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options that allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}"; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile=${ofile}T
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit, 1996
-
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# Configured defaults for sys_lib_dlsearch_path munging.
-: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-    cat <<'_LT_EOF' >> "$cfgfile"
-
-# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
-
-_LT_PREPARE_MUNGE_PATH_LIST
-_LT_PREPARE_CC_BASENAME
-
-# ### END FUNCTIONS SHARED WITH CONFIGURE
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test set != "${COLLECT_NAMES+set}"; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-  _LT_PROG_LTMAIN
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" \
-     || (rm -f "$cfgfile"; exit 1)
-
-   mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    RM='$RM'
-    ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
-  [C],			[_LT_LANG(C)],
-  [C++],		[_LT_LANG(CXX)],
-  [Go],			[_LT_LANG(GO)],
-  [Java],		[_LT_LANG(GCJ)],
-  [Fortran 77],		[_LT_LANG(F77)],
-  [Fortran],		[_LT_LANG(FC)],
-  [Windows Resource],	[_LT_LANG(RC)],
-  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
-    [_LT_LANG($1)],
-    [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
-  [LT_SUPPORTED_TAG([$1])dnl
-  m4_append([_LT_TAGS], [$1 ])dnl
-  m4_define([_LT_LANG_]$1[_enabled], [])dnl
-  _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC],     [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
-  fi
-fi
-if test -z "$GOC"; then
-  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
-  [LT_LANG(CXX)],
-  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
-  [LT_LANG(F77)],
-  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
-  [LT_LANG(FC)],
-  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-  [LT_LANG(GCJ)],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-    [LT_LANG(GCJ)],
-    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
-      [LT_LANG(GCJ)],
-      [m4_ifdef([AC_PROG_GCJ],
-	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([A][M_PROG_GCJ],
-	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([LT_PROG_GCJ],
-	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
-  [LT_LANG(GO)],
-  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
-  [LT_LANG(RC)],
-  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
-  case $host_os in
-    rhapsody* | darwin*)
-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-    AC_CHECK_TOOL([LIPO], [lipo], [:])
-    AC_CHECK_TOOL([OTOOL], [otool], [:])
-    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
-    _LT_DECL([], [DSYMUTIL], [1],
-      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
-    _LT_DECL([], [NMEDIT], [1],
-      [Tool to change global to local symbols on Mac OS X])
-    _LT_DECL([], [LIPO], [1],
-      [Tool to manipulate fat objects and archives on Mac OS X])
-    _LT_DECL([], [OTOOL], [1],
-      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
-    _LT_DECL([], [OTOOL64], [1],
-      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
-      [lt_cv_apple_cc_single_mod=no
-      if test -z "$LT_MULTI_MODULE"; then
-	# By default we will add the -single_module flag. You can override
-	# by either setting the environment variable LT_MULTI_MODULE
-	# non-empty at configure time, or by adding -multi_module to the
-	# link flags.
-	rm -rf libconftest.dylib*
-	echo "int foo(void){return 1;}" > conftest.c
-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-	# If there is a non-empty error log, and "single_module"
-	# appears in it, assume the flag caused a linker warning
-        if test -s conftest.err && $GREP single_module conftest.err; then
-	  cat conftest.err >&AS_MESSAGE_LOG_FD
-	# Otherwise, if the output was created with a 0 exit code from
-	# the compiler, it worked.
-	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
-	  lt_cv_apple_cc_single_mod=yes
-	else
-	  cat conftest.err >&AS_MESSAGE_LOG_FD
-	fi
-	rm -rf libconftest.dylib*
-	rm -f conftest.*
-      fi])
-
-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
-      [lt_cv_ld_exported_symbols_list],
-      [lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-	[lt_cv_ld_exported_symbols_list=yes],
-	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS=$save_LDFLAGS
-    ])
-
-    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
-      [lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
-      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
-      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
-      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -s conftest.err && $GREP force_load conftest.err; then
-	cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
-	lt_cv_ld_force_load=yes
-      else
-	cat conftest.err >&AS_MESSAGE_LOG_FD
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-    ])
-    case $host_os in
-    rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]][[,.]]*)
-	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test yes = "$lt_cv_apple_cc_single_mod"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test yes = "$lt_cv_ld_exported_symbols_list"; then
-      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
-    fi
-    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
-  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_automatic, $1)=yes
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test yes = "$lt_cv_ld_force_load"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
-                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
-  else
-    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
-  fi
-  _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
-  case $cc_basename in
-     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test yes = "$_lt_dar_can_shared"; then
-    output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
-    m4_if([$1], [CXX],
-[   if test yes != "$lt_cv_apple_cc_single_mod"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
-    fi
-],[])
-  else
-  _LT_TAGVAR(ld_shlibs, $1)=no
-  fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test set = "${lt_cv_aix_libpath+set}"; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
-  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
-  lt_aix_libpath_sed='[
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }]'
-  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi],[])
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
-  fi
-  ])
-  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script that will find a shell with a builtin
-# printf (that we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
-else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
-
-case $ECHO in
-  printf*) AC_MSG_RESULT([printf]) ;;
-  print*) AC_MSG_RESULT([print -r]) ;;
-  *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
-  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test "X`printf %s $ECHO`" = "X$ECHO" \
-      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
-  [Search for dependent libraries within DIR (or the compiler's sysroot
-   if not specified).])],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted.  We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case $with_sysroot in #(
- yes)
-   if test yes = "$GCC"; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   AC_MSG_RESULT([$with_sysroot])
-   AC_MSG_ERROR([The sysroot must be an absolute path.])
-   ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and where our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-  [AS_HELP_STRING([--disable-libtool-lock],
-    [avoid locking (might break parallel builds)])])
-test no = "$enable_libtool_lock" || enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out what ABI is being produced by ac_compile, and set mode
-  # options accordingly.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-	HPUX_IA64_MODE=32
-	;;
-      *ELF-64*)
-	HPUX_IA64_MODE=64
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    if test yes = "$lt_cv_prog_gnu_ld"; then
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -melf32bsmip"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -melf32bmipn32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -melf64bmip"
-	;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -32"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -n32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -64"
-	  ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-mips64*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    emul=elf
-    case `/usr/bin/file conftest.$ac_objext` in
-      *32-bit*)
-	emul="${emul}32"
-	;;
-      *64-bit*)
-	emul="${emul}64"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *MSB*)
-	emul="${emul}btsmip"
-	;;
-      *LSB*)
-	emul="${emul}ltsmip"
-	;;
-    esac
-    case `/usr/bin/file conftest.$ac_objext` in
-      *N32*)
-	emul="${emul}n32"
-	;;
-    esac
-    LD="${LD-ld} -m $emul"
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.  Note that the listed cases only cover the
-  # situations where additional linker options are needed (such as when
-  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
-  # vice versa); the common cases where no linker options are needed do
-  # not appear in the list.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_i386_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    case `/usr/bin/file conftest.o` in
-	      *x86-64*)
-		LD="${LD-ld} -m elf32_x86_64"
-		;;
-	      *)
-		LD="${LD-ld} -m elf_i386"
-		;;
-	    esac
-	    ;;
-	  powerpc64le-*linux*)
-	    LD="${LD-ld} -m elf32lppclinux"
-	    ;;
-	  powerpc64-*linux*)
-	    LD="${LD-ld} -m elf32ppclinux"
-	    ;;
-	  s390x-*linux*)
-	    LD="${LD-ld} -m elf_s390"
-	    ;;
-	  sparc64-*linux*)
-	    LD="${LD-ld} -m elf32_sparc"
-	    ;;
-	esac
-	;;
-      *64-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_x86_64_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_x86_64"
-	    ;;
-	  powerpcle-*linux*)
-	    LD="${LD-ld} -m elf64lppc"
-	    ;;
-	  powerpc-*linux*)
-	    LD="${LD-ld} -m elf64ppc"
-	    ;;
-	  s390*-*linux*|s390*-*tpf*)
-	    LD="${LD-ld} -m elf64_s390"
-	    ;;
-	  sparc*-*linux*)
-	    LD="${LD-ld} -m elf64_sparc"
-	    ;;
-	esac
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS=$CFLAGS
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test yes != "$lt_cv_cc_needs_belf"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS=$SAVE_CFLAGS
-  fi
-  ;;
-*-*solaris*)
-  # Find out what ABI is being produced by ac_compile, and set linker
-  # options accordingly.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*)
-        case $host in
-        i?86-*-solaris*|x86_64-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        sparc*-*-solaris*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-        esac
-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD=${LD-ld}_sol2
-        fi
-        ;;
-      *)
-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks=$enable_libtool_lock
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
-  [lt_cv_ar_at_file=no
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-     [echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
-      AC_TRY_EVAL([lt_ar_try])
-      if test 0 -eq "$ac_status"; then
-	# Ensure the archiver fails upon bogus file names.
-	rm -f conftest.$ac_objext libconftest.a
-	AC_TRY_EVAL([lt_ar_try])
-	if test 0 -ne "$ac_status"; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-     ])
-  ])
-
-if test no = "$lt_cv_ar_at_file"; then
-  archiver_list_spec=
-else
-  archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
-  [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
-    [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  bitrig* | openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
-    [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
-    [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $RM conftest*
-])
-
-if test yes = "[$]$2"; then
-    m4_if([$5], , :, [$5])
-else
-    m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                  [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS=$LDFLAGS
-   LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS=$save_LDFLAGS
-])
-
-if test yes = "[$]$2"; then
-    m4_if([$4], , :, [$4])
-else
-    m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring=ABCD
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  os2*)
-    # The test takes a long time on OS/2.
-    lt_cv_sys_max_cmd_len=8192
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len" && \
-       test undefined != "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
-	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test 17 != "$i" # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-])
-if test -n "$lt_cv_sys_max_cmd_len"; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
-    [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test yes = "$cross_compiling"; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <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 -fvisibility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-	}
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}]
-_LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test yes != "$enable_dlopen"; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen=load_add_on
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen=LoadLibrary
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen=dlopen
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-    # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
-    lt_cv_dlopen=dyld
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-    ;;
-
-  tpf*)
-    # Don't try to run any link tests for TPF.  We know it's impossible
-    # because TPF is a cross-compiler, and we know how we open DSOs.
-    lt_cv_dlopen=dlopen
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=no
-    ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen=shl_load],
-      [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
-	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen=dlopen],
-	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
-	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
-	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
-	      ])
-	    ])
-	  ])
-	])
-      ])
-    ;;
-  esac
-
-  if test no = "$lt_cv_dlopen"; then
-    enable_dlopen=no
-  else
-    enable_dlopen=yes
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS=$CPPFLAGS
-    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS=$LDFLAGS
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS=$LIBS
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-	  lt_cv_dlopen_self, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test yes = "$lt_cv_dlopen_self"; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-	  lt_cv_dlopen_self_static, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS=$save_CPPFLAGS
-    LDFLAGS=$save_LDFLAGS
-    LIBS=$save_LIBS
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
-	 [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
-	 [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
-	 [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
-	[Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links=nottested
-if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test no = "$hard_links"; then
-    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
-         [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
-  [Define to the sub-directory where libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
-   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
-
-  # We can hardcode non-existent directories.
-  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
-     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
-   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
-     test no = "$enable_shared"; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
-    [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP"; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      AC_MSG_RESULT([yes])
-    else
-      AC_MSG_RESULT([no])
-    fi
-    ;;
-  *)
-    AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_PREPARE_MUNGE_PATH_LIST
-# ---------------------------
-# Make sure func_munge_path_list() is defined correctly.
-m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
-[[# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-#       string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-#       string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-#       "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-#       VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
-    case x at S|@2 in
-    x)
-        ;;
-    *:)
-        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
-        ;;
-    x:*)
-        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
-        ;;
-    *::*)
-        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
-        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
-        ;;
-    *)
-        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
-        ;;
-    esac
-}
-]])# _LT_PREPARE_PATH_LIST
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
-	[], [
-if test yes = "$GCC"; then
-  case $host_os in
-    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
-    *) lt_awk_arg='/^libraries:/' ;;
-  esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
-    *) lt_sed_strip_eq='s|=/|/|g' ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary...
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  # ...but if some path component already ends with the multilib dir we assume
-  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
-  case "$lt_multi_os_dir; $lt_search_path_spec " in
-  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
-    lt_multi_os_dir=
-    ;;
-  esac
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
-    elif test -n "$lt_multi_os_dir"; then
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS = " "; FS = "/|\n";} {
-  lt_foo = "";
-  lt_count = 0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo = "/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=.so
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
-[User-defined run-time library search path.])
-
-case $host_os in
-aix3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='$libname$release$shared_ext$major'
-  ;;
-
-aix[[4-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test ia64 = "$host_cpu"; then
-    # AIX 5 supports IA64
-    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line '#! .'.  This would cause the generated library to
-    # depend on '.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # Using Import Files as archive members, it is possible to support
-    # filename-based versioning of shared library archives on AIX. While
-    # this would work for both with and without runtime linking, it will
-    # prevent static linking of such archives. So we do filename-based
-    # shared library versioning with .so extension only, which is used
-    # when both runtime linking and shared linking is enabled.
-    # Unfortunately, runtime linking may impact performance, so we do
-    # not want this to be the default eventually. Also, we use the
-    # versioned .so libs for executables only if there is the -brtl
-    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
-    # To allow for filename-based versioning support, we need to create
-    # libNAME.so.V as an archive file, containing:
-    # *) an Import File, referring to the versioned filename of the
-    #    archive as well as the shared archive member, telling the
-    #    bitwidth (32 or 64) of that shared object, and providing the
-    #    list of exported symbols of that shared object, eventually
-    #    decorated with the 'weak' keyword
-    # *) the shared object with the F_LOADONLY flag set, to really avoid
-    #    it being seen by the linker.
-    # At run time we better use the real file rather than another symlink,
-    # but for link time we create the symlink libNAME.so -> libNAME.so.V
-
-    case $with_aix_soname,$aix_use_runtimelinking in
-    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    aix,yes) # traditional libtool
-      dynamic_linker='AIX unversionable lib.so'
-      # If using run time linking (on AIX 4.2 or later) use lib<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'
-      ;;
-    aix,no) # traditional AIX only
-      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      ;;
-    svr4,*) # full svr4 only
-      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,yes) # both, prefer svr4
-      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
-      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
-      # unpreferred sharedlib libNAME.a needs extra handling
-      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
-      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
-      # We do not specify a path in Import Files, so LIBPATH fires.
-      shlibpath_overrides_runpath=yes
-      ;;
-    *,no) # both, prefer aix
-      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
-      library_names_spec='$libname$release.a $libname.a'
-      soname_spec='$libname$release$shared_ext$major'
-      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
-      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
-      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
-      ;;
-    esac
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='$libname$shared_ext'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=.dll
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
-m4_if([$1], [],[
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
-      ;;
-    esac
-    dynamic_linker='Win32 ld.exe'
-    ;;
-
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
-    library_names_spec='$libname.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec=$LIB
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \$file`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
-  *)
-    # Assume MSVC wrapper
-    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
-    dynamic_linker='Win32 ld.exe'
-    ;;
-  esac
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$major$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[23]].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-      soname_spec='$libname$release$shared_ext$major'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-haiku*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    if test 32 = "$HPUX_IA64_MODE"; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
-    fi
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[[3-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test yes = "$lt_cv_prog_gnu_ld"; then
-		version_type=linux # correct to gnu/linux during the next big refactor
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
-  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-linux*android*)
-  version_type=none # Android doesn't support versioned libraries.
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext'
-  soname_spec='$libname$release$shared_ext'
-  finish_cmds=
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  dynamic_linker='Android linker'
-  # Don't embed -rpath directories since the linker doesn't support them.
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
-    [lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-	 [lt_cv_shlibpath_overrides_runpath=yes])])
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-    ])
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Ideally, we could use ldconfig to report *all* directores which are
-  # searched for libraries, however this is still not possible.  Aside from not
-  # being certain /sbin/ldconfig is available, command
-  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
-  # even though it is searched at run-time.  Try to do the best guess by
-  # appending ld.so.conf contents (and includes) to the search path.
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-    soname_spec='$libname$release$shared_ext$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd* | bitrig*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec=/usr/lib
-  need_lib_prefix=no
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-    need_version=no
-  else
-    need_version=yes
-  fi
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-os2*)
-  libname_spec='$name'
-  version_type=windows
-  shrext_cmds=.dll
-  need_version=no
-  need_lib_prefix=no
-  # OS/2 can only load a DLL with a base name of 8 characters or less.
-  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
-    v=$($ECHO $release$versuffix | tr -d .-);
-    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
-    $ECHO $n$v`$shared_ext'
-  library_names_spec='${libname}_dll.$libext'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=BEGINLIBPATH
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-  postinstall_cmds='base_file=`basename \$file`~
-    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
-    dldir=$destdir/`dirname \$dlpath`~
-    test -d \$dldir || mkdir -p \$dldir~
-    $install_prog $dir/$dlname \$dldir/$dlname~
-    chmod a+x \$dldir/$dlname~
-    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-    fi'
-  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
-    dlpath=$dir/\$dldll~
-    $RM \$dlpath'
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='$libname$release$shared_ext$major'
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test yes = "$with_gnu_ld"; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec; then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
-    soname_spec='$libname$shared_ext.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=sco
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test yes = "$with_gnu_ld"; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test no = "$dynamic_linker" && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
-  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
-fi
-
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
-  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
-fi
-
-# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
-configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
-
-# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
-func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
-
-# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
-configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
-
-_LT_DECL([], [variables_saved_for_relink], [1],
-    [Variables whose values should be saved in libtool wrapper scripts and
-    restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
-    [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
-    [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
-    [[List of archive names.  First name is the real one, the rest are links.
-    The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
-    [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
-    [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
-    [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
-    [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
-    [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
-    [[As "finish_cmds", except a single script fragment to be evaled but
-    not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
-    [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
-    [Compile-time system search path for libraries])
-_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
-    [Detected run-time system search path for libraries])
-_LT_DECL([], [configure_time_lt_sys_library_path], [2],
-    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program that can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD=$MAGIC_CMD
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="m4_if([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS=$lt_save_ifs
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$1"; then
-      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool 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 that can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
-    [AS_HELP_STRING([--with-gnu-ld],
-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test no = "$withval" || with_gnu_ld=yes],
-    [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test yes = "$GCC"; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return, which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD=$ac_prog
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test yes = "$with_gnu_ld"; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS=$lt_save_ifs
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD=$ac_dir/$ac_prog
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test no != "$with_gnu_ld" && break
-	;;
-      *)
-	test yes != "$with_gnu_ld" && 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 yes != "$GCC"; then
-      reload_cmds=false
-    fi
-    ;;
-  darwin*)
-    if test yes = "$GCC"; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_PATH_DD
-# -----------
-# find a working dd
-m4_defun([_LT_PATH_DD],
-[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
-[printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-: ${lt_DD:=$DD}
-AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
-[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
-fi])
-rm -f conftest.i conftest2.i conftest.out])
-])# _LT_PATH_DD
-
-
-# _LT_CMD_TRUNCATE
-# ----------------
-# find command to truncate a binary pipe
-m4_defun([_LT_CMD_TRUNCATE],
-[m4_require([_LT_PATH_DD])
-AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
-[printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-lt_cv_truncate_bin=
-if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
-  cmp -s conftest.i conftest.out \
-  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
-fi
-rm -f conftest.i conftest2.i conftest.out
-test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
-_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
-  [Command to truncate a binary pipe])
-])# _LT_CMD_TRUNCATE
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# 'unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# that responds to the $file_magic_cmd with a given extended regex.
-# If you have 'file' or equivalent on your system and you're not sure
-# whether 'pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[[3-9]]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd* | bitrig*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-os2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
-    fi
-    ;;
-  esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
-    [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
-    [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
-    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM=$NM
-else
-  lt_nm_to_check=${ac_tool_prefix}nm
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS=$lt_save_ifs
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm=$ac_dir/$lt_tmp_nm
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
-	case $build_os in
-	mingw*) lt_bad_file=conftest.nm/nofile ;;
-	*) lt_bad_file=/dev/null ;;
-	esac
-	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
-	*$lt_bad_file* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break 2
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break 2
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS=$lt_save_ifs
-  done
-  : ${lt_cv_path_NM=no}
-fi])
-if test no != "$lt_cv_path_NM"; then
-  NM=$lt_cv_path_NM
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols -headers"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-  AC_SUBST([DUMPBIN])
-  if test : != "$DUMPBIN"; then
-    NM=$DUMPBIN
-  fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
-  [lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
-  cat conftest.out >&AS_MESSAGE_LOG_FD
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh;
-  # decide which one to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd=$ECHO
-  ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
-    [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
-  [lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -f conftest*])
-if test yes != "$lt_cv_path_mainfest_tool"; then
-  MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# _LT_DLL_DEF_P([FILE])
-# ---------------------
-# True iff FILE is a Windows DLL '.def' file.
-# Keep in sync with func_dll_def_p in the libtool script
-AC_DEFUN([_LT_DLL_DEF_P],
-[dnl
-  test DEF = "`$SED -n dnl
-    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
-    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
-    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
-    -e q dnl                          Only consider the first "real" line
-    $1`" dnl
-])# _LT_DLL_DEF_P
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM=-lm)
-  ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test yes = "$GCC"; then
-  case $cc_basename in
-  nvcc*)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
-  esac
-
-  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
-	[Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*)
-  if test ia64 = "$host_cpu"; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  # Gets list of data symbols to import.
-  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
-  # Adjust the below global symbol transforms to fixup imported variables.
-  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
-  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
-  lt_c_name_lib_hook="\
-  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
-  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
-else
-  # Disable hooks by default.
-  lt_cv_sys_global_symbol_to_import=
-  lt_cdecl_hook=
-  lt_c_name_hook=
-  lt_c_name_lib_hook=
-fi
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
-$lt_cdecl_hook\
-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-$lt_c_name_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
-
-# Transform an extracted symbol line into symbol name with lib prefix and
-# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-$lt_c_name_lib_hook\
-" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function,
-    # D for any global variable and I for any imported variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK ['"\
-"     {last_section=section; section=\$ 3};"\
-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
-"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
-"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
-"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
-"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx]"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT@&t 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* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-	  cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_globsym_save_LIBS=$LIBS
-	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS=conftstm.$ac_objext
-	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
-	    pipe_works=yes
-	  fi
-	  LIBS=$lt_globsym_save_LIBS
-	  CFLAGS=$lt_globsym_save_CFLAGS
-	else
-	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test yes = "$pipe_works"; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
-  nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
-    [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
-    [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
-    [Transform the output of nm into a list of symbols to manually relocate])
-_LT_DECL([global_symbol_to_c_name_address],
-    [lt_cv_sys_global_symbol_to_c_name_address], [1],
-    [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
-    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
-    [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
-    [The name lister interface])
-_LT_DECL([], [nm_file_list_spec], [1],
-    [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
-  # C++ specific cases for pic, static, wl, etc.
-  if test yes = "$GXX"; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test ia64 = "$host_cpu"; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the '-m68020' flag to GCC prevents building anything better,
-            # like '-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      case $host_os in
-      os2*)
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
-	;;
-      esac
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[[4-9]]*)
-	# All AIX code is PIC.
-	if test ia64 = "$host_cpu"; then
-	  # AIX 5 now supports IA64 processor
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	else
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-      mingw* | cygwin* | os2* | pw32* | cegcc*)
-	# This hack is so that the source file can tell whether it is being
-	# built for inclusion in a dll (and should export symbols for example).
-	m4_if([$1], [GCJ], [],
-	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-	;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
-	    if test ia64 != "$host_cpu"; then
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  ecpc* )
-	    # old Intel C++ for x86_64, which still supported -KPIC.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  icpc* )
-	    # Intel C++, used to be incompatible with GCC.
-	    # ICC 10 doesn't accept -KPIC any more.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
-	    # IBM XL 8.0, 9.0 on PPC and BlueGene
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC* | sunCC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-	;;
-    esac
-  fi
-],
-[
-  if test yes = "$GCC"; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test ia64 = "$host_cpu"; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the '-m68020' flag to GCC prevents building anything better,
-            # like '-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      case $host_os in
-      os2*)
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
-	;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
-      fi
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test ia64 = "$host_cpu"; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      case $cc_basename in
-      nagfor*)
-        # NAG Fortran compiler
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      esac
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      case $host_os in
-      os2*)
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
-	;;
-      esac
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-      case $cc_basename in
-      # old Intel for x86_64, which still supported -KPIC.
-      ecc*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
-	;;
-      nagfor*)
-	# NAG Fortran compiler
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	;;
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
-	  ;;
-	*Sun\ F* | *Sun*Fortran*)
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	  ;;
-	*Sun\ C*)
-	  # Sun C 5.9
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  ;;
-        *Intel*\ [[CF]]*Compiler*)
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	  ;;
-	*Portland\ Group*)
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    rdos*)
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-case $host_os in
-  # For platforms that do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t 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 GNU nm, but means don't demangle to AIX nm.
-    # Without the "-l" option, or with the "-B" option, AIX nm treats
-    # weak defined symbols like other global defined symbols, whereas
-    # GNU nm marks them as "W".
-    # While the 'weak' keyword is ignored in the Export File, we need
-    # it in the Import File for the 'aix-soname' feature, so we have
-    # to replace the "-B" option with "-P" for AIX nm.
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
-    ;;
-  cygwin* | mingw* | cegcc*)
-    case $cc_basename in
-    cl*)
-      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-      ;;
-    *)
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-      ;;
-    esac
-    ;;
-  *)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-    ;;
-  esac
-], [
-  runpath_var=
-  _LT_TAGVAR(allow_undefined_flag, $1)=
-  _LT_TAGVAR(always_export_symbols, $1)=no
-  _LT_TAGVAR(archive_cmds, $1)=
-  _LT_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_TAGVAR(compiler_needs_object, $1)=no
-  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(hardcode_automatic, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(inherit_rpath, $1)=no
-  _LT_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_TAGVAR(module_cmds, $1)=
-  _LT_TAGVAR(module_expsym_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ' (' and ')$', so one must not match beginning or
-  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
-  # as well as any symbol that contains 'd'.
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test yes != "$GCC"; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd* | bitrig*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_TAGVAR(ld_shlibs, $1)=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test yes = "$with_gnu_ld"; then
-    case $host_os in
-      aix*)
-	# The AIX port of GNU ld has always aspired to compatibility
-	# with the native linker.  However, as the warning in the GNU ld
-	# block says, versions before 2.19.5* couldn't really create working
-	# shared libraries, regardless of the interface used.
-	case `$LD -v 2>&1` in
-	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
-	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
-	  *)
-	    lt_use_gnu_ld_interface=yes
-	    ;;
-	esac
-	;;
-      *)
-	lt_use_gnu_ld_interface=yes
-	;;
-    esac
-  fi
-
-  if test yes = "$lt_use_gnu_ld_interface"; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='$wl'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
-    else
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[[3-9]]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test ia64 != "$host_cpu"; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Joseph Beckenbach <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, use it as
-	# is; otherwise, prepend EXPORTS...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-          cp $export_symbols $output_objdir/$soname.def;
-        else
-          echo EXPORTS > $output_objdir/$soname.def;
-          cat $export_symbols >> $output_objdir/$soname.def;
-        fi~
-        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      shrext_cmds=.dll
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    interix[[3-9]]*)
-      _LT_TAGVAR(hardcode_direct, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test linux-dietlibc = "$host_os"; then
-	case $cc_basename in
-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
-	esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test no = "$tmp_diet"
-      then
-	tmp_addflag=' $pic_flag'
-	tmp_sharedflag='-shared'
-	case $cc_basename,$host_cpu in
-        pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95* | pgfortran*)
-					# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	lf95*)				# Lahey Fortran 8.1
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-	  tmp_sharedflag='--shared' ;;
-        nagfor*)                        # NAGFOR 5.3
-          tmp_sharedflag='-Wl,-shared' ;;
-	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-	  tmp_sharedflag='-qmkshrobj'
-	  tmp_addflag= ;;
-	nvcc*)	# Cuda Compiler Driver 2.2
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
-	  ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-
-        if test yes = "$supports_anon_versioning"; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-            echo "local: *; };" >> $output_objdir/$libname.ver~
-            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
-        fi
-
-	case $cc_basename in
-	tcc*)
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
-	  ;;
-	xlf* | bgf* | bgxlf* | mpixlf*)
-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test yes = "$supports_anon_versioning"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-              echo "local: *; };" >> $output_objdir/$libname.ver~
-              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-	  fi
-	  ;;
-	esac
-      else
-        _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  # For security reasons, it is highly recommended that you always
-	  # use absolute paths for naming shared libraries, and exclude the
-	  # DT_RUNPATH tag from executables and libraries.  But doing so
-	  # requires that you compile everything twice, which is a pain.
-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-	  else
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
-      runpath_var=
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	_LT_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix[[4-9]]*)
-      if test ia64 = "$host_cpu"; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
-	# Without the "-l" option, or with the "-B" option, AIX nm treats
-	# weak defined symbols like other global defined symbols, whereas
-	# GNU nm marks them as "W".
-	# While the 'weak' keyword is ignored in the Export File, we need
-	# it in the Import File for the 'aix-soname' feature, so we have
-	# to replace the "-B" option with "-P" for AIX nm.
-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
-	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# have runtime linking enabled, and use it for executables.
-	# For shared libraries, we enable/disable runtime linking
-	# depending on the kind of the shared library created -
-	# when "with_aix_soname,aix_use_runtimelinking" is:
-	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "aix,yes"  lib.so          shared, rtl:yes, for executables
-	#            lib.a           static archive
-	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
-	#            lib.a(lib.so.V) shared, rtl:no,  for executables
-	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a(lib.so.V) shared, rtl:no
-	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
-	#            lib.a           static archive
-	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	  for ld_flag in $LDFLAGS; do
-	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
-	    aix_use_runtimelinking=yes
-	    break
-	  fi
-	  done
-	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
-	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
-	    # so we don't have lib.a shared libs to link our executables.
-	    # We have to force runtime linking in this case.
-	    aix_use_runtimelinking=yes
-	    LDFLAGS="$LDFLAGS -Wl,-brtl"
-	  fi
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_TAGVAR(archive_cmds, $1)=''
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
-      case $with_aix_soname,$aix_use_runtimelinking in
-      aix,*) ;; # traditional, no import file
-      svr4,* | *,yes) # use import file
-	# The Import File defines what to hardcode.
-	_LT_TAGVAR(hardcode_direct, $1)=no
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-	;;
-      esac
-
-      if test yes = "$GCC"; then
-	case $host_os in aix4.[[012]]|aix4.[[012]].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`$CC -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	  # We have reworked collect2
-	  :
-	  else
-	  # We have old collect2
-	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test yes = "$aix_use_runtimelinking"; then
-	  shared_flag="$shared_flag "'$wl-G'
-	fi
-	# Need to ensure runtime linking is disabled for the traditional
-	# shared library, or the linker may eventually find shared libraries
-	# /with/ Import File - we do not want to mix them.
-	shared_flag_aix='-shared'
-	shared_flag_svr4='-shared $wl-G'
-      else
-	# not using gcc
-	if test ia64 = "$host_cpu"; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test yes = "$aix_use_runtimelinking"; then
-	    shared_flag='$wl-G'
-	  else
-	    shared_flag='$wl-bM:SRE'
-	  fi
-	  shared_flag_aix='$wl-bM:SRE'
-	  shared_flag_svr4='$wl-G'
-	fi
-      fi
-
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
-      else
-	if test ia64 = "$host_cpu"; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
-	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an
-	 # empty executable.
-	 _LT_SYS_MODULE_PATH_AIX([$1])
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
-	  if test yes = "$with_gnu_ld"; then
-	    # We only use this code for GNU lds that support --whole-archive.
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
-	  else
-	    # Exported symbols can be pulled into shared objects from archives
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	  fi
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
-	  # -brtl affects multiple linker settings, -berok does not and is overridden later
-	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
-	  if test svr4 != "$with_aix_soname"; then
-	    # This is similar to how AIX traditionally builds its shared libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
-	  fi
-	  if test aix != "$with_aix_soname"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 3 [...]
-	  else
-	    # used by -dlpreopen to get the symbols
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
-	  fi
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[[45]]*)
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-	# Native MSVC
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	_LT_TAGVAR(always_export_symbols, $1)=yes
-	_LT_TAGVAR(file_list_spec, $1)='@'
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
-	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-            cp "$export_symbols" "$output_objdir/$soname.def";
-            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
-          else
-            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
-          fi~
-          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-          linknames='
-	# The linker will not automatically build a static lib if we build a DLL.
-	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-	# Don't use ranlib
-	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-          lt_tool_outputfile="@TOOL_OUTPUT@"~
-          case $lt_outputfile in
-            *.exe|*.EXE) ;;
-            *)
-              lt_outputfile=$lt_outputfile.exe
-              lt_tool_outputfile=$lt_tool_outputfile.exe
-              ;;
-          esac~
-          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
-            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-            $RM "$lt_outputfile.manifest";
-          fi'
-	;;
-      *)
-	# Assume MSVC wrapper
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=.dll
-	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-	# The linker will automatically build a .lib file if we build a DLL.
-	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-	# FIXME: Should let the user specify the lib program.
-	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-      _LT_DARWIN_LINKER_FEATURES($1)
-      ;;
-
-    dgux*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-      ;;
-
-    hpux10*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test no = "$with_gnu_ld"; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	_LT_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test yes,no = "$GCC,$with_gnu_ld"; then
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	m4_if($1, [], [
-	  # Older versions of the 11.00 compiler do not understand -b yet
-	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-	  _LT_LINKER_OPTION([if $CC understands -b],
-	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
-	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
-	  ;;
-	esac
-      fi
-      if test no = "$with_gnu_ld"; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  ;;
-	*)
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-	# Try to use the -exported_symbol ld option, if it does not
-	# work, assume that -exports_file does not work either and
-	# implicitly export all symbols.
-	# This should be the same for all languages, so no per-tag cache variable.
-	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
-	  [lt_cv_irix_exported_symbol],
-	  [save_LDFLAGS=$LDFLAGS
-	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
-	   AC_LINK_IFELSE(
-	     [AC_LANG_SOURCE(
-	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
-			      [C++], [[int foo (void) { return 0; }]],
-			      [Fortran 77], [[
-      subroutine foo
-      end]],
-			      [Fortran], [[
-      subroutine foo
-      end]])])],
-	      [lt_cv_irix_exported_symbol=yes],
-	      [lt_cv_irix_exported_symbol=no])
-           LDFLAGS=$save_LDFLAGS])
-	if test yes = "$lt_cv_irix_exported_symbol"; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
-	fi
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(inherit_rpath, $1)=yes
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    linux*)
-      case $cc_basename in
-      tcc*)
-	# Fabrice Bellard et al's Tiny C Compiler
-	_LT_TAGVAR(ld_shlibs, $1)=yes
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      esac
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd* | bitrig*)
-      if test -f /usr/libexec/ld.so; then
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-	else
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	fi
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      shrext_cmds=.dll
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	$ECHO EXPORTS >> $output_objdir/$libname.def~
-	prefix_cmds="$SED"~
-	if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	  prefix_cmds="$prefix_cmds -e 1d";
-	fi~
-	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	emximp -o $lib $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    osf3*)
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test yes = "$GCC"; then
-	wlarc='$wl'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-	case `$CC -V 2>&1` in
-	*"Compilers 5.0"*)
-	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-	  ;;
-	*)
-	  wlarc='$wl'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-	  ;;
-	esac
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands '-z linker_flag'.  GCC discards it without '$wl',
-	# but is careful enough not to reorder.
-	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test yes = "$GCC"; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
-	else
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    sunos4*)
-      if test sequent = "$host_vendor"; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-        ;;
-	motorola)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	_LT_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We CANNOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test yes = "$GCC"; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-
-    if test sni = "$host_vendor"; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
-	;;
-      esac
-    fi
-  fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
-    [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test yes,yes = "$GCC,$enable_shared"; then
-    case $_LT_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
-	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
-	[$RM conftest*
-	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-	  soname=conftest
-	  lib=conftest
-	  libobjs=conftest.$ac_objext
-	  deplibs=
-	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-	  compiler_flags=-v
-	  linker_flags=-v
-	  verstring=
-	  output_objdir=.
-	  libname=conftest
-	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-	  _LT_TAGVAR(allow_undefined_flag, $1)=
-	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-	  then
-	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	  else
-	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  fi
-	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-	else
-	  cat conftest.err 1>&5
-	fi
-	$RM conftest*
-	])
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
-    [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
-    [enable_shared_with_static_runtimes], [0],
-    [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
-    [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
-    [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
-    [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
-    [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
-    [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
-    [Commands used to build a loadable module if different from building
-    a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
-    [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
-    [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
-    [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
-    [Flag to hardcode $libdir into a binary during linking.
-    This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
-    [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
-    DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
-    DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting $shlibpath_var if the
-    library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
-    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
-    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
-    [Set to "yes" if building a shared library automatically hardcodes DIR
-    into the library and all subsequent libraries and executables linked
-    against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
-    [Set to yes if linker adds runtime paths of dependent libraries
-    to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
-    [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
-    [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
-    [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
-    [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
-    [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
-    [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
-    [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
-    [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl    [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC=$CC
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## 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 what library types will actually be built
-  AC_MSG_CHECKING([if libtool supports shared libraries])
-  AC_MSG_RESULT([$can_build_shared])
-
-  AC_MSG_CHECKING([whether to build shared libraries])
-  test no = "$can_build_shared" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test yes = "$enable_shared" && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[[4-9]]*)
-    if test ia64 != "$host_cpu"; then
-      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-      yes,aix,yes) ;;			# shared object as lib.so file only
-      yes,svr4,*) ;;			# shared object as lib.so archive member only
-      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-      esac
-    fi
-    ;;
-  esac
-  AC_MSG_RESULT([$enable_shared])
-
-  AC_MSG_CHECKING([whether to build static libraries])
-  # Make sure either enable_shared or enable_static is yes.
-  test yes = "$enable_shared" || enable_static=yes
-  AC_MSG_RESULT([$enable_static])
-
-  _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC=$lt_save_CC
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test no != "$CXX" &&
-    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
-    (test g++ != "$CXX"))); then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_caught_CXX_error"; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_CFLAGS=$CFLAGS
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  CFLAGS=$CXXFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test yes = "$GXX"; then
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-    else
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-    fi
-
-    if test yes = "$GXX"; then
-      # Set up default GNU C++ configuration
-
-      LT_PATH_LD
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test yes = "$with_gnu_ld"; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='$wl'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
-        else
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-    _LT_TAGVAR(ld_shlibs, $1)=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-      aix[[4-9]]*)
-        if test ia64 = "$host_cpu"; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # have runtime linking enabled, and use it for executables.
-          # For shared libraries, we enable/disable runtime linking
-          # depending on the kind of the shared library created -
-          # when "with_aix_soname,aix_use_runtimelinking" is:
-          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
-          # "aix,yes"  lib.so          shared, rtl:yes, for executables
-          #            lib.a           static archive
-          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
-          #            lib.a(lib.so.V) shared, rtl:no,  for executables
-          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
-          #            lib.a(lib.so.V) shared, rtl:no
-          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
-          #            lib.a           static archive
-          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	    for ld_flag in $LDFLAGS; do
-	      case $ld_flag in
-	      *-brtl*)
-	        aix_use_runtimelinking=yes
-	        break
-	        ;;
-	      esac
-	    done
-	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
-	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
-	      # so we don't have lib.a shared libs to link our executables.
-	      # We have to force runtime linking in this case.
-	      aix_use_runtimelinking=yes
-	      LDFLAGS="$LDFLAGS -Wl,-brtl"
-	    fi
-	    ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        _LT_TAGVAR(archive_cmds, $1)=''
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
-        case $with_aix_soname,$aix_use_runtimelinking in
-        aix,*) ;;	# no import file
-        svr4,* | *,yes) # use import file
-          # The Import File defines what to hardcode.
-          _LT_TAGVAR(hardcode_direct, $1)=no
-          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-          ;;
-        esac
-
-        if test yes = "$GXX"; then
-          case $host_os in aix4.[[012]]|aix4.[[012]].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`$CC -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	    # We have reworked collect2
-	    :
-	  else
-	    # We have old collect2
-	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	    # It fails to find uninstalled libraries when the uninstalled
-	    # path is not listed in the libpath.  Setting hardcode_minus_L
-	    # to unsupported forces relinking
-	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-          esac
-          shared_flag='-shared'
-	  if test yes = "$aix_use_runtimelinking"; then
-	    shared_flag=$shared_flag' $wl-G'
-	  fi
-	  # Need to ensure runtime linking is disabled for the traditional
-	  # shared library, or the linker may eventually find shared libraries
-	  # /with/ Import File - we do not want to mix them.
-	  shared_flag_aix='-shared'
-	  shared_flag_svr4='-shared $wl-G'
-        else
-          # not using gcc
-          if test ia64 = "$host_cpu"; then
-	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	  # chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-          else
-	    if test yes = "$aix_use_runtimelinking"; then
-	      shared_flag='$wl-G'
-	    else
-	      shared_flag='$wl-bM:SRE'
-	    fi
-	    shared_flag_aix='$wl-bM:SRE'
-	    shared_flag_svr4='$wl-G'
-          fi
-        fi
-
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-	# export.
-        _LT_TAGVAR(always_export_symbols, $1)=yes
-	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          # The "-G" linker flag allows undefined symbols.
-          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
-
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
-        else
-          if test ia64 = "$host_cpu"; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
-	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
-          else
-	    # Determine the default libpath from the value encoded in an
-	    # empty executable.
-	    _LT_SYS_MODULE_PATH_AIX([$1])
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
-	    # Warning - without using the other run time loading flags,
-	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
-	    if test yes = "$with_gnu_ld"; then
-	      # We only use this code for GNU lds that support --whole-archive.
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
-	    else
-	      # Exported symbols can be pulled into shared objects from archives
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	    fi
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
-	    # -brtl affects multiple linker settings, -berok does not and is overridden later
-	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
-	    if test svr4 != "$with_aix_soname"; then
-	      # This is similar to how AIX traditionally builds its shared
-	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
-	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
-	    fi
-	    if test aix != "$with_aix_soname"; then
-	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# [...]
-	    else
-	      # used by -dlpreopen to get the symbols
-	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
-	    fi
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
-          fi
-        fi
-        ;;
-
-      beos*)
-	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	  # Joseph Beckenbach <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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-              cp "$export_symbols" "$output_objdir/$soname.def";
-              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
-            else
-              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
-            fi~
-            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-            linknames='
-	  # The linker will not automatically build a static lib if we build a DLL.
-	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	  # Don't use ranlib
-	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-            lt_tool_outputfile="@TOOL_OUTPUT@"~
-            case $lt_outputfile in
-              *.exe|*.EXE) ;;
-              *)
-                lt_outputfile=$lt_outputfile.exe
-                lt_tool_outputfile=$lt_tool_outputfile.exe
-                ;;
-            esac~
-            func_to_tool_file "$lt_outputfile"~
-            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
-              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-              $RM "$lt_outputfile.manifest";
-            fi'
-	  ;;
-	*)
-	  # g++
-	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-	  # as there is no search path for DLLs.
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	  _LT_TAGVAR(always_export_symbols, $1)=no
-	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file, use it as
-	    # is; otherwise, prepend EXPORTS...
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
-              cp $export_symbols $output_objdir/$soname.def;
-            else
-              echo EXPORTS > $output_objdir/$soname.def;
-              cat $export_symbols >> $output_objdir/$soname.def;
-            fi~
-            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	  else
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	  ;;
-	esac
-	;;
-      darwin* | rhapsody*)
-        _LT_DARWIN_LINKER_FEATURES($1)
-	;;
-
-      os2*)
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	_LT_TAGVAR(hardcode_minus_L, $1)=yes
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	shrext_cmds=.dll
-	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	  $ECHO EXPORTS >> $output_objdir/$libname.def~
-	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
-	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	  emximp -o $lib $output_objdir/$libname.def'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
-	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
-	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
-	  $ECHO EXPORTS >> $output_objdir/$libname.def~
-	  prefix_cmds="$SED"~
-	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
-	    prefix_cmds="$prefix_cmds -e 1d";
-	  fi~
-	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
-	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
-	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
-	  emximp -o $lib $output_objdir/$libname.def'
-	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          ghcx*)
-	    # Green Hills C++ Compiler
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      freebsd2.*)
-        # C++ shared libraries reported to be fairly broken before
-	# switch to ELF
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      freebsd-elf*)
-        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-        ;;
-
-      haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        ;;
-
-      hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-				             # but as the default
-				             # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            _LT_TAGVAR(ld_shlibs, $1)=no
-            ;;
-          aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-            ;;
-          *)
-            if test yes = "$GXX"; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              _LT_TAGVAR(ld_shlibs, $1)=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test no = "$with_gnu_ld"; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            _LT_TAGVAR(hardcode_direct, $1)=no
-            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-            ;;
-          *)
-            _LT_TAGVAR(hardcode_direct, $1)=yes
-            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					         # but as the default
-					         # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          aCC*)
-	    case $host_cpu in
-	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	    esac
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-	    ;;
-          *)
-	    if test yes = "$GXX"; then
-	      if test no = "$with_gnu_ld"; then
-	        case $host_cpu in
-	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	        esac
-	      fi
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      interix[[3-9]]*)
-	_LT_TAGVAR(hardcode_direct, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-	# Instead, shared libraries are loaded at an image base (0x10000000 by
-	# default) and relocated if they conflict, which is a slow very memory
-	# consuming and fragmenting process.  To avoid this, we pick a random,
-	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    if test yes = "$GXX"; then
-	      if test no = "$with_gnu_ld"; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
-	      fi
-	    fi
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-	    ;;
-        esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(inherit_rpath, $1)=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-	    ;;
-	  icpc* | ecpc* )
-	    # Intel C++
-	    with_gnu_ld=yes
-	    # version 8.0 and above of icpc choke on multiply defined symbols
-	    # if we add $predep_objects and $postdep_objects, however 7.1 and
-	    # earlier do not add the objects themselves.
-	    case `$CC -V 2>&1` in
-	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	      *)  # Version 8.0 or newer
-	        tmp_idyn=
-	        case $host_cpu in
-		  ia64*) tmp_idyn=' -i_dynamic';;
-		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	    esac
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
-	    ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-	    case `$CC -V` in
-	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
-	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-               rm -rf $tpldir~
-               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
-	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-                rm -rf $tpldir~
-                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-                $RANLIB $oldlib'
-	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-                rm -rf $tpldir~
-                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-                rm -rf $tpldir~
-                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-	      ;;
-	    *) # Version 6 and above use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-	      ;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-            ;;
-	  cxx*)
-	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
-
-	    runpath_var=LD_RUN_PATH
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
-	    ;;
-	  xl* | mpixl* | bgxl*)
-	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-	    if test yes = "$supports_anon_versioning"; then
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-                echo "local: *; };" >> $output_objdir/$libname.ver~
-                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
-	    fi
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
-	      _LT_TAGVAR(compiler_needs_object, $1)=yes
-
-	      # Not sure whether something based on
-	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	      # would be better.
-	      output_verbose_link_cmd='func_echo_all'
-
-	      # Archives containing C++ object files must be created using
-	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	      # necessary to make sure instantiated templates are included
-	      # in the archive.
-	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	  *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	esac
-	;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-	  wlarc=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	fi
-	# Workaround some broken pre-1.5 toolchains
-	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-	;;
-
-      *nto* | *qnx*)
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-	;;
-
-      openbsd* | bitrig*)
-	if test -f /usr/libexec/ld.so; then
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
-	  fi
-	  output_verbose_link_cmd=func_echo_all
-	else
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Archives containing C++ object files must be created using
-	    # the KAI C++ compiler.
-	    case $host in
-	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
-	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
-	    esac
-	    ;;
-          RCC*)
-	    # Rational C++ 2.4.1
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          cxx*)
-	    case $host in
-	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-		;;
-	      *)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-                  echo "-hidden">> $lib.exp~
-                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
-                  $RM $lib.exp'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-		;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-	    ;;
-	  *)
-	    if test yes,no = "$GXX,$with_gnu_ld"; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
-	      case $host in
-	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-		  ;;
-	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
-		  ;;
-	      esac
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
-	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	      # Commands to make compiler produce verbose output that lists
-	      # what "hidden" libraries, object files and flags are used when
-	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.x
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          lcc*)
-	    # Lucid
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC* | sunCC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
-	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	    case $host_os in
-	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	      *)
-		# The compiler driver will combine and reorder linker options,
-		# but understands '-z linker_flag'.
-	        # Supported since Solaris 2.6 (maybe 2.5.1?)
-		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	        ;;
-	    esac
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-
-	    output_verbose_link_cmd='func_echo_all'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	    ;;
-          gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
-
-	    # The C++ compiler must be used to create the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    # GNU C++ compiler with Solaris linker
-	    if test yes,no = "$GXX,$with_gnu_ld"; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
-	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-	      else
-	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
-	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-	      fi
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
-	      case $host_os in
-		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
-		  ;;
-	      esac
-	    fi
-	    ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We CANNOT use -z defs as we might desire, because we do not
-	# link with -lc, and that would cause any symbols used from libc to
-	# always be unresolved, which means just about no library would
-	# ever link correctly.  If we're not using GNU ld we use -z text
-	# though, which does catch some bad symbols but isn't as heavy-handed
-	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
-	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
-	runpath_var='LD_RUN_PATH'
-
-	case $cc_basename in
-          CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-              '"$_LT_TAGVAR(old_archive_cmds, $1)"
-	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-              '"$_LT_TAGVAR(reload_cmds, $1)"
-	    ;;
-	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-	    # NonStop-UX NCC 3.20
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-    esac
-
-    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
-
-    _LT_TAGVAR(GCC, $1)=$GXX
-    _LT_TAGVAR(LD, $1)=$LD
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test yes != "$_lt_caught_CXX_error"
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
-  case @S|@2 in
-  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
-  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
-  esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case $prev$p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test x-L = "$p" ||
-          test x-R = "$p"; then
-	 prev=$p
-	 continue
-       fi
-
-       # Expand the sysroot to ease extracting the directories later.
-       if test -z "$prev"; then
-         case $p in
-         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
-         esac
-       fi
-       case $p in
-       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
-       esac
-       if test no = "$pre_test_object_deps_done"; then
-	 case $prev in
-	 -L | -R)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
-	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)=$prev$p
-	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
-	 fi
-       fi
-       prev=
-       ;;
-
-    *.lto.$objext) ;; # Ignore GCC LTO objects
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test no = "$pre_test_object_deps_done"; then
-	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)=$p
-	 else
-	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
-	 fi
-       else
-	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)=$p
-	 else
-	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_TAGVAR(predep_objects,$1)=
-  _LT_TAGVAR(postdep_objects,$1)=
-  _LT_TAGVAR(postdeps,$1)=
-  ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
-    [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
-    [Dependencies to place before and after the objects being linked to
-    create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
-    [The library search path used internally by the compiler when linking
-    a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test no = "$F77"; then
-  _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_disable_F77"; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${F77-"f77"}
-  CFLAGS=$FFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-  GCC=$G77
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test no = "$can_build_shared" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test yes = "$enable_shared" && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test ia64 != "$host_cpu"; then
-	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-	  yes,aix,yes) ;;		# shared object as lib.so file only
-	  yes,svr4,*) ;;		# shared object as lib.so archive member only
-	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-	  esac
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test yes = "$enable_shared" || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)=$G77
-    _LT_TAGVAR(LD, $1)=$LD
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-fi # test yes != "$_lt_disable_F77"
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test no = "$FC"; then
-  _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_disable_FC"; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${FC-"f95"}
-  CFLAGS=$FCFLAGS
-  compiler=$CC
-  GCC=$ac_cv_fc_compiler_gnu
-
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test no = "$can_build_shared" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test yes = "$enable_shared" && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test ia64 != "$host_cpu"; then
-	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
-	  yes,aix,yes) ;;		# shared object as lib.so file only
-	  yes,svr4,*) ;;		# shared object as lib.so archive member only
-	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
-	  esac
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test yes = "$enable_shared" || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
-    _LT_TAGVAR(LD, $1)=$LD
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-fi # test yes != "$_lt_disable_FC"
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)=$LD
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)=$LD
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=$lt_simple_compile_test_code
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
-  :
-  _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
-  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
-    [AC_CHECK_TOOL(GCJ, gcj,)
-      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
-      AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
-    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f "$lt_ac_sed" && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test 10 -lt "$lt_ac_count" && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test "$lt_ac_count" -gt "$lt_ac_max"; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine what file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
-    esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
-         [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-        ;;
-    esac
-    ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
-         [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
deleted file mode 100644
index 94b0829..0000000
--- a/m4/ltoptions.m4
+++ /dev/null
@@ -1,437 +0,0 @@
-# Helper functions for option handling.                    -*- Autoconf -*-
-#
-#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
-#   Foundation, Inc.
-#   Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 8 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
-        _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option '$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
-		      [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME.  If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-    [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
-  dnl
-  dnl Simply set some default values (i.e off) if boolean options were not
-  dnl specified:
-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
-  ])
-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
-  ])
-  dnl
-  dnl If no reference was made to various pairs of opposing options, then
-  dnl we run the default mode handler for the pair.  For example, if neither
-  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
-  dnl archives by default:
-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-		   [_LT_ENABLE_FAST_INSTALL])
-  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
-		   [_LT_WITH_AIX_SONAME([aix])])
-  ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## 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_AIX_SONAME([DEFAULT])
-# ----------------------------------
-# implement the --with-aix-soname flag, and support the `aix-soname=aix'
-# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
-# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
-m4_define([_LT_WITH_AIX_SONAME],
-[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
-shared_archive_member_spec=
-case $host,$enable_shared in
-power*-*-aix[[5-9]]*,yes)
-  AC_MSG_CHECKING([which variant of shared library versioning to provide])
-  AC_ARG_WITH([aix-soname],
-    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
-      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
-    [case $withval in
-    aix|svr4|both)
-      ;;
-    *)
-      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
-      ;;
-    esac
-    lt_cv_with_aix_soname=$with_aix_soname],
-    [AC_CACHE_VAL([lt_cv_with_aix_soname],
-      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
-    with_aix_soname=$lt_cv_with_aix_soname])
-  AC_MSG_RESULT([$with_aix_soname])
-  if test aix != "$with_aix_soname"; then
-    # For the AIX way of multilib, we name the shared archive member
-    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
-    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
-    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
-    # the AIX toolchain works better with OBJECT_MODE set (default 32).
-    if test 64 = "${OBJECT_MODE-32}"; then
-      shared_archive_member_spec=shr_64
-    else
-      shared_archive_member_spec=shr
-    fi
-  fi
-  ;;
-*)
-  with_aix_soname=aix
-  ;;
-esac
-
-_LT_DECL([], [shared_archive_member_spec], [0],
-    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
-])# _LT_WITH_AIX_SONAME
-
-LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
-LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
-LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
-# LT_INIT options.
-# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [lt_p=${PACKAGE-default}
-    case $withval in
-    yes|no) pic_mode=$withval ;;
-    *)
-      pic_mode=default
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
-      for lt_pkg in $withval; do
-	IFS=$lt_save_ifs
-	if test "X$lt_pkg" = "X$lt_p"; then
-	  pic_mode=yes
-	fi
-      done
-      IFS=$lt_save_ifs
-      ;;
-    esac],
-    [pic_mode=m4_default([$1], [default])])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the 'pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## 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
deleted file mode 100644
index 48bc934..0000000
--- a/m4/ltsugar.m4
+++ /dev/null
@@ -1,124 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
-#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
-# Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
-       [$#], [2], [[$2]],
-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59, which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
-       [$#], 1, [],
-       [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
-	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
-	     [m4_foreach([_Lt_suffix],
-		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
-	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
-	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
-		 [lt_append([$1], [$2], [$3])$4],
-		 [$5])],
-	  [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
-	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
-	[$5],
-    [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
-		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
deleted file mode 100644
index fa04b52..0000000
--- a/m4/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers			-*- Autoconf -*-
-#
-#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 4179 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.6])
-m4_define([LT_PACKAGE_REVISION], [2.4.6])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.6'
-macro_revision='2.4.6'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
deleted file mode 100644
index c6b26f8..0000000
--- a/m4/lt~obsolete.m4
+++ /dev/null
@@ -1,99 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
-#
-#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
-#   Foundation, Inc.
-#   Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else.  This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
diff --git a/m4/matlab.m4 b/m4/matlab.m4
index a43c2f2..c80ebbc 100644
--- a/m4/matlab.m4
+++ b/m4/matlab.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2013 D. V. Wiebe
+dnl Copyright (C) 2013, 2014 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
@@ -38,12 +38,18 @@ AC_ARG_WITH([mex], AS_HELP_STRING([--with-mex=PATH],
 dnl try to find mex
 MEX="not found"
 if test "x$user_mex" != "x"; then
-  AC_MSG_CHECKING([if $user_mex is a MATLAB mex compiler])
-  mex_out=`$user_mex 2>&1`
+  MEX=$user_mex
+else
+  AC_PATH_PROG([MEX], [mex], [not found])
+fi
+
+if test "x$MEX" != "xnot found"; then
+  AC_MSG_CHECKING([if $MEX is a MATLAB mex compiler])
+  mex_out=`$MEX 2>&1`
   mex_status=$?
   if test $mex_status -eq 1; then
-    if echo $mex_out | grep -q 'consult the MATLAB External Interfaces Guide'; then
-      MEX=$user_mex
+    if ! echo $mex_out | grep -q 'consult the MATLAB External Interfaces Guide'; then
+      MEX="not found";
     fi
   fi
   if test "x$MEX" = "xnot found"; then
@@ -51,14 +57,13 @@ if test "x$user_mex" != "x"; then
   else
     AC_MSG_RESULT([yes])
   fi
-else
-  AC_PATH_PROG([MEX], [mex], [not found])
 fi
 
 if test "x$MEX" = "xnot found"; then
   have_matlab="no"
   MEX=
 fi
+
 AC_SUBST([MEX])
 ])
 
@@ -107,21 +112,23 @@ fi
 dnl find matlab
 if test "x${have_matlab}" != "xno"; then
   dnl try to find matlab
-  MATLAB="not found"
   if test "x$user_matlab" != "x"; then
-    AC_MSG_CHECKING([if $user_matlab is a MATLAB interpreter])
-    GD_MATLAB_EVAL([matlab_ver], [version], [$user_matlab])
-    if test "x$matlab_ver" = "x"; then
-      AC_MSG_RESULT([no])
-    else
-      AC_MSG_RESULT([yes])
-      MATLAB=$user_matlab
-      MATLAB_VERSION=$matlab_ver
-    fi
+    MATLAB=$user_matlab;
   else
     AC_PATH_PROG([MATLAB], [matlab], [not found])
   fi
 
+  if test "x$MATLAB" != "xnot found"; then
+    AC_MSG_CHECKING([$MATLAB version])
+    GD_MATLAB_EVAL([MATLAB_VERSION], [version], [$MATLAB])
+    if test "x$MATLAB_VERSION" = "x"; then
+      AC_MSG_RESULT([none])
+      MATLAB="not found"
+    else
+      AC_MSG_RESULT([$MATLAB_VERSION])
+    fi
+  fi
+
   if test "x$MATLAB" = "xnot found"; then
     have_matlab=no
     MATLAB=
diff --git a/m4/perl.m4 b/m4/perl.m4
index 794d1fa..8665f11 100644
--- a/m4/perl.m4
+++ b/m4/perl.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2009-2011 D. V. Wiebe
+dnl Copyright (C) 2011-2013 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
@@ -167,7 +167,7 @@ if test "x${have_perl}" != "xno"; then
   if test $perl_inst_type = "vendor"; then
     GD_PERL_CONFIG([perldir], [vendorarchexp])
     GD_PERL_CONFIG([perlmandir], [vendorman3direxp])
-    if test $perldir = "UNKNOWN"; then
+    if test perldir = "UNKNOWN"; then
       perl_inst_type = "site";
     fi
   fi
@@ -180,7 +180,7 @@ if test "x${have_perl}" != "xno"; then
     perlmandir="${man3dir}"
   fi
 
-  if test "x$perlmandir" = "xUNKNOWN"; then
+  if test $perlmandir = "UNKNOWN"; then
     perlmandir="${mandir}"
   fi
 
diff --git a/m4/php.m4 b/m4/php.m4
new file mode 100644
index 0000000..a831adf
--- /dev/null
+++ b/m4/php.m4
@@ -0,0 +1,112 @@
+dnl Copyright (C) 2013, 2015 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_PHP_CONFIG
+dnl ---------------------------------------------------------------
+dnl Get a PHP configuration option and store it in the supplied local
+dnl variable.
+AC_DEFUN([GD_PHP_CONFIG],
+[
+  $1=`${PHP_CONFIG} --$2`
+ifelse(`x$3', `x',,[
+  if test "x${$1}" = "x"; then
+    $1="$3";
+    have_php="no";
+  elif test "x${$1}" = "xNONE"; then
+    have_php="no";
+  fi
+])
+])
+
+dnl GD_PHP
+dnl ---------------------------------------------------------------
+dnl Look for PHP.
+AC_DEFUN([GD_PHP],
+[
+
+have_php="yes"
+AC_ARG_WITH([php-config], AS_HELP_STRING([--with-php-config=PATH],
+            [use PATH as php-config.  [default: autodetect]]),
+            [
+              case "${withval}" in
+                no) have_php="no" ;;
+                yes) user_php_config= ;;
+                *) user_php_config="${withval}" ;;
+              esac
+            ], [ user_php_config= ])
+
+if test "x${have_php}" != "xno"; then
+  dnl try to find php
+  AC_PATH_PROGS(PHP_CONFIG, [$user_php_config php5-config php-config],
+  [not found])
+
+  if test "x$PHP_CONFIG" = "xnot found"; then
+    have_php="no"
+    PHP_CONFIG=
+  fi
+  AC_SUBST([PHP_CONFIG])
+fi
+
+dnl extension dir
+AC_ARG_WITH([php-dir], AS_HELP_STRING([--with-php-dir=DIR],
+      [install the GetData PHP extension into DIR [default: autodetect]]),
+      [
+      if test "x${withval}" = "xno"; then
+        phpdir=UNKNOWN;
+      else
+        phpdir=${withval};
+      fi
+      ], [phpdir=UNKNOWN])
+
+dnl php CLI
+if test "x${have_php}" != "xno"; then
+  AC_MSG_CHECKING([PHP interpreter path])
+  GD_PHP_CONFIG([PHP], [php-binary], [UNKNOWN])
+  AC_MSG_RESULT([$PHP])
+fi
+
+if test "x${have_php}" != "xno"; then
+  AC_SUBST([PHP])
+  AC_MSG_CHECKING([the PHP extension directory])
+  if test "x${phpdir}" = "xUNKNOWN"; then
+    GD_PHP_CONFIG([phpdir], [extension-dir], [UNKNOWN])
+  fi
+  AC_MSG_RESULT([$phpdir])
+  if test "x${phpdir}" = "xUNKNOWN"; then
+    have_php=no
+  fi
+  AC_SUBST([phpdir])
+
+  AC_MSG_CHECKING([PHP CPPFLAGS])
+  GD_PHP_CONFIG([PHP_CPPFLAGS], [includes])
+  AC_MSG_RESULT([$PHP_CPPFLAGS])
+  AC_SUBST([PHP_CPPFLAGS])
+
+  AC_MSG_CHECKING([PHP LDFLAGS])
+  GD_PHP_CONFIG([PHP_LDFLAGS], [ldflags])
+  AC_MSG_RESULT([$PHP_LDFLAGS])
+  AC_SUBST([PHP_ldflags])
+
+  AC_MSG_CHECKING([PHP LIBS])
+  GD_PHP_CONFIG([PHP_LIBS], [libs])
+  AC_MSG_RESULT([$PHP_LIBS])
+  AC_SUBST([PHP_libs])
+fi
+])
diff --git a/m4/python.m4 b/m4/python.m4
index f09ba4a..6146269 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
+dnl Copyright (C) 2009, 2011, 2013 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
@@ -96,42 +96,24 @@ dnl python version
 AC_MSG_CHECKING([$PYTHON version])
 PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[:3]]"`
 AC_MSG_RESULT([$PYTHON_VERSION])
+AC_SUBST([PYTHON_VERSION])
 
-dnl calculate python CPPFLAGS and LIBS
-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_CFLAGS=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('CFLAGS')"`
-
-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} "
+dnl calculate python CPPFLAGS
+AC_MSG_CHECKING([Python includes])
+if test -x $PYTHON-config; then
+  PYTHON_CPPFLAGS=`$PYTHON-config --includes 2>/dev/null`
 else
-  PYTHON_LIBS=""
+  python_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+  python_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+  PYTHON_CPPFLAGS="-I${python_prefix}/include/python${PYTHON_VERSION} -I${python_exec_prefix}/include/python${PYTHON_VERSION}"
 fi
-PYTHON_LIBS="${PYTHON_LIBS}$python_syslibs $python_shlibs $python_modlib"
-AC_MSG_CHECKING([Python CFLAGS])
-AC_MSG_RESULT([$PYTHON_CFLAGS])
-AC_SUBST([PYTHON_CFLAGS])
-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 figure out the platform name
+AC_MSG_CHECKING([Python platform name])
+PYTHON_PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"`
+AC_MSG_RESULT([$PYTHON_PLATFORM])
+AC_SUBST([PYTHON_PLATFORM])
 
 dnl calculate the exec prefix
 pyexec_prefix=$exec_prefix
@@ -148,19 +130,5 @@ fi
 AC_SUBST([pythondir])
 AC_MSG_RESULT([$pythondir])
 
-dnl saved_CFLAGS=${CPPFLAGS}
-dnl CFLAGS="${CFLAGS} ${PYTHON_CFLAGS}"
-dnl saved_CPPFLAGS=${CPPFLAGS}
-dnl CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}"
-dnl saved_LIBS=$LIBS
-dnl LIBS="$LIBS ${PYTHON_LIBS}"
-dnl try to compile a module
-dnl AC_MSG_CHECKING([if we can compile a simple Python extension module])
-dnl AC_TRY_LINK_FUNC([Py_Initialize], [ AC_MSG_RESULT([yes]) ],
-dnl [ AC_MSG_RESULT([no]); have_python="no" ])
-dnl CPPFLAGS=$saved_CPPFLAGS
-dnl CFLAGS=$saved_CFLAGS
-dnl LIBS=$saved_LIBS
-
 fi
 ])
diff --git a/m4/version.m4 b/m4/version.m4
index 71566f3..fe7a500 100644
--- a/m4/version.m4
+++ b/m4/version.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2008-2015 D. V. Wiebe
+dnl Copyright (C) 2011-2013 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
@@ -19,27 +19,27 @@ 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,    8)
-m4_define(getdata_revision, 9)
+m4_define(getdata_minor,    9)
+m4_define(getdata_revision, 0)
 m4_define(getdata_extra,    [])
 m4_define(getdata_version,
           getdata_major.getdata_minor.getdata_revision[]getdata_extra)
 
 dnl libgetdata current interface version
-m4_define(getdata_iface_version,    6)
+m4_define(getdata_iface_version,    7)
 dnl libgetdata current interface implementation revision
-m4_define(getdata_impl_revision,    7)
+m4_define(getdata_impl_revision,    0)
 dnl libgetdata interface age (current interface - oldest supported interface)
-m4_define(getdata_iface_age,        1)
+m4_define(getdata_iface_age,        0)
 
-dnl libgetdata++ interface version info (current:revision:age)
-m4_define(getdataxx_version, 5:1:2)
+dnl libgetdata++ interface version info
+m4_define(getdataxx_version, 6:0:0)
 
 dnl libfgetdata interface version info
-m4_define(fgetdata_version, 4:4:2)
+m4_define(fgetdata_version, 5:0:0)
 
 dnl libf95getdata interface version info
-m4_define(f95getdata_version, 5:3:3)
+m4_define(f95getdata_version, 6:0:0)
 
 dnl libgetdata-matlab interface version info
-m4_define(matlabgetdata_version, 0:1:0)
+m4_define(matlabgetdata_version, 1:0:1)
diff --git a/m4/win32.m4 b/m4/win32.m4
index 61defa5..c8e4b22 100644
--- a/m4/win32.m4
+++ b/m4/win32.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2010 D. V. Wiebe
+dnl Copyright (C) 2010, 2011 D. V. Wiebe
 dnl
 dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
 dnl
diff --git a/man/Makefile.am b/man/Makefile.am
index 5ad1224..723c7f0 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -25,20 +25,20 @@ nodist_man_MANS = gd_alter_encoding.3 gd_alter_endianness.3 \
 dist_man_MANS = checkdirfile.1 dirfile2ascii.1 gd_add.3 gd_add_alias.3 \
 								gd_add_bit.3 gd_add_spec.3 gd_alias_target.3 gd_aliases.3 \
 								gd_alter_affixes.3 gd_alter_bit.3 gd_alter_entry.3 \
-								gd_alter_protection.3 gd_alter_spec.3 gd_bof.3 gd_bof64.3 \
-								gd_carray_len.3 gd_carrays.3 gd_cbopen.3 gd_close.3 \
-								gd_constants.3 gd_delete.3 gd_desync.3 gd_dirfile_standards.3 \
-								gd_dirfilename.3 gd_encoding.3 gd_endianness.3 gd_entry.3 \
-								gd_entry_list.3 gd_entry_type.3 gd_eof.3 gd_eof64.3 gd_error.3 \
-								gd_error_count.3 gd_error_string.3 gd_flags.3 gd_flush.3 \
-								gd_fragment_affixes.3 gd_fragment_index.3 gd_fragmentname.3 \
-								gd_framenum_subset.3 gd_framenum_subset64.3 gd_frameoffset.3 \
-								gd_frameoffset64.3 gd_free_entry_strings.3 \
-								gd_get_carray_slice.3 gd_get_string.3 gd_getdata.3 \
-								gd_getdata64.3 gd_hidden.3 gd_hide.3 gd_include_affix.3 \
-								gd_invalid_dirfile.3 gd_linterp_tablename.3 gd_madd_bit.3 \
-								gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 gd_move.3 \
-								gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \
+								gd_alter_protection.3 gd_alter_spec.3 gd_array_len.3 gd_bof.3 \
+								gd_bof64.3 gd_carrays.3 gd_cbopen.3 gd_close.3 gd_constants.3 \
+								gd_delete.3 gd_desync.3 gd_dirfile_standards.3 \
+								gd_dirfilename.3 gd_encoding.3 gd_encoding_support.3 \
+								gd_endianness.3 gd_entry.3 gd_entry_list.3 gd_entry_type.3 \
+								gd_eof.3 gd_eof64.3 gd_error.3 gd_error_count.3 \
+								gd_error_string.3 gd_flags.3 gd_flush.3 gd_fragment_affixes.3 \
+								gd_fragment_index.3 gd_fragmentname.3 gd_framenum_subset.3 \
+								gd_framenum_subset64.3 gd_frameoffset.3 gd_frameoffset64.3 \
+								gd_free_entry_strings.3 gd_get_carray_slice.3 gd_get_string.3 \
+								gd_getdata.3 gd_getdata64.3 gd_hidden.3 gd_hide.3 \
+								gd_include_affix.3 gd_invalid_dirfile.3 gd_linterp_tablename.3 \
+								gd_madd_bit.3 gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 \
+								gd_move.3 gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \
 								gd_native_type.3 gd_nentries.3 gd_nfragments.3 gd_nframes.3 \
 								gd_nframes64.3 gd_parent_fragment.3 gd_parser_callback.3 \
 								gd_protection.3 gd_put_carray_slice.3 \
@@ -86,7 +86,6 @@ MAN3ALIASES=gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
 	gd_put_carray_slice.3:gd_put_carray.3 \
 	gd_put_carray_slice.3:gd_put_constant.3 \
 	gd_delete.3:gd_delete_alias.3 \
-	gd_move.3:gd_move_alias.3 \
 	gd_hide.3:gd_unhide.3 \
 	gd_add_alias.3:gd_madd_alias.3 \
 	gd_flush.3:gd_sync.3 gd_flush.3:gd_raw_close.3 \
@@ -96,7 +95,8 @@ MAN3ALIASES=gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
 	gd_entry_list.3:gd_field_list.3 gd_entry_list.3:gd_field_list_by_type.3 \
 	gd_entry_list.3:gd_mfield_list.3 gd_entry_list.3:gd_mfield_list_by_type.3 \
 	gd_entry_list.3:gd_nmvectore.3 gd_entry_list.3:gd_vector_list.3 \
-	gd_frameoffset64.3:gd_alter_frameoffset64.3
+	gd_frameoffset64.3:gd_alter_frameoffset64.3 \
+	gd_array_len.3:gd_carray_len.3
 
 #man conversion
 HTMLMANS=$(addsuffix .html,${nodist_man_MANS}) \
diff --git a/man/Makefile.in b/man/Makefile.in
index 90be4b1..82416ad 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -181,6 +179,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -206,8 +206,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -255,7 +266,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -270,12 +280,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -339,9 +353,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -349,6 +364,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -362,7 +378,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -389,20 +405,20 @@ nodist_man_MANS = gd_alter_encoding.3 gd_alter_endianness.3 \
 dist_man_MANS = checkdirfile.1 dirfile2ascii.1 gd_add.3 gd_add_alias.3 \
 								gd_add_bit.3 gd_add_spec.3 gd_alias_target.3 gd_aliases.3 \
 								gd_alter_affixes.3 gd_alter_bit.3 gd_alter_entry.3 \
-								gd_alter_protection.3 gd_alter_spec.3 gd_bof.3 gd_bof64.3 \
-								gd_carray_len.3 gd_carrays.3 gd_cbopen.3 gd_close.3 \
-								gd_constants.3 gd_delete.3 gd_desync.3 gd_dirfile_standards.3 \
-								gd_dirfilename.3 gd_encoding.3 gd_endianness.3 gd_entry.3 \
-								gd_entry_list.3 gd_entry_type.3 gd_eof.3 gd_eof64.3 gd_error.3 \
-								gd_error_count.3 gd_error_string.3 gd_flags.3 gd_flush.3 \
-								gd_fragment_affixes.3 gd_fragment_index.3 gd_fragmentname.3 \
-								gd_framenum_subset.3 gd_framenum_subset64.3 gd_frameoffset.3 \
-								gd_frameoffset64.3 gd_free_entry_strings.3 \
-								gd_get_carray_slice.3 gd_get_string.3 gd_getdata.3 \
-								gd_getdata64.3 gd_hidden.3 gd_hide.3 gd_include_affix.3 \
-								gd_invalid_dirfile.3 gd_linterp_tablename.3 gd_madd_bit.3 \
-								gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 gd_move.3 \
-								gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \
+								gd_alter_protection.3 gd_alter_spec.3 gd_array_len.3 gd_bof.3 \
+								gd_bof64.3 gd_carrays.3 gd_cbopen.3 gd_close.3 gd_constants.3 \
+								gd_delete.3 gd_desync.3 gd_dirfile_standards.3 \
+								gd_dirfilename.3 gd_encoding.3 gd_encoding_support.3 \
+								gd_endianness.3 gd_entry.3 gd_entry_list.3 gd_entry_type.3 \
+								gd_eof.3 gd_eof64.3 gd_error.3 gd_error_count.3 \
+								gd_error_string.3 gd_flags.3 gd_flush.3 gd_fragment_affixes.3 \
+								gd_fragment_index.3 gd_fragmentname.3 gd_framenum_subset.3 \
+								gd_framenum_subset64.3 gd_frameoffset.3 gd_frameoffset64.3 \
+								gd_free_entry_strings.3 gd_get_carray_slice.3 gd_get_string.3 \
+								gd_getdata.3 gd_getdata64.3 gd_hidden.3 gd_hide.3 \
+								gd_include_affix.3 gd_invalid_dirfile.3 gd_linterp_tablename.3 \
+								gd_madd_bit.3 gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 \
+								gd_move.3 gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \
 								gd_native_type.3 gd_nentries.3 gd_nfragments.3 gd_nframes.3 \
 								gd_nframes64.3 gd_parent_fragment.3 gd_parser_callback.3 \
 								gd_protection.3 gd_put_carray_slice.3 \
@@ -451,7 +467,6 @@ MAN3ALIASES = gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
 	gd_put_carray_slice.3:gd_put_carray.3 \
 	gd_put_carray_slice.3:gd_put_constant.3 \
 	gd_delete.3:gd_delete_alias.3 \
-	gd_move.3:gd_move_alias.3 \
 	gd_hide.3:gd_unhide.3 \
 	gd_add_alias.3:gd_madd_alias.3 \
 	gd_flush.3:gd_sync.3 gd_flush.3:gd_raw_close.3 \
@@ -461,7 +476,8 @@ MAN3ALIASES = gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
 	gd_entry_list.3:gd_field_list.3 gd_entry_list.3:gd_field_list_by_type.3 \
 	gd_entry_list.3:gd_mfield_list.3 gd_entry_list.3:gd_mfield_list_by_type.3 \
 	gd_entry_list.3:gd_nmvectore.3 gd_entry_list.3:gd_vector_list.3 \
-	gd_frameoffset64.3:gd_alter_frameoffset64.3
+	gd_frameoffset64.3:gd_alter_frameoffset64.3 \
+	gd_array_len.3:gd_carray_len.3
 
 
 #man conversion
diff --git a/man/dirfile-encoding.5 b/man/dirfile-encoding.5
index 5a02421..c4d4f62 100644
--- a/man/dirfile-encoding.5
+++ b/man/dirfile-encoding.5
@@ -1,6 +1,6 @@
 .\" dirfile-encoding.5.  The dirfile-encoding man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014, 2015 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH dirfile-encoding 5 "26 January 2013" "Standards Version 9" "DATA FORMATS"
+.TH dirfile-encoding 5 "15 October 2015" "Standards Version 9" "DATA FORMATS"
 .SH NAME
 dirfile-encoding \(em dirfile database encoding schemes
 .SH DESCRIPTION
@@ -59,10 +59,12 @@ Functions which may make use of the encoding framework are:
 .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),
+.BR gd_alter_raw "(3), " gd_alter_spec "(3), " gd_flush (3),
+.BR gd_getdata "(3), " gd_malter_spec "(3), " gd_move (3),
+.BR gd_nframes "(3), " gd_putdata "(3), " gd_raw_close (3),
+.BR gd_rename (3),
 and
-.BR gd_rename (3).
+.BR gd_sync (3).
 .P
 Most of the encodings supported by GetData are implemented through external
 libraries which handle the actual file I/O and data translation.  All such
@@ -83,12 +85,14 @@ 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 eight other encoding
+In addition to raw (unencoded) data, GetData supports nine other encoding
 schemes:
 .I text
 encoding,
 .I bzip2
 encoding,
+.I flac
+encoding,
 .I gzip
 encoding,
 .I lzma
@@ -106,15 +110,31 @@ The text encoding and the sample-index encoding are implemented by GetData
 natively and need no external library.  As a result, they are always present in
 the library.
 
+.SS Out-of-place writes
+
+Some of the encodings listed below only support writing via out-of-place writes;
+that is, raw files are written in a temporary location and only moved into place
+when closed.  As a result, writing to these encodings requires making a copy of
+the whole binary data file.  A further side effect of this is that a third-party
+trying to concurrently read a Dirfile which is being written to using one of
+these encodings usually doesn't work.
+
+Within GetData, reading from a field so encoded after writing to it will cause
+writing to the temporary file to be finished and then the file moved into place
+before the read occurs, which may take some time to do.  Encodings which perform
+out-of-place writes are:
+.IR bzip2 ", " flac ", " gzip ", and " lzma .
+
 .SS BZip2 Encoding
 
 The BZip2 Encoding reads compressed raw binary files using the Burrows-Wheeler
 block sorting text compression algorithm and Huffman coding, as implemented in
 the bzip2 format.  GetData's BZip2 Encoding scheme is implemented through the
 .I bzip2 compression library
-written by Julian Seward.  GetData's BZip2 Encoding framework currently lacks
-write capabilities; as a result the BZip2 Encoding does not support functions
-which modify binary data.
+written by Julian Seward.  All operations are supported by the BZip2 Encoding,
+but writing occurs out-of-place.  See the
+.B Out-of-place writes
+section above for details.
 
 GetData caches an uncompressed megabyte of data at a time to speed access times.
 A call to
@@ -124,17 +144,39 @@ size, and may take some time to complete.
 The file extension of the BZip2 Encoding is
 .BR .bz2 .
 
+.SS FLAC Encoding
+
+The FLAC Encoding compresses raw binary files using the Free Lossless Audio
+Codec.  GetData's FLAC Encoding scheme is implemented through the libFLAC
+reference implementation developed by Josh Coalson and the Xiph.Org Foundation.
+All operations are supported by the FLAC Encdoing, but writing occurs
+out-of-place.  See the
+.B Out-of-place writes
+section above for details.
+
+The FLAC format only permits samples up to 32-bits, but the libFLAC reference
+codec can only handle samples up to 24-bits.  GetData gets around this by
+slicing data that is wider than 16-bits into multiple channels (2, 4, or 8,
+depending on width).  For big-ended data, the most-significant 16-bits are
+in channel 0, the second 16-bits in channel 1, &c.  For little-ended data, this
+is reversed, with the least significant word in channel 0.
+
+The sample rate specified in the FLAC header is ignored and may be any valid
+value.  FLAC files written by GetData use a sample rate of 1 Hz.  The file
+extension of the FLAC Encoding is
+.BR .flac .
+The Ogg container format is not supported.
+
 .SS GZip Encoding
 
 The GZip Encoding compresses raw binary files using Lempel-Ziv coding (LZ77) as
 implemented in the gzip format.  GetData's GZip Encoding scheme is implemented
-through the the
+through the
 .I zlib compression library
 written by Jean-loup Gailly and Mark Adler. All operations are supported by the
-GZip Encoding.  Writes to GZip encoded data occur out-of-place; that is: writing
-GZip Encoded data requires making a copy of the whole binary data file.  A side
-effect of this is that concurrently reading a GZip Encoded Dirfile which is
-being written to usually doesn't work.
+GZip Encoding, but writing occurs out-of-place.  See the
+.B Out-of-place writes
+section above for details.
 
 To speed the operation of
 .BR gd_nframes (3),
@@ -153,16 +195,18 @@ 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.
+suite written by Lasse Collin, Ville Koskinen, and Igor Pavlov.  All operations
+are supported by the LZMA Encoding, but writing occurs out-of-place.  See the
+.B Out-of-place writes
+section above for details.  Writing is supported only for the .xz container
+format, and not for the obsolete .lzma format, which can still be read.
 
-As with the BZip2 Encoding, GetData caches an uncompressed megabyte of data at a
-time to speed access times.  A call to
+GetData caches an uncompressed megabyte of data at a time to speed access times.
+A call to
 .BR gd_nframes (3)
 requires decompression of the entire binary file to determine its uncompressed
-size, and may take some time to complete.
-The file extension of the LZMA Encoding is
+size, and may take some time to complete.  The file extension of the LZMA
+Encoding is
 .BR .xz ,
 or
 .BR .lzma .
diff --git a/man/dirfile-format.5 b/man/dirfile-format.5
index c1be545..4fabc3e 100644
--- a/man/dirfile-format.5
+++ b/man/dirfile-format.5
@@ -566,7 +566,7 @@ The full stop
 .RB ( . )
 is allowed in Standards Version 5 and earlier.  The ampersand, semicolon, less
 than, greater than, and vertical line
-.RB ( "& / ; < > |" )
+.RB ( "& ; < > |" )
 are allowed in Standards Version 4 and earlier.  Furthermore, due to the lack
 of an escape or quoting mechanism (see 
 .B Tokens
diff --git a/man/gd_add.3 b/man/gd_add.3
index 05dc71b..40b45da 100644
--- a/man/gd_add.3
+++ b/man/gd_add.3
@@ -1,6 +1,6 @@
 .\" gd_add.3.  The gd_add man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_add 3 "26 July 2012" "Version 0.8.1" "GETDATA"
+.TH gd_add 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_add, gd_madd \(em add a field to a dirfile
 .SH SYNOPSIS
@@ -58,6 +58,20 @@ specifies a
 .B STRING
 field, the field data will be set to the empty string.
 
+The only flags in the
+.IR entry -> flags
+member which are honoured are
+.BR GD_EN_HIDDEN ,
+which should be set or cleared to set the hiddenness of the entry (see
+.BR gd_hidden (3)),
+and
+.BR GD_EN_COMPSCAL ,
+which indicates whether scalar parameters are initialised from the complex
+valued or purely real member, which both are present
+.RB ( LINCOM ,
+.BR POLYNOM ,
+.BR RECIP ).
+
 A metafield may be added either by calling
 .BR gd_madd ()
 with
@@ -139,13 +153,6 @@ 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
@@ -156,17 +163,17 @@ 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
+.B GD_E_IO
 An I/O error occurred while creating an empty binary file to be associated with
 a newly added
 .B RAW
 field.
 .TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, the creation of a
+.B RAW
+field was attempted and the data of the fragment was protected.
+.TP
 .B GD_E_UNKNOWN_ENCODING
 The encoding scheme of the indicated format specification fragment is not known
 to the library.  As a result, the library was unable to create an empty binary
@@ -185,14 +192,6 @@ The dirfile error may be retrieved by calling
 A descriptive error string for the last error encountered can be obtained from
 a call to
 .BR gd_error_string (3).
-.SH NOTES
-GetData artificially 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),
diff --git a/man/gd_add_bit.3 b/man/gd_add_bit.3
index 516df4b..5e5ae6b 100644
--- a/man/gd_add_bit.3
+++ b/man/gd_add_bit.3
@@ -1,6 +1,6 @@
 .\" gd_add_bit.3.  The gd_add_bit man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_add_bit 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.TH gd_add_bit 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_add_bit, gd_add_carray gd_add_clincom, gd_add_const, gd_add_cpolynom,
 gd_add_crecip, gd_add_divide, gd_add_lincom, gd_add_linterp, gd_add_multiply,
@@ -254,13 +254,6 @@ 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
@@ -271,27 +264,30 @@ An internal error occurred in the library while trying to perform the task.
 This indicates a bug in the library.  Please report the incident to the
 GetData developers.
 .TP
+.B GD_E_IO
+.RB ( gd_add_raw ()
+only)  An I/O error occurred while creating an empty binary file to be
+associated with a newly added
+.B RAW
+field.
+.TP
 .B GD_E_PROTECTED
 The metadata of the fragment was protected from change.  Or, the creation of a
 .B RAW
 field was attempted and the data of the fragment was protected.
 .TP
-.B GD_E_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
+.RB ( gd_add_raw ()
+only) The encoding scheme of the indicated format specification fragment is not
+known to the library.  As a result, the library was unable to create an empty
+binary file to be associated with a newly added
 .B RAW
 field.
 .TP
 .B GD_E_UNSUPPORTED
-The encoding scheme of the indicated format specification fragment does not
-support creating an empty binary file to be associated with a newly added
+.RB ( gd_add_raw ()
+only) The encoding scheme of the indicated format specification fragment does
+not support creating an empty binary file to be associated with a newly added
 .B RAW
 field.
 .PP
@@ -302,21 +298,14 @@ a call to
 .BR gd_error_string (3).
 
 .SH NOTES
-GetData artificially 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 (),
+.BR gd_add_clincom "(), " gd_add_cpolynom (),
 and
 .BR gd_add_crecip ():
 .PP
 .nf
 .B #define GD_C89_API
+.br
 .B #include <getdata.h>
 .fi
 .HP
@@ -331,7 +320,7 @@ and
 .BI "int " fragment_index );
 .HP
 .BI "int gd_add_crecip(DIRFILE *" dirfile ", const char *" field_name ,
-.BI "const char *" in_field ", const double " cdividend [2],
+.BI "const char *" in_field ", const double " cdividend\fR[2] ,
 .BI "int " fragment_index );
 .hy
 .ad n
@@ -369,7 +358,6 @@ is always available, and may be accessed as
 .BR gd_add_crecip89 (),
 with the C89 prototype, in both the C99 and C89 APIs.
 
-
 .SH SEE ALSO
 .BR gd_add (3),
 .BR gd_add_spec (3),
diff --git a/man/gd_add_spec.3 b/man/gd_add_spec.3
index 0af24cf..e0c2602 100644
--- a/man/gd_add_spec.3
+++ b/man/gd_add_spec.3
@@ -1,6 +1,6 @@
 .\" gd_add_spec.3.  The gd_add_spec man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" 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"
+.TH gd_add_spec 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_add_spec, gd_madd_spec \(em add a field to a dirfile
 .SH SYNOPSIS
@@ -94,6 +94,12 @@ argument was out of range.
 A syntax error was encountered in
 .IR line .
 .TP
+.B GD_E_IO
+An I/O error occurred while creating an empty binary file to be associated with
+a newly added
+.B RAW
+field.
+.TP
 .B GD_E_LINE_TOO_LONG
 The supplied
 .I line
@@ -109,12 +115,6 @@ 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
diff --git a/man/gd_alter_bit.3 b/man/gd_alter_bit.3
index 04ee535..e6c45ef 100644
--- a/man/gd_alter_bit.3
+++ b/man/gd_alter_bit.3
@@ -1,6 +1,6 @@
 .\" gd_alter_bit.3.  The gd_alter_bit man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_alter_bit 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.TH gd_alter_bit 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_alter_bit, gd_alter_carray, gd_alter_clincom, gd_alter_const,
 gd_alter_cpolynom, gd_alter_crecip, gd_alter_divide, gd_alter_lincom,
@@ -167,9 +167,7 @@ any of the string parameters, also
 .IR m ", " b ", " a ", " cm ", " cb ", or " ca ;
 .TP
 .B 0\fR:
-.IR spf ", " n_fields ", " numbits ", " cdividend ", " dividend ,
-or
-.IR array_len ;
+.IR spf ", " n_fields ", " numbits ", " cdividend ", " dividend ", or " array_len ;
 .TP
 .B -1\fR:
 .IR bitnum " or " period ;
@@ -251,13 +249,7 @@ 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
+.B GD_E_IO
 An I/O error occurred while translating the binary file associated with a
 modified
 .B RAW
@@ -265,6 +257,12 @@ field, or an I/O error occurred while attempting to rename a
 .B LINTERP
 table file.
 .TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, a request to
+translate the binary file associated with a
+.B RAW
+field was attempted, but the data of the fragment was protected.
+.TP
 .B GD_E_UNKNOWN_ENCODING
 The encoding scheme of the indicated format specification fragment is not known
 to the library.  As a result, the library was unable to translate the binary
@@ -292,6 +290,7 @@ and
 .PP
 .nf
 .B #define GD_C89_API
+.br
 .B #include <getdata.h>
 .fi
 .HP
@@ -305,7 +304,7 @@ and
 .BI "int " poly_ord ", const char *" in_fields ", const double *" ca );
 .HP
 .BI "int gd_alter_crecip(DIRFILE *" dirfile ", const char *" field_code ,
-.BI "const char *" in_field ", const double " cdividend [2]);
+.BI "const char *" in_field ", const double " cdividend\fR[2] );
 .hy
 .ad n
 .PP
@@ -340,7 +339,10 @@ portability, the C89 version of
 .BR gd_alter_crecip ()
 is always available, and may be accessed as
 .BR gd_alter_crecip89 (),
-with the C89 prototype, in both the C99 and C89 APIs.
+with the C89 prototype, in both the C99 and C89 APIs.  Passing NULL as
+.I cdividend
+is equivalent to specifying a dividend of zero: it indicates no change to the
+dividend parameter.
 
 .SH SEE ALSO
 .BR gd_alter_entry (3),
@@ -350,4 +352,5 @@ with the C89 prototype, in both the C99 and C89 APIs.
 .BR gd_malter_spec (3),
 .BR gd_metaflush (3),
 .BR gd_open (3),
+.BR gd_put_carray_slice (3),
 .BR dirfile-format (5)
diff --git a/man/gd_alter_encoding.3.in b/man/gd_alter_encoding.3.in
index eb9e636..ca1ce57 100644
--- a/man/gd_alter_encoding.3.in
+++ b/man/gd_alter_encoding.3.in
@@ -15,7 +15,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_alter_encoding 3 "16 October 2014" "Version 0.8.6" "GETDATA"
+.TH gd_alter_encoding 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_alter_encoding \(em modify the binary encoding of data in a dirfile
 .SH SYNOPSIS
@@ -100,14 +100,14 @@ The supplied dirfile was invalid.
 .B GD_E_BAD_INDEX
 The supplied index was out of range.
 .TP
+.B GD_E_IO
+An I/O error occurred while attempting to recode a binary file.
+.TP
 .B GD_E_PROTECTED
 The metadata of the given format specification fragment was protected from
 change, or the binary data of the fragment was protected from change and binary
 file recoding was requested.
 .TP
-.B GD_E_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
diff --git a/man/gd_alter_endianness.3.in b/man/gd_alter_endianness.3.in
index bec720f..004e425 100644
--- a/man/gd_alter_endianness.3.in
+++ b/man/gd_alter_endianness.3.in
@@ -2,7 +2,7 @@
 .\"
 .\" @configure_input@
 .\"
-.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -15,7 +15,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_alter_endianness 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.TH gd_alter_endianness 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_alter_endianness \(em modify the byte sex of fields in a dirfile
 .SH SYNOPSIS
@@ -83,7 +83,11 @@ 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
+size, no change is made.  The I/O pointer of all affected
+.B RAW
+fields is reset to the beginning-of-frame.
+
+If
 .I recode
 is zero, affected binary files are left untouched.
 
@@ -110,14 +114,14 @@ The supplied dirfile was invalid.
 .B GD_E_BAD_INDEX
 The supplied index was out of range.
 .TP
+.B GD_E_IO
+An I/O error occurred while attempting to byte swap a binary file.
+.TP
 .B GD_E_PROTECTED
 The metadata of the indicated format specification fragment was protected from
 change, or the binary data of the fragment was protected from change and binary
 file byte swapping was requested.
 .TP
-.B GD_E_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
diff --git a/man/gd_alter_entry.3 b/man/gd_alter_entry.3
index 181dbb2..b265fd7 100644
--- a/man/gd_alter_entry.3
+++ b/man/gd_alter_entry.3
@@ -1,6 +1,6 @@
 .\" gd_alter_entry.3.  The gd_alter_entry man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_alter_entry 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.TH gd_alter_entry 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_alter_entry \(em modify the metadata of a dirfile field
 .SH SYNOPSIS
@@ -58,6 +58,20 @@ field, use
 To change the name of a field, use
 .BR gd_rename (3).
 
+The only flags in the
+.IR entry -> flags
+member which are honoured are
+.BR GD_EN_HIDDEN ,
+which should be set or cleared to set the hiddenness of the entry (see
+.BR gd_hidden (3)),
+and
+.BR GD_EN_COMPSCAL ,
+which indicates whether scalar parameters are initialised from the complex
+valued or purely real member, which both are present
+.RB ( LINCOM ,
+.BR POLYNOM ,
+.BR RECIP ).
+
 If
 .I field_code
 specifies a
@@ -65,7 +79,8 @@ specifies a
 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
+converted for changes in data type and samples-per-frame.  In this case,
+the field's I/O pointer will be reset to the beginning-of-frame.  If
 .I recode
 is zero, no binary file conversion will take place.
 
@@ -222,13 +237,7 @@ 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
+.B GD_E_IO
 An I/O error occurred while translating the binary file associated with a
 modified
 .B RAW
@@ -236,6 +245,12 @@ field, or an I/O error occurred while attempting to rename a
 .B LINTERP
 table file.
 .TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, a request to
+translate the binary file associated with a
+.B RAW
+field was attempted, but the data of the fragment was protected.
+.TP
 .B GD_E_UNKNOWN_ENCODING
 The encoding scheme of the indicated format specification fragment is not known
 to the library.  As a result, the library was unable to translate the binary
@@ -270,9 +285,11 @@ a call to
 .BR gd_delete (3),
 .BR gd_error (3),
 .BR gd_error_string (3),
+.BR gd_hidden (3),
 .BR gd_malter_spec (3),
 .BR gd_metaflush (3),
 .BR gd_move (3),
 .BR gd_open (3),
+.BR gd_put_carray_slice (3),
 .BR gd_rename (3),
 .BR dirfile-format (5)
diff --git a/man/gd_alter_frameoffset.3.in b/man/gd_alter_frameoffset.3.in
index 521bcfd..21eb495 100644
--- a/man/gd_alter_frameoffset.3.in
+++ b/man/gd_alter_frameoffset.3.in
@@ -2,7 +2,7 @@
 .\"
 .\" @configure_input@
 .\"
-.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -15,7 +15,7 @@
 .\" 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"
+.TH gd_alter_frameoffset 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_alter_frameoffset \(em modify the starting frame of fields in a dirfile
 .SH SYNOPSIS
@@ -63,7 +63,12 @@ argument is non-zero, this call will shift the binary data of affected
 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
+offset, the binary file will be padded at the front with zeroes.  The I/O
+pointer of all affected
+.B RAW
+fields is reset to the beginning-of-frame.
+
+If
 .I recode
 is zero, affected binary files are left untouched.
 
@@ -85,6 +90,9 @@ The supplied dirfile was invalid.
 .B GD_E_BAD_INDEX
 The supplied index was out of range.
 .TP
+.B GD_E_IO
+An I/O error occurred while attempting to shift a binary file.
+.TP
 .B GD_E_PROTECTED
 The metadata of the given format specification fragment was protected from
 change, or the binary data of the fragment was protected from change and binary
@@ -93,9 +101,6 @@ file shifting was requested.
 .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
diff --git a/man/gd_alter_spec.3 b/man/gd_alter_spec.3
index 5d11cf8..1ea2a08 100644
--- a/man/gd_alter_spec.3
+++ b/man/gd_alter_spec.3
@@ -1,6 +1,6 @@
 .\" gd_alter_spec.3.  The gd_alter_spec man page.
 .\"
-.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_alter_spec 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_alter_spec 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_alter_spec, gd_malter_spec \(em modify a field in a dirfile
 .SH SYNOPSIS
@@ -55,7 +55,8 @@ If the modified field is of type
 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
+converted for changes in data type and samples-per-frame.  In this case,
+the field's I/O pointer will be reset to the beginning-of-frame.  If
 .I recode
 is zero, no binary file conversion will take place.
 
@@ -110,6 +111,14 @@ The supplied dirfile was invalid.
 A syntax error was encountered in
 .IR line .
 .TP
+.B GD_E_IO
+An I/O error occurred while translating the binary file associated with a
+modified
+.B RAW
+field, or an I/O error occurred while attempting to rename a
+.B LINTERP
+table file.
+.TP
 .B GD_E_LINE_TOO_LONG
 The supplied
 .I line
@@ -126,14 +135,6 @@ 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
@@ -152,12 +153,6 @@ The dirfile error may be retrieved by calling
 A descriptive error string for the last error encountered can be obtained from
 a call to
 .BR gd_error_string (3).
-.SH BUGS
-If a
-.B CARRAY
-field with more than GD_MAX_CARRAY_LENGTH elements is provided, subsequent
-elements will be silently truncated.  GD_MAX_CARRAY_LENGTH is 2**24 on 32-bit
-systems.  It is larger on 64-bit systems.
 .SH SEE ALSO
 .BR gd_alter_bit (3),
 .BR gd_alter_const (3),
diff --git a/man/gd_array_len.3 b/man/gd_array_len.3
new file mode 100644
index 0000000..e5cc43f
--- /dev/null
+++ b/man/gd_array_len.3
@@ -0,0 +1,86 @@
+.\" gd_array_len.3.  The gd_array_len man page.
+.\"
+.\" Copyright (C) 2010, 2011, 2012, 2014 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_array_len 3 "27 May 2014" "Version 0.9.0" "GETDATA"
+.SH NAME
+gd_array_len \(em returns the length of a CARRAY or SARRAY field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_array_len(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_array_len ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of length of the
+.BR CARRAY ", " CONST ", " STRING ,
+or
+.B SARRAY
+field called
+.IR field_code .
+If
+.I field_code
+contains a valid representation suffix, it will be ignored.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_array_len ()
+returns the array length of the field specified.  (The length of a
+.B CONST
+or a
+.B STRING
+field is always 1.)  On error, it returns zero and sets the dirfile error to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The field specified by
+.I field_code
+was not of one of the field types listed above.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+This function used to be called
+.BR gd_carray_len ().
+This name can still be used, but it has been marked deprecated.
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3)
diff --git a/man/gd_bof.3 b/man/gd_bof.3
index 4355201..ebb0379 100644
--- a/man/gd_bof.3
+++ b/man/gd_bof.3
@@ -78,11 +78,6 @@ or one of the fields it uses as input was not found in the database.
 .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
diff --git a/man/gd_bof64.3 b/man/gd_bof64.3
index 1118b6c..aa26d23 100644
--- a/man/gd_bof64.3
+++ b/man/gd_bof64.3
@@ -18,7 +18,7 @@
 gd_bof64 \(em retrieve data from a dirfile database, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_carray_len.3 b/man/gd_carray_len.3
deleted file mode 100644
index d26db17..0000000
--- a/man/gd_carray_len.3
+++ /dev/null
@@ -1,88 +0,0 @@
-.\" gd_carray_len.3.  The gd_carray_len man page.
-.\"
-.\" Copyright (C) 2010, 2011, 2012 D. V. Wiebe
-.\"
-.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.\"
-.\" This file is part of the GetData project.
-.\"
-.\" Permission is granted to copy, distribute and/or modify this document
-.\" under the terms of the GNU Free Documentation License, Version 1.2 or
-.\" any later version published by the Free Software Foundation; with no
-.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
-.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
-.\" as part of this distribution.
-.\"
-.TH gd_carray_len 3 "4 July 2012" "Version 0.8.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 CONST
-or
-.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 array length of the field specified.  (The length of a
-.B CONST
-field is always 1.)  On error, it returns zero and sets the dirfile error to a
-non-zero error value.  Possible error values are:
-.TP 8
-.B GD_E_ALLOC
-The library was unable to allocate memory.
-.TP
-.B GD_E_BAD_CODE
-The field specified by
-.I field_code
-was not found in the database.
-.TP
-.B GD_E_BAD_DIRFILE
-The supplied dirfile was invalid.
-.TP
-.B GD_E_BAD_FIELD_TYPE
-The field specified by
-.I field_code
-was not a
-.B CONST
-or
-.BR CARRAY .
-.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_cbopen.3 b/man/gd_cbopen.3
index 0484b60..2031e39 100644
--- a/man/gd_cbopen.3
+++ b/man/gd_cbopen.3
@@ -1,6 +1,6 @@
 .\" gd_cbopen.3.  The gd_cbopen man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_cbopen 3 "3 April 2013" "Version 0.8.4" "GETDATA"
+.TH gd_cbopen 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_cbopen, gd_open \(em open or create a dirfile
 .SH SYNOPSIS
@@ -118,6 +118,13 @@ is also specified.
 An empty dirfile will be created, if one does not already exist.  This will
 create both the dirfile directory and an empty format specification file called
 .IR format .
+If the call creates a dirfile, then the specified access mode is ignored: a
+newly-created DIRFILE is always opened with access mode
+.BR GD_RDWR ,
+even if
+.B GD_RDONLY
+had been specified.
+
 The directory will have have mode
 .BR S_IRWXU " | " S_IRWXG " | "  S_IRWXO 
 (0777), modified by the caller's umask value (see
@@ -127,7 +134,6 @@ The
 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
@@ -629,9 +635,7 @@ 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
+The library was asked to truncate a dirfile opened read-only (i.e.
 .B GD_TRUNC
 was specified in
 .I flags
@@ -668,25 +672,18 @@ A syntax error occurred in the format specification.  See also
 .B The Callback Function
 section above.
 .TP
+.B GD_E_IO
+The dirfile format file, or another file that it includes, could not be opened,
+or
+.I dirfilename
+does not specify a valid dirfile.
+.TP
 .B GD_E_LINE_TOO_LONG
 The parser encountered a line in the format specification longer than it was
 able to deal with.  Lines are limited by the storage size of
 .BR ssize_t .
 On 32-bit systems, this limits format specification lines to 2**31 bytes.  The
 limit is larger on 64-bit systems.
-.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).
@@ -716,13 +713,6 @@ directive should be added to the format specification, or else
 .B GD_LITTLE_ENDIAN
 should be specified by the caller.
 
-GetData artificially 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 truncated 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
diff --git a/man/gd_close.3 b/man/gd_close.3
index d58029c..84f40b0 100644
--- a/man/gd_close.3
+++ b/man/gd_close.3
@@ -1,6 +1,6 @@
 .\" gd_close.3.  The gd_close man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,9 +13,9 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_close 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_close 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
-gd_close, gd_discard \(em close a dirfile and free associated memory.
+gd_close, gd_discard \(em close a dirfile and free associated memory
 .SH SYNOPSIS
 .B #include <getdata.h>
 .HP
@@ -88,12 +88,14 @@ are:
 .B GD_E_ALLOC
 The library was unable to allocate memory.
 .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.
+.B GD_E_LINE_TOO_LONG
+While attempting to flush modified metadata to disk, a field specification line
+exceeded the maximum allowed length.  On most platforms, the maximum length is
+at least 2**31 bytes, so this typically indicates something pathological
+happening.
 .TP
-.B GD_E_RAW_IO
-An error occurred while trying to flush or close one or more open raw files.
+.B GD_E_IO
+An I/O error occurred while trying to write modified data or metadata to disk.
 In this case, another call to
 .BR gd_close ()
 or
diff --git a/man/gd_delete.3 b/man/gd_delete.3
index 5d470c4..cb738b1 100644
--- a/man/gd_delete.3
+++ b/man/gd_delete.3
@@ -1,6 +1,6 @@
 .\" gd_delete.3.  The gd_delete man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,9 +13,9 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_delete 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.TH gd_delete 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
-gd_delete, gd_delete_alias \(em remove an entry from a dirfile
+gd_delete \(em remove an entry from a dirfile
 .SH SYNOPSIS
 .B #include <getdata.h>
 .HP
@@ -23,15 +23,12 @@ gd_delete, gd_delete_alias \(em remove an entry from a dirfile
 .ad l
 .BI "int gd_delete(DIRFILE *" dirfile ", const char *" field_code ,
 .BI "unsigned int " flags );
-.HP
-.BI "int gd_delete_alias(DIRFILE *" dirfile ", const char *" alias_name ,
-.BI "unsigned int " flags );
 .hy
 .ad n
 .SH DESCRIPTION
 The
 .BR gd_delete ()
-function attempts to delete the field specified by
+function attempts to delete the field or alias specified by
 .I field_code
 in the dirfile specified by
 .IR dirfile .
@@ -40,18 +37,6 @@ The
 should not contain a representation suffix.
 
 The
-.BR gd_delete_alias ()
-function behaves similarly, but deletes the alias specified by
-.I alias_name
-instead.  (This function is needed, since passing
-.I alias_name
-to
-.BR gd_delete ()
-as
-.I field_code
-would have resulted in the field pointed to by the alias being deleted instead.)
-
-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
@@ -65,8 +50,7 @@ field, also delete the binary data file associated with it.  If
 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.  Ignored by
-.BR gd_delete_alias ().
+binary file will be left untouched.
 .TP
 .B GD_DEL_DEREF
 If the field to be deleted is a
@@ -88,8 +72,7 @@ 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.  Ignored by
-.BR gd_delete_alias ().
+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:
@@ -123,18 +106,18 @@ An internal error occurred in the library while trying to perform the task.
 This indicates a bug in the library.  Please report the incident to the
 GetData developers.
 .TP
+.B GD_E_IO
+An error occurred while trying to close or delete the binary file associated
+with a
+.B RAW
+field.
+.TP
 .B GD_E_PROTECTED
 The metadata of the fragment containing the field was protected from change.
 Or, the deletion of the binary data file associated with a
 .B RAW
 field was attempted and the data of the fragment was protected.
 .TP
-.B GD_E_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
diff --git a/man/gd_desync.3 b/man/gd_desync.3
index 017d53b..ad3ccd6 100644
--- a/man/gd_desync.3
+++ b/man/gd_desync.3
@@ -1,6 +1,6 @@
 .\" gd_desync.3.  The gd_desync man page.
 .\"
-.\" Copyright (C) 2012 D. V. Wiebe
+.\" Copyright (C) 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_desync 3 "15 March 2012" "Version 0.8.0" "GETDATA"
+.TH gd_desync 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_desync \(em check for a change of metadata on disk
 .SH SYNOPSIS
@@ -88,7 +88,7 @@ The library was unable to allocate memory.
 .B GD_E_BAD_DIRFILE
 The supplied dirfile was invalid.
 .TP
-.B GD_E_RAW_IO
+.B GD_E_IO
 An error occurred while trying to obtain the modification time of a fragment.
 .PP
 Additionally, if
diff --git a/man/gd_dirfile_standards.3 b/man/gd_dirfile_standards.3
index 62bdc53..d515bab 100644
--- a/man/gd_dirfile_standards.3
+++ b/man/gd_dirfile_standards.3
@@ -22,7 +22,7 @@ for a DirFile
 .HP
 .nh
 .ad l
-.BI "int gd_dirfile_standards(DIRFILE *" dirfile ", int version );
+.BI "int gd_dirfile_standards(DIRFILE *" dirfile ", int " version );
 .hy
 .ad n
 .SH DESCRIPTION
diff --git a/man/gd_encoding_support.3 b/man/gd_encoding_support.3
new file mode 100644
index 0000000..72ceda9
--- /dev/null
+++ b/man/gd_encoding_support.3
@@ -0,0 +1,81 @@
+.\" gd_encoding_support.3.  The gd_encoding_support man page.
+.\"
+.\" Copyright (C) 2014 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_encoding_support 3 "5 May 2014" "Version 0.9.0" "GETDATA"
+.SH NAME
+gd_encoding_support \(em determine GetData library support for data encodings
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_encoding_support(unsigned long " encoding );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_encoding_support ()
+function reports whether the Dirfile encoding specified by
+.I encoding
+is supported by the GetData library.  The
+.I encoding
+argument should be one of the following symbols, indicating the encoding type:
+.IP
+.nh
+.ad l
+.BR GD_UNENCODED ", " GD_BZIP2_ENCODED ", " GD_GZIP_ENCODED ,
+.BR GD_LZMA_ENCODED ", " GD_SIE_ENCODED ", " GD_SLIM_ENCODED ,
+.BR GD_TEXT_ENCODED ", " GD_ZZIP_ENCODED ", " GD_ZZSLIM_ENCODED .
+.ad n
+.hy
+.PP
+See
+.BR gd_cbopen (3)
+and dirfile-encoding(5) for the meanings of these symbols and details on the
+known encoding schemes.
+
+.SH RETURN VALUE
+The function
+.BR gd_encoding_support ()
+returns
+.B GD_RDWR
+if the GetData library can read from and write to the specified encoding,
+.B GD_RDONLY
+if the GetData library can only read from the specified encoding, or -1 if
+neither reading nor writing is supported, or if
+.I encoding
+was not one of the symbols listed above.
+.SH NOTES
+GetData's encoding support framework is more finely grained than the three-way
+system reported by this function.  It is possible for the library to have
+partial support for reading or writing a particular encoding.  This function
+will only report positive support if
+.I all
+functions of a given class (read-only or read-write) are supported.
+
+Furthermore, encoding types can have multiple subtypes with different degrees of
+support.  This function reports the support of the
+.I most supported
+subtype.  For example, the LZMA encoding framework can read both the .lzma
+and .xz container formats, but only write .xz files.  If LZMA support is available, this function
+will return
+.B GD_RDWR
+when passed
+.BR GD_LZMA_ENCODED .
+
+.SH SEE ALSO
+dirfile-encoding(5),
+.BR gd_cbopen (3),
+.BR gd_encoding (3)
diff --git a/man/gd_entry.3 b/man/gd_entry.3
index 2412350..accc7a7 100644
--- a/man/gd_entry.3
+++ b/man/gd_entry.3
@@ -1,6 +1,6 @@
 .\" gd_entry.3.  The gd_entry man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2008-2013 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_entry 3 "3 April 2013" "Version 0.8.4" "GETDATA"
+.TH gd_entry 3 "10 December 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_entry \(em retrieve a dirfile field's metadata
 .SH SYNOPSIS
@@ -61,6 +61,14 @@ by the caller once they are no longer needed.  The
 .BR gd_free_entry_strings (3)
 function is provided as a convenience to do this.
 
+If the entry's metadata contains scalar field codes which cannot be
+dereferenced, the associated numerical field parameter will be initialised to
+zero.  In this case, the
+.B GD_EN_CALC
+flag in the returned entry object will
+.I NOT
+be set.
+
 The returned
 .I entry
 structure, including strings and their pointers may be freely modified by the
@@ -85,14 +93,6 @@ 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).
@@ -112,6 +112,7 @@ typedef struct {
   const char  *field;          /* field code */
   gd_entype_t  field_type;     /* field type */
   int          fragment_index; /* format fragment index */
+  unsigned     flags;          /* entry flags */
 
   ...
 } gd_entry_t;
@@ -172,6 +173,48 @@ primary fragment, the file called
 in the root dirfile directory (see 
 .IR dirfile (5)).
 .PP
+The
+.I flags
+member is a bitwise or'd collection of the following entry flags:
+.TP
+.B GD_EN_CALC
+This bit is set only when the non-literal scalar parameter field codes specified
+in the
+.I scalar
+member have been resolved, and the corresponding numerical parameter have
+been initialised with these data.  When one or more field code does not exist,
+or is invalid (ie. when
+.BR gd_validate (3)
+would fail on the specified
+.I field_code
+with the error
+.BR GD_E_BAD_SCALAR ),
+then the unresolved numerical parameters are initialised to zero, and this flag
+is not be set.  If the requested field does not allow non-literal scalar
+parameters
+.RB ( CARRAY ,
+.BR CONST ,
+.BR DIVIDE ,
+.BR INDEX ,
+.BR LINTERP ,
+.BR MULTIPLY ,
+.BR STRING ),
+the value of this bit is unspecified.
+.TP
+.B GD_EN_COMPSCAL
+For fields which permit complex valued parameters
+.RB ( LINCOM ,
+.BR POLYNOM ,
+.BR RECIP ),
+this bit is set only when at least one parameter is complex valued.  For
+other field types, the value of this bit is unspecified.
+.TP
+.B GD_EN_HIDDEN
+This bit is set only when the field has been hidden by the
+.B /HIDDEN
+directive (see
+.BR gd_hidden (3)).
+.PP
 Remaining fields in the gd_entry_t structure depend on the value of
 .IR field_type .
 Callers are advised to check
@@ -421,7 +464,6 @@ 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) */
@@ -444,15 +486,6 @@ is defined in getdata.h as 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
@@ -645,7 +678,6 @@ 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) */
@@ -666,14 +698,6 @@ is defined in getdata.h as 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
@@ -751,7 +775,6 @@ entry, will also provide:
 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 */
@@ -763,14 +786,6 @@ typedef struct {
 .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
@@ -950,4 +965,5 @@ element is the imaginary part.
 .BR gd_fragmentname (3),
 .BR gd_linterp_tablename (3)
 .BR gd_mplex_lookback (3),
-.BR gd_raw_filename (3)
+.BR gd_raw_filename (3),
+.BR gd_validate (3)
diff --git a/man/gd_entry_type.3 b/man/gd_entry_type.3
index d120840..2bfa1e8 100644
--- a/man/gd_entry_type.3
+++ b/man/gd_entry_type.3
@@ -80,11 +80,6 @@ The supplied dirfile was invalid.
 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).
diff --git a/man/gd_eof.3 b/man/gd_eof.3
index e6c8dba..0f8d16e 100644
--- a/man/gd_eof.3
+++ b/man/gd_eof.3
@@ -1,6 +1,6 @@
 .\" gd_eof.3.  The gd_eof man page.
 .\"
-.\" Copyright (C) 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2010, 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_eof 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_eof 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_eof \(em report the number of samples in a dirfile field
 .SH SYNOPSIS
@@ -89,11 +89,6 @@ 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
@@ -107,7 +102,7 @@ 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_RAW_IO
+.B GD_E_IO
 An attempt to
 .BR stat (2)
 the file associated with the field, or one of its input fields, failed.
diff --git a/man/gd_eof64.3 b/man/gd_eof64.3
index 101acf3..7705003 100644
--- a/man/gd_eof64.3
+++ b/man/gd_eof64.3
@@ -18,7 +18,7 @@
 gd_eof64 \(em retrieve data from a dirfile database, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_error_count.3 b/man/gd_error_count.3
index 0b9a7a9..e595447 100644
--- a/man/gd_error_count.3
+++ b/man/gd_error_count.3
@@ -1,6 +1,6 @@
 .\" gd_error_count.3.  The gd_error_count man page.
 .\"
-.\" Copyright (C) 2011 D. V. Wiebe
+.\" Copyright (C) 2011, 2013 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_error_count 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_error_count 3 "17 December 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_error_count \(em report the number of errors encountered by the GetData
 library
@@ -22,7 +22,7 @@ library
 .HP
 .nh
 .ad l
-.BI "int gd_error_check(DIRFILE *" dirfile );
+.BI "int gd_error_count(DIRFILE *" dirfile );
 .hy
 .ad n
 .SH DESCRIPTION
@@ -31,14 +31,15 @@ The first time
 is called with the DIRFILE object
 .IR dirfile ,
 it returns the number of errors encountered by the GetData library while
-operating on the specified DIRFILE object, since the DIRFILE's creation.
-Calling this function resets the internal count, so that subsequent calls to
+operating on
+.I dirfile
+since its creation.  Calling this function resets the internal count, so
+that subsequent calls to
 .BR gd_error_count ()
 return the number of errors encountered only since the previous call to this
 function, for the specified DIRFILE.
 
-The errors themselves are not cached by the library.  The error status of
-the 
+The errors themselves are not cached by the library.  The error status of the 
 .I last
 library call on
 .I dirfile
diff --git a/man/gd_error_string.3 b/man/gd_error_string.3
index 9cdd0b6..cf74070 100644
--- a/man/gd_error_string.3
+++ b/man/gd_error_string.3
@@ -1,6 +1,6 @@
 .\" gd_error_string.3.  The gd_error_string man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_error_string 3 "20 April 2011" "Version 0.8.0" "GETDATA"
+.TH gd_error_string 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_error_string \(em report a GetData library error
 .SH SYNOPSIS
@@ -61,9 +61,11 @@ 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
+or NULL if buflen is less than one.  If
+.I buffer
+is NULL, this function returns a newly malloc'd
+string of sufficient length which should be deallocated by the caller, or
+NULL, if memory allocation failed.  In all cases, the error state of
 .I dirfile
 is unchanged.
 .SH SEE ALSO
diff --git a/man/gd_flush.3 b/man/gd_flush.3
index 6443807..2f7e552 100644
--- a/man/gd_flush.3
+++ b/man/gd_flush.3
@@ -1,6 +1,6 @@
 .\" gd_flush.3.  The gd_flush man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_flush 3 "15 March 2012" "Version 0.8.0" "GETDATA"
+.TH gd_flush 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_flush gd_raw_close gd_sync \(em write all pending dirfile changes to disk or
 close open raw fields
@@ -56,7 +56,9 @@ function closes any raw data files which GetData has opened associated with
 .IR field_code ,
 or its input(s).  Again, if
 .I field_code
-is NULL, all open data files are closed.
+is NULL, all open data files are closed.  The I/O pointer of any
+.B RAW
+field which is closed is reset to the beginning-of-field.
 .PP
 Calling
 .BR gd_flush ()
@@ -83,22 +85,14 @@ was not found in the database.
 .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
-(Not
-.BR gd_raw_close ().)
-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.
+.B GD_E_IO
+An I/O error occurred while trying to write modified data or metadata to disk.
 .TP
-.B GD_E_RAW_IO
-An error occurred while trying to flush or close the field(s).
+.B GD_E_LINE_TOO_LONG
+While attempting to flush modified metadata to disk, a field specification line
+exceeded the maximum allowed length.  On most platforms, the maximum length is
+at least 2**31 bytes, so this typically indicates something pathological
+happening.
 .TP
 .B GD_E_RECURSE_LEVEL
 Too many levels of recursion were encountered while trying to resolve
diff --git a/man/gd_framenum_subset.3 b/man/gd_framenum_subset.3
index 94e3aec..a5d2c41 100644
--- a/man/gd_framenum_subset.3
+++ b/man/gd_framenum_subset.3
@@ -1,6 +1,6 @@
 .\" gd_framenum_subset.3.  The gd_framenum man page.
 .\"
-.\" Copyright (C) 2009, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2009, 2010, 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_framenum_subset 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_framenum_subset 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_framenum_subset, gd_framenum \(em perform a reverse look-up on a
 monotonic dirfile field
@@ -110,11 +110,6 @@ was not found.
 .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 scalar field used in the definition of the field was not found, or was not of
 scalar type.
@@ -135,16 +130,16 @@ 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.
+.B GD_E_IO
+An error occurred while trying to open or read from a file on disk containing
+a raw field or LINTERP table.
+.TP
+.B GD_E_LUT
+A LINTERP table was malformed.
 .TP
 .B GD_E_RANGE
 The specified field is constant between the supplied limits.
 .TP
-.B GD_E_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 .
diff --git a/man/gd_framenum_subset64.3 b/man/gd_framenum_subset64.3
index 2223068..2173029 100644
--- a/man/gd_framenum_subset64.3
+++ b/man/gd_framenum_subset64.3
@@ -19,7 +19,7 @@ gd_framenum_subset64 \(em perform a reverse look-up on a monotonic dirfile
 field, with largefile support.
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_frameoffset64.3 b/man/gd_frameoffset64.3
index 459e895..44266ad 100644
--- a/man/gd_frameoffset64.3
+++ b/man/gd_frameoffset64.3
@@ -19,7 +19,7 @@ gd_frameoffset64, gd_alter_frameoffset64 \(em report or change the frame
 offset of fields in a dirfile, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_free_entry_strings.3 b/man/gd_free_entry_strings.3
index 18845e0..4ff2552 100644
--- a/man/gd_free_entry_strings.3
+++ b/man/gd_free_entry_strings.3
@@ -1,6 +1,6 @@
 .\" gd_free_entry_strings.3.  The gd_free_entry_strings man page.
 .\"
-.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2013 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" 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"
+.TH gd_free_entry_strings 3 "7 December 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_free_entry_strings \(em free strings in a GetData gd_entry_t object
 .SH SYNOPSIS
@@ -31,7 +31,7 @@ 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
+After freeing a string, the associated pointer is set to NULL.  If
 .I entry
 is NULL, this function does nothing.
 
@@ -52,9 +52,9 @@ unless these pointer members are equal to NULL.
 
 See 
 .BR gd_entry (3)
-for a complete description of the gd_entry_t data type.
+for a description of the gd_entry_t data type.
 .SH RETURN VALUE
-A call to 
+The function
 .BR gd_free_entry_strings ()
 always returns its input,
 .IR entry .
diff --git a/man/gd_get_carray_slice.3 b/man/gd_get_carray_slice.3
index 2d98774..6b3bccb 100644
--- a/man/gd_get_carray_slice.3
+++ b/man/gd_get_carray_slice.3
@@ -1,6 +1,6 @@
 .\" gd_get_carray_slice.3.  The gd_get_carray_slice man page.
 .\"
-.\" Copyright (C) 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2010-2013 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,9 +13,9 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_get_carray_slice 3 "4 July 2012" "Version 0.8.0" "GETDATA"
+.TH gd_get_carray_slice 3 "1 October 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
-gd_get_carray, gd_get_carray_slice, gd_get_constant \(em retrieve CONST or\CARRAY data from a dirfile database
+gd_get_carray, gd_get_carray_slice, gd_get_constant \(em retrieve CONST or CARRAY data from a dirfile database
 .SH SYNOPSIS
 .B #include <getdata.h>
 .HP
@@ -150,9 +150,10 @@ purely real one is required, only the real portion of the requested vector will
 be returned.
 .SH RETURN VALUE
 On success,
-.BR gd_get_carray ()
+.BR gd_get_carray (),
+.BR gd_get_carray_slice (),
 and
-.BR gd_get_carray_slice ()
+.BR gd_get_constant ()
 return zero.  On error, they return -1 and set the dirfile error to a non-zero
 value.  Possible error values are:
 .TP 8
@@ -182,11 +183,6 @@ 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
diff --git a/man/gd_getdata.3 b/man/gd_getdata.3
index 536cf1c..fde4a3f 100644
--- a/man/gd_getdata.3
+++ b/man/gd_getdata.3
@@ -1,6 +1,6 @@
 .\" gd_getdata.3.  The gd_getdata man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_getdata 3 "26 January 2013" "Version 0.8.3" "GETDATA"
+.TH gd_getdata 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_getdata \(em retrieve data from a dirfile database
 .SH SYNOPSIS
@@ -92,8 +92,8 @@ as
 .IR first_frame .
 This will result in the read occurring at the current position of the I/O
 pointer for the field (see
-.BR gd_seek (3)
-for a discussion of field I/O pointers).  In this case, the value of
+.B GetData I/O Pointers
+below for a discussion of field I/O pointers).  In this case, the value of
 .I first_sample
 is ignored.
 
@@ -155,8 +155,8 @@ purely real one is required, only the real portion of the requested vector will
 be returned.
 
 Upon successful completion, the I/O pointer of the field will be on the sample
-immediately following the last sample returned.  On error, the position of the
-I/O pointer is not specified, and may not even be well defined.
+immediately following the last sample returned, if possible.  On error, the
+position of the I/O pointer is not specified, and may not even be well defined.
 
 .SS Behaviour While Reading Specific Field Types
 
@@ -269,11 +269,6 @@ An invalid
 .I dirfile
 was supplied.
 .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.
@@ -310,12 +305,12 @@ 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
+.B GD_E_IO
 An error occurred while trying to open or read from a file on disk containing
-a raw field.
+a raw field or LINTERP table.
+.TP
+.B GD_E_LUT
+A LINTERP table was malformed.
 .TP
 .B GD_E_RECURSE_LEVEL
 Too many levels of recursion were encountered while trying to resolve
@@ -338,6 +333,7 @@ The dirfile error may be retrieved by calling
 A descriptive error string for the last error encountered can be obtained from
 a call to
 .BR gd_error_string (3).
+
 .SH NOTES
 To save memory,
 .BR gd_getdata ()
@@ -351,13 +347,144 @@ will report zero samples returned on error.
 
 Reading slim-compressed data (see defile-encoding(5)), may cause unexpected
 memory usage.  This is because slimlib internally caches open decompressed files
-as they are read, and getdata doesn't close data files between
+as they are read, and GetData doesn't close data files between
 .BR gd_getdata ()
 calls for efficiency's sake.  Memory used by this internal slimlib buffer can be
 reclaimed by calling
-.BR df_raw_close (3)
+.BR gd_raw_close (3)
 on fields when finished reading them.
 
+.SH GETDATA I/O POINTERs
+This is a general discussion of field I/O pointers in the GetData library, and
+contains information not directly applicable to
+.BR gd_getdata ().
+
+Every
+.B RAW
+field in an open Dirfile has an
+.I I/O pointer
+which indicates the library's current read and write poisition in the field.
+These I/O pointers are useful when performing sequential reads or writes on
+Dirfile fields (see
+.B GD_HERE
+in the description above).  The value of the I/O pointer of a field is reported
+by
+.BR gd_tell (3).
+
+Derived fields have virtual I/O pointers arising from the I/O pointers of their
+input fields.  These virtual I/O pointers may be valid (when all input fields
+agree on their position in the dirfile) or invalid (when the input fields are
+not in agreement).  The I/O pointer of some derived fields is
+.I always
+invalid.  The usual reason for this is the derived field simultaneously reading
+from two different places in the same
+.B RAW
+field.  For example, given the following Dirfile metadata specification:
+
+.RS
+a \fBRAW UINT8\fR 1
+.br
+b \fBPHASE\fR a 1
+.br
+c \fBLINCOM\fR 2 a 1 0 b 1 0
+.RE
+
+the derived field
+.I c
+never has a valid I/O pointer, since any particular sample of
+.I c
+ultimately involves reading from more than one place in the
+.B RAW
+field
+.IR a .
+Attempting to perform sequential reads or writes (with
+.BR GD_HERE )
+on a derived field when its I/O pointer is invalid will result in an error
+(specifically,
+.BR GD_E_DOMAIN ).
+
+The implicit
+.I INDEX
+field has an effective I/O pointer than mostly behaves like a true
+.B RAW
+field I/O pointer, except that it permits simultaneous reads from multiple
+locations.  So, given the following metadata specification:
+
+.RS
+d \fBPHASE\fR INDEX 1
+.br
+e \fBLINCOM\fR 2 INDEX 1 0 d 1 0
+.RE
+
+the I/O pointer of the derived field
+.I e
+will always be valid, unlike the similarly defined
+.I c
+above.  The virtual I/O pointer of a derived field will change in response to
+movement of the
+.B RAW
+I/O pointers underlying the derived fields inputs, and vice versa: moving the
+I/O pointer of a derived field will move the I/O pointer of the
+.B RAW
+fields from which it ultimately derives.  As a result, the I/O pointer of
+any particular field may move in unexpected ways if multiple fields are
+manipulated at the same time.
+
+When a Dirfile is first opened, the I/O pointer of every
+.B RAW
+field is set to the beginning-of-frame
+(the value returned by
+.BR gd_bof (3)),
+as is the I/O pointer of any newly-created
+.B RAW
+field.
+
+The following library calls cause I/O pointers to move:
+.TP
+.BR gd_getdata "() and " gd_putdata (3)
+These functions move the I/O pointer of affected fields to the sample
+immediately following the last sample read or written, both when performed at
+an absolutely specified position and when called for a sequential read or write
+using
+.BR GD_HERE .
+When reading a derived field which simultaneously reads from more than one place
+in a
+.B RAW
+field (such as
+.I c
+above), the position of that
+.B RAW
+field's I/O pointer is unspecified (that is: it is not specified which input
+field is read first).
+.TP
+.BR gd_seek (3)
+This function is used to manipulate I/O pointers directly.
+.TP
+.BR gd_flush "(3) and " gd_raw_close (3)
+These functions set the I/O pointer of any
+.B RAW
+field which is closed back to the beginning-of-field.
+.TP
+.I calls which result in modifications to raw data files:
+this may happen when calling any of:
+.BR gd_alter_encoding "(3), " gd_alter_endianness (3),
+.BR gd_alter_frameoffset "(3), " gd_alter_entry (3),
+.BR gd_alter_raw "(3), " gd_alter_spec "(3), " gd_malter_spec (3),
+.BR gd_move (3),
+or
+.BR gd_rename (3);
+these functions close affected
+.B RAW
+fields before making changes to the raw data files, and so reset the
+corresponding I/O pointers to the beginning-of-field.
+
+.PP
+In general, when these calls fail, the I/O pointers of affected fields may be
+anything, even out-of-bounds or invalid.  After an error, the caller should
+issue an explicit
+.BR gd_seek (3)
+to repoisition I/O pointers before attempting further sequential operations.
+
 .SH SEE ALSO
 .BR dirfile (5),
 .BR dirfile-encoding (5),
diff --git a/man/gd_getdata64.3 b/man/gd_getdata64.3
index 51fb0fd..a076312 100644
--- a/man/gd_getdata64.3
+++ b/man/gd_getdata64.3
@@ -18,7 +18,7 @@
 gd_getdata64 \(em retrieve data from a dirfile database, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_hidden.3 b/man/gd_hidden.3
index bc7336d..c0a4425 100644
--- a/man/gd_hidden.3
+++ b/man/gd_hidden.3
@@ -1,6 +1,6 @@
 .\" gd_hidden.3.  The gd_hidden man page.
 .\"
-.\" Copyright (C) 2012 D. V. Wiebe
+.\" Copyright (C) 2012, 2013 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_hidden 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.TH gd_hidden 3 "10 December 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_hidden \(em retrieve the fragment containing a dirfile field
 .SH SYNOPSIS
@@ -32,7 +32,9 @@ function queries a dirfile(5) database specified by
 .I dirfile
 and indicates whether the field or alias called
 .IR entry_name
-is hidden or not.
+is hidden or not.  This information is also available in the entry object
+proved by
+.BR gd_entry (3).
 
 A hidden entry does not appear in the field lists returned by the functions
 .BR gd_field_list (3),
diff --git a/man/gd_hide.3 b/man/gd_hide.3
index d283c68..e63e1b0 100644
--- a/man/gd_hide.3
+++ b/man/gd_hide.3
@@ -1,6 +1,6 @@
 .\" gd_hide.3.  The gd_hidden man page.
 .\"
-.\" Copyright (C) 2012 D. V. Wiebe
+.\" Copyright (C) 2012, 2013 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_hide 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.TH gd_hide 3 "10 December 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_hide, gd_unhide \(em hide or unhide a dirfile database entry
 .SH SYNOPSIS
@@ -38,7 +38,9 @@ in the dirfile(5) database specified by
 and indicates whether the field or alias called is hidden or not.  Similarly,
 the
 .BR gd_unhide ()
-function unhides the specified entry.
+function unhides the specified entry.  An entry can also be hidden or unhidden
+using
+.BR gd_alter_entry (3).
 
 A hidden entry does not appear in the field lists returned by the functions
 .BR gd_field_list (3),
@@ -81,7 +83,7 @@ a call to
 .BR gd_error_string (3).
 
 .SH SEE ALSO
-.BR gd_entry (3),
+.BR gd_alter_entry (3),
 .BR gd_field_list (3),
 .BR gd_hidden (3),
 .BR gd_nfields (3),
diff --git a/man/gd_include_affix.3 b/man/gd_include_affix.3
index c4d3633..bdea7b2 100644
--- a/man/gd_include_affix.3
+++ b/man/gd_include_affix.3
@@ -1,6 +1,6 @@
 .\" gd_include_affix.3.  The gd_include_affix man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_include_affix 3 "21 April 2012" "Version 0.8.0" "GETDATA"
+.TH gd_include_affix 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_include_affix, gd_include \(em add a format specification fragment to a
 dirfile
@@ -315,8 +315,8 @@ able to deal with.  Lines are limited by the storage size of
 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.
+.B GD_E_IO
+An I/O error occured while trying to read or create the fragment.
 .TP
 .B GD_E_PROTECTED
 The metadata of the parent fragment was protected from change.
diff --git a/man/gd_linterp_tablename.3 b/man/gd_linterp_tablename.3
index 8b86004..be14add 100644
--- a/man/gd_linterp_tablename.3
+++ b/man/gd_linterp_tablename.3
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_linterp_tablename 3 "10 December 2013" "Version 0.8.6" "GETDATA"
+.TH gd_linterp_tablename 3 "10 December 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_linterp_tablename \(em retrieve the pathname of a look-up table in a dirfile
 .SH SYNOPSIS
@@ -76,11 +76,6 @@ The field specified by
 was not a
 .B LINTERP
 field.
-.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).
diff --git a/man/gd_madd_bit.3 b/man/gd_madd_bit.3
index 1bffc06..afaa731 100644
--- a/man/gd_madd_bit.3
+++ b/man/gd_madd_bit.3
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_madd_bit 3 "30 September 2013" "Version 0.8.6" "GETDATA"
+.TH gd_madd_bit 3 "30 September 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_madd_bit, gd_madd_carray, gd_madd_clincom, gd_madd_const, gd_madd_cpolynom,
 gd_madd_crecip, gd_madd_divide, gd_madd_lincom, gd_madd_linterp,
@@ -260,6 +260,7 @@ and
 .BR gd_madd_crecip ():
 .PP
 .B #define GD_C89_API
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_metaflush.3 b/man/gd_metaflush.3
index d9cd628..1d863fb 100644
--- a/man/gd_metaflush.3
+++ b/man/gd_metaflush.3
@@ -1,6 +1,6 @@
 .\" gd_metaflush.3.  The gd_metaflush man page.
 .\"
-.\" Copyright (C) 2008, 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2011, 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_metaflush 3 "15 March 2012" "Version 0.8.0" "GETDATA"
+.TH gd_metaflush 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_metaflush \(em write modified dirfile metadata to disk
 .SH SYNOPSIS
@@ -57,9 +57,14 @@ The library was unable to allocate memory.
 .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.
+.B GD_E_IO
+An I/O error occurred while trying to write modified metadata to disk.
+.TP
+.B GD_E_LINE_TOO_LONG
+While attempting to flush modified metadata to disk, a field specification line
+exceeded the maximum allowed length.  On most platforms, the maximum length is
+at least 2**31 bytes, so this typically indicates something pathological
+happening.
 .PP
 The dirfile error may be retrieved by calling
 .BR gd_error (3).
diff --git a/man/gd_move.3 b/man/gd_move.3
index c6c68e3..663aead 100644
--- a/man/gd_move.3
+++ b/man/gd_move.3
@@ -1,6 +1,6 @@
 .\" gd_move.3.  The gd_move man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,25 +13,22 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_move 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.TH gd_move 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
-gd_move, gd_move_alias \(em move a dirfile entry between format specification fragments
+gd_move \(em move a dirfile entry 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 );
-.HP
-.BI "int gd_move_alias(DIRFILE *" dirfile ", const char"
-.BI * alias_name ", int " new_fragment );
+.BI * field_code ", int " new_fragment ", unsigned int " flags );
 .hy
 .ad n
 .SH DESCRIPTION
 The
 .BR gd_move ()
-function transfers the field specified by
+function transfers the field or alias specified by
 .IR field_code ,
 which should not have a representation suffix, defined in the dirfile
 specified by
@@ -40,45 +37,59 @@ from it's current format specification fragment to the fragment indexed by
 .IR new_fragment .
 If the field is already defined in the fragment index by
 .IR new_fragment ,
-this function does nothing.
+this function does nothing and returns no error.
 
-The
-.BR gd_move_alias ()
-function behaves similarly, but moves the alias named
-.I alias_name
-to the new fragment.  (Passing
-.I alias_name
-to
-.BR gd_move ()
-as
-.I field_code
-will result in the field ultimately pointed to be the alias being moved, and
-not the alias itself.)
+If the new fragment has different affixes, the field will be renamed as part of
+the move.  See
+.BR gd_rename (3)
+for details on field renaming.  The field is closed before moving, resulting
+in it's I/O pointer being reset to the beginning-of-field.
 
-If the flag
-.I move_data
-is one, and
+The
+.I flags
+parameter should be zero or more of the following flags, bitwise or'd together:
+.TP
+.B GD_REN_DANGLE
+By default, if the move results in a change of name for the field due to
+differing fragment affixes,
+.B ALIAS
+entries pointing to this field will be updated with the field's new name.
+Specifying this flag prohibits this behaviour, turning these aliases into
+dangling aliases.  If moving the field doesn't rename it, this flag is ignored.
+.TP
+.B GD_REN_DATA
+If
 .I field_code
 specifies a
 .B RAW
 field, the binary file associated with the field will be translated to account
 for the possibly different encoding, endianness, and frame offset of the
 new format specification fragment.  It will also be moved to a new directory, if
-necessary.  If
-.I move_data
-is zero, no changes will be made to the binary file.  If
+necessary.
+
+If this flag is not specified, no changes will be made to the binary file.  If
 .I field_code
 specifies a field of type other than
 .BR RAW ,
-the
-.I move_data
-flag is ignored.
+this flag is ignored.
 
 If the binary file is translated, and the frame offset of the destination
 fragment is larger than that of the source fragment, this will result in
 permanent deletion of data from the database.  If the new frame offset is
 smaller than the old frame offset, the binary file will be padded at the front
 with zeroes.
+.TP
+.B GD_REN_FORCE
+Skip updating entries which would be invalid (see
+.BR gd_rename (3)
+for details).  By default, an invalid field causes the move to fail.  If moving
+the field doesn't rename it, this flag is ignored.
+.TP
+.B GD_REN_UPDB
+If moving the field renames it, update entries which use this field as an input
+to account for the new name (see
+.BR gd_rename (3)).
+If moving the field doesn't rename it, this flag is ignored.
 
 .SH RETURN VALUE
 On success,
@@ -95,7 +106,9 @@ The library was unable to allocate memory.
 .B GD_E_BAD_CODE
 The field specified by
 .I field_code
-was not found.
+was not found, or else the move resulted in the field being renamed and
+the resultant metadata update tried to change a field code into something
+prohibited by a fragment's affixes.
 .TP
 .B GD_E_BAD_DIRFILE
 The supplied dirfile was invalid.
@@ -110,14 +123,14 @@ The
 .I new_fragment
 argument did not index a valid format specification fragment.
 .TP
+.B GD_E_IO
+An I/O error occurred while attempting to translate a binary file.
+.TP
 .B GD_E_PROTECTED
 The metadata of the source or destination format specification fragments was
 protected from change, or the binary data of the source or destination fragments
 was protected from change and binary file translation was requested.
 .TP
-.B GD_E_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
diff --git a/man/gd_naliases.3 b/man/gd_naliases.3
index 902cfa6..6f3f662 100644
--- a/man/gd_naliases.3
+++ b/man/gd_naliases.3
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_naliases 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.TH gd_naliases 3 "1 October 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_naliases \(em report the number of aliases of a field in a dirfile
 .SH SYNOPSIS
diff --git a/man/gd_native_type.3 b/man/gd_native_type.3
index 0bb7bb6..34ee7be 100644
--- a/man/gd_native_type.3
+++ b/man/gd_native_type.3
@@ -1,6 +1,6 @@
 .\" gd_native_type.3.  The gd_native_type man page.
 .\"
-.\" Copyright (C) 2009, 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2009, 2010, 2011, 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_native_type 3 "17 August 2012" "Version 0.8.0" "GETDATA"
+.TH gd_native_type 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_native_type \(em returns the native data type of a field in a dirfile
 .SH SYNOPSIS
@@ -81,11 +81,11 @@ if the dividend or the native data type of the input field is complex valued:
 otherwise:
 .BR GD_FLOAT64 ;
 .TP
-.BR SBIT " Entry:"
-.BR GD_INT64 ;
+.BR SARRAY " or " STRING " Entry:"
+.BR GD_STRING ;
 .TP
-.BR STRING " Entry:"
-.BR GD_NULL .
+.BR SBIT " Entry:"
+.BR GD_INT64 .
 .PP
 Furthermore, if the supplied
 .I field_code
@@ -101,9 +101,9 @@ the symbols:
 .IP
 .nh
 .ad l
-.BR GD_NULL ", " GD_UINT8 ", " GD_INT8 ", " GD_UINT16 ", " GD_INT16 ,
-.BR GD_UINT32 ", " GD_INT32 ", " GD_FLOAT32 ", " GD_FLOAT64 ", " GD_COMPLEX64 ,
-.BR GD_COMPLEX128 .
+.BR GD_UINT8 ", " GD_INT8 ", " GD_UINT16 ", " GD_INT16 ", " GD_UINT32 ,
+.BR GD_INT32 ", " GD_FLOAT32 ", " GD_FLOAT64 ", " GD_COMPLEX64 ,
+.BR GD_COMPLEX128 ", " GD_STRING .
 .ad n
 .hy
 .PP
@@ -125,17 +125,15 @@ or one of the fields it uses as input was not found in the database.
 .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_DIMENSION
 A scalar field was found where a vector field was expected.
 .TP
-.B GD_E_OPEN_LINFILE
+.B GD_E_IO
 An error occurred while trying to read a LINTERP table from disk.
 .TP
+.B GD_E_LUT
+A LINTERP table was malformed.
+.TP
 .B GD_E_RECURSE_LEVEL
 Too many levels of recursion were encountered while trying to resolve
 .IR field_code .
diff --git a/man/gd_nframes.3 b/man/gd_nframes.3
index 9b86c71..b47eddf 100644
--- a/man/gd_nframes.3
+++ b/man/gd_nframes.3
@@ -1,6 +1,6 @@
 .\" gd_nframes.3.  The gd_nframes man page.
 .\"
-.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_nframes 3 "19 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_nframes 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_nframes \(em report the size of a dirfile
 .SH SYNOPSIS
@@ -61,7 +61,7 @@ The library was unable to allocate memory.
 .B GD_E_BAD_DIRFILE
 The supplied dirfile was invalid.
 .TP
-.B GD_E_RAW_IO
+.B GD_E_IO
 An attempt to determine the (unencoded) size of the data file associated with
 the reference field failed.
 .TP
diff --git a/man/gd_nframes64.3 b/man/gd_nframes64.3
index e67a43a..100d80d 100644
--- a/man/gd_nframes64.3
+++ b/man/gd_nframes64.3
@@ -18,7 +18,7 @@
 gd_nframes64 \(em report the size of a dirfile, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_put_carray_slice.3 b/man/gd_put_carray_slice.3
index 2e18777..3804f39 100644
--- a/man/gd_put_carray_slice.3
+++ b/man/gd_put_carray_slice.3
@@ -139,9 +139,10 @@ 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 (),
 .BR gd_put_carray_slice ()
+and
+.BR gd_put_constant ()
 return zero.  On error, they return -1 and set the dirfile error to a non-zero
 value.  Possible error values are:
 .TP 8
@@ -177,10 +178,6 @@ 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
diff --git a/man/gd_put_string.3 b/man/gd_put_string.3
index c6c3d41..c2a425f 100644
--- a/man/gd_put_string.3
+++ b/man/gd_put_string.3
@@ -80,11 +80,6 @@ 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
diff --git a/man/gd_putdata.3 b/man/gd_putdata.3
index f6d45fd..873dce8 100644
--- a/man/gd_putdata.3
+++ b/man/gd_putdata.3
@@ -1,6 +1,6 @@
 .\" gd_putdata.3.  The gd_putdata man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_putdata 3 "21 April 2012" "Version 0.8.0" "GETDATA"
+.TH gd_putdata 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_putdata \(em write data to a dirfile database
 .SH SYNOPSIS
@@ -84,7 +84,7 @@ as
 .IR first_frame .
 This will result in the write occurring at the current position of the I/O
 pointer for the field (see
-.BR gd_seek (3)
+.BR gd_getdata (3)
 for a discussion of I/O pointers).  In this case, the value of
 .I first_sample
 is ignored.
@@ -139,8 +139,8 @@ appropriate type.  The argument
 must point to a valid memory location of containing all the data to be written.
 
 Upon successful completion, the I/O pointer of the field will be on the sample
-immediately following the last sample written.  On error, the position of the
-I/O pointer is not specified.
+immediately following the last sample written, if possible.  On error, the
+position of the I/O pointer is not specified.
 
 .SH RETURN VALUE
 In all cases,
@@ -182,12 +182,6 @@ type with more than one input fields.  In this case, GetData has no knowledge on
 how to partition the input data.  Alternately, the caller may have attempted to
 write to the implicit INDEX field, which is not possible.
 .TP
-.B GD_E_BAD_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
@@ -215,10 +209,16 @@ 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
+.B GD_E_IO
+An error occurred while trying to open, read from, or write to a file on disk
+containing a raw field or
 .B LINTERP
-table from disk.
+table.
+.TP
+.B GD_E_LUT
+A
+.B LINTERP
+table was malformed.
 .TP
 .B GD_E_PROTECTED
 The data of the
@@ -232,10 +232,6 @@ 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 .
diff --git a/man/gd_putdata64.3 b/man/gd_putdata64.3
index 97eb6c4..bdd1fdd 100644
--- a/man/gd_putdata64.3
+++ b/man/gd_putdata64.3
@@ -18,7 +18,7 @@
 gd_putdata64 \(em write data to a dirfile database, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_raw_filename.3 b/man/gd_raw_filename.3
index 589d3b6..7590672 100644
--- a/man/gd_raw_filename.3
+++ b/man/gd_raw_filename.3
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_raw_filename 3 "10 December 2013" "Version 0.8.6" "GETDATA"
+.TH gd_raw_filename 3 "10 December 2013" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_raw_filename \(em retrieve the pathname of a binary file in a dirfile
 .SH SYNOPSIS
@@ -67,11 +67,6 @@ 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.
@@ -88,5 +83,5 @@ a call to
 .BR dirfile (5),
 .BR dirfile-encoding (5),
 .BR dirfile-format (5),
-.BR free (3)
+.BR free (3),
 .BR malloc (3)
diff --git a/man/gd_rename.3 b/man/gd_rename.3
index c1ac341..ba212f9 100644
--- a/man/gd_rename.3
+++ b/man/gd_rename.3
@@ -1,6 +1,6 @@
 .\" gd_rename.3.  The gd_rename man page.
 .\"
-.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_rename 3 "27 June 2012" "Version 0.8.0" "GETDATA"
+.TH gd_rename 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_rename \(em change the name of a dirfile field or alias
 .SH SYNOPSIS
@@ -35,7 +35,8 @@ specified by
 .IR dirfile
 to
 .IR new_name .
-If the new name is the same as the old name, this function does nothing.
+If the new name is the same as the old name, this function does nothing and
+returns no error.
 
 When renaming a metafield, the metafield should be specified in
 .I old_code
@@ -43,22 +44,52 @@ by its full (slashed) field code, while
 .I new_name
 should only contain the new name (without slash).
 
+If 
+.I old_code
+specifies a top-level field with meta subfields, the subfields will be renamed,
+too.  By default, this function also updates
+.B ALIAS
+entries whose target contains
+.I old_code
+to point to the new field.  Similarly, specifying the
+.B GD_REN_UPDB
+flag will cause this function to modify any field entry containing
+.IR old_code .
+As a result, this function may cause more than one metadata fragment to be
+modified.
+
 The
 .I flags
 parameter should be zero or more of the following flags, bitwise or'd together:
 .TP
+.B GD_REN_DANGLE
+Don't update
+.B ALIAS
+entries, instead turning them into dangling aliases.
+.TP
 .B GD_REN_DATA
 if
 .I old_code
 specifies a
 .B RAW
 field, the binary file associated with the field will be renamed as well.
-Without this flag, no changes are made to the binary file.  If
+Without this flag, no changes are made to the binary file.  In this case, the
+field's I/O pointer will be reset to the beginning-of-frame.  If
 .I field_code
 specifies a field of type other than
 .BR RAW ,
 this flag is ignored.
 .TP
+.B GD_REN_FORCE
+When updating field metadata (either the target of an alias, or else when
+specified along with
+.BR GD_REN_UPDB ), 
+skip updating field codes which would be invalid (due to
+.B /INCLUDE
+affixes).  Without this flag, such invalid field codes causes this function to
+fail with the error
+.BR GD_E_BAD_CODE .
+.TP
 .B GD_REN_UPDB
 Rename the field in any other field specifications which use this field as an
 input (either as a vector input field to a derived field, or else as a scalar
@@ -80,7 +111,8 @@ The library was unable to allocate memory.
 .B GD_E_BAD_CODE
 The field specified by
 .I old_code
-was not found.
+was not found.  Or else the resultant metadata update tried to change a
+field code into something prohibited by a fragment's affixes.
 .TP
 .B GD_E_BAD_DIRFILE
 The supplied dirfile was invalid.
@@ -93,14 +125,15 @@ field.
 .B GD_E_DUPLICATE
 The new name specified is already in use by another entry.
 .TP
-.B GD_E_PROTECTED
-The metadata of the format specification fragment containing the entry was
-protected from change, or the binary data of the fragments was protected from
-change and a binary file move was requested.
-.TP
-.B GD_E_RAW_IO
+.B GD_E_IO
 An I/O error occurred while attempting to rename the binary file.
 .TP
+.B GD_E_PROTECTED
+The metadata of the format specification fragment containing the renamed entry,
+or another entry affected by this change, was protected from change, or the
+binary data of the fragment was protected from change and a binary file move
+was requested.
+.TP
 .B GD_E_UNKNOWN_ENCODING
 The encoding scheme of the specified field could not be determined or was not
 understood by GetData.
diff --git a/man/gd_rewrite_fragment.3 b/man/gd_rewrite_fragment.3
index aeb8d79..7ef711d 100644
--- a/man/gd_rewrite_fragment.3
+++ b/man/gd_rewrite_fragment.3
@@ -1,6 +1,6 @@
 .\" gd_rewrite_fragment.3.  The gd_rewrite_fragment man page.
 .\"
-.\" Copyright (C) 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2010, 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_rewrite_fragment 3 "19 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_rewrite_fragment 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_rewrite_fragment \(em re-write a dirfile format specification fragment
 .SH SYNOPSIS
@@ -61,9 +61,14 @@ The supplied dirfile was invalid.
 .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.
+.B GD_E_IO
+An I/O error occurred while trying to write modified metadata to disk.
+.TP
+.B GD_E_LINE_TOO_LONG
+While attempting to flush modified metadata to disk, a field specification line
+exceeded the maximum allowed length.  On most platforms, the maximum length is
+at least 2**31 bytes, so this typically indicates something pathological
+happening.
 .PP
 The dirfile error may be retrieved by calling
 .BR gd_error (3).
diff --git a/man/gd_seek.3 b/man/gd_seek.3
index d647c0f..ebb6414 100644
--- a/man/gd_seek.3
+++ b/man/gd_seek.3
@@ -1,6 +1,6 @@
 .\" gd_getdata.3.  The gd_getdata man page.
 .\"
-.\" Copyright (C) 2011, 2012, 2013 D. V. Wiebe
+.\" Copyright (C) 2011, 2012, 2013, 2014, 2015 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_seek 3 "12 March 2013" "Version 0.8.4" "GETDATA"
+.TH gd_seek 3 "25 September 2015" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_seek \(em reposition a dirfile field pointer
 .SH SYNOPSIS
@@ -52,20 +52,23 @@ In addition to one of the symbols above, the
 .I flags
 parameter may also, optionally, be bitwise or'd with
 .BR GD_SEEK_WRITE ,
-which will result in the field being padded (with zero for integer types or a
+which will result in the field being padded (with zero for integer types, or a
 IEEE-754 conforming not-a-number otherwise) in the event of seeking past the
-end-of-field marker.  Note: for some data encodings, the padding may be deferred
-until a write occurs.  The result of calling
-.BR gd_seek ()
-with
-.BR GD_SEEK_WRITE ,
-but without a subsequent call to
-.BR gd_putdata (3),
-is encoding specific, and may not actually advance the end of field.  Attempting
-to seek past the end-of-field marker without specifying
+end-of-field marker.
+
+The effect of attempting to seek past the end-of-field is encoding specific.
+Some encodings don't actually add the padding requested by
 .B GD_SEEK_WRITE
+unless a subsequent
+.BR gd_putdata (3)
+call is used to add more data to the field at the new end-of-field.  Other
+encodings add the padding, advancing the end-of-field, regardless of subsequent
+writes.  Similarly, attempting to seek past the end-of-field marker in read mode
+(without specifying
+.BR GD_SEEK_WRITE )
 is also encoding specific: in some encodings the field pointer will be moved
-past the end-of-field marker, while in others, it will result in an error.
+past the end-of-field marker, while in others, it will be repositioned to the
+end of field.  Check the return value to determine the result.
 
 In general,
 .B GD_SEEK_WRITE
@@ -159,24 +162,21 @@ on the
 .I INDEX
 field, which has no end-of-field marker.
 .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_DIMENSION
 The specified field or one of its inputs wasn't of vector type.
 .TP
 .B GD_E_DOMAIN
 The field position couldn't be set due to a derived field reading simultaneously
-from more than one place in an input field.
+from more than one place in a
+.B RAW
+field.
 .TP
 .B GD_E_INTERNAL_ERROR
 An internal error occurred in the library while trying to perform the task.
 This indicates a bug in the library.  Please report the incident to the
 maintainer.
 .TP
-.B GD_E_RAW_IO
+.B GD_E_IO
 An error occurred while trying to open or read from a file on disk containing
 a raw field.
 .TP
diff --git a/man/gd_seek64.3 b/man/gd_seek64.3
index 4a54605..52044cb 100644
--- a/man/gd_seek64.3
+++ b/man/gd_seek64.3
@@ -18,7 +18,7 @@
 gd_seek64 \(em retrieve data from a dirfile database, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_spf.3 b/man/gd_spf.3
index b8841c6..5cad8ad 100644
--- a/man/gd_spf.3
+++ b/man/gd_spf.3
@@ -59,11 +59,6 @@ was not found in the database.
 .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
diff --git a/man/gd_tell.3 b/man/gd_tell.3
index df6fbe1..00f035a 100644
--- a/man/gd_tell.3
+++ b/man/gd_tell.3
@@ -1,6 +1,6 @@
 .\" gd_getdata.3.  The gd_getdata man page.
 .\"
-.\" Copyright (C) 2011 D. V. Wiebe
+.\" Copyright (C) 2011, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" Texts.  A copy of the license is included in the `COPYING.DOC' file
 .\" as part of this distribution.
 .\"
-.TH gd_tell 3 "14 October 2011" "Version 0.8.0" "GETDATA"
+.TH gd_tell 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_tell \(em reposition a dirfile field pointer
 .SH SYNOPSIS
@@ -60,25 +60,21 @@ or one of the fields it uses for input, was not found in the database.
 .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 the field codes it uses for input, was invalid.
-.TP
 .B GD_E_DIMENSION
 The specified field or one of its inputs wasn't of vector type.
 .TP
 .B GD_E_DOMAIN
-The field position couldn't be determined due to a mismatch in the I/O pointer
-of field reading simultaneously
-from more than one place in an input field.
+The I/O position of a derived field wasn't well defined because its input fields
+simultaneously read from different places in the same
+.B RAW
+field.
 .TP
 .B GD_E_INTERNAL_ERROR
 An internal error occurred in the library while trying to perform the task.
 This indicates a bug in the library.  Please report the incident to the
 maintainer.
 .TP
-.B GD_E_RAW_IO
+.B GD_E_IO
 An error occurred while trying to open or read from a file on disk containing
 a raw field.
 .TP
diff --git a/man/gd_tell64.3 b/man/gd_tell64.3
index 828229a..10507b4 100644
--- a/man/gd_tell64.3
+++ b/man/gd_tell64.3
@@ -18,7 +18,7 @@
 gd_tell64 \(em retrieve data from a dirfile database, with largefile support
 .SH SYNOPSIS
 .B #define GD_64BIT_API
-
+.br
 .B #include <getdata.h>
 .HP
 .nh
diff --git a/man/gd_uninclude.3 b/man/gd_uninclude.3
index d29311f..fb54b1b 100644
--- a/man/gd_uninclude.3
+++ b/man/gd_uninclude.3
@@ -1,6 +1,6 @@
 .\" gd_uninclude.3.  The gd_uninclude man page.
 .\"
-.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2014 D. V. Wiebe
 .\"
 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .\"
@@ -13,7 +13,7 @@
 .\" 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"
+.TH gd_uninclude 3 "16 October 2014" "Version 0.9.0" "GETDATA"
 .SH NAME
 gd_uninclude \(em remove a format specification fragment from a dirfile
 .SH SYNOPSIS
@@ -21,7 +21,7 @@ gd_uninclude \(em remove a format specification fragment from a dirfile
 .HP
 .nh
 .ad l
-.BI "int *gd_uninclude(DIRFILE *" dirfile ", int " fragment_index ,
+.BI "int gd_uninclude(DIRFILE *" dirfile ", int " fragment_index ,
 .BI "int " del );
 .hy
 .ad n
@@ -71,17 +71,12 @@ The supplied dirfile was invalid.
 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.
+.B GD_E_IO
+An I/O error occurred while trying to write modified data or metadata to disk.
 .TP
 .B GD_E_PROTECTED
 The metadata of the fragment which included the removed fragment was protected
 from change.
-.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).
diff --git a/man/gd_validate.3 b/man/gd_validate.3
index 07081fa..4501a6a 100644
--- a/man/gd_validate.3
+++ b/man/gd_validate.3
@@ -56,11 +56,6 @@ or one of the fields it uses as input was not found in the database.
 .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
diff --git a/src/Makefile.am b/src/Makefile.am
index b4bae92..9de54b1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 D. V. Wiebe
+# Copyright (C) 2008-2013, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -20,14 +20,6 @@
 #
 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
@@ -37,6 +29,15 @@ SLIM_C=slim.c
 endif
 endif
 
+if USE_FLAC
+if USE_MODULES
+LIBGETDATAFLAC_LA=libgetdataflac.la
+DLOPEN_LIBGETDATAFLAC_LA=-dlopen libgetdataflac.la
+else
+FLAC_C=flac.c
+endif
+endif
+
 if USE_GZIP
 if USE_MODULES
 LIBGETDATAGZIP_LA=libgetdatagzip.la
@@ -87,10 +88,11 @@ EXPORT_DYNAMIC=-export-dynamic
 DGETDATA_MODULEDIR=-DGETDATA_MODULEDIR="\"$(moduledir)\""
 else
 EXTERNAL_CPPFLAGS=$(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \
-									$(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS)
+									$(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS) $(FLAC_CPPFLAGS)
 EXTERNAL_LDFLAGS=$(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \
-								 $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS)
-EXTERNAL_LIBS=$(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) $(ZZIP_LIBS)
+								 $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS) $(FLAC_LDFLAGS)
+EXTERNAL_LIBS=$(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) \
+							$(ZZIP_LIBS) $(FLAC_LIBS)
 endif
 
 if INCLUDE_LEGACY_API
@@ -110,7 +112,7 @@ DEBUG_C = debug.c
 endif
 
 pkgconfigdir = @libdir@/pkgconfig
-AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR)
+AM_CFLAGS = ${GD_CC_WALL} ${GD_CC_WEXTRA} $(DGETDATA_MODULEDIR)
 AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS)
 
 BUILT_SOURCES = getdata.h
@@ -120,18 +122,19 @@ include_HEADERS = ${GETDATA_LEGACY_H}
 pkgconfig_DATA = getdata.pc
 
 lib_LTLIBRARIES = libgetdata.la
-module_LTLIBRARIES = ${LIBGETDATASLIM_LA} ${LIBGETDATAGZIP_LA} \
-									${LIBGETDATABZIP2_LA} ${LIBGETDATALZMA_LA} \
-									${LIBGETDATAZZIP_LA} ${LIBGETDATAZZSLIM_LA}
+module_LTLIBRARIES = ${LIBGETDATABZIP2_LA} ${LIBGETDATAFLAC_LA} \
+										 ${LIBGETDATAGZIP_LA} ${LIBGETDATALZMA_LA} \
+										 ${LIBGETDATASLIM_LA} ${LIBGETDATAZZIP_LA} \
+										 ${LIBGETDATAZZSLIM_LA}
 libgetdata_la_SOURCES = add.c ascii.c ${BZIP2_C} close.c common.c compat.c \
 												constant.c ${DEBUG_C} del.c encoding.c endian.c \
-												entry.c errors.c field_list.c flimits.c flush.c fpos.c \
-												fragment.c getdata.c globals.c ${GZIP_C} index.c \
-												include.c ${LEGACY_C} ${LZMA_C} mod.c move.c name.c \
-												native.c nfields.c nframes.c open.c parse.c protect.c \
-												putdata.c raw.c sie.c ${SLIM_C} spf.c string.c types.c \
-												${ZZIP_C} ${ZZSLIM_C} ${GETDATA_LEGACY_H} internal.h \
-												nan.h
+												entry.c errors.c field_list.c ${FLAC_C} flimits.c \
+												flush.c fpos.c fragment.c getdata.c globals.c \
+												${GZIP_C} index.c include.c ${LEGACY_C} ${LZMA_C} \
+												mod.c move.c name.c native.c nfields.c nframes.c \
+												open.c parse.c protect.c putdata.c raw.c sie.c \
+												${SLIM_C} spf.c string.c types.c ${ZZIP_C} ${ZZSLIM_C} \
+												${GETDATA_LEGACY_H} internal.h
 libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \
 												-version-info \
 												${GETDATA_IFACE_VERSION}:${GETDATA_IMPL_REVISION}:${GETDATA_IFACE_AGE} \
@@ -140,13 +143,18 @@ libgetdata_la_LIBADD = $(LIBLTDL) $(DLOPEN_LIBGETDATASLIM_LA) \
 											 $(DLOPEN_LIBGETDATAGZIP_LA) 
 											 $(DLOPEN_LIBGETDATABZIP2_LA) \
 											 $(DLOPEN_LIBGETDATALZMA_LA) $(DLOPEN_LIBGETDATAZZIP_LA) \
-											 $(DLOPEN_LIBGETDATAZZSLIM_LA)
+											 $(DLOPEN_LIBGETDATAZZSLIM_LA) $(DLOPEN_LIBGETDATAFLAC_LA)
 
 libgetdataslim_la_SOURCES = slim.c
 libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \
 														-module $(SLIM_LIBS)
 libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS)
 
+libgetdataflac_la_SOURCES = flac.c
+libgetdataflac_la_LDFLAGS = $(FLAC_LDFLAGS) -release $(PACKAGE_VERSION) \
+														-module $(FLAC_LIBS)
+libgetdataflac_la_CPPFLAGS = $(AM_CPPFLAGS) $(FLAC_CPPFLAGS)
+
 libgetdatagzip_la_SOURCES = gzip.c
 libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) \
 														-module $(GZIP_LIBS)
diff --git a/src/Makefile.in b/src/Makefile.in
index 4227d69..fdae068 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -89,17 +89,15 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = gd_config.h getdata.h
-CONFIG_CLEAN_FILES = getdata.ah getdata.pc
+CONFIG_CLEAN_FILES = getdata.h.in2 getdata.pc
 CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -141,29 +139,31 @@ libgetdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
 am__libgetdata_la_SOURCES_DIST = add.c ascii.c bzip.c close.c common.c \
 	compat.c constant.c debug.c del.c encoding.c endian.c entry.c \
-	errors.c field_list.c flimits.c flush.c fpos.c fragment.c \
-	getdata.c globals.c gzip.c index.c include.c legacy.c lzma.c \
-	mod.c move.c name.c native.c nfields.c nframes.c open.c \
-	parse.c protect.c putdata.c raw.c sie.c slim.c spf.c string.c \
-	types.c zzip.c zzslim.c getdata_legacy.h internal.h nan.h
+	errors.c field_list.c flac.c flimits.c flush.c fpos.c \
+	fragment.c getdata.c globals.c gzip.c index.c include.c \
+	legacy.c lzma.c mod.c move.c name.c native.c nfields.c \
+	nframes.c open.c parse.c protect.c putdata.c raw.c sie.c \
+	slim.c spf.c string.c types.c zzip.c zzslim.c getdata_legacy.h \
+	internal.h
 @USE_BZIP2_TRUE@@USE_MODULES_FALSE at am__objects_1 = bzip.lo
 @GETDATA_DEBUG_TRUE at 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
- at USE_MODULES_FALSE@@USE_ZZIP_TRUE at am__objects_7 = zzip.lo
- at USE_MODULES_FALSE@@USE_ZZSLIM_TRUE at am__objects_8 = zzslim.lo
-am__objects_9 =
+ at USE_FLAC_TRUE@@USE_MODULES_FALSE at am__objects_3 = flac.lo
+ at USE_GZIP_TRUE@@USE_MODULES_FALSE at am__objects_4 = gzip.lo
+ at INCLUDE_LEGACY_API_TRUE@am__objects_5 = legacy.lo
+ at USE_LZMA_TRUE@@USE_MODULES_FALSE at am__objects_6 = lzma.lo
+ at USE_MODULES_FALSE@@USE_SLIM_TRUE at am__objects_7 = slim.lo
+ at USE_MODULES_FALSE@@USE_ZZIP_TRUE at am__objects_8 = zzip.lo
+ at USE_MODULES_FALSE@@USE_ZZSLIM_TRUE at am__objects_9 = zzslim.lo
+am__objects_10 =
 am_libgetdata_la_OBJECTS = add.lo ascii.lo $(am__objects_1) close.lo \
 	common.lo compat.lo constant.lo $(am__objects_2) del.lo \
 	encoding.lo endian.lo entry.lo errors.lo field_list.lo \
-	flimits.lo flush.lo fpos.lo fragment.lo getdata.lo globals.lo \
-	$(am__objects_3) index.lo include.lo $(am__objects_4) \
-	$(am__objects_5) mod.lo move.lo name.lo native.lo nfields.lo \
-	nframes.lo open.lo parse.lo protect.lo putdata.lo raw.lo \
-	sie.lo $(am__objects_6) spf.lo string.lo types.lo \
-	$(am__objects_7) $(am__objects_8) $(am__objects_9)
+	$(am__objects_3) flimits.lo flush.lo fpos.lo fragment.lo \
+	getdata.lo globals.lo $(am__objects_4) index.lo include.lo \
+	$(am__objects_5) $(am__objects_6) mod.lo move.lo name.lo \
+	native.lo nfields.lo nframes.lo open.lo parse.lo protect.lo \
+	putdata.lo raw.lo sie.lo $(am__objects_7) spf.lo string.lo \
+	types.lo $(am__objects_8) $(am__objects_9) $(am__objects_10)
 libgetdata_la_OBJECTS = $(am_libgetdata_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -181,6 +181,15 @@ libgetdatabzip2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 	$(LDFLAGS) -o $@
 @USE_BZIP2_TRUE@@USE_MODULES_TRUE at am_libgetdatabzip2_la_rpath =  \
 @USE_BZIP2_TRUE@@USE_MODULES_TRUE@	-rpath $(moduledir)
+libgetdataflac_la_LIBADD =
+am_libgetdataflac_la_OBJECTS = libgetdataflac_la-flac.lo
+libgetdataflac_la_OBJECTS = $(am_libgetdataflac_la_OBJECTS)
+libgetdataflac_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdataflac_la_LDFLAGS) $(LDFLAGS) \
+	-o $@
+ at USE_FLAC_TRUE@@USE_MODULES_TRUE at am_libgetdataflac_la_rpath = -rpath \
+ at USE_FLAC_TRUE@@USE_MODULES_TRUE@	$(moduledir)
 libgetdatagzip_la_LIBADD =
 am_libgetdatagzip_la_OBJECTS = libgetdatagzip_la-gzip.lo
 libgetdatagzip_la_OBJECTS = $(am_libgetdatagzip_la_OBJECTS)
@@ -261,13 +270,14 @@ am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
 SOURCES = $(libgetdata_la_SOURCES) $(libgetdatabzip2_la_SOURCES) \
+	$(libgetdataflac_la_SOURCES) $(libgetdatagzip_la_SOURCES) \
+	$(libgetdatalzma_la_SOURCES) $(libgetdataslim_la_SOURCES) \
+	$(libgetdatazzip_la_SOURCES) $(libgetdatazzslim_la_SOURCES)
+DIST_SOURCES = $(am__libgetdata_la_SOURCES_DIST) \
+	$(libgetdatabzip2_la_SOURCES) $(libgetdataflac_la_SOURCES) \
 	$(libgetdatagzip_la_SOURCES) $(libgetdatalzma_la_SOURCES) \
 	$(libgetdataslim_la_SOURCES) $(libgetdatazzip_la_SOURCES) \
 	$(libgetdatazzslim_la_SOURCES)
-DIST_SOURCES = $(am__libgetdata_la_SOURCES_DIST) \
-	$(libgetdatabzip2_la_SOURCES) $(libgetdatagzip_la_SOURCES) \
-	$(libgetdatalzma_la_SOURCES) $(libgetdataslim_la_SOURCES) \
-	$(libgetdatazzip_la_SOURCES) $(libgetdatazzslim_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -277,7 +287,7 @@ DATA = $(pkgconfig_DATA)
 am__include_HEADERS_DIST = getdata_legacy.h
 HEADERS = $(include_HEADERS) $(nodist_include_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
-	$(LISP)gd_config.h.in getdata.ah
+	$(LISP)gd_config.h.in getdata.h.in2
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
 # *not* preserved.
@@ -323,6 +333,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -348,8 +360,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -397,7 +420,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -412,12 +434,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -481,9 +507,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -491,6 +518,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -504,7 +532,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008-2011 D. V. Wiebe
+# Copyright (C) 2008-2013, 2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -525,11 +553,12 @@ top_srcdir = @top_srcdir@
 # 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
 @USE_MODULES_TRUE@@USE_SLIM_TRUE at LIBGETDATASLIM_LA = libgetdataslim.la
 @USE_MODULES_TRUE@@USE_SLIM_TRUE at DLOPEN_LIBGETDATASLIM_LA = -dlopen libgetdataslim.la
 @USE_MODULES_FALSE@@USE_SLIM_TRUE at SLIM_C = slim.c
+ at USE_FLAC_TRUE@@USE_MODULES_TRUE at LIBGETDATAFLAC_LA = libgetdataflac.la
+ at USE_FLAC_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATAFLAC_LA = -dlopen libgetdataflac.la
+ at USE_FLAC_TRUE@@USE_MODULES_FALSE at FLAC_C = flac.c
 @USE_GZIP_TRUE@@USE_MODULES_TRUE at LIBGETDATAGZIP_LA = libgetdatagzip.la
 @USE_GZIP_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATAGZIP_LA = -dlopen libgetdatagzip.la
 @USE_GZIP_TRUE@@USE_MODULES_FALSE at GZIP_C = gzip.c
@@ -548,36 +577,39 @@ AUTOMAKE_OPTIONS = foreign
 @USE_MODULES_TRUE at EXPORT_DYNAMIC = -export-dynamic
 @USE_MODULES_TRUE at DGETDATA_MODULEDIR = -DGETDATA_MODULEDIR="\"$(moduledir)\""
 @USE_MODULES_FALSE at EXTERNAL_CPPFLAGS = $(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \
- at USE_MODULES_FALSE@									$(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS)
+ at USE_MODULES_FALSE@									$(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS) $(FLAC_CPPFLAGS)
 
 @USE_MODULES_FALSE at EXTERNAL_LDFLAGS = $(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \
- at USE_MODULES_FALSE@								 $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS)
+ at USE_MODULES_FALSE@								 $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS) $(FLAC_LDFLAGS)
+
+ at USE_MODULES_FALSE@EXTERNAL_LIBS = $(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) \
+ at USE_MODULES_FALSE@							$(ZZIP_LIBS) $(FLAC_LIBS)
 
- at USE_MODULES_FALSE@EXTERNAL_LIBS = $(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) $(ZZIP_LIBS)
 @INCLUDE_LEGACY_API_TRUE at LEGACY_C = legacy.c
 @INCLUDE_LEGACY_API_TRUE at GETDATA_LEGACY_H = getdata_legacy.h
 @GETDATA_DEBUG_TRUE at DEBUG_C = debug.c
 pkgconfigdir = @libdir@/pkgconfig
-AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR)
+AM_CFLAGS = ${GD_CC_WALL} ${GD_CC_WEXTRA} $(DGETDATA_MODULEDIR)
 AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS)
 BUILT_SOURCES = getdata.h
 nodist_include_HEADERS = getdata.h
 include_HEADERS = ${GETDATA_LEGACY_H}
 pkgconfig_DATA = getdata.pc
 lib_LTLIBRARIES = libgetdata.la
-module_LTLIBRARIES = ${LIBGETDATASLIM_LA} ${LIBGETDATAGZIP_LA} \
-									${LIBGETDATABZIP2_LA} ${LIBGETDATALZMA_LA} \
-									${LIBGETDATAZZIP_LA} ${LIBGETDATAZZSLIM_LA}
+module_LTLIBRARIES = ${LIBGETDATABZIP2_LA} ${LIBGETDATAFLAC_LA} \
+										 ${LIBGETDATAGZIP_LA} ${LIBGETDATALZMA_LA} \
+										 ${LIBGETDATASLIM_LA} ${LIBGETDATAZZIP_LA} \
+										 ${LIBGETDATAZZSLIM_LA}
 
 libgetdata_la_SOURCES = add.c ascii.c ${BZIP2_C} close.c common.c compat.c \
 												constant.c ${DEBUG_C} del.c encoding.c endian.c \
-												entry.c errors.c field_list.c flimits.c flush.c fpos.c \
-												fragment.c getdata.c globals.c ${GZIP_C} index.c \
-												include.c ${LEGACY_C} ${LZMA_C} mod.c move.c name.c \
-												native.c nfields.c nframes.c open.c parse.c protect.c \
-												putdata.c raw.c sie.c ${SLIM_C} spf.c string.c types.c \
-												${ZZIP_C} ${ZZSLIM_C} ${GETDATA_LEGACY_H} internal.h \
-												nan.h
+												entry.c errors.c field_list.c ${FLAC_C} flimits.c \
+												flush.c fpos.c fragment.c getdata.c globals.c \
+												${GZIP_C} index.c include.c ${LEGACY_C} ${LZMA_C} \
+												mod.c move.c name.c native.c nfields.c nframes.c \
+												open.c parse.c protect.c putdata.c raw.c sie.c \
+												${SLIM_C} spf.c string.c types.c ${ZZIP_C} ${ZZSLIM_C} \
+												${GETDATA_LEGACY_H} internal.h
 
 libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \
 												-version-info \
@@ -592,6 +624,11 @@ libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \
 														-module $(SLIM_LIBS)
 
 libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS)
+libgetdataflac_la_SOURCES = flac.c
+libgetdataflac_la_LDFLAGS = $(FLAC_LDFLAGS) -release $(PACKAGE_VERSION) \
+														-module $(FLAC_LIBS)
+
+libgetdataflac_la_CPPFLAGS = $(AM_CPPFLAGS) $(FLAC_CPPFLAGS)
 libgetdatagzip_la_SOURCES = gzip.c
 libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) \
 														-module $(GZIP_LIBS)
@@ -670,13 +707,13 @@ getdata.h: stamp-h2
 	@test -f $@ || rm -f stamp-h2
 	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
 
-stamp-h2: getdata.ah $(top_builddir)/config.status
+stamp-h2: getdata.h.in2 $(top_builddir)/config.status
 	@rm -f stamp-h2
 	cd $(top_builddir) && $(SHELL) ./config.status src/getdata.h
 
 distclean-hdr:
 	-rm -f gd_config.h stamp-h1 getdata.h stamp-h2
-getdata.ah: $(top_builddir)/config.status $(srcdir)/getdata.h.in
+getdata.h.in2: $(top_builddir)/config.status $(srcdir)/getdata.h.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 getdata.pc: $(top_builddir)/config.status $(srcdir)/getdata.pc.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
@@ -757,6 +794,9 @@ libgetdata.la: $(libgetdata_la_OBJECTS) $(libgetdata_la_DEPENDENCIES) $(EXTRA_li
 libgetdatabzip2.la: $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_DEPENDENCIES) $(EXTRA_libgetdatabzip2_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libgetdatabzip2_la_LINK) $(am_libgetdatabzip2_la_rpath) $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_LIBADD) $(LIBS)
 
+libgetdataflac.la: $(libgetdataflac_la_OBJECTS) $(libgetdataflac_la_DEPENDENCIES) $(EXTRA_libgetdataflac_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdataflac_la_LINK) $(am_libgetdataflac_la_rpath) $(libgetdataflac_la_OBJECTS) $(libgetdataflac_la_LIBADD) $(LIBS)
+
 libgetdatagzip.la: $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_DEPENDENCIES) $(EXTRA_libgetdatagzip_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libgetdatagzip_la_LINK) $(am_libgetdatagzip_la_rpath) $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_LIBADD) $(LIBS)
 
@@ -792,6 +832,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/errors.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/field_list.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flimits.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fpos.Plo at am__quote@
@@ -803,6 +844,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatabzip2_la-bzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdataflac_la-flac.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatagzip_la-gzip.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatalzma_la-lzma.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdataslim_la-slim.Plo at am__quote@
@@ -856,6 +898,13 @@ libgetdatabzip2_la-bzip.lo: bzip.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatabzip2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatabzip2_la-bzip.lo `test -f 'bzip.c' || echo '$(srcdir)/'`bzip.c
 
+libgetdataflac_la-flac.lo: flac.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataflac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdataflac_la-flac.lo -MD -MP -MF $(DEPDIR)/libgetdataflac_la-flac.Tpo -c -o libgetdataflac_la-flac.lo `test -f 'flac.c' || echo '$(srcdir)/'`flac.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdataflac_la-flac.Tpo $(DEPDIR)/libgetdataflac_la-flac.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='flac.c' object='libgetdataflac_la-flac.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataflac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdataflac_la-flac.lo `test -f 'flac.c' || echo '$(srcdir)/'`flac.c
+
 libgetdatagzip_la-gzip.lo: gzip.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatagzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatagzip_la-gzip.lo -MD -MP -MF $(DEPDIR)/libgetdatagzip_la-gzip.Tpo -c -o libgetdatagzip_la-gzip.lo `test -f 'gzip.c' || echo '$(srcdir)/'`gzip.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatagzip_la-gzip.Tpo $(DEPDIR)/libgetdatagzip_la-gzip.Plo
@@ -1193,7 +1242,7 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
 @INCLUDE_LEGACY_API_TRUE@	cd $(DESTDIR)$(includedir) && rm -rf getdata_struct.h
 											 $(DLOPEN_LIBGETDATABZIP2_LA) \
 											 $(DLOPEN_LIBGETDATALZMA_LA) $(DLOPEN_LIBGETDATAZZIP_LA) \
-											 $(DLOPEN_LIBGETDATAZZSLIM_LA)
+											 $(DLOPEN_LIBGETDATAZZSLIM_LA) $(DLOPEN_LIBGETDATAFLAC_LA)
 
 clean-local:
 	rm -rf *~ getdata.pc
diff --git a/src/add.c b/src/add.c
index b0cd17e..0d40f94 100644
--- a/src/add.c
+++ b/src/add.c
@@ -42,11 +42,12 @@ static gd_entry_t *_GD_FixName(DIRFILE *restrict D, char **restrict buffer,
 {
   gd_entry_t *P;
   char *ptr;
+  struct parser_state p;
 
   dtrace("%p, %p, \"%s\", %i, %p", D, buffer, name, frag, offset);
 
   /* Check prefix and suffix */
-  if (_GD_CheckCodeAffixes(D, NULL, name, frag)) {
+  if (_GD_CheckCodeAffixes(D, name, frag, 1)) {
     dreturn("%p", NULL);
     return NULL;
   }
@@ -59,7 +60,8 @@ static gd_entry_t *_GD_FixName(DIRFILE *restrict D, char **restrict buffer,
     return NULL;
   }
 
-  P = _GD_CheckParent(D, &ptr, -1, 0);
+  _GD_SimpleParserInit(D, NULL, &p);
+  P = _GD_CheckParent(D, &p, &ptr, -1);
 
   if (D->error) {
     free(*buffer);
@@ -107,11 +109,23 @@ static unsigned _GD_CopyScalars(DIRFILE *restrict D,
     {
       E->scalar[i] = NULL;
     } else {
-      if (_GD_CheckCodeAffixes(D, NULL, entry->scalar[i],
-            entry->fragment_index))
-      {
+      /* check for correct affixes */
+      if (_GD_CheckCodeAffixes(D, entry->scalar[i], entry->fragment_index, 1))
         break;
+
+      /* when using early Standards, reject ambiguous field codes */
+      if (entry->scalar_ind[i] == -1 && !(D->flags & GD_NOSTANDARD) &&
+          D->standards <= 7)
+      {
+        if (_GD_TokToNum(entry->scalar[i], D->standards, 1, NULL, NULL, NULL,
+              NULL) != -1)
+        {
+          _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_AMBIGUOUS, NULL, 0,
+              entry->scalar[i]);
+          break;
+        }
       }
+
       E->scalar[i] = _GD_Strdup(D, entry->scalar[i]);
       E->scalar_ind[i] = entry->scalar_ind[i];
       mask_out |= (1 << i);
@@ -244,13 +258,16 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
     return NULL;
   }
   memset(E->e, 0, sizeof(struct gd_private_entry_));
-  E->e->calculated = 0;
-  E->field_type = entry->field_type;
 
+  E->field_type = entry->field_type;
   E->field = temp_buffer;
+  E->flags = entry->flags & GD_EN_HIDDEN; /* it's possible to hide a newly
+                                             added field this way */
 
   /* Check */
-  if (_GD_ValidateField(E->field + offset, D->standards, 1, 0, &is_dot)) {
+  if (_GD_ValidateField(E->field + offset, D->standards, 1, GD_VF_CODE,
+        &is_dot))
+  {
     _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, entry->field);
     _GD_FreeE(D, E, 1);
     dreturn("%p", NULL);
@@ -261,10 +278,6 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
   if (P != NULL)
     E->e->n_meta = -1;
 
-  /* Hidden */
-  if (entry->hidden)
-    E->hidden = 1;
-
   /* Validate entry and add auxiliary data */
   switch(entry->field_type)
   {
@@ -287,10 +300,10 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       E->e->u.raw.file[0].idata = E->e->u.raw.file[1].idata = -1;
       E->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN;
 
-      E->e->u.raw.filebase = _GD_MungeCode(D, NULL,
+      E->e->u.raw.filebase = _GD_MungeCode(D, NULL, 0,
           D->fragment[entry->fragment_index].prefix,
           D->fragment[entry->fragment_index].suffix, NULL, NULL, E->field,
-          &offset, 0);
+          NULL, NULL, GD_MC_RQ_PARTS);
       if (D->error)
         break;
 
@@ -301,8 +314,8 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       else if (E->EN(raw,data_type) & 0x40 || (E->e->u.raw.size =
             GD_SIZE(E->EN(raw,data_type))) == 0)
         _GD_SetError(D, GD_E_BAD_TYPE, entry->EN(raw,data_type), NULL, 0, NULL);
-      else if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0,
-            GD_FILE_WRITE | GD_FILE_TOUCH, 0))
+      else if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0,
+            GD_FILE_WRITE | GD_FILE_TOUCH, _GD_FileSwapBytes(D, E)))
       {
         ;
       } else if (D->fragment[E->fragment_index].ref_name == NULL) {
@@ -318,16 +331,15 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
             E->EN(lincom,n_fields), NULL);
       
       for (i = 0; i < E->EN(lincom,n_fields); ++i)
-        _GD_CheckCodeAffixes(D, NULL, entry->in_fields[i],
-            entry->fragment_index);
+        _GD_CheckCodeAffixes(D, entry->in_fields[i], entry->fragment_index, 1);
 
       if (D->error)
         break;
 
       _GD_CopyScalars(D, E, entry, 9 * ((1 << E->EN(lincom,n_fields)) - 1));
 
-      if (entry->comp_scal) {
-        int cs = 0;
+      if (entry->flags & GD_EN_COMPSCAL) {
+        unsigned cs = 0;
         memcpy(E->EN(lincom,cm), entry->EN(lincom,cm), sizeof(double) * 2 *
             E->EN(lincom,n_fields));
         memcpy(E->EN(lincom,cb), entry->EN(lincom,cb), sizeof(double) * 2 *
@@ -336,9 +348,9 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
           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;
+            cs = GD_EN_COMPSCAL;
         }
-        E->comp_scal = cs;
+        E->flags |= cs;
       } else {
         memcpy(E->EN(lincom,m), entry->EN(lincom,m), sizeof(double) *
             E->EN(lincom,n_fields));
@@ -348,7 +360,6 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
           gd_rs2cs_(E->EN(lincom,cm)[i], E->EN(lincom,m)[i]);
           gd_rs2cs_(E->EN(lincom,cb)[i], E->EN(lincom,b)[i]);
         }
-        E->comp_scal = 0;
       }
 
       for (i = 0; i < E->EN(lincom,n_fields); ++i)
@@ -357,8 +368,8 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
     case GD_LINTERP_ENTRY:
       E->e->u.linterp.table_len = -1;
 
-      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index))
+      if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index,
+            1))
       {
         break;
       }
@@ -368,9 +379,9 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       break;
     case GD_MULTIPLY_ENTRY:
     case GD_DIVIDE_ENTRY:
-      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index) || _GD_CheckCodeAffixes(D, NULL,
-              entry->in_fields[1], entry->fragment_index))
+      if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index,
+            1) || _GD_CheckCodeAffixes(D, entry->in_fields[1],
+              entry->fragment_index, 1))
       {
         break;
       }
@@ -379,8 +390,8 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       E->in_fields[1] = _GD_Strdup(D, entry->in_fields[1]);
       break;
     case GD_RECIP_ENTRY:
-      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index))
+      if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index,
+            1))
       {
         break;
       }
@@ -389,14 +400,14 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
 
       _GD_CopyScalars(D, E, entry, 0x1);
 
-      if (entry->comp_scal) {
+      if (entry->flags & GD_EN_COMPSCAL) {
         gd_cs2cs_(E->EN(recip,cdividend), entry->EN(recip,cdividend));
         E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
-        E->comp_scal = (cimag(E->EN(recip,cdividend)) == 0) ? 0 : 1;
+        if (cimag(E->EN(recip,cdividend)) != 0)
+          E->flags |= GD_EN_COMPSCAL;
       } else {
         E->EN(recip,dividend) = entry->EN(recip,dividend);
         gd_rs2cs_(E->EN(recip,cdividend), E->EN(recip,dividend));
-        E->comp_scal = 0;
       }
       break;
     case GD_BIT_ENTRY:
@@ -404,8 +415,8 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       E->EN(bit,numbits) = entry->EN(bit,numbits);
       E->EN(bit,bitnum) = entry->EN(bit,bitnum);
 
-      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index))
+      if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index,
+            1))
       {
         break;
       }
@@ -427,8 +438,8 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
     case GD_PHASE_ENTRY:
       E->EN(phase,shift) = entry->EN(phase,shift);
 
-      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index))
+      if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index,
+            1))
       {
         break;
       }
@@ -441,9 +452,9 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       E->EN(window,windop) = entry->EN(window,windop);
       E->EN(window,threshold) = entry->EN(window,threshold);
 
-      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index) || _GD_CheckCodeAffixes(D, NULL,
-              entry->in_fields[1], entry->fragment_index))
+      if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index,
+            1) || _GD_CheckCodeAffixes(D, entry->in_fields[1],
+              entry->fragment_index, 1))
       {
         break;
       }
@@ -460,9 +471,9 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       E->EN(mplex,count_val) = entry->EN(mplex,count_val);
       E->EN(mplex,period) = entry->EN(mplex,period);
 
-      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index) || _GD_CheckCodeAffixes(D, NULL,
-              entry->in_fields[1], entry->fragment_index))
+      if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index,
+            1) || _GD_CheckCodeAffixes(D, entry->in_fields[1],
+              entry->fragment_index, 1))
       {
         break;
       }
@@ -476,7 +487,6 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       if (!(mask & 2) && entry->EN(mplex,period) < 0)
         _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_PERIOD, NULL,
             entry->EN(mplex,period), NULL);
-
       break;
     case GD_CONST_ENTRY:
       E->EN(scalar,const_type) = entry->EN(scalar,const_type);
@@ -502,9 +512,7 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
           == 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 {
+      } else {
         size_t size = GD_SIZE(_GD_ConstType(D, E->EN(scalar,const_type))) *
           E->EN(scalar,array_len);
         if (!D->error)
@@ -525,10 +533,8 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
         _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL,
             E->EN(polynom,poly_ord), NULL);
       } else {
-        _GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
-            entry->fragment_index);
-        _GD_CheckCodeAffixes(D, NULL, entry->in_fields[1],
-            entry->fragment_index);
+        _GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1);
+        _GD_CheckCodeAffixes(D, entry->in_fields[1], entry->fragment_index, 1);
       }
 
       if (D->error)
@@ -536,22 +542,21 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
 
       _GD_CopyScalars(D, E, entry, (1 << (E->EN(polynom,poly_ord) + 1)) - 1);
 
-      if (entry->comp_scal) {
-        int cs = 0;
+      if (entry->flags & GD_EN_COMPSCAL) {
+        unsigned cs = 0;
         memcpy(E->EN(polynom,ca), entry->EN(polynom,ca), sizeof(double) * 2 *
             (E->EN(polynom,poly_ord) + 1));
         for (i = 0; i <= E->EN(polynom,poly_ord); ++i) {
           E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
           if (cimag(E->EN(polynom,ca)[i]))
-            cs = 1;
+            cs = GD_EN_COMPSCAL;
         }
-        E->comp_scal = cs;
+        E->flags |= cs;
       } else {
         memcpy(E->EN(polynom,a), entry->EN(polynom,a), sizeof(double) *
             (E->EN(polynom,poly_ord) + 1));
         for (i = 0; i <= E->EN(polynom,poly_ord); ++i)
           gd_rs2cs_(E->EN(polynom,ca)[i], E->EN(polynom,a)[i]);
-        E->comp_scal = 0;
       }
 
       E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
@@ -588,6 +593,7 @@ static gd_entry_t *_GD_Add(DIRFILE *restrict D,
       dreturn("%p", NULL);
       return NULL;
     }
+    E->flags |= GD_EN_DOTTED;
     D->dot_list = (gd_entry_t **)new_list;
   }
 
@@ -661,6 +667,7 @@ int gd_madd_spec(DIRFILE* D, const char* line, const char* parent) gd_nothrow
   int n_cols;
   int me;
   gd_entry_t* E = NULL;
+  struct parser_state p;
 
   dtrace("%p, \"%s\", \"%s\"", D, line, parent);
 
@@ -699,13 +706,14 @@ int gd_madd_spec(DIRFILE* D, const char* line, const char* parent) gd_nothrow
   }
 
   /* start parsing */
-  n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols,
-      "dirfile_madd_spec()", 0, D->standards, D->flags & GD_PERMISSIVE);
+  _GD_SimpleParserInit(D, "gd_madd_spec()", &p);
+  n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS,
+      in_cols);
 
   /* Directive parsing is skipped -- The Field Spec parser will add the field */
   if (!D->error)
-    _GD_ParseFieldSpec(D, n_cols, in_cols, E, "dirfile_madd_spec()", 0, me,
-        D->standards, 1, GD_PEDANTIC, 1, &outstring, tok_pos);
+    _GD_ParseFieldSpec(D, &p, n_cols, in_cols, E,  me, 1, 1, &outstring,
+        tok_pos);
 
   free(outstring);
 
@@ -730,6 +738,7 @@ int gd_add_spec(DIRFILE* D, const char* line, int fragment_index)
   const char *tok_pos = NULL;
   char *in_cols[MAX_IN_COLS];
   int n_cols;
+  struct parser_state p;
 
   dtrace("%p, \"%s\", %i", D, line, fragment_index);
 
@@ -763,14 +772,23 @@ int gd_add_spec(DIRFILE* D, const char* line, int fragment_index)
 
   _GD_ClearError(D);
 
+  if (~D->flags & GD_HAVE_VERSION)
+    _GD_FindVersion(D);
+
+  if (D->av) {
+    p.standards = D->standards;
+    p.pedantic = 1;
+  }
+
   /* start parsing */
-  n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols,
-      "dirfile_add_spec()", 0, D->standards, D->flags & GD_PERMISSIVE);
+  _GD_SimpleParserInit(D, "gd_add_spec()", &p);
+  n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS,
+      in_cols);
 
   /* Directive parsing is skipped -- The Field Spec parser will add the field */
   if (!D->error)
-    _GD_ParseFieldSpec(D, n_cols, in_cols, NULL, "dirfile_add_spec()", 0,
-        fragment_index, D->standards, 1, GD_PEDANTIC, 1, &outstring, tok_pos);
+    _GD_ParseFieldSpec(D, &p, n_cols, in_cols, NULL, fragment_index, 1, 1,
+        &outstring, tok_pos);
 
   free(outstring);
 
@@ -811,7 +829,6 @@ int gd_add_raw(DIRFILE* D, const char* field_code, gd_type_t data_type,
     unsigned int spf, int fragment_index)
 {
   gd_entry_t R;
-  int error;
 
   dtrace("%p, \"%s\", 0x%X, %i, %i", D, field_code, data_type, spf,
       fragment_index);
@@ -828,10 +845,14 @@ int gd_add_raw(DIRFILE* D, const char* field_code, gd_type_t data_type,
   R.EN(raw,spf) = spf;
   R.EN(raw,data_type) = data_type;
   R.fragment_index = fragment_index;
-  error = (_GD_Add(D, &R, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &R, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a LINCOM entry */
@@ -839,7 +860,7 @@ 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;
+  int i;
   gd_entry_t L;
 
   dtrace("%p, \"%s\", %i, %p, %p, %p, %i", D, field_code, n_fields, in_fields,
@@ -861,7 +882,6 @@ int gd_add_lincom(DIRFILE* D, const char* field_code, int n_fields,
   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) {
@@ -869,10 +889,14 @@ int gd_add_lincom(DIRFILE* D, const char* field_code, int n_fields,
     L.EN(lincom,m)[i] = m[i];
     L.EN(lincom,b)[i] = b[i];
   }
-  error = (_GD_Add(D, &L, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &L, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a LINCOM entry with complex scalars */
@@ -880,7 +904,7 @@ 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;
+  int i;
   gd_entry_t L;
 
   dtrace("%p, \"%s\", %i, %p, %p, %p, %i", D, field_code, n_fields, in_fields,
@@ -902,7 +926,7 @@ int gd_add_clincom(DIRFILE* D, const char* field_code, int n_fields,
   L.field = (char *)field_code;
   L.field_type = GD_LINCOM_ENTRY;
   L.EN(lincom,n_fields) = n_fields;
-  L.comp_scal = 1;
+  L.flags = GD_EN_COMPSCAL;
   L.fragment_index = fragment_index;
 
   for (i = 0; i < n_fields; ++i) {
@@ -910,10 +934,14 @@ int gd_add_clincom(DIRFILE* D, const char* field_code, int n_fields,
     gd_ca2cs_(L.EN(lincom,cm)[i], cm, i);
     gd_ca2cs_(L.EN(lincom,cb)[i], cb, i);
   }
-  error = (_GD_Add(D, &L, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &L, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a LINTERP entry */
@@ -921,7 +949,6 @@ 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);
@@ -938,10 +965,14 @@ int gd_add_linterp(DIRFILE* D, const char* field_code, const char* in_field,
   L.in_fields[0] = (char *)in_field;
   L.EN(linterp,table) = (char *)table;
   L.fragment_index = fragment_index;
-  error = (_GD_Add(D, &L, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &L, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a BIT entry */
@@ -949,7 +980,6 @@ int gd_add_bit(DIRFILE* D, const char* field_code, const char* in_field,
     int bitnum, int numbits, int fragment_index) gd_nothrow
 {
   gd_entry_t B;
-  int error;
 
   dtrace("%p, \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field, bitnum,
       numbits, fragment_index);
@@ -967,10 +997,14 @@ int gd_add_bit(DIRFILE* D, const char* field_code, const char* in_field,
   B.EN(bit,bitnum) = bitnum;
   B.EN(bit,numbits) = numbits;
   B.fragment_index = fragment_index;
-  error = (_GD_Add(D, &B, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &B, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a SBIT entry */
@@ -978,7 +1012,6 @@ int gd_add_sbit(DIRFILE* D, const char* field_code, const char* in_field,
     int bitnum, int numbits, int fragment_index) gd_nothrow
 {
   gd_entry_t B;
-  int error;
 
   dtrace("%p, \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field, bitnum,
       numbits, fragment_index);
@@ -996,21 +1029,23 @@ int gd_add_sbit(DIRFILE* D, const char* field_code, const char* in_field,
   B.EN(bit,bitnum) = bitnum;
   B.EN(bit,numbits) = numbits;
   B.fragment_index = fragment_index;
-  error = (_GD_Add(D, &B, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &B, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
-/* 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
+static int _GD_AddYoke(DIRFILE* D, gd_entype_t t, const char* field_code,
+    const char* in_field1, const char* in_field2, int fragment_index) gd_nothrow
 {
   gd_entry_t M;
-  int error;
 
-  dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field1, in_field2,
-      fragment_index);
+  dtrace("%p, 0x%X, \"%s\", \"%s\", \"%s\", %i", D, t, field_code, in_field1,
+      in_field2, fragment_index);
 
   if (D->flags & GD_INVALID) {/* don't crash */
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -1020,42 +1055,32 @@ int gd_add_multiply(DIRFILE* D, const char* field_code, const char* in_field1,
 
   memset(&M, 0, sizeof(gd_entry_t));
   M.field = (char *)field_code;
-  M.field_type = GD_MULTIPLY_ENTRY;
+  M.field_type = t;
   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) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &M, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
-/* add a DIVIDE entry */
-int gd_add_divide(DIRFILE* D, const char* field_code, const char* in_field1,
+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 E;
-  int error;
-
-  dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field1, in_field2,
+  return _GD_AddYoke(D, GD_MULTIPLY_ENTRY, 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) == NULL) ? -1 : 0;
-
-  dreturn("%i", error);
-  return error;
+int gd_add_divide(DIRFILE* D, const char* field_code, const char* in_field1,
+    const char* in_field2, int fragment_index) gd_nothrow
+{
+  return _GD_AddYoke(D, GD_DIVIDE_ENTRY, field_code, in_field1, in_field2,
+      fragment_index);
 }
 
 /* add a RECIP entry */
@@ -1063,7 +1088,6 @@ 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);
@@ -1078,13 +1102,16 @@ int gd_add_recip(DIRFILE* D, const char* field_code, const char* in_field,
   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) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 #ifndef GD_NO_C99_API
@@ -1096,21 +1123,8 @@ int gd_add_crecip(DIRFILE* D, const char* field_code, const char* in_field,
   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;
-  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+  error = gd_add_crecip89(D, field_code, in_field, (const double*)(&cdividend),
+      fragment_index);
 
   dreturn("%i", error);
   return error;
@@ -1121,9 +1135,8 @@ 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,
+  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 */
@@ -1136,20 +1149,24 @@ int gd_add_crecip89(DIRFILE* D, const char* field_code, const char* in_field,
   E.field = (char *)field_code;
   E.field_type = GD_RECIP_ENTRY;
   gd_ra2cs_(E.EN(recip,cdividend), cdividend);
-  E.comp_scal = 1;
+  E.flags = GD_EN_COMPSCAL;
   E.in_fields[0] = (char *)in_field;
   E.fragment_index = fragment_index;
-  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a POLYNOM entry */
 int gd_add_polynom(DIRFILE* D, const char* field_code, int poly_ord,
     const char* in_field, const double* a, int fragment_index) gd_nothrow
 {
-  int i, error;
+  int i;
   gd_entry_t E;
 
   dtrace("%p, \"%s\", %i, \"%s\", %p, %i", D, field_code, poly_ord, in_field,
@@ -1172,22 +1189,24 @@ int gd_add_polynom(DIRFILE* D, const char* field_code, int poly_ord,
   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) == NULL) ? -1 : 0;
+  if (_GD_Add(D, &E, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
 
-  dreturn("%i", error);
-  return error;
+  dreturn("%i", 0);
+  return 0;
 }
 
 int gd_add_cpolynom(DIRFILE* D, const char* field_code, int poly_ord,
     const char* in_field, const GD_DCOMPLEXP(ca), int fragment_index) gd_nothrow
 {
-  int i, error;
+  int i;
   gd_entry_t E;
 
   dtrace("%p, \"%s\", %i, \"%s\", %p, %i", D, field_code, poly_ord, in_field,
@@ -1210,16 +1229,19 @@ int gd_add_cpolynom(DIRFILE* D, const char* field_code, int poly_ord,
   E.field_type = GD_POLYNOM_ENTRY;
   E.EN(polynom,poly_ord) = poly_ord;
   E.fragment_index = fragment_index;
-  E.comp_scal = 1;
+  E.flags = GD_EN_COMPSCAL;
   E.in_fields[0] = (char *)in_field;
 
   for (i = 0; i <= poly_ord; ++i)
     gd_ca2cs_(E.EN(polynom,ca)[i], ca, i);
 
-  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+  if (_GD_Add(D, &E, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
 
-  dreturn("%i", error);
-  return error;
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a PHASE entry */
@@ -1227,7 +1249,6 @@ 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);
@@ -1244,10 +1265,14 @@ int gd_add_phase(DIRFILE* D, const char* field_code, const char* in_field,
   P.in_fields[0] = (char *)in_field;
   P.EN(phase,shift) = shift;
   P.fragment_index = fragment_index;
-  error = (_GD_Add(D, &P, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &P, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a WINDOW entry */
@@ -1256,7 +1281,6 @@ int gd_add_window(DIRFILE *D, const char *field_code, const char *in_field,
     int fragment_index) gd_nothrow
 {
   gd_entry_t E;
-  int error;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}, %i", D, field_code,
       in_field, check_field, windop, threshold.r,
@@ -1276,10 +1300,14 @@ int gd_add_window(DIRFILE *D, const char *field_code, const char *in_field,
   E.in_fields[0] = (char *)in_field;
   E.in_fields[1] = (char *)check_field;
   E.fragment_index = fragment_index;
-  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a MPLEX entry */
@@ -1288,7 +1316,6 @@ int gd_add_mplex(DIRFILE *D, const char *field_code, const char *in_field,
   gd_nothrow
 {
   gd_entry_t E;
-  int error;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field,
       count_field, count_val, period, fragment_index);
@@ -1307,10 +1334,14 @@ int gd_add_mplex(DIRFILE *D, const char *field_code, const char *in_field,
   E.in_fields[0] = (char *)in_field;
   E.in_fields[1] = (char *)count_field;
   E.fragment_index = fragment_index;
-  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, NULL) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a STRING entry */
@@ -1319,6 +1350,7 @@ int gd_add_string(DIRFILE* D, const char* field_code, const char* value,
 {
   gd_entry_t *entry;
   gd_entry_t S;
+  char *ptr;
 
   dtrace("%p, \"%s\", \"%s\", %i", D, field_code, value, fragment_index);
 
@@ -1332,14 +1364,25 @@ int gd_add_string(DIRFILE* D, const char* field_code, const char* value,
   S.field = (char *)field_code;
   S.field_type = GD_STRING_ENTRY;
   S.fragment_index = fragment_index;
+
+  /* duplicate early, in case of failure */
+  ptr = _GD_Strdup(D, value);
+  if (ptr == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
   entry = _GD_Add(D, &S, NULL);
 
-  /* Actually store the string, now */
-  if (entry)
-    _GD_DoStringOut(D, entry, value);
+  if (D->error) {
+    free(ptr);
+    dreturn("%i", -1);
+    return -1;
+  }
 
-  dreturn("%i", D->error ? -1 : 0);
-  return D->error ? -1 : 0;
+  entry->e->u.string = ptr;
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a CONST entry */
@@ -1367,7 +1410,7 @@ int gd_add_const(DIRFILE* D, const char* field_code, gd_type_t const_type,
 
   /* Actually store the constant, now */
   if (entry)
-    _GD_DoFieldOut(D, entry, 0, 0, 1, data_type, value);
+    _GD_DoFieldOut(D, entry, 0, 1, data_type, value);
 
   dreturn("%i", D->error ? -1 : 0);
   return D->error ? -1 : 0;
@@ -1400,7 +1443,7 @@ int gd_add_carray(DIRFILE* D, const char* field_code, gd_type_t const_type,
 
   /* Actually store the carray, now */
   if (entry)
-    _GD_DoFieldOut(D, entry, 0, 0, array_len, data_type, values);
+    _GD_DoFieldOut(D, entry, 0, array_len, data_type, values);
 
   dreturn("%i", D->error ? -1 : 0);
   return D->error ? -1 : 0;
@@ -1429,7 +1472,7 @@ 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;
+  int i;
   gd_entry_t L;
 
   dtrace("%p, \"%s\", \"%s\", %i, %p, %p, %p", D, field_code, parent,
@@ -1451,7 +1494,6 @@ int gd_madd_lincom(DIRFILE* D, const char* parent, const char* field_code,
   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) {
@@ -1461,10 +1503,14 @@ int gd_madd_lincom(DIRFILE* D, const char* parent, const char* field_code,
     L.scalar[i] = NULL;
     L.scalar[i + GD_MAX_LINCOM] = NULL;
   }
-  error = (_GD_Add(D, &L, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &L, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META LINCOM entry, with complex scalaras */
@@ -1472,7 +1518,7 @@ 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;
+  int i;
   gd_entry_t L;
 
   dtrace("%p, \"%s\", \"%s\", %i, %p, %p, %p", D, field_code, parent,
@@ -1494,7 +1540,7 @@ int gd_madd_clincom(DIRFILE* D, const char* parent, const char* field_code,
   L.field = (char *)field_code;
   L.field_type = GD_LINCOM_ENTRY;
   L.EN(lincom,n_fields) = n_fields;
-  L.comp_scal = 1;
+  L.flags = GD_EN_COMPSCAL;
   L.fragment_index = 0;
 
   for (i = 0; i < n_fields; ++i) {
@@ -1504,10 +1550,14 @@ int gd_madd_clincom(DIRFILE* D, const char* parent, const char* field_code,
     L.scalar[i] = NULL;
     L.scalar[i + GD_MAX_LINCOM] = NULL;
   }
-  error = (_GD_Add(D, &L, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &L, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META LINTERP entry */
@@ -1515,7 +1565,6 @@ 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);
@@ -1532,10 +1581,14 @@ int gd_madd_linterp(DIRFILE* D, const char* parent,
   L.in_fields[0] = (char *)in_field;
   L.EN(linterp,table) = (char *)table;
   L.fragment_index = 0;
-  error = (_GD_Add(D, &L, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &L, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META BIT entry */
@@ -1543,7 +1596,6 @@ int gd_madd_bit(DIRFILE* D, const char* parent, const char* field_code,
     const char* in_field, int bitnum, int numbits) gd_nothrow
 {
   gd_entry_t B;
-  int error;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %in", D, field_code, parent, in_field,
       bitnum, numbits);
@@ -1562,10 +1614,14 @@ int gd_madd_bit(DIRFILE* D, const char* parent, const char* field_code,
   B.EN(bit,numbits) = numbits;
   B.fragment_index = 0;
   B.scalar[0] = B.scalar[1] = NULL;
-  error = (_GD_Add(D, &B, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &B, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META SBIT entry */
@@ -1573,7 +1629,6 @@ int gd_madd_sbit(DIRFILE* D, const char* parent, const char* field_code,
     const char* in_field, int bitnum, int numbits) gd_nothrow
 {
   gd_entry_t B;
-  int error;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %in", D, field_code, parent, in_field,
       bitnum, numbits);
@@ -1592,20 +1647,23 @@ int gd_madd_sbit(DIRFILE* D, const char* parent, const char* field_code,
   B.EN(bit,numbits) = numbits;
   B.fragment_index = 0;
   B.scalar[0] = B.scalar[1] = NULL;
-  error = (_GD_Add(D, &B, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &B, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
-/* 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
+static int _GD_MAddYoke(DIRFILE* D, gd_entype_t t, const char* parent,
+    const char* field_code, const char* in_field1, const char* in_field2)
+gd_nothrow
 {
   gd_entry_t M;
-  int error;
 
-  dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, field_code, parent,
+  dtrace("%p, 0x%X, \"%s\", \"%s\", \"%s\", \"%s\"", D, t, field_code, parent,
       in_field1, in_field2);
 
   if (D->flags & GD_INVALID) {/* don't crash */
@@ -1616,21 +1674,31 @@ int gd_madd_multiply(DIRFILE* D, const char* parent, const char* field_code,
 
   memset(&M, 0, sizeof(gd_entry_t));
   M.field = (char *)field_code;
-  M.field_type = GD_MULTIPLY_ENTRY;
+  M.field_type = t;
   M.in_fields[0] = (char *)in_field1;
   M.in_fields[1] = (char *)in_field2;
   M.fragment_index = 0;
-  error = (_GD_Add(D, &M, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &M, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_madd_multiply(DIRFILE* D, const char *parent, const char* field_code,
+    const char* in_field1, const char* in_field2) gd_nothrow
+{
+  return _GD_MAddYoke(D, GD_MULTIPLY_ENTRY, parent, field_code, in_field1,
+      in_field2);
 }
 
 /* add a META PHASE entry */
 int gd_madd_phase(DIRFILE* D, const char* parent, const char* field_code,
     const char* in_field, gd_shift_t shift) gd_nothrow
 {
-  int error;
   gd_entry_t P;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\", %lli", D, field_code, parent, in_field,
@@ -1649,17 +1717,21 @@ int gd_madd_phase(DIRFILE* D, const char* parent, const char* field_code,
   P.EN(phase,shift) = shift;
   P.fragment_index = 0;
   P.scalar[0] = NULL;
-  error = (_GD_Add(D, &P, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &P, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META POLYNOM entry */
 int gd_madd_polynom(DIRFILE* D, const char* parent, const char* field_code,
     int poly_ord, const char* in_field, const double* a) gd_nothrow
 {
-  int i, error;
+  int i;
   gd_entry_t E;
 
   dtrace("%p, \"%s\", \"%s\", %i, \"%s\", %p", D, field_code, parent, poly_ord,
@@ -1682,7 +1754,6 @@ int gd_madd_polynom(DIRFILE* D, const char* parent, const 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) {
@@ -1690,17 +1761,20 @@ int gd_madd_polynom(DIRFILE* D, const char* parent, const char* field_code,
     E.scalar[i] = NULL;
   }
 
-  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+  if (_GD_Add(D, &E, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
 
-  dreturn("%i", error);
-  return error;
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META POLYNOM entry */
 int gd_madd_cpolynom(DIRFILE* D, const char* parent, const char* field_code,
     int poly_ord, const char* in_field, const GD_DCOMPLEXP(ca)) gd_nothrow
 {
-  int i, error;
+  int i;
   gd_entry_t E;
 
   dtrace("%p, \"%s\", \"%s\", %i, \"%s\", %p", D, field_code, parent, poly_ord,
@@ -1723,7 +1797,7 @@ int gd_madd_cpolynom(DIRFILE* D, const char* parent, const 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.flags = GD_EN_COMPSCAL;
   E.in_fields[0] = (char *)in_field;
 
   for (i = 0; i <= poly_ord; ++i) {
@@ -1731,44 +1805,26 @@ int gd_madd_cpolynom(DIRFILE* D, const char* parent, const char* field_code,
     E.scalar[i] = NULL;
   }
 
-  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+  if (_GD_Add(D, &E, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
 
-  dreturn("%i", error);
-  return error;
+  dreturn("%i", 0);
+  return 0;
 }
 
-/* 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,
+  return _GD_MAddYoke(D, GD_DIVIDE_ENTRY, 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) == NULL) ? -1 : 0;
-
-  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,
@@ -1784,12 +1840,15 @@ int gd_madd_recip(DIRFILE* D, const char *parent, const char* field_code,
   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) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 #ifndef GD_NO_C99_API
@@ -1801,20 +1860,8 @@ int gd_madd_crecip(DIRFILE* D, const char *parent, const char* field_code, const
   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;
-  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+  error = gd_madd_crecip89(D, parent, field_code, in_field,
+      (const double*)(&cdividend));
 
   dreturn("%i", error);
   return error;
@@ -1825,9 +1872,8 @@ 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,
+  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 */
@@ -1840,12 +1886,16 @@ int gd_madd_crecip89(DIRFILE* D, const char *parent, const char* field_code,
   E.field = (char *)field_code;
   E.field_type = GD_RECIP_ENTRY;
   gd_ra2cs_(E.EN(recip,cdividend), cdividend);
-  E.comp_scal = 1;
+  E.flags = GD_EN_COMPSCAL;
   E.in_fields[0] = (char *)in_field;
-  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META WINDOW entry */
@@ -1853,7 +1903,6 @@ int gd_madd_window(DIRFILE *D, const char *parent, const char *field_code,
     const char *in_field, const char *check_field, gd_windop_t windop,
     gd_triplet_t threshold) gd_nothrow
 {
-  int error;
   gd_entry_t E;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}", D, parent,
@@ -1873,10 +1922,14 @@ int gd_madd_window(DIRFILE *D, const char *parent, const char *field_code,
   E.EN(window,windop) = windop;
   E.in_fields[0] = (char *)in_field;
   E.in_fields[1] = (char *)check_field;
-  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META MPLEX entry */
@@ -1884,7 +1937,6 @@ int gd_madd_mplex(DIRFILE *D, const char *parent, const char *field_code,
     const char *in_field, const char *count_field, int count_val, int period)
   gd_nothrow
 {
-  int error;
   gd_entry_t E;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\", %i, %i", D, parent, field_code,
@@ -1903,10 +1955,14 @@ int gd_madd_mplex(DIRFILE *D, const char *parent, const char *field_code,
   E.EN(mplex,period) = period;
   E.in_fields[0] = (char *)in_field;
   E.in_fields[1] = (char *)count_field;
-  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
 
-  dreturn("%i", error);
-  return error;
+  if (_GD_Add(D, &E, parent) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META STRING entry */
@@ -1915,6 +1971,7 @@ int gd_madd_string(DIRFILE* D, const char* parent,
 {
   gd_entry_t *entry;
   gd_entry_t S;
+  char *ptr;
 
   dtrace("%p, \"%s\", \"%s\", \"%s\"", D, parent, field_code, value);
 
@@ -1928,14 +1985,25 @@ int gd_madd_string(DIRFILE* D, const char* parent,
   S.field = (char *)field_code;
   S.field_type = GD_STRING_ENTRY;
   S.fragment_index = 0;
+
+  /* duplicate early, in case of failure */
+  ptr = _GD_Strdup(D, value);
+  if (ptr == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
   entry = _GD_Add(D, &S, parent);
 
-  /* Actually store the string, now */
-  if (entry)
-    _GD_DoStringOut(D, entry, value);
+  if (D->error) {
+    free(ptr);
+    dreturn("%i", -1);
+    return -1;
+  }
 
-  dreturn("%i", D->error ? -1 : 0);
-  return D->error ? -1 : 0;
+  entry->e->u.string = ptr;
+  dreturn("%i", 0);
+  return 0;
 }
 
 /* add a META CONST entry */
@@ -1963,7 +2031,7 @@ int gd_madd_const(DIRFILE* D, const char* parent, const char* field_code,
 
   /* Actually store the constant, now */
   if (entry)
-    _GD_DoFieldOut(D, entry, 0, 0, 1, data_type, value);
+    _GD_DoFieldOut(D, entry, 0, 1, data_type, value);
 
   dreturn("%i", D->error ? -1 : 0);
   return D->error ? -1 : 0;
@@ -1996,7 +2064,7 @@ int gd_madd_carray(DIRFILE* D, const char* parent, const char* field_code,
 
   /* Actually store the carray, now */
   if (entry)
-    _GD_DoFieldOut(D, entry, 0, 0, array_len, data_type, values);
+    _GD_DoFieldOut(D, entry, 0, array_len, data_type, values);
 
   dreturn("%i", D->error ? -1 : 0);
   return D->error ? -1 : 0;
@@ -2066,12 +2134,14 @@ static int _GD_AddAlias(DIRFILE *restrict D, const char *restrict parent,
   }
 
   /* check alias name */
-  if (_GD_ValidateField(munged_code + offset, D->standards, 1, 0, NULL))
+  if (_GD_ValidateField(munged_code + offset, D->standards, 1, GD_VF_CODE,
+        NULL))
+  {
     _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, field_code);
-  else if (_GD_FindField(D, munged_code, D->entry, D->n_entries, 0, &u))
+  } else if (_GD_FindField(D, munged_code, D->entry, D->n_entries, 0, &u))
     _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, munged_code);
   else
-    _GD_CheckCodeAffixes(D, NULL, target, fragment_index); /* check target */
+    _GD_CheckCodeAffixes(D, target, fragment_index, 1); /* check target */
 
   if (D->error)
     goto add_alias_error;
@@ -2098,7 +2168,7 @@ static int _GD_AddAlias(DIRFILE *restrict D, const char *restrict parent,
   E->fragment_index = fragment_index;
   E->in_fields[0] = _GD_Strdup(D, target);
   E->field_type = GD_ALIAS_ENTRY;
-  E->e->calculated = 1;
+  E->flags |= GD_EN_CALC;
 
   if (D->error) {
     _GD_FreeE(D, E, 1);
@@ -2141,12 +2211,6 @@ int gd_add_alias(DIRFILE *D, const char *alias_name, const char *target_code,
 
   dtrace("%p, \"%s\", \"%s\", %i", D, alias_name, target_code, fragment_index);
 
-  if (D->flags & GD_INVALID) {
-    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
-    dreturn("%i", -1);
-    return -1;
-  }
-
   _GD_ClearError(D);
 
   ret = _GD_AddAlias(D, NULL, alias_name, target_code, fragment_index);
diff --git a/src/ascii.c b/src/ascii.c
index d5ff21a..9273d16 100644
--- a/src/ascii.c
+++ b/src/ascii.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -22,10 +22,10 @@
 
 /* The ASCII encoding uses file->edata for the stream pointer */
 
-int _GD_AsciiOpen(int fd, struct gd_raw_file_* file, int swap gd_unused_,
-    unsigned int mode)
+int _GD_AsciiOpen(int fd, struct gd_raw_file_* file, gd_type_t type gd_unused_,
+    int swap gd_unused_, unsigned int mode)
 {
-  dtrace("%i, %p, <unused>, %u", fd, file, mode);
+  dtrace("%i, %p, <unused>, <unused>, %u", fd, file, mode);
 
   if (!(mode & GD_FILE_TEMP)) {
     if (file->mode & mode) {
@@ -37,12 +37,13 @@ int _GD_AsciiOpen(int fd, struct gd_raw_file_* file, int swap gd_unused_,
     file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE)
           ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666);
 
-    if (file->idata < 0) {
-      dreturn("%i", -1);
-      return -1;
-    }
   } else
-    file->idata = fd;
+    file->idata = _GD_MakeTempFile(file->D, fd, file->name);
+
+  if (file->idata < 0) {
+    dreturn("%i", -1);
+    return -1;
+  }
 
   file->edata = fdopen(file->idata, (mode & GD_FILE_WRITE) ? "rb+" : "rb");
 
@@ -135,6 +136,9 @@ static void _GD_ScanFormat(char* fmt, gd_type_t data_type)
       break;
   }
 
+  if (fmt[0])
+    strcat(fmt, "\n");
+
   dreturn("[\"%s\"]", fmt);
 }
 
@@ -159,7 +163,7 @@ ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
       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))
+        if (ferror((FILE *)file->edata))
           ret = -1;
         break;
       }
@@ -167,14 +171,14 @@ ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
     }
   } else {
     for (n = 0; n < nmemb; ++n) {
-      if (feof((FILE *)file->edata))
+      if (ferror((FILE *)file->edata))
         break;
 
 
 #ifdef NO_8BIT_INT_PREFIX
       if (GD_SIZE(data_type) == 1) {
         if (fscanf((FILE *)file->edata, fmt, &i16) < 1) {
-          if (!feof((FILE *)file->edata))
+          if (ferror((FILE *)file->edata))
             ret = -1;
           break;
         }
@@ -188,7 +192,7 @@ ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
         if (fscanf((FILE *)file->edata, fmt, (char *)ptr + GD_SIZE(data_type) *
               n) < 1)
         {
-          if (!feof((FILE *)file->edata))
+          if (ferror((FILE *)file->edata))
             ret = -1;
           break;
         }
diff --git a/src/bzip.c b/src/bzip.c
index fe6c21c..42a4539 100644
--- a/src/bzip.c
+++ b/src/bzip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013, 2014, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -24,14 +24,6 @@
 #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
@@ -51,130 +43,102 @@ struct gd_bzdata {
 /* The bzip encoding scheme uses edata as a gd_bzdata pointer.  If a file is
  * open, idata = 0 otherwise idata = -1. */
 
-static struct gd_bzdata *_GD_Bzip2DoOpen(int dirfd, struct gd_raw_file_* file)
+static struct gd_bzdata *_GD_Bzip2DoOpen(int dirfd, struct gd_raw_file_* file,
+    unsigned int mode)
 {
   int fd;
   struct gd_bzdata *ptr;
-
-  dtrace("%i, %p", dirfd, file);
-
-  if ((ptr = (struct gd_bzdata *)malloc(sizeof(struct gd_bzdata))) == NULL) {
+  FILE *stream;
+  const char *fdmode = "rb";
+
+  dtrace("%i, %p, 0x%X", dirfd, file, mode);
+
+  if (mode & GD_FILE_READ) {
+    fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666);
+  } else if (mode & GD_FILE_TEMP) {
+    fd = _GD_MakeTempFile(file->D, dirfd, file->name);
+    fdmode = "wb";
+  } else { /* internal error */
+    errno = EINVAL; /* I guess ... ? */
     dreturn("%p", NULL);
     return NULL;
   }
 
-  if ((fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY, 0666)) == -1) {
-    free(ptr);
+  if (fd < 0) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  if ((ptr->stream = fdopen(fd, "rb")) == NULL) {
+  if ((stream = fdopen(fd, fdmode)) == NULL) {
     close(fd);
-    free(ptr);
     dreturn("%p", NULL);
     return NULL;
   }
 
+  if ((ptr = (struct gd_bzdata *)malloc(sizeof(struct gd_bzdata))) == NULL) {
+    fclose(stream);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ptr->stream = stream;
   ptr->bzerror = ptr->stream_end = 0;
-  ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, ptr->stream, 0, 0, NULL, 0);
+  if (mode & GD_FILE_READ) {
+    ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, stream, 0, 0, NULL, 0);
+  } else {
+    ptr->bzfile = BZ2_bzWriteOpen(&ptr->bzerror, stream, 9, 0, 30);
+    memset(ptr->data, 0, GD_BZIP_BUFFER_SIZE);
+  }
 
-  if (ptr->bzfile == NULL || ptr->bzerror != BZ_OK) {
-    fclose(ptr->stream);
+  if (ptr->bzerror != BZ_OK) {
+    if (mode & GD_FILE_READ)
+      BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+    else
+      BZ2_bzWriteClose(&ptr->bzerror, ptr->bzfile, 0, NULL, NULL);
+    fclose(stream);
     free(ptr);
+    file->error = ptr->bzerror;
     dreturn("%p", NULL);
     return NULL;
   }
 
   ptr->pos = ptr->end = 0;
   ptr->base = 0;
+  file->pos = 0;
 
   dreturn("%p", ptr);
   return ptr;
 }
 
-int _GD_Bzip2Open(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
-    unsigned int mode gd_unused_)
+int _GD_Bzip2Open(int dirfd, struct gd_raw_file_* file,
+    gd_type_t type gd_unused_, int swap gd_unused_,
+    unsigned int mode)
 {
-  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
+  dtrace("%i, %p, <unused>, <unused>, 0x%X", dirfd, file, mode);
 
-  file->edata = _GD_Bzip2DoOpen(dirfd, file);
+  file->edata = _GD_Bzip2DoOpen(dirfd, file, mode);
 
   if (file->edata == NULL) {
     dreturn("%i", 1);
     return 1;
   }
 
-  file->mode = GD_FILE_READ;
+  file->mode = mode;
   file->idata = 0;
   dreturn("%i", 0);
   return 0;
 }
 
-off64_t _GD_Bzip2Seek(struct gd_raw_file_* file, off64_t count,
-    gd_type_t data_type, unsigned int mode gd_unused_)
-{
-  struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
-
-  dtrace("%p, %lli, 0x%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_ *restrict file, void *restrict data,
     gd_type_t data_type, size_t nmemb)
 {
   char* output = (char*)data;
   struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
-  unsigned long long nbytes = nmemb * GD_SIZE(data_type);
+  uint64_t nbytes = nmemb * GD_SIZE(data_type);
 
   dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
 
-  while (nbytes > (unsigned long long)(ptr->end - ptr->pos)) {
+  while (nbytes > (uint64_t)(ptr->end - ptr->pos)) {
     int n;
 
     memcpy(output, ptr->data + ptr->pos, ptr->end - ptr->pos);
@@ -196,6 +160,7 @@ ssize_t _GD_Bzip2Read(struct gd_raw_file_ *restrict file, void *restrict data,
       ptr->pos = 0;
       ptr->end = n;
     } else {
+      file->error = ptr->bzerror;
       dreturn("%i", -1);
       return -1;
     }
@@ -207,7 +172,7 @@ ssize_t _GD_Bzip2Read(struct gd_raw_file_ *restrict file, void *restrict data,
     }
   }
 
-  if (nbytes > (unsigned long long)(ptr->end - ptr->pos)) {
+  if (nbytes > (uint64_t)(ptr->end - ptr->pos)) {
     memcpy(output, ptr->data + ptr->pos, ptr->end - ptr->pos);
     ptr->pos = ptr->end;
     nbytes -= ptr->end;
@@ -217,19 +182,153 @@ ssize_t _GD_Bzip2Read(struct gd_raw_file_ *restrict file, void *restrict data,
     nbytes = 0;
   }
 
+  file->pos = (ptr->base + ptr->pos) / GD_SIZE(data_type);
+
   dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
   return nmemb - nbytes / GD_SIZE(data_type);
 }
 
+ssize_t _GD_Bzip2Write(struct gd_raw_file_ *file, const void *data,
+    gd_type_t data_type, size_t nmemb)
+{
+  struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
+  ssize_t n;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
+
+  n = GD_SIZE(data_type) * nmemb;
+  if (n > INT_MAX)
+    n = INT_MAX;
+
+  BZ2_bzWrite(&ptr->bzerror, ptr->bzfile, (void*)data, (int)n);
+
+  if (ptr->bzerror) {
+    file->error = ptr->bzerror;
+    n = -1;
+  } else {
+    ptr->base += n;
+    n /= GD_SIZE(data_type);
+    file->pos += n;
+  }
+
+  dreturn("%" PRNssize_t, n);
+  return n;
+}
+
+off64_t _GD_Bzip2Seek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int mode)
+{
+  struct gd_bzdata *ptr;
+
+  dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode);
+
+  ptr = (struct gd_bzdata *)(file[(mode == GD_FILE_WRITE) ? 1 : 0].edata);
+
+  /* nothing to do */
+  if (ptr->base + ptr->pos == count * GD_SIZE(data_type)) {
+    dreturn("%lli", (long long)count);
+    return count;
+  }
+
+  count *= GD_SIZE(data_type);
+
+  if (mode == GD_FILE_WRITE) {
+    /* we only get here when we need to pad */
+    count -= file->pos * GD_SIZE(data_type);
+    while (ptr->base < count) {
+      int n;
+      if (count > GD_BZIP_BUFFER_SIZE)
+        n = GD_BZIP_BUFFER_SIZE;
+      else
+        n = count;
+
+      _GD_Bzip2Write(file + 1, ptr->data, GD_UINT8, n);
+      count -= n;
+    }
+  } else {
+    if (ptr->base > count) {
+      /* a backwards seek: reopen the file */
+      ptr->bzerror = 0;
+      BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+      if (ptr->bzerror != BZ_OK) {
+        file->error = ptr->bzerror;
+        fclose(ptr->stream);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      rewind(ptr->stream);
+      ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, ptr->stream, 0, 0, NULL, 0);
+
+      if (ptr->bzerror != BZ_OK) {
+        file->error = ptr->bzerror;
+        BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+        fclose(ptr->stream);
+        dreturn("%i", -1);
+        return -1;
+      }
+      ptr->pos = ptr->end = 0;
+      ptr->base = ptr->stream_end = 0;
+    }
+
+    /* seek forward the slow way */
+    while (ptr->base + ptr->end < count) {
+      int n;
+
+      /* eof */
+      if (ptr->stream_end)
+        break;
+
+      ptr->bzerror = 0;
+      n = BZ2_bzRead(&ptr->bzerror, ptr->bzfile, ptr->data,
+          GD_BZIP_BUFFER_SIZE);
+
+      if (ptr->bzerror == BZ_OK || ptr->bzerror == BZ_STREAM_END) {
+        ptr->base += ptr->end;
+        ptr->end = n;
+        if (ptr->bzerror == BZ_STREAM_END)
+          ptr->stream_end = 1;
+      } else {
+        file->error = ptr->bzerror;
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+
+    ptr->pos = (ptr->stream_end && count >= ptr->base + ptr->end) ? ptr->end :
+      count - ptr->base;
+  }
+  
+  file->pos = (ptr->base + ptr->pos) / GD_SIZE(data_type);
+
+  dreturn("%lli", (long long)file->pos);
+  return file->pos;;
+}
+
+/* This function does nothing */
+int _GD_Bzip2Sync(struct gd_raw_file_ *file gd_unused_)
+{
+  dtrace("<unused>");
+
+  dreturn("%i", 0);
+  return 0;
+}
+
 int _GD_Bzip2Close(struct gd_raw_file_ *file)
 {
   struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
   dtrace("%p", file);
 
   ptr->bzerror = 0;
-  BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
-  if (fclose(ptr->stream)) {
+  if (file->mode & GD_FILE_READ)
+    BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+  else
+    BZ2_bzWriteClose(&ptr->bzerror, ptr->bzfile, 0, NULL, NULL);
+
+  if (ptr->bzerror || fclose(ptr->stream)) {
+    file->error = ptr->bzerror;
     dreturn("%i", 1);
+
     return 1;
   }
 
@@ -248,14 +347,14 @@ off64_t _GD_Bzip2Size(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
 
   dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
 
-  ptr = _GD_Bzip2DoOpen(dirfd, file);
+  ptr = _GD_Bzip2DoOpen(dirfd, file, GD_FILE_READ);
 
   if (ptr == NULL) {
     dreturn("%i", -1);
     return -1;
   }
 
-  /* seek forward the slow way  to the end */
+  /* seek forward the slow way to the end */
   while (ptr->bzerror != BZ_STREAM_END) {
     int n;
 
@@ -268,6 +367,7 @@ off64_t _GD_Bzip2Size(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
       ptr->pos = 0;
       ptr->end = n;
     } else {
+      file->error = ptr->bzerror;
       BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
       fclose(ptr->stream);
       free(ptr);
@@ -284,3 +384,38 @@ off64_t _GD_Bzip2Size(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
   dreturn("%lli", (long long)n);
   return n;
 }
+
+int _GD_Bzip2Strerr(const struct gd_raw_file_ *file, char *buf, size_t buflen)
+{
+  int r = 0;
+
+  dtrace("%p, %p, %" PRNsize_t, file, buf, buflen);
+
+  switch (file->error) {
+    case BZ_OK:
+    case BZ_IO_ERROR:
+      r = gd_strerror(errno, buf, buflen);
+      break;
+    case BZ_SEQUENCE_ERROR:
+    case BZ_PARAM_ERROR:
+      /* these indicate bugs in the code */
+      strncpy(buf, "Internal error in Bzip2 encoding", buflen);
+      break;
+    case BZ_MEM_ERROR:
+      strncpy(buf, "libbz2: Out of memory", buflen);
+      break;
+    case BZ_DATA_ERROR:
+      strncpy(buf, "libbz2: Data integrity error", buflen);
+      break;
+    case BZ_UNEXPECTED_EOF:
+      strncpy(buf, "libbz2: Unexpected EOF", buflen);
+      break;
+    default:
+      snprintf(buf, buflen, "libbz2: Unkown error %i", file->error);
+      break;
+  }
+  buf[buflen - 1] = 0;
+
+  dreturn("%i", r);
+  return r;
+}
diff --git a/src/close.c b/src/close.c
index 25ac590..bfc0dfe 100644
--- a/src/close.c
+++ b/src/close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008, 2010, 2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,10 +53,13 @@ static void _GD_FreeD(DIRFILE *D, int keep_dirfile)
     free(D->entry_list[j]);
   free(D->string_value_list);
   free(D->const_value_list);
-  if (D->carray_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->carray_value_list);
+  }
+  
   free(D->fragment);
   free(D->name);
   for (i = 0; i < D->ndir; ++i)
diff --git a/src/common.c b/src/common.c
index 3b9dfdd..1b5fb52 100644
--- a/src/common.c
+++ b/src/common.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
- * Copyright (C) 2005-2012, 2014, 2015 D. V. Wiebe
+ * Copyright (C) 2005-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -218,7 +218,7 @@ int _GD_SetTablePath(DIRFILE *restrict D, const gd_entry_t *restrict E,
   dtrace("%p, %p, %p", D, E, e);
 
   e->u.linterp.table_dirfd = _GD_GrabDir(D,
-      D->fragment[E->fragment_index].dirfd, E->EN(linterp,table));
+      D->fragment[E->fragment_index].dirfd, E->EN(linterp,table), 0);
 
   temp_buffer = _GD_Strdup(D, E->EN(linterp,table));
   if (temp_buffer == NULL) {
@@ -254,11 +254,11 @@ void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E)
   struct gd_lut_ *ptr;
   int i, fd;
   int dir = -1;
-  char *line;
+  char *line = NULL;
   size_t n = 0;
   int linenum = 0;
   double yr, yi;
-  int buf_len = 100;
+  int buf_len = GD_LUT_CHUNK;
 
   dtrace("%p, %p", D, E);
 
@@ -271,25 +271,33 @@ void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E)
   fd = gd_OpenAt(D, E->e->u.linterp.table_dirfd, E->e->u.linterp.table_file,
       O_RDONLY, 0666);
   if (fd == -1) {
-    _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_OPEN, NULL, 0,
-        E->EN(linterp,table));
+    _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, E->EN(linterp,table), 0, NULL);
     dreturnvoid();
     return;
   }
 
   fp = fdopen(fd, "rb");
   if (fp == NULL) {
-    _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_OPEN, NULL, 0,
-        E->EN(linterp,table));
+    _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, E->EN(linterp,table), 0, NULL);
     dreturnvoid();
     return;
   }
 
+  E->e->u.linterp.lut = _GD_Malloc(D, buf_len * sizeof(*E->e->u.linterp.lut));
+
+  if (E->e->u.linterp.lut == NULL)
+    goto LUT_ERROR;
+
   /* read the first line to see whether the table is complex valued */
   if ((line = _GD_GetLine(fp, &n, &linenum))) {
     char ystr[50];
     if (sscanf(line, "%lg %49s", &yr, ystr) == 2)
       E->e->u.linterp.complex_table = (strchr(ystr, ';') == NULL) ? 0 : 1;
+    else {
+      _GD_SetError(D, GD_E_LUT, GD_E_LUT_SYNTAX, E->EN(linterp,table), linenum,
+          NULL);
+      goto LUT_ERROR;
+    }
   } else {
     if (errno == EOVERFLOW)
       /* line too long */
@@ -297,31 +305,31 @@ void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E)
           NULL);
     else 
       /* no data in file! */
-      _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_LENGTH, NULL, 0,
-          E->EN(linterp,table));
-    fclose(fp);
-    dreturnvoid();
-    return;
-  }
-
-  E->e->u.linterp.lut = (struct gd_lut_ *)_GD_Malloc(D, buf_len *
-      sizeof(struct gd_lut_));
-
-  if (E->e->u.linterp.lut == NULL) {
-    fclose(fp);
-    dreturnvoid();
-    return;
+      _GD_SetError(D, GD_E_LUT, GD_E_LUT_LENGTH, E->EN(linterp,table), 0, NULL);
+    goto LUT_ERROR;
   }
 
   /* now read in the data -- we've already read line one */
   i = 0;
   do {
     if (E->e->u.linterp.complex_table) {
-      sscanf(line, "%lg %lg;%lg", &(E->e->u.linterp.lut[i].x), &yr, &yi);
-      gd_li2cs_(E->e->u.linterp.lut[i].y.c, yr, yi);
+      if (sscanf(line, "%lg %lg;%lg", &(E->e->u.linterp.lut[i].x), &yr, &yi) ==
+          3)
+      {
+        gd_li2cs_(E->e->u.linterp.lut[i].y.c, yr, yi);
+      } else {
+        _GD_SetError(D, GD_E_LUT, GD_E_LUT_SYNTAX, E->EN(linterp,table),
+            linenum, NULL);
+        goto LUT_ERROR;
+      }
     } else
-      sscanf(line, "%lg %lg", &(E->e->u.linterp.lut[i].x),
-          &(E->e->u.linterp.lut[i].y.r));
+      if (sscanf(line, "%lg %lg", &(E->e->u.linterp.lut[i].x),
+            &(E->e->u.linterp.lut[i].y.r)) != 2)
+      {
+        _GD_SetError(D, GD_E_LUT, GD_E_LUT_SYNTAX, E->EN(linterp,table),
+            linenum, NULL);
+        goto LUT_ERROR;
+      }
 
     if (dir > -2 && i > 0 && E->e->u.linterp.lut[i].x !=
         E->e->u.linterp.lut[i - 1].x)
@@ -334,16 +342,11 @@ void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E)
 
     i++;
     if (i >= buf_len) {
-      buf_len += 100;
-      ptr = (struct gd_lut_ *)_GD_Realloc(D, E->e->u.linterp.lut, buf_len *
-          sizeof(struct gd_lut_));
-
-      if (ptr == NULL) {
-        free(E->e->u.linterp.lut);
-        fclose(fp);
-        dreturnvoid();
-        return;
-      }
+      buf_len += GD_LUT_CHUNK;
+      ptr = _GD_Realloc(D, E->e->u.linterp.lut, buf_len * sizeof(*ptr));
+
+      if (ptr == NULL)
+        goto LUT_ERROR;
 
       E->e->u.linterp.lut = ptr;
     }
@@ -351,24 +354,15 @@ void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E)
   } 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->EN(linterp,table));
-    fclose(fp);
-    dreturnvoid();
-    return;
+    _GD_SetError(D, GD_E_LUT, GD_E_LUT_LENGTH, NULL, 0, E->EN(linterp,table));
+    goto LUT_ERROR;
   }
 
   /* Free unused memory */
-  ptr = (struct gd_lut_ *)_GD_Realloc(D, E->e->u.linterp.lut, i
-      * sizeof(struct gd_lut_));
+  ptr = _GD_Realloc(D, E->e->u.linterp.lut, i * sizeof(*ptr));
 
-  if (ptr == NULL) {
-    free(E->e->u.linterp.lut);
-    fclose(fp);
-    dreturnvoid();
-    return;
-  }
+  if (ptr == NULL)
+    goto LUT_ERROR;
 
   E->e->u.linterp.table_monotonic = -1;
   E->e->u.linterp.lut = ptr;
@@ -380,6 +374,14 @@ void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E)
 
   fclose(fp);
   dreturnvoid();
+  return;
+
+LUT_ERROR:
+  free(E->e->u.linterp.lut);
+  E->e->u.linterp.lut = NULL;
+  free(line);
+  fclose(fp);
+  dreturnvoid();
 }
 
 /* _GD_GetIndex: get LUT index.
@@ -834,8 +836,8 @@ int _GD_GetRepr(DIRFILE *restrict D, const char *restrict field_code_in,
         break;
       default:
         if (err)
-          _GD_SetError(D, GD_E_BAD_REPR, GD_E_REPR_UNKNOWN, NULL, 0,
-              field_code_in + field_code_len - 1);
+          _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0,
+              field_code_in);
         dreturn("%i", 0);
         return 0;
     }
@@ -852,11 +854,11 @@ int _GD_GetRepr(DIRFILE *restrict D, const char *restrict field_code_in,
 }
 
 /* Ensure that an input field has been identified (with error checking) */
-int _GD_BadInput(DIRFILE *D, const gd_entry_t *E, int i, int err)
+int _GD_BadInput(DIRFILE *D, const gd_entry_t *E, int i, gd_entype_t t, int err)
 {
   char *code;
 
-  dtrace("%p, %p, %i, %i", D, E, i, err);
+  dtrace("%p, %p, %i, 0x%X, %i", D, E, i, t, err);
 
   if (E->e->entry[i] == NULL) {
     E->e->entry[i] = _GD_FindFieldAndRepr(D, E->in_fields[i], &code,
@@ -871,9 +873,17 @@ int _GD_BadInput(DIRFILE *D, const gd_entry_t *E, int i, int err)
       free(code);
   }
 
-  /* scalar entries not allowed */
-  if (E->e->entry[i]->field_type & GD_SCALAR_ENTRY_BIT) {
-    _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, E->field, 0,
+  /* check field type */
+  if (t == GD_NO_ENTRY) {
+    /* scalar entries not allowed */
+    if (E->e->entry[i]->field_type & GD_SCALAR_ENTRY_BIT) {
+      _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, E->field, 0,
+          E->e->entry[i]->field);
+      dreturn("%i", 1);
+      return 1;
+    }
+  } else if (E->e->entry[i]->field_type != t) {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_FORMAT, E->field, 0,
         E->e->entry[i]->field);
     dreturn("%i", 1);
     return 1;
@@ -883,6 +893,28 @@ int _GD_BadInput(DIRFILE *D, const gd_entry_t *E, int i, int err)
   return 0;
 }
 
+/* Find an entry without a representation */
+gd_entry_t *_GD_FindEntry(DIRFILE *restrict D, const char *restrict field_code,
+    unsigned int *restrict index, int set, int err)
+{
+  gd_entry_t *E = NULL;
+
+  dtrace("%p, \"%s\", %p, %i, %i", D, field_code, index, set, err);
+
+  if (D->n_dot > 0)
+    E = _GD_FindField(D, field_code, D->dot_list, D->n_dot, 1, NULL);
+
+  if (E == NULL || index != NULL)
+    E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, index);
+
+  if (E == NULL && set)
+    if (err)
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+
+  dreturn("%p", E);
+  return E;
+}
+
 /* Find the entry and the representation */
 gd_entry_t *_GD_FindFieldAndRepr(DIRFILE *restrict D,
     const char *restrict field_code_in, char **restrict field_code,
@@ -1078,8 +1110,7 @@ char *_GD_CanonicalPath(const char *car, const char *cdr)
       *(end++) = '\0';
 
     if (cur[0] == '\0')
-      /* consecutive /s */
-      ;
+      ; /* discard consecutive DIRSEPs */
     else if (cur[0] == '.' && cur[1] == '\0') {
       /* discard . */
       continue;
@@ -1120,7 +1151,7 @@ char *_GD_CanonicalPath(const char *car, const char *cdr)
         if (lstat64(res, &statbuf)) {
           if (errno == ENOENT) {
             /* the thing doesn't exist.  I guess that means we're done;
-             * copy the rest of the work buffer onto the resul and call it a
+             * copy the rest of the work buffer onto the result and call it a
              * day. */
             if (*end) {
               len = strlen(end) + 1;
@@ -1153,10 +1184,10 @@ char *_GD_CanonicalPath(const char *car, const char *cdr)
 
           /* check for symlink loop */
           if (loop_count++ > MAXSYMLINKS) {
-            errno = ELOOP;
             free(res);
             free(work);
             dreturn("%p", NULL);
+            errno = ELOOP;
             return NULL;
           }
 
@@ -1267,7 +1298,7 @@ char *_GD_MakeFullPath(DIRFILE *D, int dirfd, const char *name, int seterr)
     else {
       /* a last ditch attempt */
       if (dir) {
-        filepath = (char*)_GD_Malloc(D, strlen(dir) + strlen(name) + 2);
+        filepath = _GD_Malloc(D, strlen(dir) + strlen(name) + 2);
         if (filepath)
           sprintf(filepath, "%s%c%s", dir, GD_DIRSEP, name);
       } else 
@@ -1294,15 +1325,18 @@ char *_GD_MakeFullPathOnly(const DIRFILE *D, int dirfd, const char *name)
   return filepath;
 }
 
-int _GD_GrabDir(DIRFILE *D, int dirfd, const char *name)
+int _GD_GrabDir(DIRFILE *D, int dirfd, const char *name, int canonical)
 {
   unsigned int i;
   char *path, *dir = NULL;
   void *ptr;
 
-  dtrace("%p, %i, \"%s\"", D, dirfd, name);
+  dtrace("%p, %i, \"%s\", %i", D, dirfd, name, canonical);
 
-  path = _GD_MakeFullPath(D, dirfd, name, 1);
+  if (canonical)
+    path = _GD_Strdup(D, name);
+  else
+    path = _GD_MakeFullPath(D, dirfd, name, 1);
 
   if (path == NULL) {
     dreturn("%i", -1);
@@ -1320,7 +1354,7 @@ int _GD_GrabDir(DIRFILE *D, int dirfd, const char *name)
     }
 
   /* new one */
-  ptr = _GD_Realloc(D, D->dir, sizeof(struct gd_dir_t) * (D->ndir + 1));
+  ptr = _GD_Realloc(D, D->dir, sizeof(D->dir[0]) * (D->ndir + 1));
 
   if (ptr == NULL) {
     free(path);
@@ -1328,7 +1362,7 @@ int _GD_GrabDir(DIRFILE *D, int dirfd, const char *name)
     return -1;
   }
 
-  D->dir = (struct gd_dir_t*)ptr;
+  D->dir = ptr;
   D->dir[D->ndir].rc = 1;
   D->dir[D->ndir].path = _GD_Strdup(D, dir);
 
diff --git a/src/compat.c b/src/compat.c
index 486fea8..a8bae0e 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010, 2011, 2012 D. V. Wiebe
+/* Copyright (C) 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int gd_OpenAt(const DIRFILE *D, int dirfd, const char *name, int flags,
   int ret;
   char *path;
 
-  dtrace("%p, %i, \"%s\", %x, 0%o", D, dirfd, name, flags, mode);
+  dtrace("%p, %i, \"%s\", 0x%X, 0%o", D, dirfd, name, flags, mode);
 
   path = _GD_MakeFullPathOnly(D, dirfd, name);
   ret = open(path, flags | O_BINARY, mode);
@@ -91,16 +91,19 @@ int gd_RenameAt(const DIRFILE *D, int olddirfd, const char *oldname,
 #endif
 
 #ifndef HAVE_FSTATAT
+#ifndef AT_SYMLINK_NOFOLLOW
+#define AT_SYMLINK_NOFOLLOW 0 /* will never match */
+#endif
 int gd_StatAt(const DIRFILE* D, int dirfd, const char* name, struct stat* buf,
     int flags)
 {
   int ret;
   char *path;
 
-  dtrace("%p, %i, \"%s\", %p, %x", D, dirfd, name, buf, flags);
+  dtrace("%p, %i, \"%s\", %p, 0x%X", D, dirfd, name, buf, flags);
 
   path = _GD_MakeFullPathOnly(D, dirfd, name);
-#if defined(HAVE_LSTAT) && defined(AT_SYMLINK_NOFOLLOW)
+#ifdef HAVE_LSTAT
   if (flags & AT_SYMLINK_NOFOLLOW)
     ret = lstat(path, buf);
   else
@@ -113,7 +116,7 @@ int gd_StatAt(const DIRFILE* D, int dirfd, const char* name, struct stat* buf,
 }
 #endif
 
-#ifndef HAVE_FSTATAT64
+#if !defined HAVE_FSTATAT64 && !defined GD_NO_64BIT_STAT
 int gd_StatAt64(const DIRFILE* D, int dirfd, const char* name, gd_stat64_t* buf,
     int flags gd_unused_)
 {
@@ -467,3 +470,28 @@ double gd_strtod(const char *nptr, char **endptr)
   return r;
 }
 #endif
+
+/* There are two versions of this function: one deals with no strerror_r,
+ * the other with GNU's non XSI-conforming strerror_r */
+#if !defined HAVE_STRERROR_R || defined STRERROR_R_CHAR_P
+int gd_strerror(int errnum, char *buf, size_t buflen)
+{
+  char *ptr;
+
+  dtrace("%i, %p, %" PRNsize_t, errnum, buf, buflen);
+  
+#ifdef STRERROR_R_CHAR_P
+  ptr = strerror_r(errnum, buf, buflen);
+  if (ptr != buf)
+#else
+    ptr = strerror(errnum);
+#endif
+  {
+    strncpy(buf, ptr, buflen);
+    buf[buflen - 1] = 0;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+#endif
diff --git a/src/constant.c b/src/constant.c
index c7874a5..e373fc7 100644
--- a/src/constant.c
+++ b/src/constant.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2010 D. V. Wiebe
+/* Copyright (C) 2008, 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -20,16 +20,16 @@
  */
 #include "internal.h"
 
-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
+int gd_get_carray_slice(DIRFILE *D, const char *field_code_in,
+    unsigned long start, size_t n, gd_type_t return_type, void *data_out)
+  gd_nothrow
 {
   gd_entry_t *entry;
   char* field_code;
   int repr;
 
-  dtrace("%p, \"%s\", %i, %" PRNsize_t ", 0x%x, %p", D, field_code_in,
-      (int)start, n, return_type, data_out);
+  dtrace("%p, \"%s\", %lu, %" PRNsize_t ", 0x%x, %p", D, field_code_in, start,
+      n, return_type, data_out);
 
   if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -121,11 +121,12 @@ int gd_get_constant(DIRFILE* D, const char *field_code_in,
   return gd_get_carray_slice(D, field_code_in, 0, 1, return_type, data_out);
 }
 
-size_t gd_carray_len(DIRFILE *D, const char *field_code_in) gd_nothrow
+size_t gd_array_len(DIRFILE *D, const char *field_code_in) gd_nothrow
 {
   gd_entry_t *entry;
   char* field_code;
   int repr;
+  size_t len = 0;
 
   dtrace("%p, \"%s\"", D, field_code_in);
 
@@ -145,43 +146,36 @@ size_t gd_carray_len(DIRFILE *D, const char *field_code_in) gd_nothrow
     return 0;
   }
 
-  if (entry->field_type != GD_CARRAY_ENTRY &&
-      entry->field_type != GD_CONST_ENTRY)
+  if (entry->field_type == GD_CARRAY_ENTRY)
+  {
+    len = entry->EN(scalar,array_len);
+  } else if (entry->field_type == GD_CONST_ENTRY ||
+      entry->field_type == GD_STRING_ENTRY)
   {
+    len = 1;
+  } else 
     _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
-  }
 
   if (field_code != field_code_in)
     free(field_code);
 
-  if (D->error) {
-    dreturn("%i", 0);
-    return 0;
-  }
+  dreturn("%" PRNsize_t, len);
+  return len;
+}
 
-  dreturn("%" PRNsize_t, (entry->field_type == GD_CONST_ENTRY) ? 1 :
-    entry->EN(scalar,array_len));
-  return (entry->field_type == GD_CONST_ENTRY) ? 1 :
-    entry->EN(scalar,array_len);
+/* Deprecated alias */
+size_t gd_carray_len(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  return gd_array_len(D, field_code);
 }
 
-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
+static int _GD_PutCarraySlice(DIRFILE* D, gd_entry_t *E, unsigned long first,
+    size_t n, gd_type_t data_type, const void *data_in) gd_nothrow
 {
   int i;
-  gd_entry_t *entry;
-  int repr;
-  char* field_code;
 
-  dtrace("%p, \"%s\", %i, %" PRNsize_t ", 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;
-  }
+  dtrace("%p, %p, %lu, %" PRNsize_t ", 0x%X, %p", D, E, first, n, data_type,
+      data_in);
 
   if ((D->flags & GD_ACCMODE) != GD_RDWR) {
     _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
@@ -189,29 +183,12 @@ gd_nothrow
     return -1;
   }
 
-  _GD_ClearError(D);
-
-  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
-      1);
-
-  if (D->error) {
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  if (entry->field_type != GD_CARRAY_ENTRY &&
-      entry->field_type != GD_CONST_ENTRY)
-  {
-    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
-  } else if (first + n > ((entry->field_type == GD_CONST_ENTRY) ? 1 :
-        entry->EN(scalar,array_len)))
+  if (first + n > ((E->field_type == GD_CONST_ENTRY) ? 1 :
+        E->EN(scalar,array_len)))
   {
     _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
   } else
-    _GD_DoFieldOut(D, entry, repr, first, n, data_type, data_in);
-
-  if (field_code != field_code_in)
-    free(field_code);
+    _GD_DoFieldOut(D, E, first, n, data_type, data_in);
 
   if (D->error) {
     dreturn("%i", -1);
@@ -219,27 +196,26 @@ gd_nothrow
   }
 
   /* 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;
+  for (i = 0; i < E->e->u.scalar.n_client; ++i)
+    E->e->u.scalar.client[i]->flags &= ~GD_EN_CALC;
 
   /* Clear the client list */
-  free(entry->e->u.scalar.client);
-  entry->e->u.scalar.client = NULL;
-  entry->e->u.scalar.n_client = 0;
+  free(E->e->u.scalar.client);
+  E->e->u.scalar.client = NULL;
+  E->e->u.scalar.n_client = 0;
 
   dreturn("%i", 0);
   return 0;
 }
 
-int gd_put_carray(DIRFILE* D, const char *field_code_in, gd_type_t data_type,
-    const void *data_in) gd_nothrow
+int gd_put_carray_slice(DIRFILE* D, const char *field_code, unsigned long first,
+    size_t n, gd_type_t data_type, const void *data_in) gd_nothrow
 {
-  int i;
   gd_entry_t *entry;
-  int repr;
-  char* field_code;
+  int r = -1;
 
-  dtrace("%p, \"%s\", 0x%x, %p", D, field_code_in, data_type, data_in);
+  dtrace("%p, \"%s\", %lu, %" PRNsize_t ", 0x%X, %p", D, field_code, first,
+      n, data_type, data_in);
 
   if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -247,18 +223,12 @@ int gd_put_carray(DIRFILE* D, const char *field_code_in, gd_type_t data_type,
     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,
-      1);
+  entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
 
-  if (D->error) {
+  if (entry == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
     dreturn("%i", -1);
     return -1;
   }
@@ -268,35 +238,53 @@ int gd_put_carray(DIRFILE* D, const char *field_code_in, gd_type_t data_type,
   {
     _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
   } else
-    _GD_DoFieldOut(D, entry, repr, 0,
-        (entry->field_type == GD_CONST_ENTRY) ? 1 : entry->EN(scalar,array_len),
-        data_type, data_in);
+    r = _GD_PutCarraySlice(D, entry, first, n, data_type, data_in);
 
-  if (field_code != field_code_in)
-    free(field_code);
+  dreturn("%i", r);
+  return r;
+}
 
-  if (D->error) {
+int gd_put_carray(DIRFILE* D, const char *field_code, gd_type_t data_type,
+    const void *data_in) gd_nothrow
+{
+  gd_entry_t *entry;
+  int r = -1;
+
+  dtrace("%p, \"%s\", 0x%x, %p", D, field_code, data_type, data_in);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
     dreturn("%i", -1);
     return -1;
   }
 
-  /* 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;
+  _GD_ClearError(D);
 
-  /* Clear the client list */
-  free(entry->e->u.scalar.client);
-  entry->e->u.scalar.client = NULL;
-  entry->e->u.scalar.n_client = 0;
+  entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
 
-  dreturn("%i", 0);
-  return 0;
+  if (entry == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (entry->field_type != GD_CARRAY_ENTRY &&
+      entry->field_type != GD_CONST_ENTRY)
+  {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+  } else
+    r = _GD_PutCarraySlice(D, entry, 0,
+        (entry->field_type == GD_CONST_ENTRY) ? 1 : entry->EN(scalar,array_len),
+        data_type, data_in);
+
+  dreturn("%i", r);
+  return r;
 }
 
-int gd_put_constant(DIRFILE* D, const char *field_code_in, gd_type_t data_type,
+int gd_put_constant(DIRFILE* D, const char *field_code, gd_type_t data_type,
     const void *data_in) gd_nothrow
 {
-  return gd_put_carray_slice(D, field_code_in, 0, 1, data_type, data_in);
+  return gd_put_carray_slice(D, field_code, 0, 1, data_type, data_in);
 }
 
 /* vim: ts=2 sw=2 et tw=80
diff --git a/src/debug.c b/src/debug.c
index 5e5f0f4..b343e50 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2010, 2013 D. V. Wiebe
+/* Copyright (C) 2008, 2010, 2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -40,7 +40,7 @@ const char* gd_coladd(void)
 const char* gd_colsub(void)
 {
   static char buffer[GD_COL_SIZE + 1];
-  strcpy(buffer, gd_colnil());
+  strcpy(buffer, gd_debug_col);
 
   if (gd_col_count > 0)
     gd_debug_col[--gd_col_count] = '\0';
diff --git a/src/del.c b/src/del.c
index 8f8659d..8eff8cf 100644
--- a/src/del.c
+++ b/src/del.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -72,14 +72,13 @@ static void _GD_ClearDerived(DIRFILE *restrict D, gd_entry_t *restrict E,
     case GD_CARRAY_ENTRY:
     case GD_STRING_ENTRY:
       break;
-    default:
-      if (E->field_type == GD_ALIAS_ENTRY)
-        if (E->e->entry[0] == C) {
-          if (check)
-            _GD_SetError(D, GD_E_DELETE, GD_E_DEL_ALIAS, E->field, 0, C->field);
-          else
-            E->e->entry[0] = NULL;
-        }
+    case GD_ALIAS_ENTRY:
+      if (E->e->entry[0] == C) {
+        if (check)
+          _GD_SetError(D, GD_E_DELETE, GD_E_DEL_ALIAS, E->field, 0, C->field);
+        else
+          E->e->entry[0] = NULL;
+      }
   }
 
   dreturnvoid();
@@ -286,8 +285,8 @@ static int _GD_Delete(DIRFILE *restrict D, gd_entry_t *restrict E,
   }
 
   /* gather a list of fields */
-  del_list = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) *
-        (((E->e->n_meta == -1) ?  0 : E->e->n_meta) + 1));
+  del_list = _GD_Malloc(D, sizeof(*del_list) * (((E->e->n_meta == -1) ? 0 :
+          E->e->n_meta) + 1));
 
   if (del_list == NULL) {
     dreturn("%i", -1);
@@ -300,15 +299,17 @@ static int _GD_Delete(DIRFILE *restrict D, gd_entry_t *restrict E,
   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 */
+  /* Check for clients, derived fields, and inbound aliases */
   if (~flags & GD_DEL_FORCE)
     for (j = 0; j < D->n_entries; ++j)
       for (i = 0; i < n_del; ++i) {
         if ((del_list[i]->field_type == GD_CONST_ENTRY ||
               del_list[i]->field_type == GD_CARRAY_ENTRY) &&
             ~flags & GD_DEL_DEREF)
+        {
           _GD_DeReference(D, D->entry[j], del_list[i], 1);
-        else if (del_list[i]->field_type != GD_STRING_ENTRY)
+        }
+        if (!D->error)
           _GD_ClearDerived(D, D->entry[j], del_list[i], 1);
 
         if (D->error) {
@@ -319,50 +320,55 @@ static int _GD_Delete(DIRFILE *restrict D, gd_entry_t *restrict E,
       }
 
   /* 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);
+  if (E->field_type == GD_RAW_ENTRY) {
+    /* close data file, if open */
+    if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD)) {
       free(del_list);
       dreturn("%i", -1);
       return -1;
     }
 
-    if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_UNLINK)) {
-      free(del_list);
-      dreturn("%i", -1);
-      return -1;
-    }
+    if (flags & GD_DEL_DATA) {
+      /* check protection */
+      if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) {
+        _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+            D->fragment[E->fragment_index].cname);
+        free(del_list);
+        dreturn("%i", -1);
+        return -1;
+      }
 
-    if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
-          (const char*)D->fragment[E->fragment_index].enc_data,
-          E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
-    {
-      free(del_list);
-      dreturn("%i", -1);
-      return -1;
-    }
+      if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_UNLINK)) {
+        free(del_list);
+        dreturn("%i", -1);
+        return -1;
+      }
 
-    if ((*gd_ef_[E->e->u.raw.file[0].subenc].unlink)(
-          D->fragment[E->fragment_index].dirfd, 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->idata >= 0) {
-    if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD)) {
-      free(del_list);
-      dreturn("%i", -1);
-      return -1;
+      if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D,
+            (const char*)D->fragment[E->fragment_index].enc_data,
+            E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
+      {
+        free(del_list);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      if ((*_GD_ef[E->e->u.raw.file[0].subenc].unlink)(
+            D->fragment[E->fragment_index].dirfd, E->e->u.raw.file))
+      {
+        if (errno != ENOENT) {
+          _GD_SetEncIOError(D, GD_E_IO_UNLINK, E->e->u.raw.file + 0);
+          free(del_list);
+          dreturn("%i", -1);
+          return -1;
+        }
+      }
     }
   }
 
   /* Fix up reference fields */
   if (E->field_type == GD_RAW_ENTRY) {
-    new_ref = (char **)_GD_Malloc(D, sizeof(char*) * D->n_fragment);
+    new_ref = _GD_Malloc(D, sizeof(*new_ref) * D->n_fragment);
     if (new_ref == NULL) {
       free(del_list);
       dreturn("%i", -1);
@@ -483,42 +489,7 @@ static int _GD_Delete(DIRFILE *restrict D, gd_entry_t *restrict E,
   return 0;
 }
 
-int gd_delete(DIRFILE *D, const char *field_code_in, unsigned int flags)
-{
-  unsigned index;
-  int repr, ret;
-  char *field_code;
-  gd_entry_t *E;
-
-  dtrace("%p, \"%s\", 0x%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;
-  }
-
-  _GD_ClearError(D);
-
-  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, &index, 1, 1);
-
-  if (field_code != field_code_in)
-    free(field_code);
-
-  if (D->error) {
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  ret = _GD_Delete(D, E, index, flags);
-
-  dreturn("%i", ret);
-  return ret;
-}
-
-
-int gd_delete_alias(DIRFILE *D, const char *field_code, unsigned int flags)
-  gd_nothrow
+int gd_delete(DIRFILE *D, const char *field_code, unsigned int flags)
 {
   unsigned index;
   int ret;
@@ -526,7 +497,7 @@ int gd_delete_alias(DIRFILE *D, const char *field_code, unsigned int flags)
 
   dtrace("%p, \"%s\", 0x%X", D, field_code, flags);
 
-  if (D->flags & GD_INVALID) {
+  if (D->flags & GD_INVALID) {/* don't crash */
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
     dreturn("%i", -1);
     return -1;
@@ -536,14 +507,7 @@ int gd_delete_alias(DIRFILE *D, const char *field_code, unsigned int flags)
 
   E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, &index);
 
-  if (!E) {
-    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  if (E->field_type != GD_ALIAS_ENTRY) {
-    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+  if (D->error) {
     dreturn("%i", -1);
     return -1;
   }
diff --git a/src/encoding.c b/src/encoding.c
index 5d7f8d7..fa6852e 100644
--- a/src/encoding.c
+++ b/src/encoding.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -28,14 +28,19 @@
 static pthread_mutex_t gd_mutex_ = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
+#ifdef HAVE_LTDL_H
+#include <ltdl.h>
+#endif
+
 static int framework_initialised = 0;
 #endif
 
 /* encoding schemas */
 #define GD_EF_NULL_SET NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \
-  NULL
+  NULL, NULL
 #define GD_EF_GENERIC_SET &_GD_GenericName, NULL, NULL, NULL, NULL, NULL, \
-  NULL, NULL, &_GD_GenericMove, &_GD_GenericUnlink
+  NULL, NULL, &_GD_GenericMove, &_GD_GenericUnlink, NULL
+
 #ifdef USE_MODULES
 #define GD_EXT_ENCODING_NULL(sc,ex,ec,af,ff) \
 { sc,ex,ec,af,ff,GD_EF_PROVIDES,GD_EF_NULL_SET }
@@ -46,21 +51,21 @@ static int framework_initialised = 0;
 #define GD_EXT_ENCODING_NULL GD_EXT_ENCODING
 #define GD_EXT_ENCODING_GEN GD_EXT_ENCODING
 #endif
-struct encoding_t gd_ef_[GD_N_SUBENCODINGS] = {
+struct encoding_t _GD_ef[GD_N_SUBENCODINGS] = {
   { GD_UNENCODED, "", GD_EF_ECOR, NULL, "none", 0,
     &_GD_GenericName, &_GD_RawOpen, &_GD_RawClose, &_GD_RawSeek, &_GD_RawRead,
     &_GD_RawSize, &_GD_RawWrite, &_GD_RawSync, &_GD_GenericMove,
-    &_GD_GenericUnlink
+    &_GD_GenericUnlink, NULL /* strerr */
   },
 
 #ifdef USE_GZIP
 #define GD_EF_PROVIDES \
   GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \
-  GD_EF_WRITE | GD_EF_SYNC
+  GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR
 #define GD_INT_FUNCS \
   &_GD_GenericName, &_GD_GzipOpen, &_GD_GzipClose, &_GD_GzipSeek, \
   &_GD_GzipRead, &_GD_GzipSize, &_GD_GzipWrite, &_GD_GzipSync, \
-  &_GD_GenericMove, &_GD_GenericUnlink
+  &_GD_GenericMove, &_GD_GenericUnlink, &_GD_GzipStrerr
 #else
 #define GD_EF_PROVIDES 0
 #define GD_INT_FUNCS GD_EF_NULL_SET
@@ -73,27 +78,29 @@ struct encoding_t gd_ef_[GD_N_SUBENCODINGS] = {
 
 #ifdef USE_BZIP2
 #define GD_EF_PROVIDES \
-    GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+  GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \
+  GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR
 #define GD_INT_FUNCS \
   &_GD_GenericName, &_GD_Bzip2Open, &_GD_Bzip2Close, &_GD_Bzip2Seek, \
-  &_GD_Bzip2Read, &_GD_Bzip2Size, NULL /* WRITE */, NULL /* SYNC */, \
-  &_GD_GenericMove, &_GD_GenericUnlink
+  &_GD_Bzip2Read, &_GD_Bzip2Size, &_GD_Bzip2Write, &_GD_Bzip2Sync, \
+  &_GD_GenericMove, &_GD_GenericUnlink, &_GD_Bzip2Strerr
 #else
 #define GD_INT_FUNCS GD_EF_NULL_SET
 #define GD_EF_PROVIDES 0
 #endif
-  GD_EXT_ENCODING_GEN(GD_BZIP2_ENCODED, ".bz2", GD_EF_ECOR, "Bzip2", "bzip2"),
+  GD_EXT_ENCODING_GEN(GD_BZIP2_ENCODED, ".bz2", GD_EF_ECOR | GD_EF_OOP, "Bzip2",
+      "bzip2"),
 #undef GD_INT_FUNCS
 #undef GD_EF_PROVIDES
 
 
 #ifdef USE_SLIM
 #define GD_EF_PROVIDES \
-  GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+  GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | GD_EF_STRERR
 #define GD_INT_FUNCS \
   &_GD_GenericName, &_GD_SlimOpen, &_GD_SlimClose, &_GD_SlimSeek, \
   &_GD_SlimRead, &_GD_SlimSize, NULL /* WRITE */, NULL /* SYNC */, \
-  &_GD_GenericMove, &_GD_GenericUnlink
+  &_GD_GenericMove, &_GD_GenericUnlink, &_GD_SlimStrerr
 #else
 #define GD_INT_FUNCS GD_EF_NULL_SET
 #define GD_EF_PROVIDES 0
@@ -103,18 +110,35 @@ struct encoding_t gd_ef_[GD_N_SUBENCODINGS] = {
 #undef GD_EF_PROVIDES
 
 
+/* We only provide write support for .xz files, not .lzma */
+#ifdef USE_LZMA
+#define GD_EF_PROVIDES \
+  GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \
+  GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR
+#define GD_INT_FUNCS \
+  &_GD_GenericName, &_GD_LzmaOpen, &_GD_LzmaClose, &_GD_LzmaSeek, \
+  &_GD_LzmaRead, &_GD_LzmaSize, &_GD_LzmaWrite, &_GD_LzmaSync, \
+  &_GD_GenericMove, &_GD_GenericUnlink, &_GD_LzmaStrerr
+#else
+#define GD_INT_FUNCS GD_EF_NULL_SET
+#define GD_EF_PROVIDES 0
+#endif
+  GD_EXT_ENCODING_GEN(GD_LZMA_ENCODED, ".xz", GD_EF_ECOR | GD_EF_OOP, "Lzma",
+      "lzma"),
+#undef GD_INT_FUNCS
+#undef GD_EF_PROVIDES
+
 #ifdef USE_LZMA
 #define GD_EF_PROVIDES \
-    GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+  GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | GD_EF_STRERR
 #define GD_INT_FUNCS \
   &_GD_GenericName, &_GD_LzmaOpen, &_GD_LzmaClose, &_GD_LzmaSeek, \
   &_GD_LzmaRead, &_GD_LzmaSize, NULL /* WRITE */, NULL /* SYNC */, \
-  &_GD_GenericMove, &_GD_GenericUnlink
+  &_GD_GenericMove, &_GD_GenericUnlink, &_GD_LzmaStrerr
 #else
 #define GD_INT_FUNCS GD_EF_NULL_SET
 #define GD_EF_PROVIDES 0
 #endif
-  GD_EXT_ENCODING_GEN(GD_LZMA_ENCODED, ".xz", GD_EF_ECOR, "Lzma", "lzma"),
   GD_EXT_ENCODING_GEN(GD_LZMA_ENCODED, ".lzma", GD_EF_ECOR, "Lzma", "lzma"),
 #undef GD_INT_FUNCS
 #undef GD_EF_PROVIDES
@@ -123,25 +147,26 @@ struct encoding_t gd_ef_[GD_N_SUBENCODINGS] = {
   { GD_TEXT_ENCODED, ".txt", 0, NULL, "text", 0,
     &_GD_GenericName, &_GD_AsciiOpen, &_GD_AsciiClose, &_GD_AsciiSeek,
     &_GD_AsciiRead, &_GD_AsciiSize, &_GD_AsciiWrite, &_GD_AsciiSync,
-    &_GD_GenericMove, &_GD_GenericUnlink
+    &_GD_GenericMove, &_GD_GenericUnlink, NULL /* strerr */
   },
 
   { GD_SIE_ENCODED, ".sie", GD_EF_ECOR | GD_EF_SWAP, NULL, "sie", 0,
     &_GD_GenericName, &_GD_SampIndOpen, &_GD_SampIndClose, &_GD_SampIndSeek,
     &_GD_SampIndRead, &_GD_SampIndSize, &_GD_SampIndWrite, &_GD_SampIndSync,
-    &_GD_GenericMove, &_GD_GenericUnlink
+    &_GD_GenericMove, &_GD_GenericUnlink, NULL /* strerr */
   },
 
 
 #ifdef USE_ZZIP
 #define GD_EF_PROVIDES \
-    GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+  GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | \
+  GD_EF_SIZE | GD_EF_STRERR
 #define GD_INT_FUNCS \
   &_GD_ZzipName, &_GD_ZzipOpen, &_GD_ZzipClose, &_GD_ZzipSeek, &_GD_ZzipRead, \
   &_GD_ZzipSize, NULL /* WRITE */, NULL /* SYNC */, NULL /* MOVE */, \
-  NULL /* UNLINK */
+  NULL /* UNLINK */, &_GD_ZzipStrerr
 #else
-#define GD_INT_FUNCS NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+#define GD_INT_FUNCS GD_EF_NULL_SET
 #define GD_EF_PROVIDES 0
 #endif
   GD_EXT_ENCODING_NULL(GD_ZZIP_ENCODED, NULL, GD_EF_ECOR | GD_EF_EDAT, "Zzip",
@@ -152,13 +177,14 @@ struct encoding_t gd_ef_[GD_N_SUBENCODINGS] = {
 
 #ifdef USE_ZZSLIM
 #define GD_EF_PROVIDES \
-    GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+  GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | \
+  GD_EF_SIZE | GD_EF_STRERR
 #define GD_INT_FUNCS \
   &_GD_ZzslimName, &_GD_ZzslimOpen, &_GD_ZzslimClose, &_GD_ZzslimSeek, \
   &_GD_ZzslimRead, &_GD_ZzslimSize, NULL /* WRITE */, NULL /* SYNC */, \
-  NULL /* MOVE */, NULL /* UNLINK */
+  NULL /* MOVE */, NULL /* UNLINK */, &_GD_ZzslimStrerr
 #else
-#define GD_INT_FUNCS NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+#define GD_INT_FUNCS GD_EF_NULL_SET
 #define GD_EF_PROVIDES 0
 #endif
   GD_EXT_ENCODING_NULL(GD_ZZSLIM_ENCODED, NULL, GD_EF_ECOR | GD_EF_EDAT,
@@ -167,24 +193,46 @@ struct encoding_t gd_ef_[GD_N_SUBENCODINGS] = {
 #undef GD_EF_PROVIDES
 
 
+#ifdef USE_FLAC
+#define GD_EF_PROVIDES \
+  GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \
+  GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR
+#define GD_INT_FUNCS \
+  &_GD_GenericName, &_GD_FlacOpen, &_GD_FlacClose, &_GD_FlacSeek, \
+  &_GD_FlacRead, &_GD_FlacSize, &_GD_FlacWrite, &_GD_FlacSync, \
+  &_GD_GenericMove, &_GD_GenericUnlink, &_GD_FlacStrerr
+#else
+#define GD_INT_FUNCS GD_EF_NULL_SET
+#define GD_EF_PROVIDES 0
+#endif
+  GD_EXT_ENCODING_GEN(GD_FLAC_ENCODED, ".flac", GD_EF_ECOR | GD_EF_OOP, "Flac",
+      "flac"),
+#undef GD_INT_FUNCS
+#undef GD_EF_PROVIDES
+
+
   { GD_ENC_UNSUPPORTED, NULL, 0, "", "", 0,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+    NULL, 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();
-  }
+    pthread_mutex_lock(&gd_mutex_);
+#endif
+    /* check again */
+    if (!framework_initialised) {
+      framework_initialised = 1;
+      lt_dlinit();
+    }
 #ifdef USE_PTHREAD
-  pthread_mutex_unlock(&gd_mutex_);
+    pthread_mutex_unlock(&gd_mutex_);
+  }
 #endif
 #endif
   dreturnvoid();
@@ -194,7 +242,8 @@ void _GD_InitialiseFramework(void)
   ((encoding == GD_UNENCODED || encoding == GD_SLIM_ENCODED || \
     encoding == GD_GZIP_ENCODED || encoding == GD_BZIP2_ENCODED || \
     encoding == GD_TEXT_ENCODED || encoding == GD_LZMA_ENCODED || \
-    encoding == GD_SIE_ENCODED))
+    encoding == GD_SIE_ENCODED || encoding == GD_ZZIP_ENCODED || \
+    encoding == GD_ZZSLIM_ENCODED || encoding == GD_FLAC_ENCODED))
 
 #ifdef USE_MODULES
 static void *_GD_ResolveSymbol(lt_dlhandle lib, struct encoding_t *restrict enc,
@@ -205,8 +254,8 @@ static void *_GD_ResolveSymbol(lt_dlhandle lib, struct encoding_t *restrict enc,
 
   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';
+  sprintf(symbol, "lt_libgetdata%s_LTX_GD_%s%s", enc->affix, enc->affix, name);
+  symbol[13] -= 'A' - 'a';
   func = lt_dlsym(lib, symbol);
 
   dreturn("%p", func);
@@ -214,6 +263,7 @@ static void *_GD_ResolveSymbol(lt_dlhandle lib, struct encoding_t *restrict enc,
 }
 #endif
 
+#define GETDATA_MODULEPREFIX GETDATA_MODULEDIR "/libgetdata"
 int _GD_MissingFramework(int encoding, unsigned int funcs)
 {
   int ret;
@@ -226,15 +276,15 @@ int _GD_MissingFramework(int encoding, unsigned int funcs)
 #endif
 
   /* set up the encoding library if required */
-  if (gd_ef_[encoding].provides) {
+  if (_GD_ef[encoding].provides) {
     char *library;
     lt_dlhandle lib;
 
     /* make the library name */
     library = (char *)malloc(sizeof(GETDATA_MODULEDIR) +
-        strlen(gd_ef_[encoding].affix) + sizeof(PACKAGE_VERSION) + 13);
+        strlen(_GD_ef[encoding].affix) + sizeof(PACKAGE_VERSION) + 13);
     if (!library) {
-      gd_ef_[encoding].provides = 0;
+      _GD_ef[encoding].provides = 0;
 #ifdef USE_PTHREAD
       pthread_mutex_unlock(&gd_mutex_);
 #endif
@@ -242,9 +292,12 @@ int _GD_MissingFramework(int encoding, unsigned int funcs)
       return 1;
     }
 
-    strcat(strcat(strcpy(library, GETDATA_MODULEDIR "/libgetdata"),
-          gd_ef_[encoding].affix), "-" PACKAGE_VERSION);
-    library[sizeof(GETDATA_MODULEDIR) + 10] -= 'A' - 'a';
+    sprintf(library, GETDATA_MODULEPREFIX "%s-" PACKAGE_VERSION,
+        _GD_ef[encoding].affix);
+
+    /* affix starts with a capital letter, we need to lowercasify it --
+     * also, sizeof includes the trailing NUL in its count */
+    library[sizeof(GETDATA_MODULEPREFIX) - 1] -= 'A' - 'a';
 
     /* open */
     if ((lib = lt_dlopenext(library)) == NULL) {
@@ -252,7 +305,7 @@ int _GD_MissingFramework(int encoding, unsigned int funcs)
       if ((lib = lt_dlopenext(library + sizeof(GETDATA_MODULEDIR))) == NULL)
       {
         free(library);
-        gd_ef_[encoding].provides = 0;
+        _GD_ef[encoding].provides = 0;
 #ifdef USE_PTHREAD
         pthread_mutex_unlock(&gd_mutex_);
 #endif
@@ -263,36 +316,36 @@ int _GD_MissingFramework(int encoding, unsigned int funcs)
     free(library);
 
     /* Try to resolve the symbols */
-    if (gd_ef_[encoding].provides & GD_EF_NAME)
-      gd_ef_[encoding].name = (gd_ef_name_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Name");
-    if (gd_ef_[encoding].provides & GD_EF_OPEN)
-      gd_ef_[encoding].open = (gd_ef_open_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Open");
-    if (gd_ef_[encoding].provides & GD_EF_CLOSE)
-      gd_ef_[encoding].close = (gd_ef_close_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Close");
-    if (gd_ef_[encoding].provides & GD_EF_SEEK)
-      gd_ef_[encoding].seek = (gd_ef_seek_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Seek");
-    if (gd_ef_[encoding].provides & GD_EF_READ)
-      gd_ef_[encoding].read = (gd_ef_read_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Read");
-    if (gd_ef_[encoding].provides & GD_EF_SIZE)
-      gd_ef_[encoding].size = (gd_ef_size_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Size");
-    if (gd_ef_[encoding].provides & GD_EF_WRITE)
-      gd_ef_[encoding].write = (gd_ef_write_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Write");
-    if (gd_ef_[encoding].provides & GD_EF_SYNC)
-      gd_ef_[encoding].sync = (gd_ef_sync_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Sync");
-    if (gd_ef_[encoding].provides & GD_EF_UNLINK)
-      gd_ef_[encoding].unlink = (gd_ef_unlink_t)_GD_ResolveSymbol(lib,
-          gd_ef_ + encoding, "Unlink");
+    if (_GD_ef[encoding].provides & GD_EF_NAME)
+      _GD_ef[encoding].name = (gd_ef_name_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Name");
+    if (_GD_ef[encoding].provides & GD_EF_OPEN)
+      _GD_ef[encoding].open = (gd_ef_open_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Open");
+    if (_GD_ef[encoding].provides & GD_EF_CLOSE)
+      _GD_ef[encoding].close = (gd_ef_close_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Close");
+    if (_GD_ef[encoding].provides & GD_EF_SEEK)
+      _GD_ef[encoding].seek = (gd_ef_seek_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Seek");
+    if (_GD_ef[encoding].provides & GD_EF_READ)
+      _GD_ef[encoding].read = (gd_ef_read_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Read");
+    if (_GD_ef[encoding].provides & GD_EF_SIZE)
+      _GD_ef[encoding].size = (gd_ef_size_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Size");
+    if (_GD_ef[encoding].provides & GD_EF_WRITE)
+      _GD_ef[encoding].write = (gd_ef_write_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Write");
+    if (_GD_ef[encoding].provides & GD_EF_SYNC)
+      _GD_ef[encoding].sync = (gd_ef_sync_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Sync");
+    if (_GD_ef[encoding].provides & GD_EF_UNLINK)
+      _GD_ef[encoding].unlink = (gd_ef_unlink_t)_GD_ResolveSymbol(lib,
+          _GD_ef + encoding, "Unlink");
 
     /* we tried our best, don't bother trying again */
-    gd_ef_[encoding].provides = 0;
+    _GD_ef[encoding].provides = 0;
   }
 #ifdef USE_PTHREAD
   pthread_mutex_unlock(&gd_mutex_);
@@ -300,15 +353,16 @@ int _GD_MissingFramework(int encoding, unsigned int funcs)
 #endif
 
   ret =
-    (funcs & GD_EF_NAME    && gd_ef_[encoding].name    == NULL) ||
-    (funcs & GD_EF_OPEN    && gd_ef_[encoding].open    == NULL) ||
-    (funcs & GD_EF_CLOSE   && gd_ef_[encoding].close   == NULL) ||
-    (funcs & GD_EF_SEEK    && gd_ef_[encoding].seek    == NULL) ||
-    (funcs & GD_EF_READ    && gd_ef_[encoding].read    == NULL) ||
-    (funcs & GD_EF_SIZE    && gd_ef_[encoding].size    == NULL) ||
-    (funcs & GD_EF_WRITE   && gd_ef_[encoding].write   == NULL) ||
-    (funcs & GD_EF_SYNC    && gd_ef_[encoding].sync    == NULL) ||
-    (funcs & GD_EF_UNLINK  && gd_ef_[encoding].unlink  == NULL);
+    (funcs & GD_EF_NAME    && _GD_ef[encoding].name    == NULL) ||
+    (funcs & GD_EF_OPEN    && _GD_ef[encoding].open    == NULL) ||
+    (funcs & GD_EF_CLOSE   && _GD_ef[encoding].close   == NULL) ||
+    (funcs & GD_EF_SEEK    && _GD_ef[encoding].seek    == NULL) ||
+    (funcs & GD_EF_READ    && _GD_ef[encoding].read    == NULL) ||
+    (funcs & GD_EF_SIZE    && _GD_ef[encoding].size    == NULL) ||
+    (funcs & GD_EF_WRITE   && _GD_ef[encoding].write   == NULL) ||
+    (funcs & GD_EF_SYNC    && _GD_ef[encoding].sync    == NULL) ||
+    (funcs & GD_EF_UNLINK  && _GD_ef[encoding].unlink  == NULL) ||
+    (funcs & GD_EF_STRERR  && _GD_ef[encoding].strerr  == NULL);
 
   dreturn("%i", ret);
   return ret;
@@ -321,13 +375,18 @@ static int _GD_MoveOver(DIRFILE *restrict D, int fragment,
 #ifdef HAVE_FCHMOD
   int fd;
   struct stat stat_buf;
-  mode_t mode;
+  mode_t mode, tmode;
 #endif
   dtrace("%p, %i, %p", D, fragment, file);
 
 #ifdef HAVE_FCHMOD
+  if (gd_StatAt(D, dirfd, file[1].name, &stat_buf, 0))
+    tmode = 0644;
+  else
+    tmode = stat_buf.st_mode;
+
   if (gd_StatAt(D, dirfd, file[0].name, &stat_buf, 0))
-    mode = 0644;
+    mode = tmode;
   else
     mode = stat_buf.st_mode;
 #endif
@@ -339,16 +398,19 @@ static int _GD_MoveOver(DIRFILE *restrict D, int fragment,
       file[1].name = NULL;
     }
     errno = move_errno;
-    _GD_SetError(D, GD_E_UNCLEAN_DB, 0, D->fragment[fragment].cname, 0, NULL);
+    _GD_SetError(D, GD_E_UNCLEAN_DB, GD_E_UNCLEAN_CALL,
+        D->fragment[fragment].cname, 0, "gd_RenameAt");
     D->flags |= GD_INVALID;
     dreturn("%i", -1);
     return -1;
   }
 
 #ifdef HAVE_FCHMOD
-  fd = gd_OpenAt(file->D, dirfd, file[0].name, O_RDONLY, 0666);
-  fchmod(fd, mode);
-  close(fd);
+  if (tmode != mode) {
+    fd = gd_OpenAt(file->D, dirfd, file[0].name, O_RDONLY, 0666);
+    fchmod(fd, mode);
+    close(fd);
+  }
 #endif
 
   dreturn("%i", 0);
@@ -361,7 +423,7 @@ int _GD_FiniRawIO(DIRFILE *D, const gd_entry_t *E, int fragment, int flags)
 {
   const int clotemp = (flags & GD_FINIRAW_CLOTEMP) ? 1 : 0;
   const int old_mode = E->e->u.raw.file[0].mode;
-  const int oop_write = ((gd_ef_[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP)
+  const int oop_write = ((_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP)
       && (old_mode & GD_FILE_WRITE)) ? 1 : 0;
   dtrace("%p, %p, %i, 0x%X", D, E, fragment, flags);
 
@@ -372,32 +434,40 @@ int _GD_FiniRawIO(DIRFILE *D, const gd_entry_t *E, int fragment, int flags)
     if (oop_write && E->e->u.raw.file[1].idata >= 0) {
       if (E->e->u.raw.file[0].idata >= 0) {
         /* copy the rest of the input to the output */
-        char buffer[GD_BUFFER_SIZE];
+        char *buffer;
         int n_read, n_wrote, n_to_write;
 
+        buffer = _GD_Malloc(D, GD_BUFFER_SIZE);
+        if (buffer == NULL) {
+          dreturn("%i", -1);
+          return -1;
+        }
+
         do {
-          n_to_write = n_read = (*gd_ef_[E->e->u.raw.file[0].subenc].read)(
+          n_to_write = n_read = (*_GD_ef[E->e->u.raw.file[0].subenc].read)(
               E->e->u.raw.file, buffer, E->EN(raw,data_type), GD_BUFFER_SIZE);
           if (n_read < 0) {
-            _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
-                NULL);
+            free(buffer);
+            _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0);
             dreturn("%i", -1);
             return -1;
           } else while (n_to_write > 0) {
-            n_wrote = (*gd_ef_[E->e->u.raw.file[0].subenc].write)(
+            n_wrote = (*_GD_ef[E->e->u.raw.file[0].subenc].write)(
                 E->e->u.raw.file + 1, buffer, E->EN(raw,data_type), n_to_write);
             if (n_wrote < 0) {
-              _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
-                  NULL);
+              free(buffer);
+              _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0);
               dreturn("%i", -1);
               return -1;
             }
             n_to_write -= n_wrote;
           }
         } while (n_read == GD_BUFFER_SIZE);
+
+        free(buffer);
       }
 
-      if ((*gd_ef_[E->e->u.raw.file[0].subenc].close)(E->e->u.raw.file + 1)) {
+      if ((*_GD_ef[E->e->u.raw.file[0].subenc].close)(E->e->u.raw.file + 1)) {
         dreturn("%i", -1);
         return -1;
       }
@@ -405,12 +475,11 @@ int _GD_FiniRawIO(DIRFILE *D, const gd_entry_t *E, int fragment, int flags)
 
     /* close the file */
     if ((E->e->u.raw.file[clotemp].idata >= 0) &&
-      (*gd_ef_[E->e->u.raw.file[clotemp].subenc].close)(E->e->u.raw.file +
+      (*_GD_ef[E->e->u.raw.file[clotemp].subenc].close)(E->e->u.raw.file +
           clotemp))
     {
       if (D->error == GD_E_OK)
-        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[clotemp].name, errno,
-            NULL);
+        _GD_SetEncIOError(D, GD_E_IO_CLOSE, E->e->u.raw.file + clotemp);
       dreturn("%i", 1);
       return 1;
     }
@@ -430,8 +499,7 @@ int _GD_FiniRawIO(DIRFILE *D, const gd_entry_t *E, int fragment, int flags)
             0))
       {
         if (D->error == GD_E_OK)
-          _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
-              NULL);
+          _GD_SetEncIOError(D, GD_E_IO_UNLINK, E->e->u.raw.file + 1);
         dreturn("%i", -1);
         return -1;
       }
@@ -486,7 +554,6 @@ int _GD_InitRawIO(DIRFILE *D, const gd_entry_t *E, const char *filebase,
     int fragment, const struct encoding_t *enc, unsigned int funcs,
     unsigned int mode, int swap)
 {
-  int temp_fd = -1;
   const int touch = mode & GD_FILE_TOUCH;
   int oop_write = 0;
 
@@ -504,7 +571,7 @@ int _GD_InitRawIO(DIRFILE *D, const gd_entry_t *E, const char *filebase,
       return 1;
     }
 
-    enc = gd_ef_ + E->e->u.raw.file[0].subenc;
+    enc = _GD_ef + E->e->u.raw.file[0].subenc;
     oop_write = ((enc->flags & GD_EF_OOP) && mode == GD_FILE_WRITE) ? 1 : 0;
 
     /* Do nothing, if possible */
@@ -538,67 +605,45 @@ int _GD_InitRawIO(DIRFILE *D, const gd_entry_t *E, const char *filebase,
   if (fragment == -1)
     fragment = E->fragment_index;
 
-  if (mode & GD_FILE_TEMP) {
+  if (oop_write || mode & GD_FILE_TEMP) {
     /* create temporary file in file[1] */
-    if ((*enc->name)(D, (const char*)D->fragment[E->fragment_index].enc_data,
+    if ((*enc->name)(D, (const char*)D->fragment[fragment].enc_data,
           E->e->u.raw.file + 1, filebase, 1, 0))
     {
       ; /* error already set */
-    } else if ((temp_fd = _GD_MakeTempFile(D, D->fragment[fragment].dirfd,
-            E->e->u.raw.file[1].name)) < 0)
-    {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
-    } else if ((*enc->open)(temp_fd, E->e->u.raw.file + 1, swap,
-          GD_FILE_WRITE | GD_FILE_TEMP))
-    {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
-    }
-
-    if (D->error) {
-      dreturn("%i", 1);
-      return 1;
-    }
-    dreturn("%i", 0);
-    return 0;
-  }
-
-  if (oop_write) {
-    /* an out-of-place write requires us to open a temporary file and pass
-     * in its fd */
-    if ((*enc->name)(D, (const char*)D->fragment[E->fragment_index].enc_data,
-          E->e->u.raw.file + 1, filebase, 1, 0))
-    {
       dreturn("%i", 1);
       return 1;
-    } else if ((temp_fd = _GD_MakeTempFile(D,
-            D->fragment[E->fragment_index].dirfd, E->e->u.raw.file[1].name))
-          < 0)
+    } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file + 1,
+          E->EN(raw,data_type), swap, GD_FILE_WRITE | GD_FILE_TEMP))
     {
-      dreturn("%i", 1);
-      return 1;
-    } else if ((*enc->open)(temp_fd, E->e->u.raw.file + 1, _GD_FileSwapBytes(D,
-            E->fragment_index), GD_FILE_WRITE)) {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      _GD_SetEncIOError(D, GD_E_IO_OPEN, E->e->u.raw.file + 1);
       dreturn("%i", 1);
       return 1;
     }
-    /* The read file in OOP mode is flagged as RW. */
-    mode = GD_FILE_RDWR;
+
+    if (oop_write) {
+      /* The read file in OOP mode is flagged as RW. */
+      mode = GD_FILE_RDWR;
+    } else {
+      /* Temp file creation complete */
+      dreturn("%i", 0);
+      return 0;
+    }
   }
 
   /* open a regular file, if necessary */
   if (E->e->u.raw.file[0].idata < 0) {
-    if ((*enc->name)(D, (const char*)D->fragment[E->fragment_index].enc_data,
+    if ((*enc->name)(D, (const char*)D->fragment[fragment].enc_data,
           E->e->u.raw.file, filebase, 0, 0))
     {
       dreturn("%i", 1);
       return 1;
-    } else if ((*enc->open)(D->fragment[E->fragment_index].dirfd,
-          E->e->u.raw.file, _GD_FileSwapBytes(D, E->fragment_index), mode))
+    } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file,
+          E->EN(raw,data_type), swap, mode))
     {
       /* In oop_write mode, it doesn't matter if the old file doesn't exist */
       if (!oop_write || errno != ENOENT) {
-        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+        _GD_SetEncIOError(D, GD_E_IO_OPEN, E->e->u.raw.file + 0);
         dreturn("%i", 1);
         return 1;
       }
@@ -607,7 +652,7 @@ int _GD_InitRawIO(DIRFILE *D, const gd_entry_t *E, const char *filebase,
   }
 
   if (touch)
-    _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP);
+    _GD_FiniRawIO(D, E, fragment, GD_FINIRAW_KEEP);
 
   dreturn("%i", 0);
   return 0;
@@ -626,19 +671,19 @@ static unsigned long _GD_ResolveEncoding(DIRFILE *restrict D,
   dtrace("%p, \"%s\", \"%s\", 0x%08lx, %i, %p", D, name, enc_data, scheme,
       dirfd, file);
 
-  for (i = 0; gd_ef_[i].scheme != GD_ENC_UNSUPPORTED; i++) {
-    if (scheme == GD_AUTO_ENCODED || scheme == gd_ef_[i].scheme) {
-      if (gd_ef_[i].ext) {
-        candidate = (char *)malloc(len + strlen(gd_ef_[i].ext) + 1);
+  for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) {
+    if (scheme == GD_AUTO_ENCODED || scheme == _GD_ef[i].scheme) {
+      if (_GD_ef[i].ext) {
+        candidate = (char *)malloc(len + strlen(_GD_ef[i].ext) + 1);
         if (!candidate)
           continue;
 
-        strcat(strcpy(candidate, name), gd_ef_[i].ext);
+        sprintf(candidate, "%s%s", name, _GD_ef[i].ext);
       } else {
         if (_GD_MissingFramework(i, GD_EF_NAME))
           continue;
 
-        if ((*gd_ef_[i].name)(D, enc_data, file, name, 0, 1))
+        if ((*_GD_ef[i].name)(D, enc_data, file, name, 0, 1))
           continue;
 
         candidate = file->name;
@@ -650,19 +695,19 @@ static unsigned long _GD_ResolveEncoding(DIRFILE *restrict D,
           if (file != NULL)
             file->subenc = i;
           free(candidate);
-          dreturn("%08lx", gd_ef_[i].scheme);
-          return gd_ef_[i].scheme;
+          dreturn("%08lx", _GD_ef[i].scheme);
+          return _GD_ef[i].scheme;
         }
       free(candidate);
     }
   }
 
   if (scheme != 0 && file != NULL) {
-    for (i = 0; gd_ef_[i].scheme != GD_ENC_UNSUPPORTED; i++)
-      if (scheme == gd_ef_[i].scheme) {
+    for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++)
+      if (scheme == _GD_ef[i].scheme) {
         file->subenc = i;
-        dreturn("0x%08lx", gd_ef_[i].scheme);
-        return gd_ef_[i].scheme;;
+        dreturn("0x%08lx", _GD_ef[i].scheme);
+        return _GD_ef[i].scheme;
       }
   }
 
@@ -716,15 +761,15 @@ int _GD_GenericName(DIRFILE *restrict D,
 
   if (file->name == NULL) {
     file->D = D;
-    file->name = (char *)_GD_Malloc(D, strlen(base) + (temp ? 8 :
-          strlen(gd_ef_[file->subenc].ext) + 1));
+    file->name = _GD_Malloc(D, strlen(base) + (temp ? 8 :
+          strlen(_GD_ef[file->subenc].ext) + 1));
     if (file->name == NULL) {
       dreturn("%i", -1);
       return -1;
     }
 
-    strcat(strcpy(file->name, base), temp ? "_XXXXXX" :
-        gd_ef_[file->subenc].ext);
+    sprintf(file->name, "%s%s", base,
+        temp ? "_XXXXXX" : _GD_ef[file->subenc].ext);
   }
 
   dreturn("%i (%s)", 0, file->name);
@@ -748,8 +793,7 @@ static void _GD_RecodeFragment(DIRFILE* D, unsigned long encoding, int fragment,
   }
 
   if (move && encoding != D->fragment[fragment].encoding) {
-    gd_entry_t **raw_entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) *
-        D->n_entries);
+    gd_entry_t **raw_entry = _GD_Malloc(D, sizeof(*raw_entry) * D->n_entries);
 
     if (raw_entry == NULL) {
       dreturnvoid();
@@ -793,7 +837,7 @@ static void _GD_RecodeFragment(DIRFILE* D, unsigned long encoding, int fragment,
         /* discard the old file */
         _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD);
 
-        if ((*gd_ef_[temp.subenc].name)(D,
+        if ((*_GD_ef[temp.subenc].name)(D,
               (const char*)D->fragment[raw_entry[i]->fragment_index].enc_data,
               raw_entry[i]->e->u.raw.file, raw_entry[i]->e->u.raw.filebase, 0,
               0))
@@ -805,7 +849,7 @@ static void _GD_RecodeFragment(DIRFILE* D, unsigned long encoding, int fragment,
         {
           raw_entry[i]->e->u.raw.file[0].name = temp.name;
           raw_entry[i]->e->u.raw.file[0].subenc = temp.subenc;
-        } else if ((*gd_ef_[temp.subenc].unlink)(D->fragment[fragment].dirfd,
+        } else if ((*_GD_ef[temp.subenc].unlink)(D->fragment[fragment].dirfd,
               &temp))
         {
           _GD_SetError(D, GD_E_UNCLEAN_DB, 0,
@@ -829,14 +873,8 @@ static void _GD_RecodeFragment(DIRFILE* D, unsigned long encoding, int fragment,
           D->entry[i]->field_type == GD_RAW_ENTRY)
       {
         /* close the old file */
-        if (D->entry[i]->e->u.raw.file[0].idata != -1 &&
-            (*gd_ef_[D->entry[i]->e->u.raw.file[0].subenc].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;
-        }
+        _GD_FiniRawIO(D, D->entry[i], fragment, GD_FINIRAW_KEEP);
+
         /* reset encoding subscheme. */
         D->entry[i]->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN;
 
@@ -947,6 +985,50 @@ unsigned long gd_encoding(DIRFILE* D, int fragment) gd_nothrow
   return reported_encoding;
 }
 
+/* report whether a particular encoding is supported */
+int gd_encoding_support(unsigned long encoding) gd_nothrow
+{
+  int i;
+
+  const unsigned int read_funcs = GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE |
+    GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE;
+  const unsigned int write_funcs = read_funcs | GD_EF_WRITE | GD_EF_SYNC |
+    GD_EF_MOVE | GD_EF_UNLINK;
+
+  dtrace("0x%lX", encoding);
+
+  /* make sure we have a valid encoding */
+  if (!_GD_EncodingUnderstood(encoding)) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* spin up ltdl if needed */
+  _GD_InitialiseFramework();
+
+  /* Loop through valid subencodings checking for write support */
+  for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++)
+    if (_GD_ef[i].scheme == encoding) {
+      if (!_GD_MissingFramework(i, write_funcs)) {
+        dreturn("%i", GD_RDWR);
+        return GD_RDWR;
+      }
+    }
+
+  /* No write support; try read support */
+  for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++)
+    if (_GD_ef[i].scheme == encoding) {
+      if (!_GD_MissingFramework(i, read_funcs)) {
+        dreturn("%i", GD_RDONLY);
+        return GD_RDONLY;
+      }
+    }
+
+  /* nope */
+  dreturn("%i", -1);
+  return -1;
+}
+
 /* This is basically the non-existant POSIX funcion mkstempat.  There are two
  * approaches we could take here:
  * 1) fchdir to dirfd, use mkstemp to grab a file descriptor; fchdir back to
diff --git a/src/endian.c b/src/endian.c
index 5f4dcff..96c6cdb 100644
--- a/src/endian.c
+++ b/src/endian.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,9 +63,9 @@ static void _GD_ByteSwapFragment(DIRFILE* D, unsigned long byte_sex,
           break;
 
         /* if the field's data type is one byte long, and no in-framework
-         * byte-swapping is required, do nothing */
+         * byte-swapping is performed, do nothing */
         if (D->entry[i]->e->u.raw.size == 1 &&
-            !(gd_ef_[D->entry[i]->e->u.raw.file[0].subenc].flags & GD_EF_SWAP))
+            !(_GD_ef[D->entry[i]->e->u.raw.file[0].subenc].flags & GD_EF_SWAP))
           continue;
 
         /* add this raw field to the list */
@@ -174,13 +174,10 @@ unsigned long gd_endianness(DIRFILE* D, int fragment) gd_nothrow
   return D->fragment[fragment].byte_sex;
 }
 
-void _GD_ArmEndianise(uint64_t* databuffer, int is_complex, size_t ns)
+static void _GD_ArmEndianise(uint64_t* databuffer, size_t ns)
 {
   uint64_t *p;
-  dtrace("%p, %i, %zi", databuffer, is_complex, ns);
-
-  if (is_complex)
-    ns *= 2;
+  dtrace("%p, %zi", databuffer, ns);
 
   for (p = databuffer; p < databuffer + ns; ++p)
     *p = ((*p & 0xffffffff) << 32) | ((*p & 0xffffffff00000000ULL) >> 32);
@@ -188,26 +185,153 @@ void _GD_ArmEndianise(uint64_t* databuffer, int is_complex, size_t ns)
   dreturnvoid();
 }
 
-void _GD_FixEndianness(void* databuffer, size_t size, size_t ns)
+/* determine byte sex flags for the machine endianness */
+#ifdef FLOATS_BIGENDIAN
+#define  GD_FLOAT_SEX     GD_BIG_ENDIAN
+#else
+#define  GD_FLOAT_SEX     GD_LITTLE_ENDIAN
+#endif
+
+#ifdef WORDS_BIGENDIAN
+#define  GD_INT_SEX     GD_BIG_ENDIAN
+#else
+#define  GD_INT_SEX     GD_LITTLE_ENDIAN
+#endif
+
+/* returns non-zero if sex1 and sex2 imply byte sex correction is required, and
+ * sets *arm_fix if middle-ended double correction is needed; returns 
+ */
+int _GD_CheckByteSex(gd_type_t type, unsigned sex1, unsigned sex2,
+    int skip_bytes, int *restrict arm_fix)
+{
+  int endian_fix = 0;
+
+  dtrace("0x%X, 0x%X, 0x%X, %p", type, sex1, sex2, arm_fix);
+
+  /* the trivial case */
+  if (GD_SIZE(type) < 1 || (skip_bytes && GD_SIZE(type) == 1)) {
+    if (arm_fix)
+      *arm_fix = 0;
+    dreturn("%i/%i", 0, 0);
+    return 0;
+  }
+
+  /* ensure we have exactly one of GD_BIG_ENDIAN or GD_LITTLE_ENDIAN set in
+   * both bitfields */
+  if (type & (GD_IEEE754 | GD_COMPLEX)) {
+    /* arm check */
+    if (arm_fix) {
+      if (type == GD_FLOAT64 || type == GD_COMPLEX128)
+        *arm_fix = ((sex1 & GD_ARM_FLAG) != (sex2 & GD_ARM_FLAG));
+      else
+        *arm_fix = 0;
+    }
+
+    switch (sex1 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) {
+      case 0:
+        sex1 |= GD_FLOAT_SEX;
+        break;
+      case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN:
+        sex1 &= ~GD_FLOAT_SEX;
+        break;
+      default:
+        break; /* bits are okay */
+    }
+    switch (sex2 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) {
+      case 0:
+        sex2 |= GD_FLOAT_SEX;
+        break;
+      case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN:
+        sex2 &= ~GD_FLOAT_SEX;
+        break;
+      default:
+        break; /* bits are okay */
+    }
+  } else {
+    if (arm_fix)
+      *arm_fix = 0;
+
+    switch (sex1 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) {
+      case 0:
+        sex1 |= GD_INT_SEX;
+        break;
+      case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN:
+        sex1 &= ~GD_INT_SEX;
+        break;
+      default:
+        break; /* bits are okay */
+    }
+    switch (sex2 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) {
+      case 0:
+        sex2 |= GD_INT_SEX;
+        break;
+      case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN:
+        sex2 &= ~GD_INT_SEX;
+        break;
+      default:
+        break; /* bits are okay */
+    }
+  }
+
+  /* endianness check */
+  endian_fix = ((sex1 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) != 
+    (sex2 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)));
+
+  dreturn("%i/%i", endian_fix, arm_fix ? *arm_fix : -1);
+  return endian_fix;
+}
+
+/* returns non-zero if the byte sex of RAW entry E is different than the native
+ * machine endianness */
+int _GD_FileSwapBytes(const DIRFILE *restrict D, const gd_entry_t *restrict E)
+{
+  int swap;
+
+  dtrace("%p, %p", D, E);
+
+  swap = _GD_CheckByteSex(E->EN(raw,data_type),
+      D->fragment[E->fragment_index].byte_sex, 0, 0, NULL);
+
+  dreturn("%i", swap);
+  return swap;
+}
+
+void _GD_FixEndianness(void* databuffer, size_t ns, gd_type_t type, unsigned
+    old_sex, unsigned new_sex)
 {
   size_t i;
+  int endian_fix, arm_fix;
+
+  dtrace("%p, %" PRNsize_t ", 0x%X, 0x%X, 0x%X", databuffer, ns, type, old_sex,
+      new_sex);
 
-  dtrace("%p, %zu, %" PRNsize_t, databuffer, size, ns);
-
-  switch (size) {
-    case 2:
-      for (i = 0; i < ns; ++i)
-        ((uint16_t*)databuffer)[i] = gd_swap16(((uint16_t*)databuffer)[i]);
-      break;
-    case 4:
-      for (i = 0; i < ns; ++i)
-        ((uint32_t*)databuffer)[i] = gd_swap32(((uint32_t*)databuffer)[i]);
-      break;
-    case 8:
-      for (i = 0; i < ns; ++i)
-        ((uint64_t*)databuffer)[i] = gd_swap64(((uint64_t*)databuffer)[i]);
-      break;
+  /* compare byte sexes */
+  endian_fix = _GD_CheckByteSex(type, old_sex, new_sex, 1, &arm_fix);
+  
+  /* complex data - treat as twice as many floating point */
+  if (type & GD_COMPLEX) {
+    ns *= 2;
+    type = (GD_SIZE(type) >> 1) | GD_IEEE754;
   }
 
+  if (arm_fix)
+    _GD_ArmEndianise(databuffer, ns);
+
+  if (endian_fix)
+    switch (GD_SIZE(type)) {
+      case 2:
+        for (i = 0; i < ns; ++i)
+          ((uint16_t*)databuffer)[i] = gd_swap16(((uint16_t*)databuffer)[i]);
+        break;
+      case 4:
+        for (i = 0; i < ns; ++i)
+          ((uint32_t*)databuffer)[i] = gd_swap32(((uint32_t*)databuffer)[i]);
+        break;
+      case 8:
+        for (i = 0; i < ns; ++i)
+          ((uint64_t*)databuffer)[i] = gd_swap64(((uint64_t*)databuffer)[i]);
+        break;
+    }
+
   dreturnvoid();
 }
diff --git a/src/entry.c b/src/entry.c
index 316a47a..cec07be 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2013, 2015 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,8 @@ void _GD_FreeE(DIRFILE *restrict D, gd_entry_t *restrict entry, int priv)
           _GD_ReleaseDir(D, entry->e->u.linterp.table_dirfd);
         free(entry->e->u.linterp.table_file);
         free(entry->e->u.linterp.lut);
-      }
+      } else
+        entry->EN(linterp,table) = NULL;
       break;
     case GD_DIVIDE_ENTRY:
     case GD_MULTIPLY_ENTRY:
@@ -102,12 +103,12 @@ void _GD_FreeE(DIRFILE *restrict D, gd_entry_t *restrict entry, int priv)
       free(entry->in_fields[0]);
       free(entry->in_fields[1]);
       break;
+    case GD_ALIAS_ENTRY:
+      free(entry->in_fields[0]);
+      break;
     case GD_INDEX_ENTRY:
     case GD_NO_ENTRY:
       break;
-    default:
-      if (entry->field_type == GD_ALIAS_ENTRY)
-        free(entry->in_fields[0]);
   }
 
   if (priv) {
@@ -116,14 +117,21 @@ void _GD_FreeE(DIRFILE *restrict D, gd_entry_t *restrict entry, int priv)
       free(entry->e->entry_list[i]);
     free(entry->e->string_value_list);
     free(entry->e->const_value_list);
-    if (entry->e->carray_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);
+      free(entry->e->carray_value_list);
+    }
+
     if (entry->e->n_meta > -1)
       free(entry->e->p.meta_entry);
     free(entry->e);
     free(entry);
+  } else {
+    entry->field = NULL;
+    memset(entry->in_fields, 0, sizeof(char*) * GD_MAX_LINCOM);
+    memset(entry->scalar, 0, sizeof(char*) * GD_MAX_LINCOM * 2);
   }
 
   dreturnvoid();
@@ -140,12 +148,12 @@ gd_entry_t* gd_free_entry_strings(gd_entry_t* entry) gd_nothrow
   return entry;
 }
 
-static void _GD_GetScalar(DIRFILE *restrict D, gd_entry_t *restrict E, int i,
+static int _GD_GetScalar(DIRFILE *restrict D, gd_entry_t *restrict E, int i,
     gd_type_t type, void *restrict data, int err)
 {
   void *ptr = NULL;
   gd_entry_t* C = NULL;
-  int repr;
+  int repr, e = 0;
   char* field_code;
   const char* scalar = E->scalar[i];
   int index = E->scalar_ind[i];
@@ -156,20 +164,22 @@ static void _GD_GetScalar(DIRFILE *restrict D, gd_entry_t *restrict E, int i,
     C = _GD_FindFieldAndRepr(D, scalar, &field_code, &repr, NULL, 0, 1);
 
     if (D->error) {
-      dreturnvoid();
-      return;
+      dreturn("%i", 1);
+      return 1;
     }
 
     if (C == NULL) {
       if (err)
         _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_CODE, E->field, 0,
             field_code);
+      e = 1;
     } else if (C->field_type != GD_CONST_ENTRY &&
         C->field_type != GD_CARRAY_ENTRY)
     {
       if (err)
         _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_TYPE, E->field, 0,
             field_code);
+      e = 1;
     } else {
       if (C->field_type == GD_CONST_ENTRY) {
         index = 0;
@@ -183,9 +193,7 @@ static void _GD_GetScalar(DIRFILE *restrict D, gd_entry_t *restrict E, int i,
         ptr = _GD_Realloc(D, C->e->u.scalar.client,
             (C->e->u.scalar.n_client + 1) * sizeof(gd_entry_t*));
 
-      /* err = 0 means we're only interested in initialising the client list */
-      if (err)
-        _GD_DoField(D, C, repr, index, 1, type, data);
+      _GD_DoField(D, C, repr, index, 1, type, data);
 
       if (ptr) {
         C->e->u.scalar.client = (gd_entry_t **)ptr;
@@ -197,84 +205,99 @@ static void _GD_GetScalar(DIRFILE *restrict D, gd_entry_t *restrict E, int i,
       free(field_code);
   }
 
-  dreturnvoid();
+  dreturn("%i", e);
+  return e;
 }
 
 /* resolve non-literal scalars */
 int _GD_CalculateEntry(DIRFILE *restrict D, gd_entry_t *restrict E, int err)
 {
-  int i;
+  int i, e = 0, cs = 0;
 
   dtrace("%p, %p, %i", D, E, err);
 
   switch(E->field_type) {
     case GD_RAW_ENTRY:
-      _GD_GetScalar(D, E, 0, GD_UINT_TYPE, &E->EN(raw,spf), err);
+      e = _GD_GetScalar(D, E, 0, GD_UINT_TYPE, &E->EN(raw,spf), err);
       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], err);
-        E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
+        if (_GD_GetScalar(D, E, i, GD_COMPLEX128, &E->EN(polynom,ca)[i], err))
+          e = 1;
+        else {
+          E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
 
-        if (cimag(E->EN(polynom,ca)[i]))
-          E->comp_scal = 1;
+          if (!cs && cimag(E->EN(polynom,ca)[i]))
+            cs = 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], err);
-        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], err);
-        E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
-
-        if (cimag(E->EN(lincom,cb)[i]))
-          E->comp_scal = 1;
+        if (_GD_GetScalar(D, E, i, GD_COMPLEX128, &E->EN(lincom,cm)[i], err))
+          e = 1;
+        else {
+          E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]);
+
+          if (!cs && cimag(E->EN(lincom,cm)[i]))
+            cs = 1;
+        }
+
+        if (_GD_GetScalar(D, E, i + GD_MAX_LINCOM, GD_COMPLEX128,
+            &E->EN(lincom,cb)[i], err))
+        {
+          e = 1;
+        } else {
+          E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
+
+          if (!cs && cimag(E->EN(lincom,cb)[i]))
+            cs = 1;
+        }
 
         if (D->error)
           break;
       }
       break;
     case GD_RECIP_ENTRY:
-      _GD_GetScalar(D, E, 0, GD_COMPLEX128, &E->EN(recip,cdividend), err);
-      E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
-      E->comp_scal = (cimag(E->EN(recip,cdividend)) == 0) ? 0 : 1;
+      if (_GD_GetScalar(D, E, 0, GD_COMPLEX128, &E->EN(recip,cdividend), err))
+        e = 1;
+      else {
+        E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
+        if (cimag(E->EN(recip,cdividend)))
+          cs = 1;
+      }
       break;
     case GD_BIT_ENTRY:
     case GD_SBIT_ENTRY:
-      _GD_GetScalar(D, E, 0, GD_INT_TYPE, &E->EN(bit,bitnum), err);
-      _GD_GetScalar(D, E, 1, GD_INT_TYPE, &E->EN(bit,numbits), err);
+      e = _GD_GetScalar(D, E, 0, GD_INT_TYPE, &E->EN(bit,bitnum), err);
+      e |= _GD_GetScalar(D, E, 1, GD_INT_TYPE, &E->EN(bit,numbits), err);
       break;
     case GD_PHASE_ENTRY:
-      _GD_GetScalar(D, E, 0, GD_INT64, &E->EN(phase,shift), err);
+      e = _GD_GetScalar(D, E, 0, GD_INT64, &E->EN(phase,shift), err);
       break;
     case GD_WINDOW_ENTRY:
       switch (E->EN(window,windop)) {
         case GD_WINDOP_EQ:
         case GD_WINDOP_NE:
-          _GD_GetScalar(D, E, 0, GD_INT64, &E->EN(window,threshold.i), err);
+          e = _GD_GetScalar(D, E, 0, GD_INT64, &E->EN(window,threshold.i), err);
           break;
         case GD_WINDOP_SET:
         case GD_WINDOP_CLR:
-          _GD_GetScalar(D, E, 0, GD_UINT64, &E->EN(window,threshold.u), err);
+          e = _GD_GetScalar(D, E, 0, GD_UINT64, &E->EN(window,threshold.u),
+              err);
           break;
         default:
-          _GD_GetScalar(D, E, 0, GD_FLOAT64, &E->EN(window,threshold.r), err);
+          e = _GD_GetScalar(D, E, 0, GD_FLOAT64, &E->EN(window,threshold.r),
+              err);
           break;
       }
       break;
     case GD_MPLEX_ENTRY:
-      _GD_GetScalar(D, E, 0, GD_INT_TYPE, &E->EN(mplex,count_val), err);
-      _GD_GetScalar(D, E, 1, GD_INT_TYPE, &E->EN(mplex,period), err);
+      e = _GD_GetScalar(D, E, 0, GD_INT_TYPE, &E->EN(mplex,count_val), err);
+      e |= _GD_GetScalar(D, E, 1, GD_INT_TYPE, &E->EN(mplex,period), err);
       break;
     case GD_NO_ENTRY:
     case GD_LINTERP_ENTRY:
@@ -288,20 +311,24 @@ int _GD_CalculateEntry(DIRFILE *restrict D, gd_entry_t *restrict E, int err)
       break;
   }
 
-  if (!D->error)
-    E->e->calculated = 1;
+  if (!e)
+    E->flags |= GD_EN_CALC;
 
-  dreturn("%i", E->e->calculated);
-  return E->e->calculated;
+  if (cs)
+    E->flags |= GD_EN_COMPSCAL;
+  else
+    E->flags &= ~GD_EN_COMPSCAL;
+
+  dreturn("%i", !e);
+  return !e;
 }
 
-char* gd_raw_filename(DIRFILE* D, const char* field_code_in) gd_nothrow
+char* gd_raw_filename(DIRFILE* D, const char* field_code) gd_nothrow
 {
-  int repr;
-  char *field_code, *filename;
+  char *filename;
   gd_entry_t *E;
 
-  dtrace("%p, \"%s\"", D, field_code_in);
+  dtrace("%p, \"%s\"", D, field_code);
 
   _GD_ClearError(D);
 
@@ -312,7 +339,7 @@ char* gd_raw_filename(DIRFILE* D, const char* field_code_in) gd_nothrow
   }
 
   /* Check field */
-  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+  E = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
     dreturn("%p", NULL);
@@ -325,9 +352,6 @@ char* gd_raw_filename(DIRFILE* D, const char* field_code_in) gd_nothrow
     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, GD_EF_NAME)) {
@@ -339,7 +363,7 @@ char* gd_raw_filename(DIRFILE* D, const char* field_code_in) gd_nothrow
       _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, NULL, 0, NULL);
       dreturn("%p", NULL);
       return NULL;
-    } else if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
+    } else if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D,
           (const char*)D->fragment[E->fragment_index].enc_data,
           E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
     {
@@ -355,14 +379,12 @@ char* gd_raw_filename(DIRFILE* D, const char* field_code_in) gd_nothrow
   return filename;
 }
 
-int gd_entry(DIRFILE* D, const char* field_code_in, gd_entry_t* entry)
-  gd_nothrow
+int gd_entry(DIRFILE* D, const char* field_code, gd_entry_t* entry) gd_nothrow
 {
-  int i, repr;
+  int i;
   gd_entry_t *E;
-  char* field_code;
 
-  dtrace("%p, \"%s\", %p", D, field_code_in, entry);
+  dtrace("%p, \"%s\", %p", D, field_code, entry);
 
   if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -372,25 +394,17 @@ int gd_entry(DIRFILE* D, const char* field_code_in, gd_entry_t* entry)
 
   _GD_ClearError(D);
 
-  /* get rid of the represenation, if any */
-  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+  E = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
     dreturn("%i", -1);
     return -1;
   }
 
-  if (field_code != field_code_in)
-    free(field_code);
-
   /* Calculate the entry, if necessary */
-  if (!E->e->calculated)
-    _GD_CalculateEntry(D, E, 1);
-
-  if (D->error) {
-    dreturn("%i", -1);
-    return -1;
-  }
+  if (!(E->flags & GD_EN_CALC))
+    _GD_CalculateEntry(D, E, 0);
 
   /* now copy to the user supplied buffer */
   memcpy(entry, E, sizeof(gd_entry_t));
@@ -503,8 +517,8 @@ const char *gd_alias_target(DIRFILE *D, const char *field_code) gd_nothrow
 const char **gd_aliases(DIRFILE *D, const char *field_code) gd_nothrow
 {
   gd_entry_t *E;
-  int n, j = 1;
-  unsigned u;
+  int j = 1;
+  unsigned u, n;
 
   dtrace("%p, \"%s\"", D, field_code);
 
@@ -553,26 +567,25 @@ const char **gd_aliases(DIRFILE *D, const char *field_code) gd_nothrow
   return E->e->alias_list;
 }
 
-int gd_naliases(DIRFILE *D, const char *field_code) gd_nothrow
+unsigned int gd_naliases(DIRFILE *D, const char *field_code) gd_nothrow
 {
   gd_entry_t *E;
-  int n = 1;
-  unsigned u;
+  unsigned u, n = 1;
 
   dtrace("%p, \"%s\"", D, field_code);
 
   if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
-    dreturn("%i", -1);
-    return -1;
+    dreturn("%u", 0);
+    return 0;
   }
 
   E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
 
   if (E == NULL) {
     _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
-    dreturn("%i", -1);
-    return -1;
+    dreturn("%u", 0);
+    return 0;
   }
 
   for (u = 0; u < D->n_entries; ++u)
@@ -582,17 +595,15 @@ int gd_naliases(DIRFILE *D, const char *field_code) gd_nothrow
       n++;
     }
 
-  dreturn("%i", n);
+  dreturn("%u", n);
   return n;
 }
 
-gd_entype_t gd_entry_type(DIRFILE* D, const char* field_code_in) gd_nothrow
+gd_entype_t gd_entry_type(DIRFILE* D, const char* field_code) gd_nothrow
 {
   gd_entry_t* E;
-  char* field_code;
-  int repr;
 
-  dtrace("%p, \"%s\"", D, field_code_in);
+  dtrace("%p, \"%s\"", D, field_code);
 
   if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -602,17 +613,13 @@ gd_entype_t gd_entry_type(DIRFILE* D, const char* field_code_in) gd_nothrow
 
   _GD_ClearError(D);
 
-  /* get rid of the represenation, if any */
-  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+  E = _GD_FindEntry(D, field_code, NULL, 1, 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;
 }
@@ -676,8 +683,8 @@ int gd_hide(DIRFILE *D, const char *field_code) gd_nothrow
     return -1;
   }
 
-  if (!E->hidden) {
-    E->hidden = 1;
+  if (!(E->flags & GD_EN_HIDDEN)) {
+    E->flags |= GD_EN_HIDDEN;
     D->fragment[E->fragment_index].modified = 1;
   }
 
@@ -707,8 +714,8 @@ int gd_hidden(DIRFILE *D, const char *field_code) gd_nothrow
     return -1;
   }
 
-  dreturn("%i", E->hidden);
-  return E->hidden;
+  dreturn("%i", (E->flags & GD_EN_HIDDEN) ? 1 : 0);
+  return (E->flags & GD_EN_HIDDEN) ? 1 : 0;
 }
 
 int gd_unhide(DIRFILE *D, const char *field_code) gd_nothrow
@@ -744,8 +751,8 @@ int gd_unhide(DIRFILE *D, const char *field_code) gd_nothrow
     return -1;
   }
 
-  if (E->hidden) {
-    E->hidden = 0;
+  if (E->flags & GD_EN_HIDDEN) {
+    E->flags &= ~GD_EN_HIDDEN;
     D->fragment[E->fragment_index].modified = 1;
   }
 
@@ -769,7 +776,6 @@ int gd_validate(DIRFILE *D, const char *field_code_in) gd_nothrow
 
   _GD_ClearError(D);
 
-  /* get rid of the representation, if any */
   E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
 
   if (D->error) {
@@ -781,20 +787,20 @@ int gd_validate(DIRFILE *D, const char *field_code_in) gd_nothrow
     free(field_code);
 
   /* calculate scalars */
-  if (!E->e->calculated)
+  if (!(E->flags & GD_EN_CALC))
     _GD_CalculateEntry(D, E, 1);
 
   /* check input fields */
   switch (E->field_type) {
     case GD_LINCOM_ENTRY:
       for (i = 0; i < E->EN(lincom,n_fields); ++i)
-        _GD_BadInput(D, E, i, 1);
+        _GD_BadInput(D, E, i, GD_NO_ENTRY, 1);
       break;
     case GD_DIVIDE_ENTRY:
     case GD_MULTIPLY_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      _GD_BadInput(D, E, 1, 1);
+      _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1);
       /* fallthrough */
     case GD_LINTERP_ENTRY:
     case GD_BIT_ENTRY:
@@ -802,7 +808,7 @@ int gd_validate(DIRFILE *D, const char *field_code_in) gd_nothrow
     case GD_POLYNOM_ENTRY:
     case GD_SBIT_ENTRY:
     case GD_RECIP_ENTRY:
-      _GD_BadInput(D, E, 0, 1);
+      _GD_BadInput(D, E, 0, GD_NO_ENTRY, 1);
       /* Fallthrough */
     case GD_RAW_ENTRY:
     case GD_CONST_ENTRY:
@@ -823,13 +829,12 @@ int gd_validate(DIRFILE *D, const char *field_code_in) gd_nothrow
   return 0;
 }
 
-char *gd_linterp_tablename(DIRFILE *D, const char *field_code_in) gd_nothrow
+char *gd_linterp_tablename(DIRFILE *D, const char *field_code) gd_nothrow
 {
-  int repr;
   gd_entry_t *E;
-  char *field_code, *table;
+  char *table;
 
-  dtrace("%p, \"%s\"", D, field_code_in);
+  dtrace("%p, \"%s\"", D, field_code);
 
   if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -839,19 +844,15 @@ char *gd_linterp_tablename(DIRFILE *D, const char *field_code_in) gd_nothrow
 
   _GD_ClearError(D);
 
-  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+  E = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  if (field_code != field_code_in)
-    free(field_code);
-
   if (E->field_type != GD_LINTERP_ENTRY) {
-    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0,
-        field_code_in);
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
     dreturn("%p", NULL);
     return NULL;
   }
diff --git a/src/errors.c b/src/errors.c
index 110ff69..2b96f6a 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
- * Copyright (C) 2005-2012 D. V. Wiebe
+ * Copyright (C) 2005-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -26,14 +26,8 @@ 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) */
+  int adderr; /* 1 = append strerror(errno) */
 } 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_OPEN, GD_E_OPEN_PATH, "Bad path: {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 },
@@ -55,8 +49,7 @@ static const struct {
     "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_BAD_NAME, "Bad name on line {3} of {2}: {4}", 0 },
   { GD_E_FORMAT, GD_E_FORMAT_UNTERM,
     "Unterminated token on line {3} of {2}", 0 },
   { GD_E_FORMAT, GD_E_FORMAT_METARAW,
@@ -79,22 +72,34 @@ static const struct {
     "Cannot use alias {4} as parent to a meta field on line {3} of {2}", 0 },
   { GD_E_FORMAT, GD_E_FORMAT_MPLEXVAL,
     "Bad MPLEX period ({4}) on line {3} of {2}", 0 },
-  /* GD_E_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: 1 = suberror, 2 = filename */
   { GD_E_CREAT, GD_E_CREAT_DIR, "Unable to create directory {2}: ", 1 },
   { GD_E_CREAT, GD_E_CREAT_OPEN, "Unable to open directory {2}: ", 1 },
   { GD_E_CREAT, GD_E_CREAT_FORMAT, "Unable to create format file {2}: ", 1 },
   /* GD_E_BAD_CODE: 4 = field code */
   { GD_E_BAD_CODE, GD_E_CODE_MISSING, "Field not found: {4}", 0 },
-  { GD_E_BAD_CODE, GD_E_CODE_INVALID, "Bad field name: {4}", 0 },
+  { GD_E_BAD_CODE, GD_E_CODE_INVALID, "Bad field code: {4}", 0 },
+  { GD_E_BAD_CODE, GD_E_CODE_AMBIGUOUS, "Ambiguous field code: {4}", 0 },
+  { GD_E_BAD_CODE, GD_E_CODE_INVALID_NS, "Bad namespace: {4}", 0 },
+  { GD_E_BAD_CODE, GD_E_CODE_REPR, "Invalid representation suffix in: {4}", 0 },
   /* GD_E_BAD_TYPE: 1 = data type */
-  { GD_E_BAD_TYPE, 0, "Unsupported data type: {1}", 0 },
-  /* GD_E_RAW_IO: 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_BAD_TYPE, 0, "Bad data type: {1}", 0 },
+  /* GD_E_IO: 2 = filename; 3 = line; 4 = included file/encoding error */
+  { GD_E_IO, GD_E_IO_OPEN, "Error opening {2}: ", 1 },
+  { GD_E_IO, GD_E_IO_READ, "Error reading {2}: ", 1 },
+  { GD_E_IO, GD_E_IO_WRITE, "Error writing {2}: ", 1 },
+  { GD_E_IO, GD_E_IO_CLOSE, "Error closing {2}: ", 1 },
+  { GD_E_IO, GD_E_IO_UNLINK, "Error unlinking {2}: ", 1 },
+  { GD_E_IO, GD_E_IO_RENAME, "Error renaming {2}: ", 1 },
+  { GD_E_IO, GD_E_IO_INCL, "Error opening {4} included on line {3} of {2}: ", 
+    1 },
+  { GD_E_IO, GD_E_IO_ENC_OPEN, "Error opening {2}: {4}", 0 },
+  { GD_E_IO, GD_E_IO_ENC_READ, "Error reading {2}: {4}", 0 },
+  { GD_E_IO, GD_E_IO_ENC_WRITE, "Error writing {2}: {4}", 0 },
+  { GD_E_IO, GD_E_IO_ENC_CLOSE, "Error closing {2}: {4}", 0 },
+  { GD_E_IO, GD_E_IO_ENC_UNLINK, "Error unlinking {2}: {4} ", 0 },
+  { GD_E_IO, GD_E_IO_ENC_RENAME, "Error renaming {2}: {4} ", 0 },
+  { GD_E_IO, 0, "Error accessing {2}: ", 1 },
   /* GD_E_INTERNAL_ERROR: 2 = source file, 3 = line */
   { GD_E_INTERNAL_ERROR, 0, "Internal error at [{2},{3}]; "
     "please report to " PACKAGE_BUGREPORT , 0 },
@@ -103,9 +108,10 @@ static const struct {
   /* 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_LUT: 1 = suberror, 2 = lutfile, 3 = line */
+  { GD_E_LUT, GD_E_LUT_LENGTH, "LINTERP table {2} too short", 0 },
+  { GD_E_LUT, GD_E_LUT_SYNTAX, "Malfomed data on line {3} of LINTERP table {2}",
+    0 },
   /* GD_E_RECURSE_LEVEL: 2 = file; 3 = line; 4 = name */
   { GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE,
     "Recursion too deep resolving field {4}", 0 },
@@ -113,10 +119,13 @@ static const struct {
     "Recursion too deep including {4} on line {3} of {2}", 0 },
   /* GD_E_BAD_DIRFILE: (nothing) */
   { GD_E_BAD_DIRFILE, 0, "Invalid dirfile", 0 },
-  /* GD_E_BAD_FIELD_TYPE: 4 = fieldcode */
+  /* GD_E_BAD_FIELD_TYPE: 2 = parent field (if any) 4 = fieldcode */
   { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, "No method to write field {4}", 0 },
   { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, "Invalid field type for {4}", 0 },
   { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_MATCH, "Field type mismatch for {4}", 0 },
+  { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_FORMAT,
+    "Bad field type for {4} in definition of {2}", 0 },
+  { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_STR, "Non-numeric data in {4}", 0 },
   /* GD_E_ACCMODE: (nothing) */
   { GD_E_ACCMODE, 0, "Dirfile has been opened read-only", 0 },
   /* GD_E_UNSUPPORTED: (nothing) */
@@ -138,7 +147,6 @@ static const struct {
   { GD_E_BAD_ENTRY, GD_E_ENTRY_METARAW, "Invalid metafield type: {3}", 0 },
   { GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, "POLYNOM order out of range: {3}", 0 },
   { GD_E_BAD_ENTRY, GD_E_ENTRY_WINDOP, "Unrecognised WINDOW operator: {3}", 0 },
-  { GD_E_BAD_ENTRY, GD_E_ENTRY_CNTVAL, "Count value out of range: {3}", 0 },
   { GD_E_BAD_ENTRY, GD_E_ENTRY_PERIOD, "MPLEX period out of range: {3}", 0 },
   /* GD_E_DUPLICATE: 4 = name */
   { GD_E_DUPLICATE, 0, "Field code already present: {4}", 0 },
@@ -185,42 +193,37 @@ static const struct {
   { GD_E_CALLBACK, 0, "Unrecognised response from callback function: {3}", 0 },
   /* GD_E_ExISTS: (nothing) */
   { GD_E_EXISTS, 0, "Dirfile exists", 0 },
-  /* GD_E_UNCLEAN_DB: 3 = fragment */
+  /* GD_E_UNCLEAN_DB: 2 = fragment, 4 = call */
+  { GD_E_UNCLEAN_DB, GD_E_UNCLEAN_CALL,
+    "Unexpected system error processing {2}; database unclean: {4}: ", 1 },
   { GD_E_UNCLEAN_DB, 0,
-    "Unexpected system error processing {3}; database unclean", 0 },
+    "Unexpected system error processing {2}; database unclean", 0 },
   /* GD_E_DOMAIN: (nothing) */
   { GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, "Improper domain: complex valued", 0 },
   { GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, "Improper domain: empty set", 0 },
   { GD_E_DOMAIN, GD_E_DOMAIN_ANTITONIC, "Improper domain: not monotonic", 0 },
   { GD_E_DOMAIN, GD_E_DOMAIN_MULTIPOS, "I/O position mismatch in inputs", 0 },
-  /* GD_E_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_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_BOUNDS: (nothing) */
-  { GD_E_BOUNDS, 0, "CARRAY length out of bounds", 0 },
-  /* GD_E_LINE_TOO_LONG: 2 = fragment, 3 = line number */
+  { GD_E_BOUNDS, 0, "Array length out of bounds", 0 },
+  /* GD_E_LINE_TOO_LONG */
+  { GD_E_LINE_TOO_LONG, GD_E_LONG_FLUSH, "Line too long writing {2}", 0 },
   { GD_E_LINE_TOO_LONG, 0, "Line {3} of {2} too long", 0 },
   /* GD_E_OK: (nothing) */
   { 0, 0, "Success", 0} /* this must be the last error string defined */
 };
 
-/* _GD_SetError: Sets the global error variables for a library error
-*/
-void _GD_SetError(DIRFILE* D, int error, int suberror,
-    const char* format_file, int line, const char* token)
+/* _GD_SetError: Sets the global error variables for a library error */
+void _GD_SetError2(DIRFILE* D, int error, int suberror,
+    const char* format_file, int line, const char* token, int stdlib_errno)
 {
-  dtrace("%p, %i, %i, \"%s\", %i, \"%s\"", D, error, suberror, format_file,
-      line, token);
+  dtrace("%p, %i, %i, \"%s\", %i, \"%s\", %i", D, error, suberror, format_file,
+      line, token, stdlib_errno);
 
   D->error = error;
   if (error != GD_E_OK)
     D->n_error++;
   D->suberror = suberror;
+  D->stdlib_errno = stdlib_errno;
   D->error_line = line;
   if (format_file != NULL) {
     free(D->error_file);
@@ -241,6 +244,34 @@ void _GD_SetError(DIRFILE* D, int error, int suberror,
   dreturnvoid();
 }
 
+void _GD_SetError(DIRFILE* D, int error, int suberror, const char* format_file,
+    int line, const char* token)
+{
+  dtrace("%p, %i, %i, \"%s\", %i, \"%s\"", D, error, suberror, format_file,
+      line, token);
+
+  _GD_SetError2(D, error, suberror, format_file, line, token, errno);
+
+  dreturnvoid();
+}
+
+/* Set an appropriate error message for encoding framework errors */
+void _GD_SetEncIOError(DIRFILE *D, int suberror, const struct gd_raw_file_ *f)
+{
+  dtrace("%p, %i, %p", D, suberror, f);
+
+  /* If the encoding has no strerr function, fallback on strerr */
+  if (_GD_MissingFramework(f->subenc, GD_EF_STRERR))
+    _GD_SetError(D, GD_E_IO, suberror, f->name, 0, NULL);
+  else {
+    char buffer[GD_MAX_LINE_LENGTH];
+    if ((*_GD_ef[f->subenc].strerr)(f, buffer, GD_MAX_LINE_LENGTH))
+      strcpy(buffer, "Unknown error");
+    _GD_SetError2(D, GD_E_IO, GD_E_IO_ENC_OFFSET + suberror, f->name, 0,
+        buffer, 0);
+  }
+}
+
 /* Return the error */
 int gd_error(const DIRFILE* D) gd_nothrow
 {
@@ -266,7 +297,7 @@ char* gd_error_string(const DIRFILE* D, char* buffer, size_t buflen) gd_nothrow
   dtrace("%p, %p, %" PRNsize_t, D, buffer, buflen);
 
   /* Sanity check */
-  if (D == NULL || (buffer && buflen < 1)) {
+  if (buffer && buflen < 1) {
     dreturn("%p", NULL);
     return NULL;
   }
@@ -331,17 +362,8 @@ char* gd_error_string(const DIRFILE* D, char* buffer, size_t buflen) gd_nothrow
     }
 
     *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
-    }
+    if (op < bufend - 1 && error_string[s].adderr)
+      gd_strerror(D->stdlib_errno, op, bufend - op);
   }
 
   dreturn("\"%s\"", buffer);
diff --git a/src/field_list.c b/src/field_list.c
index 90ea137..223fc9f 100644
--- a/src/field_list.c
+++ b/src/field_list.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2013 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -78,6 +78,7 @@ gd_static_inline_ int _GD_EntryIndex(unsigned int t)
     case GD_STRING_ENTRY:
       i = 15;
       break;
+
     case GD_VECTOR_ENTRIES:
       i = 16;
       break;
@@ -107,7 +108,7 @@ int _GD_ListEntry(const gd_entry_t *E, int meta, int hidden, int noalias,
       special, type);
 
   /* check hidden */
-  if (!hidden && E->hidden) {
+  if (!hidden && (E->flags & GD_EN_HIDDEN)) {
     dreturn("%i (hidden)", 0);
     return 0;
   }
@@ -174,14 +175,6 @@ static const char **_GD_EntryList(DIRFILE *D, struct gd_private_entry_ *p,
 
   dtrace("%p, %p, %" PRNsize_t ", 0x%X, 0x%X", D, p, offs, type, flags);
 
-  if (D->flags & GD_INVALID) {
-    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
-    dreturn("%p", NULL);
-    return NULL;
-  }
-
-  _GD_ClearError(D);
-
   index = _GD_EntryIndex(type);
   if (index < 0) {
     _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, NULL, type, NULL);
@@ -217,7 +210,7 @@ static const char **_GD_EntryList(DIRFILE *D, struct gd_private_entry_ *p,
     return zero_list;
   }
 
-  el = (char **)_GD_Malloc(D, sizeof(const char*) * (n + 1));
+  el = _GD_Malloc(D, sizeof(*el) * (n + 1));
 
   if (el == NULL) {
     dreturn("%p", NULL);
@@ -346,7 +339,7 @@ const gd_carray_t *gd_carrays(DIRFILE* D, gd_type_t return_type) gd_nothrow
     return zero_carrays;
   }
 
-  fl = (gd_carray_t *)_GD_Malloc(D, sizeof(gd_carray_t) * (n + 1));
+  fl = _GD_Malloc(D, sizeof(*fl) * (n + 1));
 
   if (fl == NULL) {
     dreturn("%p", NULL);
@@ -403,7 +396,7 @@ const char **gd_strings(DIRFILE* D) gd_nothrow
     return D->string_value_list;
   }
 
-  fl = (char **)_GD_Malloc(D, sizeof(const char*) * (n + 1));
+  fl = _GD_Malloc(D, sizeof(*fl) * (n + 1));
 
   if (fl == NULL) {
     dreturn("%p", NULL);
@@ -546,7 +539,7 @@ const gd_carray_t *gd_mcarrays(DIRFILE* D, const char* parent,
     return zero_carrays;
   }
 
-  fl = (gd_carray_t *)_GD_Malloc(D, sizeof(gd_carray_t) * (n + 1));
+  fl = _GD_Malloc(D, sizeof(*fl) * (n + 1));
 
   if (fl == NULL) {
     dreturn("%p", NULL);
@@ -611,8 +604,7 @@ const char **gd_mstrings(DIRFILE* D, const char* parent) gd_nothrow
     return zero_list;
   }
 
-  fl = (char **)_GD_Realloc(D, (char **)e->string_value_list,
-      sizeof(const char*) * (n + 1));
+  fl = _GD_Malloc(D, sizeof(*fl) * (n + 1));
 
   if (fl == NULL) {
     dreturn("%p", NULL);
@@ -624,6 +616,7 @@ const char **gd_mstrings(DIRFILE* D, const char* parent) gd_nothrow
       fl[n++] = e->p.meta_entry[i]->e->u.string;
   fl[n] = NULL;
 
+  free(e->string_value_list);
   e->string_value_list = (const char **)fl;
 
   dreturn("%p", e->string_value_list);
diff --git a/src/flac.c b/src/flac.c
new file mode 100644
index 0000000..ef9a97e
--- /dev/null
+++ b/src/flac.c
@@ -0,0 +1,574 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#ifdef HAVE_FLAC_ALL_H
+#include <FLAC/all.h>
+#endif
+
+/* errors and error disambiguation */
+#define GD_FLAC_E_IO           0 /* I/O (stdlib) error */
+#define GD_FLAC_E_EOS          1 /* seek past eof */
+#define GD_FLAC_E_CPS          2 /* bad channels per sample */
+#define GD_FLAC_E_BPS          3 /* bad bits per sample */
+#define GD_FLAC_E_MEM          4 /* alloc error */
+#define GD_FLAC_E_SDS    0x10000 /* FLAC__StreamDecoderState */
+#define GD_FLAC_E_SDIS   0x20000 /* FLAC__StreamDecoderInitStatus */
+#define GD_FLAC_E_SDES   0x20000 /* FLAC__StreamDecoderErrorStatus */
+#define GD_FLAC_E_SES    0x30000 /* FLAC__StreamEncoderState */
+#define GD_FLAC_E_SEIS   0x40000 /* FLAC__StreamEncoderInitStatus */
+
+struct gd_flacdata {
+  union {
+    FLAC__StreamDecoder *d;
+    FLAC__StreamEncoder *e;
+  } codec;
+  FILE* stream;
+  unsigned bps; /* bits per sample */
+  unsigned cps; /* channels per sample */
+
+  int stream_end;
+  int error; /* error flag */
+  int *errnum; /* file->error */
+
+  char *data; /* Dechannelised frame of data */
+  unsigned dlen; /* Length in samples of data */
+  unsigned pos; /* offset into the frame data */
+  off64_t base; /* sample number of the start of the frame */
+};
+
+/* The flac encoding scheme uses edata as a gd_flacdata pointer.  If a file is
+ * open, idata = 0 otherwise idata = -1. */
+
+/* The decoder callback */
+static FLAC__StreamDecoderWriteStatus _GD_FlacWriteCallback(
+    const FLAC__StreamDecoder *decoder gd_unused_, const FLAC__Frame *frame,
+    const FLAC__int32 *const buffer[], void *client_data)
+{
+  struct gd_flacdata *gdfl = client_data;
+  unsigned u, c;
+  int16_t *ptr;
+
+  dtrace("<unused>, %p, %p, %p", frame, buffer, client_data);
+
+  /* Advance base for previous frame */
+  gdfl->base += gdfl->dlen;
+
+  /* Reset position */
+  gdfl->pos = 0;
+
+  /* check bps and cps */
+  if (gdfl->cps != FLAC__stream_decoder_get_channels(gdfl->codec.d)) {
+    gdfl->error = 1;
+    *gdfl->errnum = GD_FLAC_E_CPS;
+    dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_ABORT");
+    return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
+  }
+
+  if (gdfl->bps != FLAC__stream_decoder_get_bits_per_sample(gdfl->codec.d)) {
+    gdfl->error = 1;
+    *gdfl->errnum = GD_FLAC_E_BPS;
+    dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_ABORT");
+    return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
+  }
+
+  if (gdfl->dlen != frame->header.blocksize) {
+    /* Resize the data buffer to accommodate the new frame */
+    free(gdfl->data);
+    gdfl->data = malloc(frame->header.blocksize * gdfl->bps * gdfl->cps / 8);
+    if (gdfl->data == NULL) {
+      gdfl->error = 1;
+      *gdfl->errnum = GD_FLAC_E_MEM;
+      dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_ABORT");
+      return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
+    }
+    gdfl->dlen = frame->header.blocksize;
+  }
+
+  ptr = (int16_t*)gdfl->data;
+
+  /* Copy and dechannelise the decoded data to our local buffer */
+  if (gdfl->bps == 1)
+    for (u = 0; u < frame->header.blocksize; ++u)
+      /* there's only one channel in this case */
+      gdfl->data[u] = (int8_t)buffer[0][u];
+  else
+    for (u = 0; u < frame->header.blocksize; ++u)
+      for (c = 0; c < gdfl->cps; ++c)
+        *(ptr++) = (int16_t)buffer[c][u];
+
+  dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE");
+  return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+}
+
+/* The decoder error callback */
+static void _GD_FlacErrorCallback(const FLAC__StreamDecoder *decoder gd_unused_,
+    FLAC__StreamDecoderErrorStatus status, void *client_data)
+{
+  struct gd_flacdata *gdfl = client_data;
+
+  dtrace("<unused>, %i, %p", (int)status, client_data);
+
+  gdfl->error = 1;
+  *gdfl->errnum = GD_FLAC_E_SDES | status;
+
+  dreturnvoid();
+  return;
+}
+
+static struct gd_flacdata *_GD_FlacDoOpen(int dirfd, struct gd_raw_file_* file,
+    gd_type_t data_type, unsigned int mode)
+{
+  int fd, status;
+  struct gd_flacdata *gdfl;
+  FILE *stream;
+  const char *fdmode = "rb";
+
+  dtrace("%i, %p, 0x%X, 0x%X", dirfd, file, data_type, mode);
+
+  if (mode & GD_FILE_READ) {
+    fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666);
+  } else if (mode & GD_FILE_TEMP) {
+    fd = _GD_MakeTempFile(file->D, dirfd, file->name);
+    fdmode = "wb";
+  } else { /* internal error */
+    errno = EINVAL; /* I guess ... ? */
+    fd = -1;
+  }
+
+  if (fd < 0) {
+    file->error = GD_FLAC_E_IO;
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if ((stream = fdopen(fd, fdmode)) == NULL) {
+    close(fd);
+    file->error = GD_FLAC_E_IO;
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if ((gdfl = malloc(sizeof *gdfl)) == NULL) {
+    fclose(stream);
+    file->error = GD_FLAC_E_MEM;
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  memset(gdfl, 0, sizeof *gdfl);
+  gdfl->stream = stream;
+  gdfl->data = NULL;
+
+  /* libFLAC only supports up to 24-bits per sample (which isn't a helpful
+   * number for us).  Except for 1-byte types, we use 16 bits-per-sample 
+   * and increase the number of channels to accomodate the data type.  */
+  if (GD_SIZE(data_type) <= 2) {
+    gdfl->bps = GD_SIZE(data_type) * 8;
+    gdfl->cps = 1;
+  } else {
+    gdfl->bps = 16;
+    gdfl->cps = GD_SIZE(data_type) / 2;
+  }
+
+  if (mode & GD_FILE_READ) {
+    if ((gdfl->codec.d = FLAC__stream_decoder_new()) == NULL) {
+      file->error = GD_FLAC_E_MEM;
+      goto OPEN_ERROR;
+    }
+
+    status = FLAC__stream_decoder_init_FILE(gdfl->codec.d, stream,
+          _GD_FlacWriteCallback, NULL, _GD_FlacErrorCallback, gdfl);
+
+    if (status != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+      file->error = GD_FLAC_E_SDIS | status;
+      goto OPEN_ERROR;
+    }
+
+    /* Advance to the end of the metadata */
+    if (!FLAC__stream_decoder_process_until_end_of_metadata(gdfl->codec.d))
+      goto OPEN_ERROR;
+  } else {
+    if ((gdfl->codec.e = FLAC__stream_encoder_new()) == NULL) {
+      file->error = GD_FLAC_E_MEM;
+      goto OPEN_ERROR;
+    }
+
+    FLAC__stream_encoder_set_channels(gdfl->codec.e, gdfl->cps);
+    FLAC__stream_encoder_set_bits_per_sample(gdfl->codec.e, gdfl->bps);
+    FLAC__stream_encoder_set_sample_rate(gdfl->codec.e, 1);
+
+    status = FLAC__stream_encoder_init_FILE(gdfl->codec.e, stream, NULL, NULL);
+    if (status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) {
+      if (status == FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR)
+        file->error = GD_FLAC_E_SES |
+          FLAC__stream_encoder_get_state(gdfl->codec.e);
+      else
+        file->error = GD_FLAC_E_SEIS | status;
+      goto OPEN_ERROR;
+    }
+  }
+
+  file->pos = 0;
+
+  dreturn("%p", gdfl);
+  return gdfl;
+
+OPEN_ERROR:
+  fclose(stream);
+  free(gdfl);
+  dreturn("%p", NULL);
+  return NULL;
+}
+
+int _GD_FlacOpen(int dirfd, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap gd_unused_, unsigned int mode)
+{
+  dtrace("%i, %p, 0x%X, <unused>, 0x%X", dirfd, file, data_type, mode);
+
+  file->edata = _GD_FlacDoOpen(dirfd, file, data_type, mode);
+
+  if (file->edata == NULL) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->mode = mode;
+  file->idata = 0;
+  ((struct gd_flacdata*)file->edata)->errnum = &file->error;
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* copy the decoded frame to the output */
+static size_t _GD_FlacOutput(struct gd_flacdata *gdfl, gd_type_t data_type,
+    char *output, size_t ns)
+{
+  dtrace("%p, 0x%X, %p, %" PRNsize_t, gdfl, data_type, output, ns);
+
+  if (ns > gdfl->dlen - gdfl->pos)
+    ns = gdfl->dlen - gdfl->pos;
+
+  memcpy(output, gdfl->data + gdfl->pos, ns * GD_SIZE(data_type));
+  gdfl->pos += ns;
+
+  dreturn("%" PRNsize_t, ns);
+  return ns;
+}
+
+ssize_t _GD_FlacRead(struct gd_raw_file_ *restrict file, void *restrict data,
+    gd_type_t data_type, size_t nmemb)
+{
+  struct gd_flacdata *gdfl = (struct gd_flacdata *)file->edata;
+  void *output = data;
+  size_t ns = nmemb;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
+
+  for (;;) {
+    /* copy the currently loaded frame to the output */
+    ns -= _GD_FlacOutput(gdfl, data_type, output, ns);
+    if (ns == 0)
+      break;
+
+    /* Decode one frame */
+    if (!FLAC__stream_decoder_process_single(gdfl->codec.d)) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    if (gdfl->error) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* out of data */
+    if (FLAC__stream_decoder_get_state(gdfl->codec.d) ==
+        FLAC__STREAM_DECODER_END_OF_STREAM)
+    {
+      gdfl->stream_end = 1;
+      break;
+    }
+  }
+
+  file->pos = gdfl->base + gdfl->pos;
+
+  dreturn("%li", (long)(nmemb - ns));
+  return nmemb - ns;
+}
+
+ssize_t _GD_FlacWrite(struct gd_raw_file_ *file, const void *data,
+    gd_type_t data_type, size_t nmemb)
+{
+  struct gd_flacdata *gdfl = (struct gd_flacdata *)file->edata;
+  ssize_t n = nmemb;
+  const int size = GD_SIZE(data_type);
+  size_t i, remaining;
+  unsigned c;
+  int32_t *buffer[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
+  const int8_t *i8 = data;
+  const int16_t *i16 = data;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
+
+  if (nmemb > 0 && size) {
+    /* Allocate buffers */
+    for (i = 0; i < gdfl->cps; ++i)
+      if ((buffer[i] = malloc(nmemb * sizeof *buffer[i])) == NULL) {
+        file->error = GD_FLAC_E_MEM;
+        goto WRITE_ERROR;
+      }
+
+    /* Data marshalling -- split into 32-bit-wide channels of
+     * 8- or 16-bit signed data */
+    if (gdfl->bps == 8)
+      for (i = 0; i < nmemb; ++i)
+        buffer[0][i] = *(i8++);
+    else
+      for (i = 0; i < nmemb; ++i)
+        for (c = 0; c < gdfl->cps; ++c)
+          buffer[c][i] = *(i16++);
+
+    /* Write the data -- we have to loop here because libFLAC uses
+     * unsigned int for sample count */
+    remaining = nmemb;
+    while (remaining > 0) {
+      unsigned ns = UINT_MAX;
+      if (ns > remaining)
+        ns = remaining;
+
+      if (!FLAC__stream_encoder_process(gdfl->codec.e, (void*)buffer, ns)) {
+        file->error = GD_FLAC_E_SES
+          | FLAC__stream_encoder_get_state(gdfl->codec.e);
+        goto WRITE_ERROR;
+      }
+      remaining -= ns;
+      file->pos += ns;
+    }
+  } else if (0) {
+WRITE_ERROR:
+    n = -1;
+  }
+
+  for (i = 0; i < gdfl->cps; ++i)
+    free(buffer[i]);
+  dreturn("%" PRNssize_t, n);
+  return n;
+}
+
+off64_t _GD_FlacSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int mode)
+{
+  struct gd_flacdata *gdfl;
+
+  dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode);
+
+  gdfl = (struct gd_flacdata *)(file[(mode == GD_FILE_WRITE) ? 1 : 0].edata);
+
+  /* nothing to do */
+  if (gdfl->base + gdfl->pos == count) {
+    dreturn("%lli", (long long)count);
+    return count;
+  }
+
+  if (mode == GD_FILE_WRITE) {
+    /* we only get here when we need to pad */
+    char *zero = malloc(GD_BUFFER_SIZE);
+    if (zero == NULL) {
+      *gdfl->errnum = GD_FLAC_E_MEM;
+      dreturn("%i", -1);
+      return -1;
+    }
+    memset(zero, 0, GD_BUFFER_SIZE);
+
+    count -= file->pos;
+    while (gdfl->base < count) {
+      int n = GD_BUFFER_SIZE / GD_SIZE(data_type);;
+      if (n > count)
+        n = count;
+
+      _GD_FlacWrite(file + 1, zero, GD_UINT8, n);
+      if (file->error) {
+        free(zero);
+        dreturn("%i", -1);
+        return -1;
+      }
+      count -= n;
+    }
+    free(zero);
+  } else {
+    int eof = 0;
+    off64_t last = FLAC__stream_decoder_get_total_samples(gdfl->codec.d) - 1;
+
+    if (last < 0) { /* no data -- fake it */
+      file->pos = 0;
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    if (count > last) {
+      count = last;
+      eof = 1;
+    }
+
+    if (!FLAC__stream_decoder_seek_absolute(gdfl->codec.d, count)) {
+      file->error = GD_FLAC_E_SDS |
+        FLAC__stream_decoder_get_state(gdfl->codec.d);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    if (eof) {
+      /* advance to EOF by reading the last frame */
+      if (!FLAC__stream_decoder_process_single(gdfl->codec.d)) {
+        dreturn("%i", -1);
+        return -1;
+      }
+      /* and "consume" it */
+      gdfl->pos = gdfl->dlen;
+
+      gdfl->stream_end = 1;
+      count++;
+    }
+  }
+  
+  file->pos = count;
+
+  dreturn("%lli", (long long)file->pos);
+  return file->pos;
+}
+
+/* This function does nothing */
+int _GD_FlacSync(struct gd_raw_file_ *file gd_unused_)
+{
+  dtrace("<unused>");
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int _GD_FlacClose(struct gd_raw_file_ *file)
+{
+  struct gd_flacdata *gdfl = (struct gd_flacdata *)file->edata;
+  dtrace("%p", file);
+
+  if (file->mode & GD_FILE_READ) {
+    FLAC__stream_decoder_finish(gdfl->codec.d);
+    FLAC__stream_decoder_delete(gdfl->codec.d);
+  } else {
+    FLAC__stream_encoder_finish(gdfl->codec.e);
+    FLAC__stream_encoder_delete(gdfl->codec.e);
+  }
+
+  file->idata = -1;
+  file->mode = 0;
+  free(file->edata);
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_FlacSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
+    int swap gd_unused_)
+{
+  struct gd_flacdata *gdfl;
+  off_t n;
+
+  dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
+
+  gdfl = _GD_FlacDoOpen(dirfd, file, data_type, GD_FILE_READ);
+
+  if (gdfl == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  n = FLAC__stream_decoder_get_total_samples(gdfl->codec.d);
+
+  free(gdfl);
+
+  dreturn("%lli", (long long)n);
+  return n;
+}
+
+int _GD_FlacStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen)
+{
+  int r = 0;
+
+  dtrace("%p, %p, %" PRNsize_t, file, buf, buflen);
+
+  switch(file->error) {
+    case GD_FLAC_E_EOS:
+      strncpy(buf, "Cannot seek past end of stream", buflen);
+      break;
+    case GD_FLAC_E_CPS:
+      strncpy(buf, "Invalid channels per sample in FLAC stream", buflen);
+      break;
+    case GD_FLAC_E_BPS:
+      strncpy(buf, "Invalid bits per sample in FLAC stream", buflen);
+      break;
+    case GD_FLAC_E_IO:
+    case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_IO_ERROR:
+      r = gd_strerror(errno, buf, buflen);
+      break;
+    case GD_FLAC_E_MEM:
+    case GD_FLAC_E_SDS | FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
+    case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR:
+      strncpy(buf, "FLAC: Out of memory", buflen);
+      break;
+    case GD_FLAC_E_SDS | FLAC__STREAM_DECODER_SEEK_ERROR:
+      strncpy(buf, "FLAC: Seek error", buflen);
+      break;
+    case GD_FLAC_E_SDIS 
+        | FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER:
+    case GD_FLAC_E_SEIS 
+        | FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER:
+      strncpy(buf, "FLAC: Unsupported container", buflen);
+      break;
+    case GD_FLAC_E_SDIS | FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED:
+    case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED:
+    case GD_FLAC_E_SDIS | FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS:
+    case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS:
+    case GD_FLAC_E_SEIS
+      | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS:
+    case GD_FLAC_E_SEIS
+      | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE:
+    case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE:
+    case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE:
+    case GD_FLAC_E_SES  | FLAC__STREAM_ENCODER_UNINITIALIZED:
+    case GD_FLAC_E_SES  | FLAC__STREAM_ENCODER_CLIENT_ERROR:
+      /* these indicate bugs in our code */
+      snprintf(buf, buflen, "Internal error 0x%X in FLAC encoding",
+          file->error);
+      break;
+    case GD_FLAC_E_SDIS | FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE:
+      strncpy(buf, "FLAC: Error opening file", buflen);
+      break;
+    case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_FRAMING_ERROR:
+      strncpy(buf, "FLAC: Framing error", buflen);
+      break;
+    default:
+      snprintf(buf, buflen, "FLAC: Unkown error 0x%X", file->error);
+      break;
+  }
+
+  dreturn("%i", r);
+  return r;
+}
diff --git a/src/flimits.c b/src/flimits.c
index 0b9f526..e1bd154 100644
--- a/src/flimits.c
+++ b/src/flimits.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -36,8 +36,7 @@ static void _GD_ShiftFragment(DIRFILE* D, off64_t offset, int fragment,
   }
 
   if (move && offset != D->fragment[fragment].frame_offset) {
-    gd_entry_t **raw_entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) *
-        D->n_entries);
+    gd_entry_t **raw_entry = _GD_Malloc(D, sizeof(*raw_entry) * D->n_entries);
 
     if (raw_entry == NULL) {
       dreturnvoid();
@@ -192,19 +191,19 @@ off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
       if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_SIZE))
         break;
 
-      if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
+      if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D,
             (const char*)D->fragment[E->fragment_index].enc_data,
             E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
       {
         break;
       }
 
-      ns = (*gd_ef_[E->e->u.raw.file[0].subenc].size)(
+      ns = (*_GD_ef[E->e->u.raw.file[0].subenc].size)(
           D->fragment[E->fragment_index].dirfd, E->e->u.raw.file,
-          E->EN(raw,data_type), _GD_FileSwapBytes(D, E->fragment_index));
+          E->EN(raw,data_type), _GD_FileSwapBytes(D, E));
 
       if (ns < 0) {
-        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+        _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0);
         ns = -1;
         break;
       }
@@ -216,7 +215,7 @@ off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
     case GD_SBIT_ENTRY:
     case GD_POLYNOM_ENTRY:
     case GD_RECIP_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
@@ -225,8 +224,11 @@ off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
     case GD_MULTIPLY_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) ||
+          _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1))
+      {
         break;
+      }
 
       ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
 
@@ -263,7 +265,7 @@ off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
       }
       break;
     case GD_LINCOM_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
@@ -284,7 +286,7 @@ off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
       }
 
       for (i = 1; i < E->EN(lincom,n_fields); ++i) {
-        if (_GD_BadInput(D, E, i, 1)) {
+        if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) {
           ns = -1;
           break;
         }
@@ -313,7 +315,7 @@ off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
       }
       break;
     case GD_PHASE_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
@@ -350,14 +352,13 @@ off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
   return ns;
 }
 
-off64_t gd_eof64(DIRFILE* D, const char *field_code_in)
+off64_t gd_eof64(DIRFILE* D, const char *field_code)
 {
   off64_t ns;
   gd_entry_t *entry;
-  int repr, is_index;
-  char* field_code;
+  int is_index;
 
-  dtrace("%p, \"%s\"", D, field_code_in);
+  dtrace("%p, \"%s\"", D, field_code);
 
   _GD_ClearError(D);
 
@@ -367,8 +368,7 @@ off64_t gd_eof64(DIRFILE* D, const char *field_code_in)
     return -1;
   }
 
-  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
-      1);
+  entry = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
     dreturn("%i", -1);
@@ -380,9 +380,6 @@ off64_t gd_eof64(DIRFILE* D, const char *field_code_in)
   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;
 }
@@ -395,11 +392,11 @@ off_t gd_eof(DIRFILE* D, const char *field_code)
 
 static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
     const char *restrict parent, unsigned int *restrict spf,
-    long long *restrict ds)
+    int64_t *restrict ds)
 {
   off64_t bof = -1, bof1;
   unsigned int spf1;
-  long long ds1;
+  int64_t ds1;
   int i;
 
   dtrace("%p, %p, \"%s\", %p, %p", D, E, parent, spf, ds);
@@ -422,13 +419,13 @@ static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
     case GD_LINTERP_ENTRY:
     case GD_POLYNOM_ENTRY:
     case GD_RECIP_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
       break;
     case GD_PHASE_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
@@ -436,6 +433,7 @@ static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
       if (!D->error) {
         *ds -= E->EN(phase,shift);
 
+        /* remove whole frames from delta-samples */
         while (*ds < 0) {
           *ds += *spf;
           bof--;
@@ -456,8 +454,11 @@ static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
     case GD_DIVIDE_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) ||
+          _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1))
+      {
         break;
+      }
 
       bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
 
@@ -481,7 +482,7 @@ static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
       }
       break;
     case GD_LINCOM_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
@@ -492,7 +493,7 @@ static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
       }
 
       for (i = 1; i < E->EN(lincom,n_fields); ++i) {
-        if (_GD_BadInput(D, E, i, 1)) {
+        if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) {
           bof = -1;
           break;
         }
@@ -533,20 +534,19 @@ static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
 
   D->recurse_level--;
 
-  dreturn("%llu %lu %lli", (unsigned long long)bof, (unsigned long)*spf, *ds);
+  dreturn("%llu %lu %lli", (unsigned long long)bof, (unsigned long)*spf,
+      (long long)*ds);
   return bof;
 }
 
-off64_t gd_bof64(DIRFILE* D, const char *field_code_in) gd_nothrow
+off64_t gd_bof64(DIRFILE* D, const char *field_code) gd_nothrow
 {
   off64_t bof;
   gd_entry_t *entry;
-  int repr;
-  char *field_code;
   unsigned int spf;
-  long long ds;
+  int64_t ds;
 
-  dtrace("%p, \"%s\"", D, field_code_in);
+  dtrace("%p, \"%s\"", D, field_code);
 
   _GD_ClearError(D);
 
@@ -556,8 +556,7 @@ off64_t gd_bof64(DIRFILE* D, const char *field_code_in) gd_nothrow
     return -1;
   }
 
-  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
-      1);
+  entry = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
     dreturn("%i", -1);
@@ -569,9 +568,6 @@ off64_t gd_bof64(DIRFILE* D, const char *field_code_in) gd_nothrow
   if (bof != -1)
     bof = bof * spf + ds;
 
-  if (field_code != field_code_in)
-    free(field_code);
-
   dreturn("%lli", (unsigned long long)bof);
   return bof;
 }
diff --git a/src/flush.c b/src/flush.c
index f0c3a24..ad3a2c9 100644
--- a/src/flush.c
+++ b/src/flush.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012, 2015 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,33 +38,34 @@ void _GD_Flush(DIRFILE *D, gd_entry_t *E, int syn, int clo)
   switch(E->field_type) {
     case GD_RAW_ENTRY:
       if (E->e->u.raw.file[0].idata >= 0 ||
-          ((gd_ef_[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP) &&
+          ((_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP) &&
            (E->e->u.raw.file[1].idata >= 0)))
       {
         if (syn && (D->flags & GD_ACCMODE) == GD_RDWR &&
             (E->e->u.raw.file[0].mode & GD_FILE_WRITE) &&
-            gd_ef_[E->e->u.raw.file[0].subenc].sync != NULL &&
-            (*gd_ef_[E->e->u.raw.file[0].subenc].sync)(E->e->u.raw.file))
+            _GD_ef[E->e->u.raw.file[0].subenc].sync != NULL &&
+            (*_GD_ef[E->e->u.raw.file[0].subenc].sync)(E->e->u.raw.file))
         {
-          _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
-              NULL);
+          _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0);
         } else if (clo && _GD_FiniRawIO(D, E, E->fragment_index,
               GD_FINIRAW_KEEP))
         {
-          _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
-              NULL);
+          ; /* error already set */
         }
       }
       break;
     case GD_LINCOM_ENTRY:
-      for (i = 0; i < E->EN(lincom,n_fields); ++i)
-        _GD_Flush(D, E->e->entry[i], syn, clo);
+      for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+        if (!_GD_BadInput(D, E, i, GD_NO_ENTRY, 0))
+            _GD_Flush(D, E->e->entry[i], syn, clo);
+      }
       break;
     case GD_MULTIPLY_ENTRY:
     case GD_DIVIDE_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      _GD_Flush(D, E->e->entry[1], syn, clo);
+      if (!_GD_BadInput(D, E, 1, GD_NO_ENTRY, 0))
+        _GD_Flush(D, E->e->entry[1], syn, clo);
       /* fallthrough */
     case GD_LINTERP_ENTRY:
     case GD_BIT_ENTRY:
@@ -72,7 +73,8 @@ void _GD_Flush(DIRFILE *D, gd_entry_t *E, int syn, int clo)
     case GD_POLYNOM_ENTRY:
     case GD_SBIT_ENTRY:
     case GD_RECIP_ENTRY:
-      _GD_Flush(D, E->e->entry[0], syn, clo);
+      if (!_GD_BadInput(D, E, 0, GD_NO_ENTRY, 0))
+        _GD_Flush(D, E->e->entry[0], syn, clo);
     case GD_CONST_ENTRY:
     case GD_CARRAY_ENTRY:
     case GD_STRING_ENTRY:
@@ -218,32 +220,34 @@ static const char *_GD_WindopName(DIRFILE *D, gd_windop_t op)
   return ptr;
 }
 
-static size_t _GD_StringEscapeise(FILE *stream, const char *in, int meta,
+static ssize_t _GD_StringEscapeise(FILE *stream, const char *in, int meta,
     int permissive, int standards)
 {
   const char* HexDigit = "0123456789ABCDEF";
-  size_t len = 0;
+  ssize_t len = 0;
 
-  dtrace("%p, \"%s\", %i, %i", stream, in, permissive, standards);
+  dtrace("%p, \"%s\", %i, %i, %i", stream, in, meta, permissive, standards);
 
   if (in == NULL || in[0] == '\0') {
-    fputs("\"\"", stream);
+    if (stream) {
+      if (fputs("\"\"", stream) == EOF)
+        goto WRITE_ERR;
+    }
+
     dreturn("%i", 2);
     return 2;
   }
 
   if (!permissive && standards < 6) {
-    fputs(in, stream);
+    if (stream)
+      if (fputs(in, stream) == EOF)
+        goto WRITE_ERR;
     dreturn("%" PRNsize_t, strlen(in));
     return strlen(in);
   }
 
   for (; *in != '\0'; ++in) {
-    if (*in == '"') {
-      fputs("\\\"", stream);
-      len += 2;
-      fputc('\\', stream);
-    } else if (*in == '\\' || *in == '#' || *in == '"' || *in == ' ') {
+    if (*in == '\\' || *in == '#' || *in == '"' || *in == ' ') {
       fputc('\\', stream);
       fputc(*in, stream);
       len += 2;
@@ -251,80 +255,130 @@ static size_t _GD_StringEscapeise(FILE *stream, const char *in, int meta,
 #if CHAR_MIN != 0
         && *in >= 0x00
 #endif
-        ) {
-      fputs("\\x", stream);
-      fputc(HexDigit[*in >> 4], stream);
-      fputc(HexDigit[*in & 0xF], stream);
+        )
+    {
+      if (stream) {
+        if (fputs("\\x", stream) == EOF)
+          goto WRITE_ERR;
+        if (fputc(HexDigit[*in >> 4], stream) == EOF)
+          goto WRITE_ERR;
+        if (fputc(HexDigit[*in & 0xF], stream) == EOF)
+          goto WRITE_ERR;
+      }
       len += 4;
     } else if (meta && *in == '/')
       break;
     else {
-      fputc(*in, stream);
+      if (stream)
+        if (fputc(*in, stream) == EOF)
+          goto WRITE_ERR;
       len++;
     }
   }
 
   dreturn("%" PRNsize_t, len);
   return len;
+
+WRITE_ERR:
+  dreturn("%i", -1);
+  return -1;
 }
 
 /* write a field code, taking care of stripping off affixes; returns the length
  * written */
-static size_t _GD_WriteFieldCode(DIRFILE *D, FILE *stream, int me,
-    const char *code, int permissive, int standards)
+#define GD_WFC_SPACE      0x1
+#define GD_WFC_SCALAR     0x2
+static ssize_t _GD_WriteFieldCode(DIRFILE *D, FILE *stream, int me,
+    const char *code, int index, int permissive, int standards, unsigned flags)
 {
-  int dummy;
-  size_t len;
+  ssize_t len;
   char *ptr;
 
-  dtrace("%p, %p, %i, \"%s\", %i, %i", D, stream, me, code, permissive,
-      standards);
+  const int scalar     = flags & GD_WFC_SCALAR;
+  const int space      = flags & GD_WFC_SPACE;
+
+  dtrace("%p, %p, %i, \"%s\", %i, %i, %i, 0x%X", D, stream, me, code, index,
+      permissive, standards, flags);
 
-  ptr = _GD_MungeCode(D, NULL, D->fragment[me].prefix, D->fragment[me].suffix,
-      NULL, NULL, code, &dummy, 0);
+  ptr = _GD_MungeCode(D, NULL, 0, D->fragment[me].prefix,
+      D->fragment[me].suffix, NULL, NULL, code, NULL, NULL, GD_MC_RQ_PARTS);
 
   len = _GD_StringEscapeise(stream, ptr, 0, permissive, standards);
 
+  /* If a scalar field code could be interpreted as a number, we must force
+   * interpretation as a field code by appending a <0> scalar index, which is
+   * valid for both CARRAY and CONST fields.
+   */
+  if (len > 0 && scalar && index == -1)
+    if (_GD_TokToNum(ptr, standards, !permissive, NULL, NULL, NULL, NULL) != -1)
+    {
+      if (permissive || standards >= 8) {
+        if (fputs("<0>", stream) == EOF)
+          len = -1;
+        else
+          len += 3;
+      } else 
+        _GD_InternalError(D);
+    }
+
+  /* append a space */
+  if (space && len > 0) {
+    if (fputc(' ', stream) == EOF)
+      len = -1;
+    else
+      len++;
+  }
+
   free(ptr);
 
-  dreturn("%" PRNsize_t, len);
+  dreturn("%" PRNssize_t, len);
   return len;
 }
 
 /* write a field, padding to the specified length */
-static void _GD_PadField(DIRFILE *D, FILE *stream, int me, const char *in,
-    size_t len, int permissive, int standards)
+static ssize_t _GD_PadField(DIRFILE *D, FILE *stream, int me, const char *in,
+    ssize_t len, int permissive, int standards)
 {
-  size_t i;
+  ssize_t i;
 
   dtrace("%p, %p, %i, \"%s\", %" PRNsize_t ", %i, %i", D, stream, me, in, len,
       permissive, standards);
 
-  for (i = _GD_WriteFieldCode(D, stream, me, in, permissive, standards);
-      i < len; ++i)
-  {
-    fputc(' ', stream);
-  }
+  i = _GD_WriteFieldCode(D, stream, me, in, 0, permissive, standards, 0);
 
-  dreturnvoid();
+  if (i >= 0)
+    for (; i < len; ++i)
+      if (fputc(' ', stream) == EOF) {
+        i = -1;
+        break;
+      }
+
+  dreturn("%" PRNssize_t, i);
+  return i;
 }
 
 /* Write a litteral parameter or CONST name or CARRAY element */
-static void _GD_WriteConst(DIRFILE *D, FILE* stream, int me, int permissive,
-    int type, const void* value, const char* scalar, int index,
-    const char* postamble)
+static int _GD_WriteConst(DIRFILE *D, FILE *stream, int me, int permissive,
+    int type, const void* value, const char *scalar, int index,
+    const char *postamble)
 {
+  int e;
+
   dtrace("%p, %p, %i, %i, 0x%X, %p, \"%s\", %i, \"%s\"", D, stream, me,
       permissive, type, value, scalar, index, postamble);
 
   if (scalar != NULL) {
-    _GD_WriteFieldCode(D, stream, me, scalar, permissive, D->standards);
+    if (_GD_WriteFieldCode(D, stream, me, scalar, index, permissive,
+          D->standards, GD_WFC_SCALAR) < 0)
+    {
+      dreturn("%i", -1);
+      return -1;
+    }
     if (index == -1)
       fprintf(stream, "%s", postamble);
     else
       fprintf(stream, "<%i>%s", index, postamble);
-  }
-  else if (type == GD_UINT64)
+  } else if (type == GD_UINT64)
     fprintf(stream, "%" PRIu64 "%s", *(uint64_t *)value, postamble);
   else if (type == GD_INT64)
     fprintf(stream, "%" PRIi64 "%s", *(int64_t *)value, postamble);
@@ -340,259 +394,365 @@ static void _GD_WriteConst(DIRFILE *D, FILE* stream, int me, int permissive,
     fprintf(stream, "%.15g%s", *(double *)value, postamble);
   else if (type == GD_COMPLEX128)
     fprintf(stream, "%.15g;%.15g%s", *(double *)value, ((double *)value)[1],
-      postamble);
-  else
+        postamble);
+  else {
     _GD_InternalError(D);
+    dreturn("%i", -1);
+    return -1;
+  }
 
-  dreturnvoid();
+  e = ferror(stream);
+  dreturn("%i", e);
+  return e;
 }
 
 /* Write a field specification line */
-static void _GD_FieldSpec(DIRFILE* D, FILE* stream, const gd_entry_t* E,
+static int _GD_FieldSpec(DIRFILE* D, FILE* stream, const gd_entry_t* E,
     int me, int meta, size_t max_len, int pretty, int permissive)
 {
   int i;
-  size_t z;
   char *ptr;
+  ssize_t len, pos;
+  char buffer[1000];
+  size_t z;
 
   dtrace("%p, %p, %p, %i, %i, %" PRNsize_t ", %i, %i", D, stream, E, me, meta,
       max_len, pretty, permissive);
 
   /* INDEX is implicit, and it is an error to define it in the format file */
   if (E->field_type == GD_INDEX_ENTRY) {
-    dreturnvoid();
-    return;
+    dreturn("%i", 0);
+    return 0;
   }
 
   /* aliases */
   if (E->field_type == GD_ALIAS_ENTRY) {
-    fputs("/ALIAS ", stream);
-    _GD_WriteFieldCode(D, stream, me, E->field, permissive, D->standards);
-    fputc(' ', stream);
-    _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-        D->standards);
-    fputc('\n', stream);
+    if (fputs("/ALIAS ", stream) == EOF)
+      goto WRITE_ERR;
+    if (_GD_WriteFieldCode(D, stream, me, E->field, 0, permissive, D->standards,
+          GD_WFC_SPACE) < 0)
+    {
+      goto WRITE_ERR;
+    }
+    if (_GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+          D->standards, 0) < 0)
+    {
+      goto WRITE_ERR;
+    }
+    if (fputc('\n', stream) == EOF)
+      goto WRITE_ERR;
   } else {
     ptr = E->field;
 
     /* From Standards Version 7 and on, just use Barth-style */
     if (meta && D->standards < 7) {
-      fputs("META ", stream);
-      _GD_StringEscapeise(stream, ptr, 1, permissive, D->standards);
-      fputc(' ', stream);
+      if (fputs("META ", stream) == EOF)
+        goto WRITE_ERR;
+      if (_GD_StringEscapeise(stream, ptr, 1, permissive, D->standards) < 0)
+        goto WRITE_ERR;
+      if (fputc(' ', stream) == EOF)
+        goto WRITE_ERR;
       ptr = strchr(E->field, '/') + 1;
     }
 
     /* field name */
-    _GD_PadField(D, stream, me, ptr, max_len, permissive, D->standards);
+    if (_GD_PadField(D, stream, me, ptr, max_len, permissive, D->standards) < 0)
+      goto WRITE_ERR;
 
     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, me, permissive, GD_UINT_TYPE, &E->EN(raw,spf),
-            E->scalar[0], E->scalar_ind[0], "\n");
+        if (fprintf(stream, " RAW%s %s ", pretty ? "     " : "", (permissive ||
+                D->standards >= 5) ? _GD_TypeName(D, E->EN(raw,data_type)) :
+              _GD_OldTypeName(D, E->EN(raw,data_type))) < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_UINT_TYPE,
+              &E->EN(raw,spf), E->scalar[0], E->scalar_ind[0], "") < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_LINCOM_ENTRY:
-        fprintf(stream, " LINCOM%s %i", pretty ? "  " : "",
-            E->EN(lincom,n_fields));
+        if (fprintf(stream, " LINCOM%s %i ", pretty ? "  " : "",
+              E->EN(lincom,n_fields)) < 0)
+        {
+          goto WRITE_ERR;
+        }
         for (i = 0; i < E->EN(lincom,n_fields); ++i) {
-          fputc(' ', stream);
-          _GD_WriteFieldCode(D, stream, me, E->in_fields[i], permissive,
-              D->standards);
-          fputc(' ', stream);
-          if (E->comp_scal) {
-            _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
-                &E->EN(lincom,cm)[i], E->scalar[i], E->scalar_ind[i], " ");
-            _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
-                &E->EN(lincom,cb)[i], E->scalar[i + GD_MAX_LINCOM],
-                E->scalar_ind[i + GD_MAX_LINCOM], "");
+          if (_GD_WriteFieldCode(D, stream, me, E->in_fields[i], 0, permissive,
+                D->standards, GD_WFC_SPACE) < 0)
+          {
+            goto WRITE_ERR;
+          }
+
+          if (E->flags & GD_EN_COMPSCAL) {
+            if (_GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
+                  &E->EN(lincom,cm)[i], E->scalar[i], E->scalar_ind[i], " ") < 0
+                || _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
+                  &E->EN(lincom,cb)[i], E->scalar[i + GD_MAX_LINCOM],
+                  E->scalar_ind[i + GD_MAX_LINCOM],
+                  i == E->EN(lincom,n_fields) - 1 ? "" : " ") < 0)
+            {
+              goto WRITE_ERR;
+            }
           } else {
-            _GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
-                &E->EN(lincom,m)[i], E->scalar[i], E->scalar_ind[i], " ");
-            _GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
-                &E->EN(lincom,b)[i], E->scalar[i + GD_MAX_LINCOM],
-                E->scalar_ind[i + GD_MAX_LINCOM], "");
+            if (_GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
+                  &E->EN(lincom,m)[i], E->scalar[i], E->scalar_ind[i], " ") < 0
+                || _GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
+                  &E->EN(lincom,b)[i], E->scalar[i + GD_MAX_LINCOM],
+                  E->scalar_ind[i + GD_MAX_LINCOM],
+                  i == E->EN(lincom,n_fields) - 1 ? "" : " ") < 0)
+            {
+              goto WRITE_ERR;
+            }
           }
         }
-        fputc('\n', stream);
         break;
       case GD_LINTERP_ENTRY:
-        fprintf(stream, " LINTERP%s ", pretty ? " " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_StringEscapeise(stream, E->EN(linterp,table), 0, permissive,
-            D->standards);
-        fputc('\n', stream);
+        if (fprintf(stream, " LINTERP%s ", pretty ? " " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_StringEscapeise(stream, E->EN(linterp,table), 0, permissive,
+              D->standards) < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_BIT_ENTRY:
-        fprintf(stream, " BIT%s ", pretty ? "     " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
-            &E->EN(bit,bitnum), E->scalar[0], E->scalar_ind[0], " ");
-        _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
-            &E->EN(bit,numbits), E->scalar[1], E->scalar_ind[1], "\n");
+        if (fprintf(stream, " BIT%s ", pretty ? "     " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
+              &E->EN(bit,bitnum), E->scalar[0], E->scalar_ind[0], " ") < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
+              &E->EN(bit,numbits), E->scalar[1], E->scalar_ind[1], "") < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_DIVIDE_ENTRY:
-        fprintf(stream, " DIVIDE%s ", pretty ? "  " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[1], permissive,
-            D->standards);
-        fputc('\n', stream);
+        if (fprintf(stream, " DIVIDE%s ", pretty ? "  " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive,
+              D->standards, 0) < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_RECIP_ENTRY:
-        fprintf(stream, " RECIP%s ", pretty ? "   " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
-            &E->EN(recip,cdividend), E->scalar[0], E->scalar_ind[0], "\n");
+        if (fprintf(stream, " RECIP%s ", pretty ? "   " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
+              &E->EN(recip,cdividend), E->scalar[0], E->scalar_ind[0], "") < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_MULTIPLY_ENTRY:
-        fputs(" MULTIPLY ", stream);
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[1], permissive,
-            D->standards);
-        fputc('\n', stream);
+        if (fputs(" MULTIPLY ", stream) == EOF ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive,
+              D->standards, 0) < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_PHASE_ENTRY:
-        fprintf(stream, " PHASE%s ", pretty ? "   " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteConst(D, stream, me, permissive, GD_INT64, &E->EN(phase,shift),
-            E->scalar[0], E->scalar_ind[0], "\n");
+        if (fprintf(stream, " PHASE%s ", pretty ? "   " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_INT64,
+              &E->EN(phase,shift), E->scalar[0], E->scalar_ind[0], "") < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_POLYNOM_ENTRY:
-        fprintf(stream, " POLYNOM%s ", pretty ? " " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
+        if (fprintf(stream, " POLYNOM%s ", pretty ? " " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0)
+        {
+          goto WRITE_ERR;
+        }
         for (i = 0; i <= E->EN(polynom,poly_ord); ++i)
-          if (E->comp_scal)
-            _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
-                &E->EN(polynom,ca)[i], E->scalar[i], E->scalar_ind[i],
-                (i == E->EN(polynom,poly_ord)) ?  "\n" : " ");
-          else
-            _GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
-                &E->EN(polynom,a)[i], E->scalar[i], E->scalar_ind[i],
-                (i == E->EN(polynom,poly_ord)) ?  "\n" : " ");
+          if (E->flags & GD_EN_COMPSCAL) {
+            if (_GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128,
+                  &E->EN(polynom,ca)[i], E->scalar[i], E->scalar_ind[i],
+                  (i == E->EN(polynom,poly_ord)) ?  "" : " ") < 0)
+            {
+              goto WRITE_ERR;
+            }
+          } else {
+            if (_GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
+                  &E->EN(polynom,a)[i], E->scalar[i], E->scalar_ind[i],
+                  (i == E->EN(polynom,poly_ord)) ?  "" : " ") < 0)
+            {
+              goto WRITE_ERR;
+            }
+          }
         break;
       case GD_SBIT_ENTRY:
-        fprintf(stream, " SBIT%s ", pretty ? "    " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE, &E->EN(bit,bitnum),
-            E->scalar[0], E->scalar_ind[0], " ");
-        _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
-            &E->EN(bit,numbits), E->scalar[1], E->scalar_ind[1], "\n");
+        if (fprintf(stream, " SBIT%s ", pretty ? "    " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
+              &E->EN(bit,bitnum), E->scalar[0], E->scalar_ind[0], " ") < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
+              &E->EN(bit,numbits), E->scalar[1], E->scalar_ind[1], "") < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_WINDOW_ENTRY:
-        fprintf(stream, " WINDOW%s ", pretty ? "  " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[1], permissive,
-            D->standards);
-        fprintf(stream, " %s ", _GD_WindopName(D, E->EN(window,windop)));
+        if (fprintf(stream, " WINDOW%s ", pretty ? "  " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive,
+              D->standards, 0) < 0 ||
+            fprintf(stream, " %s ", _GD_WindopName(D, E->EN(window,windop)))
+            < 0)
+        {
+          goto WRITE_ERR;
+        }
         switch (E->EN(window,windop)) {
           case GD_WINDOP_EQ:
           case GD_WINDOP_NE:
-            _GD_WriteConst(D, stream, me, permissive, GD_INT64,
-                &E->EN(window,threshold.i), E->scalar[0], E->scalar_ind[0],
-                "\n");
+            if (_GD_WriteConst(D, stream, me, permissive, GD_INT64,
+                  &E->EN(window,threshold.i), E->scalar[0], E->scalar_ind[0],
+                  "") < 0)
+            {
+              goto WRITE_ERR;
+            }
             break;
           case GD_WINDOP_SET:
           case GD_WINDOP_CLR:
-            _GD_WriteConst(D, stream, me, permissive, GD_UINT64,
-                &E->EN(window,threshold.u), E->scalar[0], E->scalar_ind[0],
-                "\n");
+            if (_GD_WriteConst(D, stream, me, permissive, GD_UINT64,
+                  &E->EN(window,threshold.u), E->scalar[0], E->scalar_ind[0],
+                  "") < 0)
+            {
+              goto WRITE_ERR;
+            }
             break;
           default:
-            _GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
-                &E->EN(window,threshold.r), E->scalar[0], E->scalar_ind[0],
-                "\n");
+            if (_GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
+                  &E->EN(window,threshold.r), E->scalar[0], E->scalar_ind[0],
+                  "") < 0)
+            {
+              goto WRITE_ERR;
+            }
             break;
         }
         break;
       case GD_MPLEX_ENTRY:
-        fprintf(stream, " MPLEX%s ", pretty ? "   " : "");
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteFieldCode(D, stream, me, E->in_fields[1], permissive,
-            D->standards);
-        fputc(' ', stream);
-        _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
-            &E->EN(mplex,count_val), E->scalar[0], E->scalar_ind[0], "");
-        if (E->EN(mplex,period) > 0 || E->scalar[1]) {
-          fputc(' ', stream);
-          _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
-              &E->EN(mplex,period), E->scalar[1], E->scalar_ind[1], "\n");
-        } else
-          fputc('\n', stream);
+        if (fprintf(stream, " MPLEX%s ", pretty ? "   " : "") < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive,
+              D->standards, GD_WFC_SPACE) < 0 ||
+            _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
+              &E->EN(mplex,count_val), E->scalar[0], E->scalar_ind[0], " ") < 0
+            || _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE,
+              &E->EN(mplex,period), E->scalar[1], E->scalar_ind[1], "") < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_CONST_ENTRY:
-        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);
+        if (fprintf(stream, " CONST%s %s ", pretty ? "   " : "", _GD_TypeName(D,
+                E->EN(scalar,const_type))) < 0)
+        {
+          goto WRITE_ERR;
+        }
+        if (E->EN(scalar,const_type) & GD_SIGNED) {
+          if (fprintf(stream, "%" PRIi64, *(int64_t*)E->e->u.scalar.d) < 0)
+            goto WRITE_ERR;
+        } else if (E->EN(scalar,const_type) & GD_IEEE754) {
+          if (fprintf(stream, "%.15g", *(double*)E->e->u.scalar.d) < 0)
+            goto WRITE_ERR;
+        } else if (E->EN(scalar,const_type) & GD_COMPLEX) {
+          if (fprintf(stream, "%.15g;%.15g", *(double*)E->e->u.scalar.d,
+                *((double*)E->e->u.scalar.d + 1)) < 0)
+          {
+            goto WRITE_ERR;
+          }
+        } else
+          if (fprintf(stream, "%" PRIu64, *(uint64_t*)E->e->u.scalar.d) < 0)
+            goto WRITE_ERR;
         break;
       case GD_CARRAY_ENTRY:
-        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],
+        pos = fprintf(stream, " CARRAY%s %s", pretty ? "  " : "",
+            _GD_TypeName(D, E->EN(scalar,const_type)));
+        if (pos < 0)
+          goto WRITE_ERR;
+
+        for (z = 0; z < E->EN(scalar,array_len); ++z) {
+          if (E->EN(scalar,const_type) & GD_SIGNED)
+            len = sprintf(buffer, " %" PRIi64, ((int64_t*)E->e->u.scalar.d)[z]);
+          else if (E->EN(scalar,const_type) & GD_IEEE754)
+            len = sprintf(buffer, " %.15g", ((double*)E->e->u.scalar.d)[z]);
+          else if (E->EN(scalar,const_type) & GD_COMPLEX)
+            len = sprintf(buffer, " %.15g;%.15g",
+                ((double*)E->e->u.scalar.d)[2 * z],
                 ((double*)E->e->u.scalar.d)[2 * z + 1]);
-        else
-          for (z = 0; z < E->EN(scalar,array_len); ++z)
-            fprintf(stream, " %" PRIu64, ((uint64_t*)E->e->u.scalar.d)[z]);
-        fputc('\n', stream);
+          else
+            len = sprintf(buffer, " %" PRIu64,
+                ((uint64_t*)E->e->u.scalar.d)[z]);
+
+          /* don't write lines that are too long
+           * also, add one to length for the trailing '\n' */
+          if (GD_SSIZE_T_MAX - (len + 1) <= pos) {
+            _GD_SetError(D, GD_E_LINE_TOO_LONG, GD_E_LONG_FLUSH, E->field, 0, NULL);
+            dreturn("%i", -1);
+            return -1;
+          }
+          if (fputs(buffer, stream) == EOF)
+            goto WRITE_ERR;
+        }
         break;
       case GD_STRING_ENTRY:
-        fprintf(stream, " STRING%s ", pretty ? "  " : "");
-        _GD_StringEscapeise(stream, E->e->u.string, 0, permissive,
-            D->standards);
-        fputc('\n', stream);
+        if (fprintf(stream, " STRING%s ", pretty ? "  " : "") < 0)
+          goto WRITE_ERR;
+        if (_GD_StringEscapeise(stream, E->e->u.string, 0, permissive,
+              D->standards) < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
       case GD_INDEX_ENTRY:
       case GD_ALIAS_ENTRY:
       case GD_NO_ENTRY:
         _GD_InternalError(D);
-        break;
+        dreturn("%i", -1);
+        return -1;
     }
+
+    if (fputc('\n', stream) == EOF)
+      goto WRITE_ERR;
   }
 
-  if (!D->error && E->hidden && (permissive || D->standards >= 9)) {
-    fputs("/HIDDEN ", stream);
-    _GD_WriteFieldCode(D, stream, me, E->field, permissive, D->standards);
-    fputc('\n', stream);
+  if (!D->error && (E->flags & GD_EN_HIDDEN) &&
+      (permissive || D->standards >= 9))
+  {
+    if (fputs("/HIDDEN ", stream) == EOF)
+      goto WRITE_ERR;
+    if (_GD_WriteFieldCode(D, stream, me, E->field, 0, permissive, D->standards,
+          0) < 0)
+    {
+      goto WRITE_ERR;
+    }
+    if (fputc('\n', stream) == EOF)
+      goto WRITE_ERR;
   }
 
-  dreturnvoid();
+  dreturn("%i", 0);
+  return 0;
+
+WRITE_ERR:
+  if (!D->error)
+    _GD_SetError(D, GD_E_IO, GD_E_IO_WRITE, NULL, 0, NULL);
+  dreturn("%i", -1);
+  return -1;
 }
 
 static void _GD_FlushFragment(DIRFILE* D, int i, int permissive)
@@ -603,9 +763,9 @@ static void _GD_FlushFragment(DIRFILE* D, int i, int permissive)
   char temp_file[] = "format_XXXXXX";
   char* ptr;
   struct tm now;
-  int fd, dummy;
+  int fd;
   int pretty = 0;
-  size_t max_len = 0;
+  ssize_t max_len = 0;
   unsigned int u;
 #ifdef HAVE_FCHMOD
   mode_t mode;
@@ -627,25 +787,25 @@ static void _GD_FlushFragment(DIRFILE* D, int i, int permissive)
   /* open a temporary file */
   fd = _GD_MakeTempFile(D, dirfd, temp_file);
   if (fd == -1) {
-    _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_MKTMP, NULL, errno, temp_file);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, NULL, 0, NULL);
     dreturnvoid();
     return;
   }
   stream = fdopen(fd, "wb+");
   if (stream == NULL) {
-    _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_OPEN, NULL, errno, temp_file);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, NULL, 0, NULL);
     dreturnvoid();
     return;
   }
 
   if (D->flags & GD_PRETTY_PRINT) {
     size_t t = 0;
-    size_t m = 0;
+    ssize_t m = 0;
     int n = 0;
     pretty = 1;
     for (u = 0; u < D->n_entries; ++u)
       if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) {
-        size_t l = strlen(D->entry[u]->field);
+        ssize_t l = strlen(D->entry[u]->field);
         if (m < l)
           m = l;
         t += l;
@@ -662,148 +822,225 @@ static void _GD_FlushFragment(DIRFILE* D, int i, int permissive)
   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 (fprintf(stream, "# This is a dirfile format file.\n"
+        "# It was written using version %s of the GetData Library.\n"
+        "# Written on %s UTC", PACKAGE_VERSION, buffer) < 0)
+  {
+    goto WRITE_ERR;
+  }
+
+  ptr = getenv("LOGNAME");
+  if (ptr == NULL)
+    ptr = getenv("USER");
 
-  if ((ptr = getenv("LOGNAME")) != NULL) {
-    fprintf(stream, " by %s", ptr);
+  if (ptr != NULL) {
+    if (fprintf(stream, " by %s", ptr) < 0)
+      goto WRITE_ERR;
     if ((ptr = getenv("HOSTNAME")) != NULL)
-      fprintf(stream, "@%s", ptr);
+      if (fprintf(stream, "@%s", ptr) < 0)
+        goto WRITE_ERR;
   }
-  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);
+  if (fputs(".\n\n", stream) == EOF)
+    goto WRITE_ERR;
+
+  /* version */
+  if (permissive) {
+    if (fprintf(stream, "# WARNING: This file may not conform to any "
+          "Dirfile Standards Version.\n") < 0)
+    {
+      goto WRITE_ERR;
+    }
+  } else if (D->standards >= 5) {
+    if (fprintf(stream, "/VERSION %i\n", D->standards) < 0)
+      goto WRITE_ERR;
+  } else
+    if (fprintf(stream,
+          "# This file conforms to Dirfile Standards Version %i.\n",
+          D->standards) < 0)
+    {
+      goto WRITE_ERR;
+    }
 
   /* Byte Sex */
   if (permissive || D->standards >= 5)
-    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 (fprintf(stream, "/ENDIAN %s%s\n",
+          (D->fragment[i].byte_sex & GD_LITTLE_ENDIAN) ? "little" : "big",
+          ((permissive || D->standards >= 8) &&
+           (D->fragment[i].byte_sex & GD_ARM_FLAG) == GD_ARM_ENDIAN) ? " arm" :
+          "") < 0)
+    {
+      goto WRITE_ERR;
+    }
 
+  /* Protection */
   if (permissive || D->standards >= 6) {
-    if (D->fragment[i].protection == GD_PROTECT_NONE)
-      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_DATA)
-      fputs("/PROTECT data\n", stream);
-    else
-      fputs("/PROTECT all\n", stream);
+    if (D->fragment[i].protection == GD_PROTECT_NONE) {
+      if (fputs("/PROTECT none\n", stream) == EOF)
+        goto WRITE_ERR;
+    } else if (D->fragment[i].protection == GD_PROTECT_FORMAT) {
+      if (fputs("/PROTECT format\n", stream) == EOF)
+        goto WRITE_ERR;
+    } else if (D->fragment[i].protection == GD_PROTECT_DATA) {
+      if (fputs("/PROTECT data\n", stream) == EOF)
+        goto WRITE_ERR;
+    } else {
+      if (fputs("/PROTECT all\n", stream) == EOF)
+        goto WRITE_ERR;
+    }
   }
 
+  /* Frame offset */
   if (permissive || D->standards >= 1)
     if (D->fragment[i].frame_offset != 0)
-      fprintf(stream, "%sFRAMEOFFSET %llu\n", (D->standards >= 5) ? "/" : "",
-          (unsigned long long)D->fragment[i].frame_offset);
+      if (fprintf(stream, "%sFRAMEOFFSET %llu\n",
+            (D->standards >= 5) ? "/" : "",
+            (unsigned long long)D->fragment[i].frame_offset) < 0)
+      {
+        goto WRITE_ERR;
+      }
 
+  /* Encoding */
   if (permissive || D->standards >= 6) {
+    const char *encoding = NULL;
+    int use_encdat = 0;
     switch(D->fragment[i].encoding) {
       case GD_UNENCODED:
-        fputs("/ENCODING none\n", stream);
+        encoding = "none";
         break;
       case GD_BZIP2_ENCODED:
-        fputs("/ENCODING bzip2\n", stream);
+        encoding = "bzip2";
         break;
       case GD_GZIP_ENCODED:
-        fputs("/ENCODING gzip\n", stream);
+        encoding = "gzip";
         break;
       case GD_LZMA_ENCODED:
-        fputs("/ENCODING lzma\n", stream);
+        encoding = "lzma";
         break;
       case GD_SLIM_ENCODED:
-        fputs("/ENCODING slim\n", stream);
+        encoding = "slim";
         break;
       case GD_TEXT_ENCODED:
-        fputs("/ENCODING text\n", stream);
+        encoding = "text";
         break;
       case GD_SIE_ENCODED:
-        fputs("/ENCODING sie\n", stream);
+        encoding = "sie";
         break;
       case GD_ZZIP_ENCODED:
-        if (D->fragment[i].enc_data)
-          fprintf(stream, "/ENCODING zzip %s\n",
-              (char*)D->fragment[i].enc_data);
-        else
-          fputs("/ENCODING zzip\n", stream);
+        encoding = "zzip";
+        use_encdat = 1;
         break;
       case GD_ZZSLIM_ENCODED:
-        if (D->fragment[i].enc_data)
-          fprintf(stream, "/ENCODING zzslim %s\n",
-              (char*)D->fragment[i].enc_data);
-        else
-          fputs("/ENCODING zzslim\n", stream);
+        encoding = "zzslim";
+        use_encdat = 1;
+        break;
+      case GD_FLAC_ENCODED:
+        encoding = "flac";
         break;
       case GD_AUTO_ENCODED: /* an unresolved, auto-encoded fragment */
         break;
       default:
-        fprintf(stream, "/ENCODING unknown # (%lx)\n", D->fragment[i].encoding);
+        if (fprintf(stream, "/ENCODING unknown # (%lx)\n",
+              D->fragment[i].encoding) < 0)
+        {
+          goto WRITE_ERR;
+        }
         break;
     }
+
+    if (encoding != NULL) {
+      if (use_encdat && D->fragment[i].enc_data) {
+
+        if (fprintf(stream, "/ENCODING %s %s\n", encoding,
+              (char*)D->fragment[i].enc_data) < 0)
+        {
+          goto WRITE_ERR;
+        }
+      } else {
+        if (fprintf(stream, "/ENCODING %s\n", encoding) < 0)
+          goto WRITE_ERR;
+      }
+    }
   }
 
   /* The includes */
   if (permissive || D->standards >= 3)
     for (j = 0; j < D->n_fragment; ++j)
       if (D->fragment[j].parent == i) {
-        char *prefix = _GD_MungeCode(D, NULL, D->fragment[i].prefix, NULL, NULL,
-            NULL, D->fragment[j].prefix, &dummy, 0);
-        char *suffix = _GD_MungeCode(D, NULL, NULL, D->fragment[i].suffix, NULL,
-            NULL, D->fragment[j].suffix, &dummy, 0);
-
-        fprintf(stream, "%sINCLUDE ", (D->standards >= 5) ? "/" : "");
-        _GD_StringEscapeise(stream, D->fragment[j].ename, 0, permissive,
-            D->standards);
+        char *prefix = _GD_MungeCode(D, NULL, 0, D->fragment[i].prefix, NULL,
+            NULL, NULL, D->fragment[j].prefix, NULL, NULL, GD_MC_RQ_PARTS);
+        char *suffix = _GD_MungeCode(D, NULL, 0, NULL, D->fragment[i].suffix,
+            NULL, NULL, D->fragment[j].suffix, NULL, NULL, GD_MC_RQ_PARTS);
+
+        if (fprintf(stream, "%sINCLUDE ", (D->standards >= 5) ? "/" : "") < 0 ||
+            _GD_StringEscapeise(stream, D->fragment[j].ename, 0, permissive,
+              D->standards) < 0)
+        {
+          goto WRITE_ERR;
+        }
         if (prefix || suffix) {
-          fputc(' ', stream);
-          _GD_StringEscapeise(stream, prefix, 0, permissive, D->standards);
+          if (fputc(' ', stream) == EOF || _GD_StringEscapeise(stream, prefix,
+                0, permissive, D->standards) < 0)
+          {
+            goto WRITE_ERR;
+          }
           free(prefix);
         }
 
         if (suffix) {
-          fputc(' ', stream);
-          _GD_StringEscapeise(stream, suffix, 0, permissive, D->standards);
+          if (fputc(' ', stream) == EOF || _GD_StringEscapeise(stream, suffix,
+                0, permissive, D->standards) < 0)
+          {
+            goto WRITE_ERR;
+          }
           free(suffix);
         }
-        fputc('\n', stream);
+        if (fputc('\n', stream) == EOF)
+          goto WRITE_ERR;
       }
 
   /* The fields */
   for (u = 0; u < D->n_entries; ++u)
     if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) {
-      _GD_FieldSpec(D, stream, D->entry[u], i, 0, max_len, pretty, permissive);
+      if (_GD_FieldSpec(D, stream, D->entry[u], i, 0, max_len, pretty,
+            permissive) < 0)
+      {
+        goto WRITE_ERR;
+      }
       if (permissive || D->standards >= 6)
         for (j = 0; j < D->entry[u]->e->n_meta; ++j)
-          _GD_FieldSpec(D, stream, D->entry[u]->e->p.meta_entry[j], i, 1, 0,
-              pretty, permissive);
+          if (_GD_FieldSpec(D, stream, D->entry[u]->e->p.meta_entry[j], i, 1, 0,
+                pretty, permissive) < 0)
+          {
+            goto WRITE_ERR;
+          }
     }
 
   /* REFERENCE is written at the end, because its effect can propagate
    * upwards */
   if (permissive || D->standards >= 6)
     if (D->fragment[i].ref_name != NULL) {
-      fputs("/REFERENCE ", stream);
-      _GD_WriteFieldCode(D, stream, i, D->fragment[i].ref_name, permissive,
-          D->standards);
-      fputc('\n', stream);
+      if (fputs("/REFERENCE ", stream) == EOF ||
+          _GD_WriteFieldCode(D, stream, i, D->fragment[i].ref_name, 0,
+            permissive, D->standards, 0) < 0 ||
+          fputc('\n', stream) == EOF)
+      {
+        goto WRITE_ERR;
+      }
     }
 
-  /* That's all; flush, sync, and close */
-  fflush(stream);
-  fsync(fd);
+  /* That's all */
 #ifdef HAVE_FCHMOD
-  fchmod(fd, mode);
+  if (fchmod(fd, mode))
+    goto WRITE_ERR;
 #endif
-  fclose(stream);
+
+  /* if there's no error, try closing */
+  if (ferror(stream) || fclose(stream) == EOF) {
+WRITE_ERR:
+    if (!D->error)
+      _GD_SetError(D, GD_E_IO, GD_E_IO_WRITE, NULL, 0, NULL);
+    fclose(stream);
+  }
 
   /* If no error was encountered, move the temporary file over the
    * old format file, otherwise abort */
@@ -812,8 +1049,7 @@ static void _GD_FlushFragment(DIRFILE* D, int i, int permissive)
   if (D->error != GD_E_OK)
     gd_UnlinkAt(D, dirfd, temp_file, 0);
   else if (gd_RenameAt(D, dirfd, temp_file, dirfd, D->fragment[i].bname)) {
-    _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_RENAME, NULL, errno,
-        D->fragment[i].cname);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_WRITE, NULL, 0, NULL);
     gd_UnlinkAt(D, dirfd, temp_file, 0);
   } else
     D->fragment[i].modified = 0;
@@ -834,9 +1070,9 @@ void _GD_FlushMeta(DIRFILE* D, int fragment, int 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);
+        _GD_FlushFragment(D, i, D->flags & GD_NOSTANDARD);
   } else if (force || D->fragment[fragment].modified)
-    _GD_FlushFragment(D, fragment, D->flags & GD_PERMISSIVE);
+    _GD_FlushFragment(D, fragment, D->flags & GD_NOSTANDARD);
 
   dreturnvoid();
 }
@@ -898,8 +1134,6 @@ int gd_rewrite_fragment(DIRFILE* D, int fragment)
 static int _GD_SyncOrClose(DIRFILE* D, const char* field_code, int syn, int clo)
 {
   unsigned int i;
-  int repr;
-  char *simple_field_code;
   gd_entry_t *E;
 
   dtrace("%p, \"%s\", %i, %i", D, field_code, syn, clo);
@@ -915,15 +1149,10 @@ static int _GD_SyncOrClose(DIRFILE* D, const char* field_code, int syn, int clo)
         if (D->entry[i]->field_type == GD_RAW_ENTRY)
           _GD_Flush(D, D->entry[i], syn, clo);
   } else {
-    /* discard representation */
-    E = _GD_FindFieldAndRepr(D, field_code, &simple_field_code, &repr, NULL, 1,
-        1);
+    E = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
     if (!D->error)
       _GD_Flush(D, E, syn, clo);
-
-    if (field_code != simple_field_code)
-      free(simple_field_code);
   }
 
   dreturn("%i", (D->error == GD_E_OK) ? 0 : -1);
@@ -1028,7 +1257,7 @@ uint64_t _GD_FindVersion(DIRFILE *D)
   }
 
   for (i = 0; D->av && i < D->n_entries; ++i) {
-    if (D->entry[i]->hidden)
+    if (D->entry[i]->flags & GD_EN_HIDDEN)
       D->av &= GD_VERS_GE_9;
     else
       switch (D->entry[i]->field_type) {
@@ -1117,7 +1346,8 @@ uint64_t _GD_FindVersion(DIRFILE *D)
           D->av &= GD_VERS_GE_6;
           break;
         case '.':
-          D->av &= GD_VERS_LE_5;
+          if (D->entry[i]->flags & GD_EN_DOTTED)
+            D->av &= GD_VERS_LE_5;
           break;
         case '&':
         case ';':
diff --git a/src/fpos.c b/src/fpos.c
index 628c9dc..d64c098 100644
--- a/src/fpos.c
+++ b/src/fpos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2012 D. V. Wiebe
+/* Copyright (C) 2011-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,19 +38,22 @@ off64_t _GD_GetFilePos(DIRFILE *D, gd_entry_t *E, off64_t index_pos)
     case GD_RAW_ENTRY:
       /* We must open the file to know its starting offset */
       if (E->e->u.raw.file[0].idata < 0)
-        if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0))
+        if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_READ,
+              _GD_FileSwapBytes(D, E)))
+        {
           break;
+        }
       pos = E->e->u.raw.file[0].pos + E->EN(raw,spf) *
         D->fragment[E->fragment_index].frame_offset;
       break;
     case GD_LINCOM_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       pos = _GD_GetFilePos(D, E->e->entry[0], -1);
       if (!D->error)
         for (i = 1; i < E->EN(lincom,n_fields); ++i) {
-          if (_GD_BadInput(D, E, i, 1)) {
+          if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) {
             pos = -1;
             break;
           }
@@ -67,7 +70,7 @@ off64_t _GD_GetFilePos(DIRFILE *D, gd_entry_t *E, off64_t index_pos)
     case GD_POLYNOM_ENTRY:
     case GD_SBIT_ENTRY:
     case GD_RECIP_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
           break;
       pos = _GD_GetFilePos(D, E->e->entry[0], -1);
       break;
@@ -75,8 +78,11 @@ off64_t _GD_GetFilePos(DIRFILE *D, gd_entry_t *E, off64_t index_pos)
     case GD_DIVIDE_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) ||
+          _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1))
+      {
           break;
+      }
       pos = _GD_GetFilePos(D, E->e->entry[0], -1);
       if (D->error)
         break;
@@ -87,7 +93,7 @@ off64_t _GD_GetFilePos(DIRFILE *D, gd_entry_t *E, off64_t index_pos)
       }
       break;
     case GD_PHASE_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
       pos = _GD_GetFilePos(D, E->e->entry[0], -1);
       if (pos >= 0)
@@ -114,14 +120,12 @@ off64_t _GD_GetFilePos(DIRFILE *D, gd_entry_t *E, off64_t index_pos)
 
 /* Get the current I/O position of the given field
 */
-off64_t gd_tell64(DIRFILE *D, const char *field_code_in) gd_nothrow
+off64_t gd_tell64(DIRFILE *D, const char *field_code) gd_nothrow
 {
   off64_t pos = -1;
   gd_entry_t* entry;
-  char* field_code;
-  int repr;
 
-  dtrace("%p, \"%s\"", D, field_code_in);
+  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);
@@ -131,8 +135,7 @@ off64_t gd_tell64(DIRFILE *D, const char *field_code_in) gd_nothrow
 
   _GD_ClearError(D);
 
-  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
-      1);
+  entry = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
     dreturn("%u", 0);
@@ -144,9 +147,6 @@ off64_t gd_tell64(DIRFILE *D, const char *field_code_in) gd_nothrow
   else
     pos = _GD_GetFilePos(D, entry, -1);
 
-  if (field_code != field_code_in)
-    free(field_code);
-
   dreturn("%lli", (long long)pos);
   return pos;
 }
@@ -156,73 +156,87 @@ off_t gd_tell(DIRFILE *D, const char *field_code) gd_nothrow
   return (off_t)gd_tell64(D, field_code);
 }
 
-off64_t _GD_WriteSeek(DIRFILE *D, gd_entry_t *E, const struct encoding_t *enc,
+off64_t _GD_DoSeek(DIRFILE *D, gd_entry_t *E, const struct encoding_t *enc,
     off64_t offset, unsigned int mode)
 {
-  off64_t pos = 0;
+  off64_t pos;
   const int which = (mode & GD_FILE_TEMP) ? 1 : 0;
   const int oop_write = ((enc->flags & GD_EF_OOP) && (mode & GD_FILE_WRITE))
     ? 1 : 0;
 
   dtrace("%p, %p, %p, %lli, 0x%X", D, E, enc, (long long)offset, mode);
 
-  /* in this case we need to close and then re-open the file */
-  if ((offset < E->e->u.raw.file[which].pos) && oop_write) {
-    if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) {
-      dreturn("%i", -1);
-      return -1;
-    } else if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK, GD_FILE_WRITE, 0))
-    {
-      dreturn("%i", -1);
-      return -1;
+  if (oop_write) {
+    /* in this case we need to close and then re-open the file */
+    if (offset < E->e->u.raw.file[which].pos) {
+      if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) {
+        dreturn("%i", -1);
+        return -1;
+      } else if (_GD_InitRawIO(D, E, NULL, -1, NULL, GD_EF_SEEK, GD_FILE_WRITE,
+            _GD_FileSwapBytes(D, E)))
+      {
+        dreturn("%i", -1);
+        return -1;
+      }
     }
-  }
 
-  if (oop_write && E->e->u.raw.file[0].idata >= 0) {
-    /* read from the old file until we reach the point we're interested in or
-     * run out of data */
-    char buffer[GD_BUFFER_SIZE];
-    ssize_t n_read, n_wrote;
-
-    while (offset * GD_SIZE(E->EN(raw,data_type)) > GD_BUFFER_SIZE) {
-      n_read = (*enc->read)(E->e->u.raw.file, buffer, E->EN(raw,data_type),
-            GD_BUFFER_SIZE);
-      if (n_read > 0) {
-        n_wrote = (*enc->write)(E->e->u.raw.file + 1, buffer,
-            E->EN(raw,data_type), n_read);
-        if (n_wrote != n_read) {
-          dreturn("%i", -1);
-          return -1;
-        }
-        offset -= n_wrote;
-        pos += n_wrote;
-      } else if (n_read < 0) {
+    if (E->e->u.raw.file[0].idata >= 0) {
+      /* read from the old file until we reach the point we're interested in or
+       * run out of data */
+      char *buffer, *ptr;
+      ssize_t n_read, n_wrote;
+      const off64_t chunk_size = GD_BUFFER_SIZE / GD_SIZE(E->EN(raw,data_type));
+
+      off64_t count, remaining = offset - E->e->u.raw.file[which].pos;
+
+      buffer = _GD_Malloc(D, GD_BUFFER_SIZE);
+      if (buffer == NULL) {
         dreturn("%i", -1);
         return -1;
       }
-    }
 
-    if (offset > 0) {
-      n_read = (*enc->read)(E->e->u.raw.file, buffer, E->EN(raw,data_type),
-            offset);
-      if (n_read > 0) {
-        n_wrote = (*enc->write)(E->e->u.raw.file + 1, buffer,
-            E->EN(raw,data_type), n_read);
-        if (n_wrote != n_read) {
+      while (remaining > 0) {
+        if (remaining > chunk_size)
+          count = chunk_size;
+        else
+          count = remaining;
+
+        n_read = (*enc->read)(E->e->u.raw.file, buffer, E->EN(raw,data_type),
+            count);
+
+        if (n_read < 0) {
+          _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0);
+          free(buffer);
           dreturn("%i", -1);
           return -1;
+        } else if (n_read == 0) /* EOF */
+          break;
+
+        ptr = buffer;
+        while (n_read > 0) {
+          n_wrote = (*enc->write)(E->e->u.raw.file + 1, ptr,
+              E->EN(raw,data_type), n_read);
+          if (n_wrote < 0) {
+            _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 1);
+            free(buffer);
+            dreturn("%i", -1);
+            return -1;
+          }
+          remaining -= n_wrote;
+          n_read -= n_wrote;
+          ptr += n_wrote;
         }
-        offset -= n_wrote;
-        pos += n_wrote;
-      } else if (n_read < 0) {
-        dreturn("%i", -1);
-        return -1;
       }
+
+      free(buffer);
     }
   }
 
-  pos += (*enc->seek)(E->e->u.raw.file + which, offset, E->EN(raw,data_type),
+  pos = (*enc->seek)(E->e->u.raw.file + which, offset, E->EN(raw,data_type),
       mode);
+  if (pos < 0)
+    _GD_SetEncIOError(D, (mode & GD_FILE_WRITE) ? GD_E_IO_WRITE : GD_E_IO_READ,
+        E->e->u.raw.file + 0);
 
   dreturn("%lli", (long long)pos);
   return pos;
@@ -250,8 +264,11 @@ int _GD_Seek(DIRFILE *D, gd_entry_t *E, off64_t offset, unsigned int mode)
   switch (E->field_type) {
     case GD_RAW_ENTRY:
       /* open/create the file, if necessary */
-      if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK, mode, 0))
+      if (_GD_InitRawIO(D, E, NULL, -1, NULL, GD_EF_SEEK, mode,
+            _GD_FileSwapBytes(D, E)))
+      {
         break;
+      }
 
       /* The requested offset is before the start of the file, so I guess
        * pretend we've repositioned it...
@@ -263,16 +280,12 @@ int _GD_Seek(DIRFILE *D, gd_entry_t *E, off64_t offset, unsigned int mode)
         break;
       }
 
-      if (_GD_WriteSeek(D, E, gd_ef_ + E->e->u.raw.file[0].subenc, offset -
-            E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset, mode)
-          == -1)
-      {
-        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
-      }
+      _GD_DoSeek(D, E, _GD_ef + E->e->u.raw.file[0].subenc, offset -
+          E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset, mode);
       break;
     case GD_LINCOM_ENTRY:
       for (i = 0; i < E->EN(lincom,n_fields); ++i)
-        if (!_GD_BadInput(D, E, i, 1))
+        if (!_GD_BadInput(D, E, i, GD_NO_ENTRY, 1))
           _GD_Seek(D, E->e->entry[i], offset, mode);
         else
           break;
@@ -281,7 +294,7 @@ int _GD_Seek(DIRFILE *D, gd_entry_t *E, off64_t offset, unsigned int mode)
     case GD_DIVIDE_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      if (_GD_BadInput(D, E, 1, 1))
+      if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1))
         break;
       if (_GD_Seek(D, E->e->entry[1], offset, mode))
         break;
@@ -291,11 +304,11 @@ int _GD_Seek(DIRFILE *D, gd_entry_t *E, off64_t offset, unsigned int mode)
     case GD_POLYNOM_ENTRY:
     case GD_SBIT_ENTRY:
     case GD_RECIP_ENTRY:
-      if (!_GD_BadInput(D, E, 0, 1))
+      if (!_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         _GD_Seek(D, E->e->entry[0], offset, mode);
       break;
     case GD_PHASE_ENTRY:
-      if (!_GD_BadInput(D, E, 0, 1))
+      if (!_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         _GD_Seek(D, E->e->entry[0], offset - E->EN(phase,shift), mode);
       break;
     case GD_INDEX_ENTRY:
@@ -315,18 +328,17 @@ int _GD_Seek(DIRFILE *D, gd_entry_t *E, off64_t offset, unsigned int mode)
 }
 
 /* Set the I/O position of the given field
- */
-off64_t gd_seek64(DIRFILE *D, const char *field_code_in, off64_t frame_num,
+*/
+off64_t gd_seek64(DIRFILE *D, const char *field_code, off64_t frame_num,
     off64_t sample_num, int whence)
 {
   unsigned int spf = 0;
   off64_t pos = 0;
   gd_entry_t* entry;
-  char* field_code;
-  int repr, is_index = 0;
+  int is_index = 0;
   unsigned int mode = (whence & GD_SEEK_WRITE) ? GD_FILE_WRITE : GD_FILE_READ;
 
-  dtrace("%p, \"%s\", %lli, %lli, 0x%X", D, field_code_in, (long long)frame_num,
+  dtrace("%p, \"%s\", %lli, %lli, 0x%X", D, field_code, (long long)frame_num,
       (long long)sample_num, whence);
 
   if (D->flags & GD_INVALID) {/* don't crash */
@@ -337,8 +349,7 @@ off64_t gd_seek64(DIRFILE *D, const char *field_code_in, off64_t frame_num,
 
   _GD_ClearError(D);
 
-  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
-      1);
+  entry = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
     dreturn("%i", -1);
@@ -347,8 +358,6 @@ off64_t gd_seek64(DIRFILE *D, const char *field_code_in, off64_t frame_num,
 
   if (entry->field_type & GD_SCALAR_ENTRY_BIT) {
     _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
-    if (field_code != field_code_in)
-      free(field_code);
     dreturn("%i", -1);
     return -1;
   }
@@ -357,8 +366,6 @@ off64_t gd_seek64(DIRFILE *D, const char *field_code_in, off64_t frame_num,
     spf = _GD_GetSPF(D, entry);
 
     if (D->error) {
-      if (field_code != field_code_in)
-        free(field_code);
       dreturn("%i", -1);
       return -1;
     }
@@ -381,9 +388,6 @@ off64_t gd_seek64(DIRFILE *D, const char *field_code_in, off64_t frame_num,
   if (!D->error)
     _GD_Seek(D, entry, sample_num + pos, mode);
 
-  if (field_code != field_code_in)
-    free(field_code);
-
   if (D->error)
     pos = -1;
   else
diff --git a/src/fragment.c b/src/fragment.c
index ae375df..90d9a90 100644
--- a/src/fragment.c
+++ b/src/fragment.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2010, 2011, 2012 D. V. Wiebe
+/* Copyright (C) 2008, 2010, 2011, 2012, 2014, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -83,13 +83,13 @@ int gd_fragment_affixes(DIRFILE *D, int index, char **prefix, char **suffix)
 static char **_GD_CheckAffixes(DIRFILE *D, int i, const char *prefix,
     const char *suffix, char **codes, unsigned *n)
 {
-  int j, dummy;
+  int j;
   unsigned u, nn = *n;
   char **new_codes = codes, **ptr;
 
   dtrace("%p, %i, \"%s\", \"%s\", %p, %p", D, i, prefix, suffix, new_codes, n);
 
-  ptr = (char**)_GD_Realloc(D, codes, sizeof(char*) * (nn + 2));
+  ptr = _GD_Realloc(D, codes, sizeof(*ptr) * (nn + 2));
   if (!ptr) {
     dreturn("%p (%i)", codes, *n);
     return codes;
@@ -109,10 +109,12 @@ static char **_GD_CheckAffixes(DIRFILE *D, int i, const char *prefix,
   /* Propagate changes downward */
   for (j = 0; j < D->n_fragment; ++j)
     if (D->fragment[j].parent == i) {
-      char *subprefix = _GD_MungeCode(D, NULL, D->fragment[i].prefix, NULL,
-          prefix, NULL, D->fragment[j].prefix, &dummy, 1);
-      char *subsuffix = _GD_MungeCode(D, NULL, NULL, D->fragment[i].suffix,
-          NULL, suffix, D->fragment[j].suffix, &dummy, 1);
+      char *subprefix = _GD_MungeCode(D, NULL, 0, D->fragment[i].prefix,
+          NULL, prefix, NULL, D->fragment[j].prefix, NULL, NULL,
+          GD_MC_RQ_PARTS | GD_MC_ERROR_OK);
+      char *subsuffix = _GD_MungeCode(D, NULL, 0, NULL,
+          D->fragment[i].suffix, NULL, suffix, D->fragment[j].suffix, NULL,
+          NULL, GD_MC_RQ_PARTS | GD_MC_ERROR_OK);
       if (D->error) {
         free(subprefix);
         dreturn("%p (%i)", new_codes, *n);
@@ -133,22 +135,21 @@ static char **_GD_CheckAffixes(DIRFILE *D, int i, const char *prefix,
   /* Check for namespace clashes in our files */
   for (u = 0; u < D->n_entries; ++u)
     if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) {
-      ptr = (char**)_GD_Realloc(D, new_codes, sizeof(char*) * ++nn);
+      ptr = _GD_Realloc(D, new_codes, sizeof(*ptr) * ++nn);
       if (ptr) {
+        char *nso;
         new_codes = ptr;
         /* remunge the code */
-        new_codes[nn - 1] = _GD_MungeCode(D, NULL, D->fragment[i].prefix,
-            D->fragment[i].suffix, prefix, suffix, D->entry[u]->field, &dummy,
-            0);
+        new_codes[nn - 1] = _GD_MungeCode(D, NULL, 0, D->fragment[i].prefix,
+            D->fragment[i].suffix, prefix, suffix, D->entry[u]->field, &nso,
+            NULL, GD_MC_RQ_PARTS);
 
         /* look for a duplicate and validate */
         if (new_codes[nn - 1] && _GD_FindField(D, new_codes[nn - 1], D->entry,
               D->n_entries, 0, NULL))
         {
           _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, new_codes[nn - 1]);
-        } else if (_GD_ValidateField(new_codes[nn - 1], D->standards, 1, 0,
-              NULL))
-        {
+        } else if (_GD_ValidateField(nso, D->standards, 1, GD_VF_NAME, NULL)) {
           _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0,
               new_codes[nn - 1]);
         }
@@ -333,8 +334,8 @@ int gd_desync(DIRFILE *D, unsigned int flags)
       /* stat the file via it's path relative to the original filedir */
       char *buffer;
       if (D->fragment[i].sname) {
-        buffer = (char*)_GD_Malloc(D, strlen(D->name) +
-            strlen(D->fragment[i].bname) + strlen(D->fragment[i].sname) + 3);
+        buffer = _GD_Malloc(D, strlen(D->name) + strlen(D->fragment[i].bname) +
+            strlen(D->fragment[i].sname) + 3);
         if (buffer == NULL) {
           dreturn("%i", -1);
           return -1;
@@ -342,8 +343,8 @@ int gd_desync(DIRFILE *D, unsigned int flags)
         sprintf(buffer, "%s%c%s%c%s", D->name, GD_DIRSEP, D->fragment[i].sname,
             GD_DIRSEP, D->fragment[i].bname);
       } else {
-        buffer = (char*)_GD_Malloc(D, strlen(D->name) +
-            strlen(D->fragment[i].bname) + 2);
+        buffer = _GD_Malloc(D, strlen(D->name) + strlen(D->fragment[i].bname) +
+            2);
         if (buffer == NULL) {
           dreturn("%i", -1);
           return -1;
@@ -351,7 +352,7 @@ int gd_desync(DIRFILE *D, unsigned int flags)
         sprintf(buffer, "%s%c%s", D->name, GD_DIRSEP, D->fragment[i].bname);
       }
       if (stat(buffer, &statbuf)) {
-        _GD_SetError(D, GD_E_RAW_IO, 0, buffer, errno, NULL);
+        _GD_SetError(D, GD_E_IO, 0, buffer, 0, NULL);
         free(buffer);
         dreturn("%i", -1);
         return -1;
@@ -361,7 +362,7 @@ int gd_desync(DIRFILE *D, unsigned int flags)
       /* stat the file based on it's name and our cached dirfd */
       if (gd_StatAt(D, D->fragment[i].dirfd, D->fragment[i].bname, &statbuf, 0))
       {
-        _GD_SetError(D, GD_E_RAW_IO, 0, D->fragment[i].cname, errno, NULL);
+        _GD_SetError(D, GD_E_IO, 0, D->fragment[i].cname, 0, NULL);
         dreturn("%i", -1);
         return -1;
       }
@@ -387,7 +388,7 @@ int gd_desync(DIRFILE *D, unsigned int flags)
     if (!(flags & GD_DESYNC_PATHCHECK)) {
       dirfd = dup(D->fragment[0].dirfd);
       if (dirfd == -1) {
-        _GD_SetError(D, GD_E_RAW_IO, 0, D->name, errno, NULL);
+        _GD_SetError(D, GD_E_IO, GD_E_OPEN, D->name, 0, NULL);
         dreturn("%i", -1);
         return -1;
       }
diff --git a/src/gd_config.h.in b/src/gd_config.h.in
index f23235d..110d4f0 100644
--- a/src/gd_config.h.in
+++ b/src/gd_config.h.in
@@ -36,6 +36,9 @@
 /* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */
 #undef FC_NO_MINUS_C_MINUS_O
 
+/* Define to the full path to the `flac' binary */
+#undef FLAC
+
 /* Define to 1 if your processor stores double-precision floats in big-endian
    order */
 #undef FLOATS_BIGENDIAN
@@ -116,6 +119,14 @@
    don't. */
 #undef HAVE_DECL_STRERROR_R
 
+/* Define to 1 if you have the declaration of `_strtoi64', and to 0 if you
+   don't. */
+#undef HAVE_DECL__STRTOI64
+
+/* Define to 1 if you have the declaration of `_strtoui64', and to 0 if you
+   don't. */
+#undef HAVE_DECL__STRTOUI64
+
 /* Define to 1 if you have the <direct.h> header file. */
 #undef HAVE_DIRECT_H
 
@@ -135,6 +146,9 @@
 /* Define to 1 if you have the `fdopendir' function. */
 #undef HAVE_FDOPENDIR
 
+/* Define to 1 if you have the <FLAC/all.h> header file. */
+#undef HAVE_FLAC_ALL_H
+
 /* Define to 1 if you have the <float.h> header file. */
 #undef HAVE_FLOAT_H
 
@@ -183,6 +197,12 @@
 /* Define to 1 if you have the `gmtime_r' function. */
 #undef HAVE_GMTIME_R
 
+/* Define to 1 if you have the `gzseek64' function. */
+#undef HAVE_GZSEEK64
+
+/* Define to 1 if you have the `gztell64' function. */
+#undef HAVE_GZTELL64
+
 /* Define to 1 if you have the <idl_export.h> header file. */
 #undef HAVE_IDL_EXPORT_H
 
@@ -198,6 +218,9 @@
 /* Define to 1 if you have the `bz2' library (-lbz2). */
 #undef HAVE_LIBBZ2
 
+/* Define to 1 if you have the `FLAC' library (-lFLAC). */
+#undef HAVE_LIBFLAC
+
 /* Define to 1 if you have the <libgen.h> header file. */
 #undef HAVE_LIBGEN_H
 
@@ -261,9 +284,6 @@
 /* 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 `readdir_r' function. */
 #undef HAVE_READDIR_R
 
@@ -273,18 +293,21 @@
 /* Define to 1 if you have the `renameat' function. */
 #undef HAVE_RENAMEAT
 
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
 /* Define to 1 if you have the `slimdopen' function. */
 #undef HAVE_SLIMDOPEN
 
+/* Define to 1 if you have the `slimdrawsize' function. */
+#undef HAVE_SLIMDRAWSIZE
+
 /* Define to 1 if you have the <slimlib.h> header file. */
 #undef HAVE_SLIMLIB_H
 
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
-/* 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
 
@@ -347,9 +370,15 @@
 /* Define to 1 if you have the <sys/param.h> header file. */
 #undef HAVE_SYS_PARAM_H
 
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_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/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
@@ -515,8 +544,8 @@
 /* The size of `void *', as computed by sizeof. */
 #undef SIZEOF_VOID_P
 
-/* Define to the full path to the `slim' binary */
-#undef SLIM
+/* Define to the full path to the `slimdata' binary */
+#undef SLIMDATA
 
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
@@ -527,6 +556,9 @@
 /* Define to enable bzip2 tests */
 #undef TEST_BZIP2
 
+/* Define to enable flac tests */
+#undef TEST_FLAC
+
 /* Define to enable gzip tests */
 #undef TEST_GZIP
 
@@ -551,6 +583,9 @@
 /* Define to enable bzip2 support */
 #undef USE_BZIP2
 
+/* Define to enable flac support */
+#undef USE_FLAC
+
 /* Define to enable gzip support */
 #undef USE_GZIP
 
@@ -560,9 +595,6 @@
 /* Define if building with modules */
 #undef USE_MODULES
 
-/* Define to enable NumPy support in the Python bindings */
-#undef USE_NUMPY
-
 /* Define if you have a POSIX compliant thread library */
 #undef USE_PTHREAD
 
@@ -618,17 +650,6 @@
 /* Define to the full path to the `zip' binary */
 #undef ZIP
 
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
 /* Define to 1 if on MINIX. */
 #undef _MINIX
 
@@ -682,6 +703,9 @@
    a type exists and the standard includes do not define it. */
 #undef int8_t
 
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
+
 /* Define to `long int' if <sys/types.h> does not define. */
 #undef off_t
 
@@ -705,6 +729,9 @@
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
+
 /* Define to the type of an unsigned integer type of width exactly 16 bits if
    such a type exists and the standard includes do not define it. */
 #undef uint16_t
diff --git a/src/getdata.c b/src/getdata.c
index 34f3906..0d41cd8 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -21,84 +21,55 @@
  */
 #include "internal.h"
 
-#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) \
+#define EXTRACT_REPRR2(it,ot,fb,fr) \
   switch (repr) { \
     case GD_REPR_REAL: EXTRACT_REPR(it,ot,); break; \
     case GD_REPR_IMAG: EXTRACT_REPR(it,ot,0 *); break; \
-    case GD_REPR_MOD:  EXTRACT_REPR(it,ot,fabs); break; \
-    case GD_REPR_ARG:  EXTRACT_REPR(it,ot,f); break; \
+    case GD_REPR_MOD:  EXTRACT_REPR(it,ot,fb); break; \
+    case GD_REPR_ARG:  EXTRACT_REPR(it,ot,fr); break; \
   }
 
 #define EXTRACT_REPRS(ot) \
   switch (in_type) { \
-    case GD_UINT8:      EXTRACT_REPRR2(       uint8_t, ot,fargu); break; \
-    case GD_INT8:       EXTRACT_REPRR2(        int8_t, ot,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_UINT8:      EXTRACT_REPRR2(       uint8_t, ot,,fargu); break; \
+    case GD_INT8:       EXTRACT_REPRR2(        int8_t, ot,abs,fargs); break; \
+    case GD_UINT16:     EXTRACT_REPRR2(      uint16_t, ot,,fargu); break; \
+    case GD_INT16:      EXTRACT_REPRR2(       int16_t, ot,abs,fargs); break; \
+    case GD_UINT32:     EXTRACT_REPRR2(      uint32_t, ot,,fargu); break; \
+    case GD_INT32:      EXTRACT_REPRR2(       int32_t, ot,abs,fargs); break; \
+    case GD_UINT64:     EXTRACT_REPRR2(      uint64_t, ot,,fargu); break; \
+    case GD_INT64:      EXTRACT_REPRR2(       int64_t, ot,llabs,fargs); break; \
+    case GD_FLOAT32:    EXTRACT_REPRR2(         float, ot,fabs,fargs); break; \
+    case GD_FLOAT64:    EXTRACT_REPRR2(        double, ot,fabs,fargs); break; \
+    case GD_COMPLEX64:  EXTRACT_REPRC2(         float, ot); break; \
+    case GD_COMPLEX128: EXTRACT_REPRC2(        double, ot); break; \
     case GD_NULL: \
       break; \
     default: \
       _GD_SetError(D, GD_E_BAD_TYPE, in_type, NULL, 0, NULL); \
   }
-#else
-#define EXTRACT_REPR2(it,ot) \
+
+#define EXTRACT_REPRC2(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; \
+    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_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); \
-  }
+#ifdef GD_NO_C99_API
+#define EXTRACT_REPRC(it,ot,f) \
+  for (i = 0; i < n; ++i) ((ot *)rdata)[i] = (ot)f((it *)cdata + 2 * i)
+#else
+#define EXTRACT_REPRC(it,ot,f) EXTRACT_REPR(_Complex it,ot,f)
 #endif
 
-
 static void _GD_ExtractRepr(DIRFILE *restrict D, const void *restrict cdata,
     gd_type_t in_type, void *restrict rdata, gd_type_t type, size_t n, int repr)
 {
@@ -253,8 +224,8 @@ static int _GD_FillZero(void *databuffer, gd_type_t type, size_t nz)
 static size_t _GD_DoRaw(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t s0,
     size_t ns, gd_type_t return_type, void *restrict data_out)
 {
-  size_t n_read = 0;
-  ssize_t samples_read;
+  size_t n_read, zeroed_samples = 0;
+  ssize_t samples_read = 0;
   char *databuffer;
   size_t zero_pad = 0;
 
@@ -267,7 +238,7 @@ static size_t _GD_DoRaw(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t s0,
   else
     s0 -= E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset;
 
-  databuffer = (char *)_GD_Malloc(D, ns * E->e->u.raw.size);
+  databuffer = _GD_Malloc(D, ns * E->e->u.raw.size);
   if (databuffer == NULL) {
     dreturn("%i", 0);
     return 0;
@@ -275,83 +246,63 @@ static size_t _GD_DoRaw(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t s0,
 
   if (zero_pad > 0) {
     /* frame offset in samples */
-    off64_t foffs = E->EN(raw,spf) *
+    const off64_t foffs = E->EN(raw,spf) *
       D->fragment[E->fragment_index].frame_offset;
 
-    n_read = _GD_FillZero(databuffer, E->EN(raw,data_type),
+    zeroed_samples = _GD_FillZero(databuffer, E->EN(raw,data_type),
         (zero_pad > ns) ? ns : zero_pad);
-    ns -= n_read;
+    ns -= zeroed_samples;
 
-    /* Padding up to the end of the frameoffset, results in a "real" file
-     * position.  In this case we need to make sure the underlying file is
-     * actually at the BOF, for consistency.
-     */
-    if (s0 + (off64_t)n_read == foffs) /* ie. file->pos is zero */
+     /* Padding up to the end of the frameoffset, results in a "real" file
+      * position.  In this case we need to make sure the underlying file is
+      * actually at the BOF, for consistency.
+      */
+    if (s0 + (off64_t)zeroed_samples == foffs) /* ie. file->pos is zero */
       _GD_Seek(D, E, foffs, GD_SEEK_SET);
     else 
-      E->e->u.raw.file[0].pos = s0 + n_read - foffs;
+      E->e->u.raw.file[0].pos = s0 + zeroed_samples - foffs;
     s0 = 0;
   }
 
   if (ns > 0) {
     /* open the file (and cache the fp) if it hasn't been opened yet. */
-    if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK | GD_EF_READ,
-          GD_FILE_READ, 0))
+    if (_GD_InitRawIO(D, E, NULL, -1, NULL, GD_EF_SEEK | GD_EF_READ,
+          GD_FILE_READ, _GD_FileSwapBytes(D, E)))
     {
       free(databuffer);
       dreturn("%i", 0);
       return 0;
     }
 
-    if ((*gd_ef_[E->e->u.raw.file[0].subenc].seek)(E->e->u.raw.file, s0,
+    if ((*_GD_ef[E->e->u.raw.file[0].subenc].seek)(E->e->u.raw.file, s0,
           E->EN(raw,data_type), GD_FILE_READ) == -1)
     {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0);
       free(databuffer);
       dreturn("%i", 0);
       return 0;
     }
 
-    samples_read =
-      (*gd_ef_[E->e->u.raw.file[0].subenc].read)(E->e->u.raw.file,
-          databuffer + n_read * E->e->u.raw.size, E->EN(raw,data_type), ns);
+    samples_read = (*_GD_ef[E->e->u.raw.file[0].subenc].read)(E->e->u.raw.file,
+          databuffer + zeroed_samples * E->e->u.raw.size, E->EN(raw,data_type),
+          ns);
 
     if (samples_read == -1) {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0);
       free(databuffer);
       dreturn("%i", 0);
       return 0;
     }
 
-    if (gd_ef_[E->e->u.raw.file[0].subenc].flags & GD_EF_ECOR) {
-      /* 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);
-      }
-    }
+    if (_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_ECOR)
+      _GD_FixEndianness(databuffer + zeroed_samples * E->e->u.raw.size,
+          samples_read, E->EN(raw,data_type),
+          D->fragment[E->fragment_index].byte_sex, 0);
 
-    n_read += samples_read;
   }
+
+  n_read = samples_read + zeroed_samples;
+
   _GD_ConvertType(D, databuffer, E->EN(raw,data_type), data_out, return_type,
       n_read);
 
@@ -691,10 +642,11 @@ static void _GD_CPolynomData(DIRFILE *restrict D, void *restrict data,
 #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.
+/* MultiplyData: Multiply A by purely real B.  B is unchanged.
 */
 static void _GD_MultiplyData(DIRFILE *restrict D, void *restrict A,
-    unsigned int spfA, double *B, unsigned int spfB, gd_type_t type, size_t n)
+    unsigned int spfA, const double *B, unsigned int spfB, gd_type_t type,
+    size_t n)
 {
   size_t i;
 
@@ -722,7 +674,6 @@ static void _GD_MultiplyData(DIRFILE *restrict D, void *restrict A,
 }
 
 #ifdef GD_NO_C99_API
-#undef MULTIPLY
 #undef MULTIPLYC
 
 #define MULTIPLYC(t) \
@@ -736,13 +687,10 @@ static void _GD_MultiplyData(DIRFILE *restrict D, void *restrict A,
     } \
   } 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.
+/* CMultiplyData: Multiply A by B.  B is complex -- as it happens A is also
+ * complex due to the way we deal with complex valued derived fields
 */
 static void _GD_CMultiplyData(DIRFILE *restrict D, void *restrict A,
     unsigned int spfA, GD_DCOMPLEXP(B), unsigned int spfB, gd_type_t type,
@@ -754,16 +702,16 @@ static void _GD_CMultiplyData(DIRFILE *restrict D, void *restrict A,
 
   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_UINT8:
+    case GD_INT8:
+    case GD_UINT16:
+    case GD_INT16:
+    case GD_UINT32:
+    case GD_INT32:
+    case GD_UINT64:
+    case GD_INT64:
+    case GD_FLOAT32:
+    case GD_FLOAT64: _GD_InternalError(D);  break;
     case GD_COMPLEX64:  MULTIPLYC(  float); break;
     case GD_COMPLEX128: MULTIPLYC( double); break;
     default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
@@ -786,7 +734,8 @@ static void _GD_CMultiplyData(DIRFILE *restrict D, void *restrict A,
 #endif
 
 #define DIVIDE(t) \
-  for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] / B[i * spfB / spfA])
+  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.
 */
@@ -820,7 +769,6 @@ static void _GD_DivideData(DIRFILE *restrict D, void *restrict A,
 }
 
 #ifdef GD_NO_C99_API
-#undef DIVIDE
 #undef DIVIDEC
 
 #define DIVIDEC(t) \
@@ -835,13 +783,10 @@ static void _GD_DivideData(DIRFILE *restrict D, void *restrict A,
     } \
   } 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.
+/* CDivideData: Divide A by B.  B is complex.  (See remarks on CMultiplyData
+ * about A.)
 */
 static void _GD_CDivideData(DIRFILE *restrict D, void *restrict A,
     unsigned int spfA, GD_DCOMPLEXP(B), unsigned int spfB, gd_type_t type,
@@ -853,16 +798,16 @@ static void _GD_CDivideData(DIRFILE *restrict D, void *restrict A,
 
   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_UINT8:
+    case GD_INT8:
+    case GD_UINT16:
+    case GD_INT16:
+    case GD_UINT32:
+    case GD_INT32:
+    case GD_UINT64:
+    case GD_INT64:
+    case GD_FLOAT32:
+    case GD_FLOAT64: _GD_InternalError(D); break;
     case GD_COMPLEX64:  DIVIDEC(  float); break;
     case GD_COMPLEX128: DIVIDEC( double); break;
     default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
@@ -1020,7 +965,7 @@ static size_t _GD_DoLincom(DIRFILE *restrict D, gd_entry_t *restrict E,
 
   /* input field checks */
   for (i = 0; i < E->EN(lincom,n_fields); ++i) {
-    if (_GD_BadInput(D, E, i, 1)) {
+    if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) {
       dreturn("%i", 0);
       return 0;
     }
@@ -1117,7 +1062,7 @@ static size_t _GD_DoLincom(DIRFILE *restrict D, gd_entry_t *restrict E,
   }
 
   /* Compute everything at once */
-  if (E->comp_scal)
+  if (E->flags & GD_EN_COMPSCAL)
     _GD_CLincomData(D, E->EN(lincom,n_fields), data_out, return_type,
         (GD_DCOMPLEXP_t)tmpbuf2, (GD_DCOMPLEXP_t)tmpbuf3, E->EN(lincom,cm),
         E->EN(lincom,cb), spf, n_read);
@@ -1153,12 +1098,12 @@ static size_t _GD_DoMultiply(DIRFILE *restrict D, gd_entry_t *restrict E,
       num_samp, return_type, data_out);
 
   /* Check input fields */
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
 
-  if (_GD_BadInput(D, E, 1, 1)) {
+  if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
@@ -1224,11 +1169,9 @@ static size_t _GD_DoMultiply(DIRFILE *restrict D, gd_entry_t *restrict E,
     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);
+    _GD_CMultiplyData(D, data_out, spf1, tmpbuf, spf2, return_type, n_read);
   else
-    _GD_MultiplyData(D, data_out, spf1, (double *)tmpbuf, spf2, return_type,
-        n_read);
+    _GD_MultiplyData(D, data_out, spf1, tmpbuf, spf2, return_type, n_read);
 
   free(tmpbuf);
 
@@ -1248,7 +1191,7 @@ static size_t _GD_DoRecip(DIRFILE *restrict D, gd_entry_t *restrict E,
       num_samp, return_type, data_out);
 
   /* Check input fields */
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
@@ -1269,7 +1212,7 @@ static size_t _GD_DoRecip(DIRFILE *restrict D, gd_entry_t *restrict E,
   }
 
   /* Compute a reciprocal */
-  if (E->comp_scal)
+  if (E->flags & GD_EN_COMPSCAL)
     _GD_CInvertData(D, data_out, return_type, E->EN(recip,cdividend), num_samp);
   else
     _GD_InvertData(D, data_out, return_type, E->EN(recip,dividend), num_samp);
@@ -1294,7 +1237,9 @@ static size_t _GD_DoDivide(DIRFILE *restrict D, gd_entry_t *restrict E,
       num_samp, return_type, data_out);
 
   /* Check input fields */
-  if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) ||
+      _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1))
+  {
     dreturn("%i", 0);
     return 0;
   }
@@ -1389,15 +1334,15 @@ static size_t _GD_DoBit(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %i, %lli, %" PRNsize_t ", 0x%X, %p", D, E, is_signed,
       (long long)first_samp, num_samp, return_type, data_out);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
 
   if (is_signed)
-    tmpbuf = (int64_t *)_GD_Malloc(D, num_samp * sizeof(int64_t));
+    tmpbuf = _GD_Malloc(D, num_samp * sizeof(int64_t));
   else
-    tmpbuf = (uint64_t *)_GD_Malloc(D, num_samp * sizeof(uint64_t));
+    tmpbuf = _GD_Malloc(D, num_samp * sizeof(uint64_t));
   if (tmpbuf == NULL) {
     dreturn("%i", 0);
     return 0;
@@ -1442,7 +1387,7 @@ static size_t _GD_DoPhase(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
       num_samp, return_type, data_out);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
@@ -1466,21 +1411,13 @@ static size_t _GD_DoLinterp(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)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, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
 
   /* allocate a temporary buffer */
-  data_in = (double *)_GD_Alloc(D, GD_FLOAT64, num_samp);
+  data_in = _GD_Alloc(D, GD_FLOAT64, num_samp);
 
   if (D->error) {
     free(data_in);
@@ -1516,7 +1453,7 @@ static size_t _GD_DoPolynom(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
       num_samp, return_type, data_out);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
@@ -1536,7 +1473,7 @@ static size_t _GD_DoPolynom(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  if (E->comp_scal)
+  if (E->flags & GD_EN_COMPSCAL)
     _GD_CPolynomData(D, data_out, return_type, n_read, E->EN(polynom,poly_ord),
         E->EN(polynom,ca));
   else
@@ -1563,12 +1500,12 @@ static size_t _GD_DoWindow(DIRFILE *restrict D, gd_entry_t *restrict E,
       num_samp, return_type, data_out);
 
   /* Check input fields */
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
 
-  if (_GD_BadInput(D, E, 1, 1)) {
+  if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
@@ -1669,12 +1606,12 @@ static size_t _GD_DoMplex(DIRFILE *restrict D, gd_entry_t *restrict E,
       num_samp, return_type, data_out);
 
   /* Check input fields */
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
 
-  if (_GD_BadInput(D, E, 1, 1)) {
+  if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
@@ -1719,7 +1656,7 @@ static size_t _GD_DoMplex(DIRFILE *restrict D, gd_entry_t *restrict E,
   first_samp2 = first_samp * spf2 / spf1;
 
   /* Allocate a temporary buffer for the count field */
-  tmpbuf = (int*)_GD_Alloc(D, GD_INT_TYPE, num_samp2);
+  tmpbuf = _GD_Alloc(D, GD_INT_TYPE, num_samp2);
 
   if (D->error != GD_E_OK) {
     free(tmpbuf);
@@ -1772,7 +1709,7 @@ static size_t _GD_DoMplex(DIRFILE *restrict D, gd_entry_t *restrict E,
       /* the start of the next chunk */
       chunk_start -= chunk_size;
 
-      tmpbuf2 = (int*)_GD_Alloc(D, GD_INT_TYPE, chunk_size);
+      tmpbuf2 = _GD_Alloc(D, GD_INT_TYPE, chunk_size);
       if (D->error) {
         free(tmpbuf);
         dreturn("%i", 0);
@@ -1836,8 +1773,7 @@ static size_t _GD_DoMplex(DIRFILE *restrict D, gd_entry_t *restrict E,
   return n_read;
 }
 
-/* _GD_DoConst:  Read from a const.  Returns number of samples read (ie. 1).
-*/
+/* _GD_DoConst:  Read from a const.  Returns number of samples read */
 static size_t _GD_DoConst(DIRFILE *restrict D, const gd_entry_t *restrict E,
     off64_t first, size_t len, gd_type_t return_type, void *restrict data_out)
 {
@@ -1855,7 +1791,7 @@ static size_t _GD_DoConst(DIRFILE *restrict D, const gd_entry_t *restrict E,
     return 0;
   }
 
-  dreturn("%" PRNsize_t, len);
+  dreturn("%zu", len);
   return len;
 }
 
@@ -1881,7 +1817,7 @@ size_t _GD_DoField(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
     return 0;
   }
 
-  if (!E->e->calculated) {
+  if (!(E->flags & GD_EN_CALC)) {
     _GD_CalculateEntry(D, E, 1);
 
     if (D->error) {
diff --git a/src/getdata.h.in b/src/getdata.h.in
index 07d2570..ec99e7f 100644
--- a/src/getdata.h.in
+++ b/src/getdata.h.in
@@ -114,27 +114,20 @@ extern "C" {
  */
 #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
+/* unused                      1 */
 #define GD_E_FORMAT            2
-#define GD_E_TRUNC             3
+/* unused                      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_IO                7
+/* unused                      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_LUT              12
 #define GD_E_RECURSE_LEVEL    13
 #define GD_E_BAD_DIRFILE      14
 #define GD_E_BAD_FIELD_TYPE   15
@@ -154,20 +147,26 @@ extern "C" {
 #define GD_E_EXISTS           29
 #define GD_E_UNCLEAN_DB       30
 #define GD_E_DOMAIN           31
-#define GD_E_BAD_REPR         32
-/* unused                     33 */
-#define GD_E_FLUSH            34
+/* unused                     32, 33, 34 */
 #define GD_E_BOUNDS           35
 #define GD_E_LINE_TOO_LONG    36
 
-#define GD_N_ERROR_CODES      37
+#define GD_N_ERROR_CODES      37 /* including unused codes */
 
 /* Deprecated error codes */
-#define GD_E_OPEN_INCLUDE     GD_E_OPEN_FRAGMENT
 #define GD_E_BAD_ENDIANNESS   GD_E_ARGUMENT
 #define GD_E_BAD_PROTECTION   GD_E_ARGUMENT
 #define GD_E_BAD_VERSION      GD_E_ARGUMENT
-
+#define GD_E_BAD_REPR         GD_E_BAD_CODE
+#define GD_E_OPEN_LINFILE     GD_E_LUT
+#define GD_E_FLUSH            GD_E_IO
+#define GD_E_OPEN             GD_E_IO
+#define GD_E_OPEN_FRAGMENT    GD_E_IO
+#define GD_E_OPEN_INCLUDE     GD_E_IO
+#define GD_E_RAW_IO           GD_E_IO
+#define GD_E_TRUNC            GD_E_IO
+
+/* the maximum number of input vectors in a LINCOM */
 #define GD_MAX_LINCOM 3
 
 /* the following MUST be at least one less than twice GD_MAX_LINCOM */
@@ -298,6 +297,7 @@ typedef unsigned int gd_spf_t;
 #define GD_SIGNED    0x020
 #define GD_IEEE754   0x080
 #define GD_COMPLEX   0x100
+#define GD_CHAR      0x200
 
 typedef enum {
   GD_NULL       = 0,
@@ -313,8 +313,10 @@ typedef enum {
   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_COMPLEX128 = GD_SIZE128 | GD_COMPLEX,
 } gd_type_t;
+
+
 /* deprecated type aliases */
 #define GD_FLOAT     GD_FLOAT32
 #define GD_DOUBLE    GD_FLOAT64
@@ -340,6 +342,13 @@ typedef union {
   double r;
 } gd_triplet_t;
 
+/* Entry object flags */
+#define GD_EN_COMPSCAL 0x1 /* entry has complex scalar parameters */
+#define GD_EN_CALC     0x2 /* scalar field codes have been resolved */
+#define GD_EN_HIDDEN   0x4 /* entry is hidden */
+#define GD_EN_DOTTED   0x8 /* the field's name contains a dot (.) (i.e.
+                              Standards Version 5 or earlier) */
+
 /* ANSI C does not permit anonymous structs/unions */
 #ifdef GD_C89_API
 # define GD_ANON(x) x
@@ -354,8 +363,7 @@ struct gd_unified_entry_ {
   char *scalar[GD_MAX_POLYORD + 1];
   int scalar_ind[GD_MAX_POLYORD + 1];
   int fragment_index;
-  int comp_scal;
-  int hidden;
+  unsigned flags;
   union {
     struct { /* RAW */
       unsigned int spf;
@@ -406,7 +414,7 @@ struct gd_unified_entry_ {
 
 typedef struct gd_unified_entry_ gd_entry_t;
 
-/* The dirifle object */
+/* The dirfile object */
 typedef struct gd_dirfile_ DIRFILE;
 
 /* Parser callback objects */
@@ -473,6 +481,7 @@ typedef int (*gd_parser_callback_t)(gd_parser_data_t*, void*);
 #define GD_SIE_ENCODED    0x07000000 /* Data are sample index encoded */
 #define GD_ZZIP_ENCODED   0x08000000 /* Data are zzip encoded */
 #define GD_ZZSLIM_ENCODED 0x09000000 /* Data are zzslim encoded */
+#define GD_FLAC_ENCODED   0x0A000000 /* Data are flac encoded */
 #define GD_ENC_UNSUPPORTED GD_ENCODING /* Encoding unsupported */
 
 /* delete flags */
@@ -481,9 +490,11 @@ typedef int (*gd_parser_callback_t)(gd_parser_data_t*, void*);
 #define GD_DEL_DEREF 0x4
 #define GD_DEL_FORCE 0x8
 
-/* move flags */
-#define GD_REN_DATA  0x1
-#define GD_REN_UPDB  0x2
+/* move/rename flags */
+#define GD_REN_DATA   0x1
+#define GD_REN_UPDB   0x2
+#define GD_REN_DANGLE 0x4
+#define GD_REN_FORCE  0x8
 
 /* seek flags */
 #define GD_SEEK_SET   0x0
@@ -648,24 +659,24 @@ extern int gd_alter_window(DIRFILE *dirfile, const char *field_code,
     const char *in_field, const char *check_field, gd_windop_t windop,
     gd_triplet_t threshold) gd_nothrow gd_nonnull((1,2));
 
-extern size_t gd_carray_len(DIRFILE *dirfile, const char *field_code) gd_nothrow
+extern size_t gd_array_len(DIRFILE *dirfile, const char *field_code) gd_nothrow
 gd_nonnull((1,2));
 
-extern int gd_delete_alias(DIRFILE *dirfile, const char *field_code,
-    unsigned int flags) gd_nothrow gd_nonnull ((1,2));
+extern size_t gd_carray_len(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull((1,2)) gd_deprecated;
 
 extern int gd_get_carray(DIRFILE *dirfile, const char *field_code,
     gd_type_t return_type, void *data_out) gd_nothrow gd_nonnull((1,2));
 
 extern int gd_get_carray_slice(DIRFILE *dirfile, const char *field_code,
-    unsigned int start, size_t n, gd_type_t return_type, void *data_out)
+    unsigned long start, size_t n, gd_type_t return_type, void *data_out)
 gd_nothrow gd_nonnull((1,2));
 
 extern int gd_put_carray(DIRFILE *dirfile, const char *field_code,
   gd_type_t data_type, const void *data_in) gd_nothrow gd_nonnull((1,2,4));
 
 extern int gd_put_carray_slice(DIRFILE *dirfile, const char *field_code,
-    unsigned int first, size_t n, gd_type_t data_type, const void *data_in)
+    unsigned long first, size_t n, gd_type_t data_type, const void *data_in)
 gd_nothrow gd_nonnull((1,2,6));
 
 extern int gd_get_constant(DIRFILE *dirfile, const char *field_code,
@@ -680,19 +691,19 @@ extern const void *gd_constants(DIRFILE *dirfile,
 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 int gd_encoding_support(unsigned long encoding) gd_nothrow;
+
 extern unsigned long int gd_endianness(DIRFILE *dirfile,
     int fragment) gd_nothrow gd_nonnull((1));
 
 extern int gd_entry(DIRFILE *dirfile, const char *field_code,
     gd_entry_t *entry) gd_nothrow gd_nonnull ((1, 2));
 
-extern const char **gd_entry_list(DIRFILE* D, const char *parent, int type,
-    unsigned int flags) gd_nothrow gd_nonnull ((1));
+extern const char **gd_entry_list(DIRFILE *dirfile, const char *parent,
+    int type, unsigned int flags) gd_nothrow gd_nonnull ((1));
 
 extern gd_entype_t gd_entry_type(DIRFILE *dirfile,
     const char *field_code) gd_nothrow gd_nonnull ((1));
@@ -721,6 +732,8 @@ extern int gd_fragment_index(DIRFILE *dirfile,
 extern const char *gd_fragmentname(DIRFILE *dirfile,
     int index) gd_nothrow gd_nonnull ((1));
 
+extern gd_entry_t *gd_free_entry_strings(gd_entry_t *entry) gd_nothrow;
+
 extern int gd_hidden(DIRFILE *dirfile, const char *field_code) gd_nothrow
 gd_nonnull ((1,2));
 
@@ -836,9 +849,6 @@ extern const char **gd_mfield_list(DIRFILE *dirfile,
 extern const char **gd_mfield_list_by_type(DIRFILE *dirfile,
     const char *parent, gd_entype_t type) gd_nothrow gd_nonnull((1,2));
 
-extern int gd_move_alias(DIRFILE *dirfile, const char *field_code,
-    int new_fragment) gd_nothrow gd_nonnull ((1,2));
-
 extern void gd_mplex_lookback(DIRFILE *dirfile, int lookback) gd_nothrow
 gd_nonnull((1));
 
@@ -850,8 +860,8 @@ extern const char **gd_mvector_list(DIRFILE *dirfile,
 
 extern const char *gd_dirfilename(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
 
-extern int gd_naliases(DIRFILE *dirfile, const char *field_code) gd_nothrow
-gd_nonnull ((1,2));
+extern unsigned int gd_naliases(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1,2));
 
 extern gd_type_t gd_native_type(DIRFILE *dirfile,
     const char *field_code) gd_nothrow gd_nonnull ((1,2));
@@ -980,7 +990,7 @@ extern int gd_malter_spec(DIRFILE *dirfile, const char *line,
 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));
+    unsigned flags) gd_nonnull ((1,2));
 
 extern DIRFILE *gd_open(const char *dirfilename,
     unsigned long int flags) gd_nonnull ((1));
@@ -998,15 +1008,28 @@ extern int gd_sync(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1));
 extern int gd_uninclude(DIRFILE *dirfile, int fragment_index,
     int del) gd_nonnull ((1));
 
-/* if required, declare the LFS transitional extension */
-#if defined _LARGEFILE64_SOURCE || (defined _FILE_OFFSET_BITS && \
-    _FILE_OFFSET_BITS == 64) || (defined __CYGWIN__) || (defined __APPLE__)
-#if ! defined GD_64BIT_API
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+
+/* Expose the 64-bit API */
+#ifndef GD_64BIT_API
 #define GD_64BIT_API
 #endif
-#endif
 
-/* the following functions are _FILE_OFFSET_BITS sensitive */
+/* Force the use of the 64-bit API */
+#define gd_alter_frameoffset gd_alter_frameoffset64
+#define gd_getdata gd_getdata64
+#define gd_putdata gd_putdata64
+#define gd_framenum_subset gd_framenum_subset64
+#define gd_frameoffset gd_frameoffset64
+#define gd_nframes gd_nframes64
+#define gd_bof gd_bof64
+#define gd_eof gd_eof64
+#define gd_seek gd_seek64
+#define gd_tell gd_tell64
+
+#else
+
+/* the following functions are _FILE_OFFSET_BITS sensitive.  */
 extern int gd_alter_frameoffset(DIRFILE *dirfile, off_t offset, int fragment,
     int recode) gd_nonnull ((1));
 
@@ -1039,6 +1062,15 @@ extern off_t gd_seek(DIRFILE *dirfile, const char *field_code, off_t frame_num,
 extern off_t gd_tell(DIRFILE *dirfile, const char *field_code) gd_nothrow
 gd_nonnull ((1,2));
 
+#endif 
+
+#ifdef _LARGEFILE64_SOURCE
+#ifndef GD_64BIT_API
+#define GD_64BIT_API
+#endif
+#endif
+
+/* This is the explicitly 64-bit API */
 #ifdef GD_64BIT_API
 #ifdef __off64_t_defined
 typedef __off64_t gd_off64_t;
@@ -1100,6 +1132,12 @@ gd_nonnull ((1,2));
 #  endif
 #endif
 
+/* Library version information */
+ at DEFINE_GD_GETDATA_VERSION@
+
+/* This is (major * 10000) + (minor * 100) + revision */
+ at DEFINE_GD_GETDATA_INT_VERSION@
+
 /* function aliases */
 #ifdef GD_FUNCTION_ALIASES
 #  warning "Using deprecated function aliases."
diff --git a/src/globals.c b/src/globals.c
index 6349fb9..d65739b 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008-2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -115,7 +115,7 @@ const char *gd_reference(DIRFILE* D, const char* field_code) gd_nothrow
 }
 
 /* the mask of allowed flags */
-#define GD_FLAG_MASK ( GD_VERBOSE | GD_PRETTY_PRINT)
+#define GD_FLAG_MASK (GD_VERBOSE | GD_PRETTY_PRINT)
 unsigned long gd_flags(DIRFILE *D, unsigned long set, unsigned long reset)
   gd_nothrow
 {
diff --git a/src/gzip.c b/src/gzip.c
index ee70f16..9accdd8 100644
--- a/src/gzip.c
+++ b/src/gzip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -24,35 +24,42 @@
 #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_GzipWrite libgetdatagzip_LTX_GD_GzipWrite
-#define _GD_GzipSync libgetdatagzip_LTX_GD_GzipSync
-#define _GD_GzipClose libgetdatagzip_LTX_GD_GzipClose
-#define _GD_GzipSize libgetdatagzip_LTX_GD_GzipSize
+#ifdef HAVE_GZSEEK64
+#define gd_gzseek gzseek64
+#else
+#define gd_gzseek gzseek
+#endif
+
+#ifdef HAVE_GZTELL64
+#define gd_gztell gztell64
+#else
+#define gd_gztell gztell
 #endif
 
 /* The gzip encoding scheme uses edata as a gzFile object.  If a file is
  * open, idata >= 0 otherwise idata = -1.  Writes occur out-of-place. */
 
-int _GD_GzipOpen(int fd, struct gd_raw_file_* file, int swap gd_unused_,
-    unsigned int mode)
+int _GD_GzipOpen(int fd, struct gd_raw_file_* file,
+    gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode)
 {
   const char *gzmode = "w";
-  dtrace("%i, %p, <unused>, 0x%X", fd, file, mode);
+  dtrace("%i, %p, <unused>, <unused>, 0x%X", fd, file, mode);
 
   if (mode & GD_FILE_READ) {
     file->idata = gd_OpenAt(file->D, fd, file->name, O_RDONLY | O_BINARY, 0666);
-
-    if (file->idata == -1) {
-      dreturn("%i", 1);
-      return 1;
-    }
     gzmode = "r";
-  } else
-    file->idata = fd;
+  } else if (mode & GD_FILE_TEMP) {
+    file->idata = _GD_MakeTempFile(file->D, fd, file->name);
+  } else { /* internal error */
+    dreturn("%i", 1);
+    errno = EINVAL; /* I guess ... ? */
+    return 1;
+  }
+
+  if (file->idata == -1) {
+    dreturn("%i", 1);
+    return 1;
+  }
 
   file->edata = gzdopen(file->idata, gzmode);
 
@@ -84,13 +91,13 @@ off64_t _GD_GzipSeek(struct gd_raw_file_* file, off64_t count,
   count *= GD_SIZE(data_type);
 
   if (count >= 0) {
-    n = (off64_t)gzseek((gzFile)file[(mode == GD_FILE_WRITE) ? 1 : 0].edata,
-        (off_t)count, SEEK_SET);
+    n = gd_gzseek((gzFile)file[(mode == GD_FILE_WRITE) ? 1 : 0].edata, count,
+        SEEK_SET);
 
     if (n == -1) {
       /* gzseek returns error on attempts to seek past the EOF in read mode */
       if (mode != GD_FILE_WRITE && gzeof((gzFile)file[0].edata))
-        n = gztell((gzFile)file[0].edata);
+        n = gd_gztell((gzFile)file[0].edata);
       else {
         dreturn("%i", -1);
         return -1;
@@ -218,3 +225,24 @@ off64_t _GD_GzipSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
   dreturn("%lli", (long long)size);
   return size;
 }
+
+int _GD_GzipStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen)
+{
+  int r = 0;
+  int gzerrnum = 0;
+  const char *gzerr;
+
+  dtrace("%p, %p, %" PRNsize_t, file, buf, buflen);
+
+  gzerr = gzerror((gzFile)file->edata, &gzerrnum);
+
+  if (gzerrnum == Z_ERRNO)
+    r = gd_strerror(errno, buf, buflen);
+  else {
+    strncpy(buf, gzerr, buflen);
+    buf[buflen - 1] = 0;
+  }
+
+  dreturn("%i", r);
+  return r;
+}
diff --git a/src/include.c b/src/include.c
index 7f7fecf..cd76510 100644
--- a/src/include.c
+++ b/src/include.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011, 2014 D. V. Wiebe
+/* Copyright (C) 2008, 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -21,19 +21,20 @@
 #include "internal.h"
 
 /* Create new affixes given the current affixes and the new parts indicated
- * on a /INCLUDE line */
-static int _GD_SetFieldAffixes(DIRFILE *D, int me, const char *prefix_in,
-    const char *suffix_in, int standards, int pedantic, const char *format_file,
-    int line, char **prefix, char **suffix)
+ * on a /INCLUDE line.  Also, change the root namespace, if necessary.  The
+ * caller is responsible for freeing strings on error */
+static int _GD_SetFieldAffixes(DIRFILE *D, const struct parser_state *p, int me,
+    const char *prefix_in, const char *suffix_in, char **prefix, char **suffix)
 {
-  dtrace("%p, %i, \"%s\", \"%s\", %i, %i, \"%s\", %i, %p, %p", D, me, prefix_in,
-      suffix_in, standards, pedantic, format_file, line, prefix, suffix);
+  dtrace("%p, %p, %i, \"%s\", \"%s\", %p, %p", D, p, me, prefix_in, suffix_in,
+      prefix, suffix);
 
   /* suffix first, for some reason */
   if (suffix_in && suffix_in[0] != '\0') {
-    if (_GD_ValidateField(suffix_in, standards, pedantic, 1, NULL))
+    if (_GD_ValidateField(suffix_in, p->standards, p->pedantic, GD_VF_AFFIX,
+          NULL))
     {
-      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, p->file, p->line,
           suffix_in);
       dreturn("%i", 1);
       return 1;
@@ -42,10 +43,10 @@ static int _GD_SetFieldAffixes(DIRFILE *D, int me, const char *prefix_in,
     if (D->fragment[me].suffix == NULL)
       *suffix = _GD_Strdup(D, suffix_in);
     else {
-      *suffix = (char*)_GD_Malloc(D, strlen(D->fragment[me].suffix) +
-          strlen(suffix_in) + 1);
+      *suffix = _GD_Malloc(D, strlen(D->fragment[me].suffix) + strlen(suffix_in)
+          + 1);
       if (*suffix)
-        strcat(strcpy(*suffix, suffix_in), D->fragment[me].suffix);
+        sprintf(*suffix, "%s%s", suffix_in, D->fragment[me].suffix);
     }
   } else if (D->fragment[me].suffix)
     *suffix = _GD_Strdup(D, D->fragment[me].suffix);
@@ -57,9 +58,10 @@ static int _GD_SetFieldAffixes(DIRFILE *D, int me, const char *prefix_in,
 
   /* now the prefix */
   if (prefix_in && prefix_in[0] != '\0') {
-    if (_GD_ValidateField(prefix_in, standards, pedantic, 1, NULL))
+    if (_GD_ValidateField(prefix_in, p->standards, p->pedantic, GD_VF_AFFIX,
+          NULL))
     {
-      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, p->file, p->line,
           prefix_in);
       dreturn("%i", 1);
       return 1;
@@ -68,52 +70,78 @@ static int _GD_SetFieldAffixes(DIRFILE *D, int me, const char *prefix_in,
     if (D->fragment[me].prefix == NULL)
       *prefix = _GD_Strdup(D, prefix_in);
     else {
-      *prefix = (char*)_GD_Malloc(D, strlen(D->fragment[me].prefix) +
-          strlen(prefix_in) + 1);
+      *prefix = _GD_Malloc(D, strlen(D->fragment[me].prefix) + strlen(prefix_in)
+          + 1);
       if (*prefix)
-        strcat(strcpy(*prefix, D->fragment[me].prefix), prefix_in);
+        sprintf(*prefix, "%s%s", D->fragment[me].prefix, prefix_in);
     }
-  } else if (D->fragment[me].prefix)
-    *prefix = _GD_Strdup(D, D->fragment[me].prefix);
+  } else {
+    if (D->fragment[me].prefix)
+      *prefix = _GD_Strdup(D, D->fragment[me].prefix);
+  }
 
-  dreturn("%i", D->error);
-  return D->error;
+  if (D->error) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  dreturn("%i (\"%s\", \"%s\")", 0, *prefix, *suffix);
+  return 0;
 }
 
-/* Include a format file fragment -- returns the mew fragment index, or
+/* Include a format file fragment -- returns the new fragment index, or
  * -1 on error */
-int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
-    int linenum, char **ref_name, int parent, const char *prefix_in,
-    const char *suffix_in, int *standards, unsigned long *flags, int resolve)
+int _GD_Include(DIRFILE *D, struct parser_state *p, const char *ename,
+    char **ref_name, int parent, const char *prefix_in, const char *suffix_in,
+    int immediate)
 {
   int i;
   int me = D->n_fragment;
-  int old_standards = *standards;
-  int old_pedantic = *flags & GD_PEDANTIC;
-  int dirfd = -1;
+  struct parser_state oldp = *p;
+  int dirfd = -1, pop_ns = 0, free_ns = 1;
   char *temp_buf1 = NULL, *temp_buf2, *sname = NULL;
-  char *base = NULL, *prefix = NULL, *suffix = NULL;
+  char *base = NULL, *prefix = NULL, *suffix = NULL, *ns = NULL;
+  size_t nsl = 0;
   void *ptr = NULL;
   FILE* new_fp = NULL;
   time_t mtime = 0;
   struct stat statbuf;
 
-  dtrace("%p, \"%s\", \"%s\", %p, %i, %i, \"%s\", \"%s\", %p, %p, %i", D, ename,
-      format_file, ref_name, linenum, parent, prefix_in, suffix_in, standards,
-      flags, resolve);
+  dtrace("%p, %p, \"%s\", %p, %i, \"%s\", \"%s\", %i", D, p, ename, ref_name,
+      parent, prefix_in, suffix_in, immediate);
 
   if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
-    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_INCLUDE, format_file,
-        linenum, ename);
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_INCLUDE, p->file, p->line,
+        ename);
     goto include_error;
   }
 
-  if (_GD_SetFieldAffixes(D, parent, prefix_in, suffix_in, old_standards,
-        old_pedantic, format_file, linenum, &prefix, &suffix))
+  if (_GD_SetFieldAffixes(D, p, parent, prefix_in, suffix_in, &prefix, &suffix))
   {
     goto include_error;
   }
 
+  if (ns) {
+    /* namespace change, remember old one so we can pop at the end */
+    pop_ns = 1;
+    if (ns[0] == '\0') {
+      /* revert to NULLspace */
+      free(ns);
+      ns = p->ns = NULL;
+    } else {
+      /* new namespace */
+      p->ns = _GD_Strdup(D, ns);
+      if (p->ns == NULL)
+        goto include_error;
+      p->nsl = nsl;
+    }
+  } else {
+    /* no namespace change; inherit from parent */
+    free_ns = 0;
+    ns = D->fragment[parent].ns;
+    nsl = D->fragment[parent].nsl;
+  }
+
   /* isolate filename */
   temp_buf2 = _GD_Strdup(D, ename);
   if (temp_buf2 == NULL)
@@ -132,36 +160,34 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
   if (sname == NULL)
     goto include_error;
 
+  /* canonicalise */
+  temp_buf1 = _GD_MakeFullPath(D, D->fragment[parent].dirfd, ename, 1);
+  if (temp_buf1 == NULL)
+    goto include_error;
+
   /* Open the containing directory */
-  dirfd = _GD_GrabDir(D, D->fragment[parent].dirfd, ename);
+  dirfd = _GD_GrabDir(D, D->fragment[parent].dirfd, temp_buf1, 1);
   if (dirfd == -1 && D->error == GD_E_OK)
-    _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum, ename);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, ename);
   if (D->error)
     goto include_error;
 
-  temp_buf1 = _GD_MakeFullPath(D, dirfd, base, 1);
-  if (temp_buf1 == NULL) {
-    _GD_ReleaseDir(D, dirfd);
-    goto include_error;
-  }
-
   /* Reject weird stuff */
   if (gd_StatAt(D, dirfd, base, &statbuf, 0)) {
-    if (!(*flags & GD_CREAT)) {
-      _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum,
-          temp_buf1);
+    if (!(p->flags & GD_CREAT)) {
+      _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1);
       _GD_ReleaseDir(D, dirfd);
       goto include_error;
     }
   } else {
     if (S_ISDIR(statbuf.st_mode)) {
-      _GD_SetError(D, GD_E_OPEN_FRAGMENT, EISDIR, format_file, linenum,
-          temp_buf1);
+      _GD_SetError2(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1,
+          EISDIR);
       _GD_ReleaseDir(D, dirfd);
       goto include_error;
     } else if (!S_ISREG(statbuf.st_mode)) {
-      _GD_SetError(D, GD_E_OPEN_FRAGMENT, EINVAL, format_file, linenum,
-          temp_buf1);
+      _GD_SetError2(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1,
+          EINVAL);
       _GD_ReleaseDir(D, dirfd);
       goto include_error;
     }
@@ -169,23 +195,22 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
 
   /* Try to open the file */
   i = gd_OpenAt(D, dirfd, base,
-      ((*flags & (GD_CREAT | GD_TRUNC)) ? O_RDWR : O_RDONLY) |
-      ((*flags & GD_CREAT) ? O_CREAT : 0) |
-      ((*flags & GD_TRUNC) ? O_TRUNC : 0) |
-      ((*flags & GD_EXCL) ? O_EXCL : 0) | O_BINARY, 0666);
+      ((p->flags & (GD_CREAT | GD_TRUNC)) ? O_RDWR : O_RDONLY) |
+      ((p->flags & GD_CREAT) ? O_CREAT : 0) |
+      ((p->flags & GD_TRUNC) ? O_TRUNC : 0) |
+      ((p->flags & GD_EXCL) ? O_EXCL : 0) | O_BINARY, 0666);
 
   if (i < 0) {
-    _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum,
-        temp_buf1);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1);
     _GD_ReleaseDir(D, dirfd);
     goto include_error;
   }
 
-  new_fp = fdopen(i, (*flags & (GD_CREAT | GD_TRUNC)) ? "rb+" : "rb");
+  new_fp = fdopen(i, (p->flags & (GD_CREAT | GD_TRUNC)) ? "rb+" : "rb");
 
   /* If opening the file failed, set the error code and abort parsing. */
   if (new_fp == NULL) {
-    _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum, temp_buf1);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1);
     _GD_ReleaseDir(D, dirfd);
     goto include_error;
   }
@@ -195,15 +220,14 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
     mtime = statbuf.st_mtime;
 
   /* If we got here, we managed to open the included file; parse it */
-  ptr = _GD_Realloc(D, D->fragment,
-      (++D->n_fragment) * sizeof(struct gd_fragment_t));
+  ptr = _GD_Realloc(D, D->fragment, (++D->n_fragment) * sizeof(D->fragment[0]));
   if (ptr == NULL) {
     fclose(new_fp);
     _GD_ReleaseDir(D, dirfd);
     D->n_fragment--;
     goto include_error;
   }
-  D->fragment = (struct gd_fragment_t *)ptr;
+  D->fragment = ptr;
 
   D->fragment[me].bname = base;
   D->fragment[me].cname = temp_buf1;
@@ -212,12 +236,12 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
   D->fragment[me].modified = 0;
   D->fragment[me].parent = parent;
   D->fragment[me].dirfd = dirfd;
-  D->fragment[me].encoding = *flags & GD_ENCODING;
+  D->fragment[me].encoding = p->flags & GD_ENCODING;
   D->fragment[me].byte_sex =
 #ifdef WORDS_BIGENDIAN
-    (*flags & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN
+    (p->flags & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN
 #else
-    (*flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
+    (p->flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
 #endif
     ;
   D->fragment[me].ref_name = NULL;
@@ -225,8 +249,10 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
   D->fragment[me].protection = GD_PROTECT_NONE;
   D->fragment[me].prefix = prefix;
   D->fragment[me].suffix = suffix;
+  D->fragment[me].ns = ns;
+  D->fragment[me].nsl = nsl;
   D->fragment[me].mtime = mtime;
-  D->fragment[me].vers = (*flags & GD_PEDANTIC) ? 1ULL << *standards : 0;
+  D->fragment[me].vers = (p->pedantic) ? 1ULL << p->standards : 0;
 
   /* compute the (relative) subdirectory name */
   if (sname[0] == '.' && sname[1] == '\0') {
@@ -237,7 +263,7 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
   } else if (D->fragment[parent].sname && _GD_AbsPath(sname)) {
     /* have both a relative dirname and the parent's sname; squish them
      * together */
-    D->fragment[me].sname = (char*)_GD_Malloc(D, strlen(sname) +
+    D->fragment[me].sname = _GD_Malloc(D, strlen(sname) +
         strlen(D->fragment[parent].sname) + 2);
     if (D->fragment[me].sname)
       sprintf(D->fragment[me].sname, "%s%c%s", D->fragment[parent].sname,
@@ -256,18 +282,25 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
     goto include_error;
   }
 
-  *ref_name = _GD_ParseFragment(new_fp, D, me, standards, flags, resolve);
+  *ref_name = _GD_ParseFragment(new_fp, D, p, me, immediate);
 
   fclose(new_fp);
 
   /* prevent /VERSION leak in DSV >= 9 */
-  if ((old_standards >= 9 && old_pedantic) || *standards >= 9) {
-    if (*standards != old_standards) {
-      *standards = old_standards;
+  if ((oldp.standards >= 9 && oldp.pedantic) || p->standards >= 9) {
+    if (p->standards != oldp.standards) {
+      p->standards = oldp.standards;
       D->flags |= GD_MULTISTANDARD;
     }
-    if (!old_pedantic)
-      *flags &= ~GD_PEDANTIC;
+    if (!oldp.pedantic)
+      p->pedantic = 0;
+  }
+
+  /* pop namespace, if necessary */
+  if (pop_ns) {
+    free(p->ns);
+    p->ns = oldp.ns;
+    p->nsl = oldp.nsl;
   }
 
   D->recurse_level--;
@@ -275,6 +308,8 @@ int _GD_Include(DIRFILE *D, const char *ename, const char *format_file,
   return me;
 
 include_error:
+  if (free_ns)
+    free(ns);
   free(prefix);
   free(suffix);
   free(base);
@@ -288,10 +323,14 @@ include_error:
 int gd_include_affix(DIRFILE* D, const char* file, int fragment_index,
     const char *prefix, const char *suffix, unsigned long flags)
 {
-  int standards = GD_DIRFILE_STANDARDS_VERSION;
   char* ref_name = NULL;
   int i, new_fragment;
 
+  struct parser_state p = {
+    "gd_include_affix()", 0, GD_DIRFILE_STANDARDS_VERSION, flags & GD_PEDANTIC,
+    NULL, 0, flags
+  };
+
   dtrace("%p, \"%s\", %i, \"%s\", \"%s\", 0x%lX", D, file, fragment_index,
       prefix, suffix, flags);
 
@@ -329,15 +368,15 @@ int gd_include_affix(DIRFILE* D, const char* file, int fragment_index,
 
   /* only set if the dirfile conforms to some standard */
   if (D->av)
-    standards = D->standards;
+    p.standards = D->standards;
 
   /* if the caller specified no encoding scheme, but we were asked to create
    * the fragment, inherit it from the parent */
-  if ((flags & (GD_ENCODING | GD_CREAT)) == GD_CREAT)
-    flags |= D->fragment[fragment_index].encoding;
+  if ((p.flags & (GD_ENCODING | GD_CREAT)) == GD_CREAT)
+    p.flags |= D->fragment[fragment_index].encoding;
 
-  new_fragment = _GD_Include(D, file, "dirfile_include()", 0, &ref_name,
-      fragment_index, prefix, suffix, &standards, &flags, 1);
+  new_fragment = _GD_Include(D, &p, file, &ref_name, fragment_index, prefix,
+      suffix, 1);
 
   if (!D->error) {
     D->fragment[fragment_index].modified = 1;
@@ -402,7 +441,7 @@ static int _GD_CollectFragments(DIRFILE* D, int** f, int fragment, int nf)
 
   dtrace("%p, %p, %i, %i", D, f, fragment, nf);
 
-  new_f = (int *)_GD_Realloc(D, *f, sizeof(int) * ++nf);
+  new_f = _GD_Realloc(D, *f, sizeof(*new_f) * ++nf);
   if (new_f == NULL) {
     dreturn("%i", -1);
     return -1;
@@ -547,7 +586,7 @@ int gd_uninclude(DIRFILE* D, int fragment_index, int del)
   /* 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;
+    D->entry[i]->flags &= ~GD_EN_CALC;
     for (j = 0; j < GD_MAX_LINCOM; ++j)
       D->entry[i]->e->entry[j] = NULL;
     D->entry[i]->e->value_list_validity = 0;
diff --git a/src/index.c b/src/index.c
index cf9c435..f048ab1 100644
--- a/src/index.c
+++ b/src/index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2012 D. V. Wiebe
+/* Copyright (C) 2009-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -20,8 +20,6 @@
  */
 #include "internal.h"
 
-#include "nan.h"
-
 static double _GD_Extrapolate(DIRFILE *D, gd_entry_t *E, int repr, double value,
     off64_t limit, int eof)
 {
@@ -35,16 +33,16 @@ static double _GD_Extrapolate(DIRFILE *D, gd_entry_t *E, int repr, double value,
   n = _GD_DoField(D, E, repr, limit - eof, 2, GD_FLOAT64, data);
 
   if (D->error) {
-    dreturn("%g", sample);
+    dreturn("%.15g", sample);
     return sample;
   } else if (n < 2) {
     _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
-    dreturn("%g", sample);
+    dreturn("%.15g", sample);
     return sample;
   }
 
   sample = limit + (value - data[eof]) / (data[1] - data[0]);
-  dreturn("%g", sample);
+  dreturn("%.15g", sample);
   return sample;
 }
 
@@ -68,27 +66,27 @@ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
   field_start_v = low_v;
 
   if (D->error) {
-    dreturn("%g", sample);
+    dreturn("%.15g", sample);
     return sample;
   }
 
   if (n == 0) {
     _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
-    dreturn("%g", sample);
+    dreturn("%.15g", sample);
     return sample;
   }
 
   n = _GD_DoField(D, E, repr, field_end - 1, 1, GD_FLOAT64, &high_v);
 
   if (D->error) {
-    dreturn("%g", sample);
+    dreturn("%.15g", sample);
     return sample;
   }
 
   if (n > 0) {
     if (high_v == low_v) {
       _GD_SetError(D, GD_E_RANGE, GD_E_SINGULAR_RANGE, NULL, 0, NULL);
-      dreturn("%g", sample);
+      dreturn("%.15g", sample);
       return sample;
     }
 
@@ -97,11 +95,11 @@ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
     /* extrapolate, if necessary */
     if ((!dir && low_v > value) || (dir && low_v < value)) {
       sample = _GD_Extrapolate(D, E, repr, value, low, 0);
-      dreturn("%g", sample);
+      dreturn("%.15g", sample);
       return sample;
     } else if ((!dir && high_v < value) || (dir && high_v > value)) {
       sample = _GD_Extrapolate(D, E, repr, value, high - 1, 1);
-      dreturn("%g", sample);
+      dreturn("%.15g", sample);
       return sample;
     }
   } else {
@@ -112,7 +110,7 @@ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
       n = _GD_DoField(D, E, repr, c, 1, GD_FLOAT64, &c_v);
 
       if (D->error) {
-        dreturn("%g", sample);
+        dreturn("%.15g", sample);
         return sample;
       }
 
@@ -120,13 +118,13 @@ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
         if (c - low == 1) {
           if (low == field_start) {
             _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
-            dreturn("%g", sample);
+            dreturn("%.15g", sample);
             return sample;
           }
 
           /* low is the EOF -- so, extrapolate */
           sample = _GD_Extrapolate(D, E, repr, value, low, 1);
-          dreturn("%g", sample);
+          dreturn("%.15g", sample);
           return sample;
         } else {
           /* haven't found the EOF yet */
@@ -148,7 +146,7 @@ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
           {
             /* extrapolate BOF */
             sample = _GD_Extrapolate(D, E, repr, value, low, 0);
-            dreturn("%g", sample);
+            dreturn("%.15g", sample);
             return sample;
           }
         }
@@ -173,14 +171,14 @@ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
     n = _GD_DoField(D, E, repr, c, 1, GD_FLOAT64, &c_v);
 
     if (D->error) {
-      dreturn("%g", sample);
+      dreturn("%.15g", sample);
       return sample;
     }
 
     if (n == 0) {
       /* someone's been stealing our data.  How Rude! */
       _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
-      dreturn("%g", sample);
+      dreturn("%.15g", sample);
       return sample;
     }
 
@@ -195,13 +193,13 @@ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
     } else {
       /* our guess was unexpectedly correct */
       sample = (double)c;
-      dreturn("%g", sample);
+      dreturn("%.15g", sample);
       return sample;
     }
   }
 
   sample = low + (value - low_v) / (high_v - low_v);
-  dreturn("%g", sample);
+  dreturn("%.15g", sample);
   return sample;
 }
 
@@ -219,7 +217,7 @@ double gd_framenum_subset64(DIRFILE* D, const char* field_code_in,
 
   if (D->flags & GD_INVALID) {/* don't crash */
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
-    dreturn("%g", frame);
+    dreturn("%.15g", frame);
     return frame;
   }
 
@@ -229,7 +227,7 @@ double gd_framenum_subset64(DIRFILE* D, const char* field_code_in,
       1);
 
   if (D->error) {
-    dreturn("%g", frame);
+    dreturn("%.15g", frame);
     return frame;
   }
 
@@ -242,7 +240,7 @@ double gd_framenum_subset64(DIRFILE* D, const char* field_code_in,
     free(field_code);
 
   if (D->error) {
-    dreturn("%g", frame);
+    dreturn("%.15g", frame);
     return frame;
   }
 
@@ -263,7 +261,7 @@ double gd_framenum_subset64(DIRFILE* D, const char* field_code_in,
   if (!D->error)
     frame = _GD_GetIndex(D, entry, repr, value, field_start, field_end) / spf;
 
-  dreturn("%g", frame);
+  dreturn("%.15g", frame);
   return frame;
 }
 
@@ -278,7 +276,7 @@ double gd_framenum_subset(DIRFILE* D, const char* field_code, double value,
   frame = gd_framenum_subset64(D, field_code,  value, (off64_t)field_start,
       (off64_t)field_end);
 
-  dreturn("%g", frame);
+  dreturn("%.15g", frame);
   return frame;
 }
 
@@ -290,7 +288,7 @@ double gd_framenum(DIRFILE* D, const char* field_code, double value)
 
   frame = gd_framenum_subset64(D, field_code,  value, 0, 0);
 
-  dreturn("%g", frame);
+  dreturn("%.15g", frame);
   return frame;
 }
 /* vim: ts=2 sw=2 et tw=80
diff --git a/src/internal.h b/src/internal.h
index 1641144..3d0e7a0 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -1,5 +1,5 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
- * Copyright (C) 2005-2013 D. V. Wiebe
+ * Copyright (C) 2005-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -22,6 +22,10 @@
 #ifndef GETDATA_INTERNAL_H
 #define GETDATA_INTERNAL_H
 
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE
+#endif
+
 #ifdef HAVE_CONFIG_H
 #include "gd_config.h"
 #endif
@@ -29,7 +33,7 @@
 #define GD_64BIT_API
 #include "getdata.h"
 
-/* OS X 10.6 deprecates lstat64 */
+/* MacOS 10.6 deprecates the LFS transitional API */
 #ifdef HAVE_AVAILABILITY_H
 #include <Availability.h>
 #endif
@@ -96,6 +100,9 @@
 #ifdef HAVE_DIRECT_H
 #include <direct.h>
 #endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
 
 /* MSVC types */
 #ifdef _MSC_VER
@@ -108,7 +115,6 @@ typedef int ssize_t;
 #define PRNssize_t "i"
 #define PRNsize_t  "u"
 #endif
-typedef int mode_t;
 #else
 #define PRNssize_t "zi"
 #define PRNsize_t  "zu"
@@ -162,6 +168,8 @@ typedef gd_off64_t off64_t;
 #  define gd_ra2cs_(a,b) gd_cs2cs_(a,b)
 /* assign scalar b to scalar a */
 #  define gd_cs2cs_(a,b) do { (a)[0] = (b)[0]; (a)[1] = (b)[1]; } while(0)
+/* assign scalar *b to scalar a */
+#  define gd_cp2cs_(a,b) gd_cs2cs_(a,b)
 /* assign scalar b to scalar (*a) */
 #  define gd_cs2cp_(a,b) gd_cs2cs_(a,b)
 /* assign b[i] to scalar a */
@@ -170,9 +178,9 @@ typedef gd_off64_t off64_t;
 #  define gd_cp2ca_(a,i,b) do { \
   (a)[2 * i] = (b)[0]; (a)[2 * i + 1] = (b)[1]; \
 } while(0)
-/* assign literal (x;y) to scalar a */
+/* assign complex pair (x;y) to scalar a */
 #  define gd_li2cs_(a,x,y) do { (a)[0] = (x); (a)[1] = (y); } while(0)
-/* assign literal (x;y) to scalar (*a) */
+/* assign complex pair (x;y) to scalar (*a) */
 #  define gd_li2cp_(a,x,y) gd_li2cs_(a,x,y)
 /* assign polar (r,p) to scalar a */
 #  define gd_po2cs_(a,r,p) do { \
@@ -192,7 +200,7 @@ typedef gd_off64_t off64_t;
 #  define gd_rs2ca_(a,i,b,t) do { \
   ((t*)a)[2 * i] = (t)(b); ((t*)a)[2 * i + 1] = 0; \
 } while(0)
-/* compare a to literal (x;y) */
+/* compare a to complex pair (x;y) */
 #  define gd_ccmpl_(a,x,y) ((a)[0] == x && (a)[1] == y)
 /* compare a to b */
 #  define gd_ccmpc_(a,b) ((a)[0] == (b)[0] && (a)[1] == (b)[1])
@@ -206,15 +214,16 @@ typedef gd_off64_t off64_t;
 #  define gd_csp_(a) (&(a))
 #  define gd_ra2cs_(a,b) a = *((double complex*)(b))
 #  define gd_cs2cs_(a,b) a = b
-#  define gd_cs2cp_(a,b) *a = b
+#  define gd_cp2cs_(a,b) a = *(b)
+#  define gd_cs2cp_(a,b) *(a) = b
 #  define gd_ca2cs_(a,b,i) a = b[i]
 #  define gd_cp2ca_(a,i,b) (a)[i] = *(b)
 #  define gd_li2cs_(a,x,y) a = (x + _Complex_I * y)
-#  define gd_li2cp_(a,x,y) *a = (x + _Complex_I * y)
+#  define gd_li2cp_(a,x,y) *(a) = (x + _Complex_I * y)
 #  define gd_po2cs_(a,r,p) a = (r) * cexp(p)
-#  define gd_po2cp_(a,r,p) *a = (r) * cexp(p)
+#  define gd_po2cp_(a,r,p) *(a) = (r) * cexp(p)
 #  define gd_rs2cs_(a,b) a = b
-#  define gd_rs2cp_(a,b) *a = b
+#  define gd_rs2cp_(a,b) *(a) = b
 #  define gd_cs2ca_(a,i,b,t) ((complex t*)a)[i] = (complex t)(b)
 #  define gd_rs2ca_(a,i,b,t) gd_cs2ca_(a,i,b,t)
 #  define gd_ccmpl_(a,x,y) (a == (x + _Complex_I * y))
@@ -236,6 +245,14 @@ double cimag(double complex z);
 #endif
 #endif
 
+#ifndef NAN
+# if HAVE_NAN
+#  define NAN nan("")
+# else
+#  define NAN gd_strtod("NAN", NULL)
+# endif
+#endif
+
 #ifdef GD_RESTRICT_ARRAY_OK
 #define gd_restrict_arr restrict
 #else
@@ -266,21 +283,23 @@ double cimag(double complex z);
 #define SIZEOF_UNSIGNED_INT (sizeof(unsigned int))
 #endif
 
+#define GD_INT_TYPE ((gd_type_t)(SIZEOF_INT | GD_SIGNED))
+#define GD_UINT_TYPE ((gd_type_t)(SIZEOF_UNSIGNED_INT))
+
+/* a few integer limits */
 #ifndef SIZEOF_SIZE_T
 #define SIZEOF_SIZE_T (sizeof(size_t))
 #endif
 
+#define GD_INT64_MAX ((int64_t)((uint64_t)-1>>1))
 #define GD_SSIZE_T_MAX ((ssize_t)((size_t)-1>>1))
 #define GD_SIZE_T_MAX ((size_t)-1)
 
-#define GD_INT_TYPE ((gd_type_t)(SIZEOF_INT | GD_SIGNED))
-#define GD_UINT_TYPE ((gd_type_t)(SIZEOF_UNSIGNED_INT))
-
 /* default buffer size */
 #if SIZEOF_INT < 4
 #define GD_BUFFER_SIZE 32767
 #else
-#define GD_BUFFER_SIZE 1000000
+#define GD_BUFFER_SIZE 9000000
 #endif
 
 /* the default mplex cycle length */
@@ -321,18 +340,6 @@ gd_static_inline_ int64_t gd_put_unaligned64(int64_t v, void *p)
 #endif
 #endif
 
-/* 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)
 
 /* Internal type conventions:
@@ -365,29 +372,35 @@ gd_static_inline_ int64_t gd_put_unaligned64(int64_t v, void *p)
 #  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);
-void gd_colclear(void);
-#define dtracevoid() printf("%s %s()\n", gd_coladd(), __FUNCTION__)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  const char* gd_colnil(void);
+  const char* gd_coladd(void);
+  const char* gd_colsub(void);
+  void gd_colclear(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#define dtracevoid() printf("%s %s()\n", gd_coladd(), __func__)
 #define dtrace(fmt, ...) printf("%s %s(" fmt ")\n", gd_coladd(), \
-    __FUNCTION__, ##__VA_ARGS__)
+    __func__, ##__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__)
+    __func__, __LINE__, ##__VA_ARGS__)
+#define dreturnvoid() printf("%s %s = (nil)\n", gd_colsub(), __func__)
 #define dreturn(fmt, ...) printf("%s %s = " fmt "\n", gd_colsub(), \
-    __FUNCTION__, ##__VA_ARGS__)
+    __func__, ##__VA_ARGS__)
 #define dwatch(fmt, v) printf("%s %s = " fmt "\n", gd_colnil(), #v, v)
 #else
+#define gd_colclear()
 #define dtracevoid()
 #define dtrace(...)
 #define dprintf(...)
@@ -461,6 +474,9 @@ int _GD_ReadDir(DIR *dirp, struct dirent *entry, struct dirent **result);
 #endif
 
 #ifdef HAVE__STRTOI64
+#if HAVE_DECL__STRTOI64 == 0
+__int64 _strtoi64(const char *nptr, char **endptr, int base);
+#endif
 #  define gd_strtoll _strtoi64
 #elif defined(HAVE_STRTOLL)
 #  define gd_strtoll strtoll
@@ -471,6 +487,9 @@ int _GD_ReadDir(DIR *dirp, struct dirent *entry, struct dirent **result);
 #endif
 
 #ifdef HAVE__STRTOUI64
+#if HAVE_DECL__STRTOUI64 == 0
+unsigned __int64 _strtoui64(const char *nptr, char **endptr, int base);
+#endif
 #  define gd_strtoull _strtoi64
 #elif defined(HAVE_STRTOULL)
 #  define gd_strtoull strtoull
@@ -549,6 +568,7 @@ typedef struct stat gd_stat64_t;
 #ifdef GD_NO_64BIT_STAT
 # define gd_stat64 stat
 # define gd_fstat64 fstat
+# define gd_StatAt64 gd_StatAt
 #else
 # if HAVE_STAT64
 #  define gd_stat64 stat64
@@ -567,6 +587,12 @@ typedef struct stat gd_stat64_t;
 # else
 #  define gd_fstat64 fstat
 # endif
+
+# ifdef HAVE_FSTATAT64
+#  define gd_StatAt64(d,...) fstatat64(__VA_ARGS__)
+# else
+int gd_StatAt64(const DIRFILE*, int, const char*, gd_stat64_t*, int);
+# endif
 #endif
 
 #ifdef HAVE_OPENAT
@@ -602,18 +628,18 @@ int gd_RenameAt(const DIRFILE *D, int, const char*, int, const char*);
 int gd_UnlinkAt(const DIRFILE*, int, const char*, int);
 #endif
 
-#ifdef HAVE_FSTATAT64
-# define gd_StatAt64(d,...) fstatat64(__VA_ARGS__)
-#else
-int gd_StatAt64(const DIRFILE*, int, const char*, gd_stat64_t*, int);
-#endif
-
-#if ! HAVE_DECL_STRERROR_R
-#ifdef STRERROR_R_CHAR_P
+#if defined HAVE_STERROR_R && ! defined HAVE_DECL_STRERROR_R
+# if ! HAVE_DECL_STRERROR_R
 char* strerror_r(int, char*, size_t);
-#else
+# else
 int strerror_r(int, char*, size_t);
+# endif
 #endif
+
+#if !defined HAVE_STRERROR_R || defined STRERROR_R_CHAR_P
+int gd_strerror(int errnum, char *buf, size_t buflen);
+#else
+# define gd_strerror strerror_r
 #endif
 
 #if defined HAVE_FTRUNCATE64
@@ -723,24 +749,31 @@ ssize_t getdelim(char**, size_t*, int, FILE*);
 /* Suberror codes */
 /* GD_E_FORMAT suberrors are in getdata.h */
 
-#define GD_E_OPEN_NOT_EXIST    1
-#define GD_E_OPEN_NOT_DIRFILE  2
-#define GD_E_OPEN_NO_ACCESS    3
-#define GD_E_OPEN_PATH         4
-
-#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_DIR         2
 #define GD_E_CREAT_OPEN        3
 
 #define GD_E_CODE_MISSING      1
 #define GD_E_CODE_INVALID      2
-
-#define GD_E_LINFILE_LENGTH    1
-#define GD_E_LINFILE_OPEN      2
+#define GD_E_CODE_AMBIGUOUS    3
+#define GD_E_CODE_INVALID_NS   4
+#define GD_E_CODE_REPR         5
+
+#define GD_E_IO_OPEN           1
+#define GD_E_IO_READ           2
+#define GD_E_IO_WRITE          3
+#define GD_E_IO_CLOSE          4
+#define GD_E_IO_UNLINK         5
+#define GD_E_IO_RENAME         6
+#define GD_E_IO_INCL           7
+
+#define GD_E_IO_ENC_OFFSET     GD_E_IO_INCL
+#define GD_E_IO_ENC_OPEN       ( GD_E_IO_OPEN   + GD_E_IO_ENC_OFFSET )
+#define GD_E_IO_ENC_READ       ( GD_E_IO_READ   + GD_E_IO_ENC_OFFSET )
+#define GD_E_IO_ENC_WRITE      ( GD_E_IO_WRITE  + GD_E_IO_ENC_OFFSET )
+#define GD_E_IO_ENC_CLOSE      ( GD_E_IO_CLOSE  + GD_E_IO_ENC_OFFSET )
+#define GD_E_IO_ENC_UNLINK     ( GD_E_IO_UNLINK + GD_E_IO_ENC_OFFSET )
+#define GD_E_IO_ENC_RENAME     ( GD_E_IO_RENAME + GD_E_IO_ENC_OFFSET )
 
 #define GD_E_RECURSE_CODE       1
 #define GD_E_RECURSE_INCLUDE    2
@@ -748,6 +781,8 @@ ssize_t getdelim(char**, size_t*, int, FILE*);
 #define GD_E_FIELD_PUT         1
 #define GD_E_FIELD_BAD         2
 #define GD_E_FIELD_MATCH       3
+#define GD_E_FIELD_FORMAT      4
+#define GD_E_FIELD_STR         5
 
 #define GD_E_ENTRY_TYPE      1
 #define GD_E_ENTRY_METARAW   2
@@ -758,8 +793,7 @@ ssize_t getdelim(char**, size_t*, int, FILE*);
 #define GD_E_ENTRY_BITSIZE   7
 #define GD_E_ENTRY_POLYORD   8
 #define GD_E_ENTRY_WINDOP    9
-#define GD_E_ENTRY_CNTVAL   10
-#define GD_E_ENTRY_PERIOD   11
+#define GD_E_ENTRY_PERIOD   10
 
 #define GD_E_SCALAR_CODE        1
 #define GD_E_SCALAR_TYPE        2
@@ -775,8 +809,7 @@ ssize_t getdelim(char**, size_t*, int, FILE*);
 #define GD_E_DEL_DERIVED        3
 #define GD_E_DEL_ALIAS          4
 
-#define GD_E_REPR_UNKNOWN       1
-#define GD_E_REPR_PUT           2
+#define GD_E_UNCLEAN_CALL       1
 
 #define GD_E_DOMAIN_COMPLEX     1
 #define GD_E_DOMAIN_EMPTY       2
@@ -786,13 +819,12 @@ ssize_t getdelim(char**, size_t*, int, FILE*);
 #define GD_E_OUT_OF_RANGE       1
 #define GD_E_SINGULAR_RANGE     2
 
+#define GD_E_LUT_LENGTH         1
+#define GD_E_LUT_SYNTAX         2
+
 #define GD_E_DIM_FORMAT         1
 #define GD_E_DIM_CALLER         2
 
-#define GD_E_FLUSH_MKTMP        1
-#define GD_E_FLUSH_OPEN         2
-#define GD_E_FLUSH_RENAME       3
-
 #define GD_E_UNENC_UNDET        1
 #define GD_E_UNENC_TARGET       2
 
@@ -803,6 +835,10 @@ ssize_t getdelim(char**, size_t*, int, FILE*);
 #define GD_E_ARG_NO_VERS        5
 #define GD_E_ARG_BAD_VERS       6
 
+#define GD_E_LONG_FLUSH         1
+
+/* number of lines chunked-in from a LINTERP table at a time */
+#define GD_LUT_CHUNK 100
 
 /* I/O flags */
 #define GD_FILE_READ  0x1
@@ -816,16 +852,43 @@ ssize_t getdelim(char**, size_t*, int, FILE*);
 
 #define GD_LIST_VALID_STRING_VALUE 0x01
 
+/* name types for ValidateField */
+#define GD_VF_NAME  0
+#define GD_VF_AFFIX 1
+#define GD_VF_NS    2
+#define GD_VF_CODE  3
+
+/* MungeCode flags */
+#define GD_MC_RQ_PARTS 0x01
+#define GD_MC_CHECK_NS 0x02
+#define GD_MC_ERROR_OK 0x04
+#define GD_MC_NO_NS    0x08
+#define GD_MC_NO_ALLOC 0x10
+
+/* database metadata update data for a field rename */
+struct gd_rename_data_ {
+  int n_meta, n_code, old_dot, new_dot;
+  gd_entype_t type;
+  unsigned flags, dot_ind;
+  size_t old_len, new_len;
+
+  char **meta_name, **code_list, *old_code, *new_code;
+  gd_entry_t *E, **meta_entry;
+};
+
+/* data file book-keeping record */
 struct gd_raw_file_ {
   char* name;
   int idata;
   void* edata;
   int subenc;
+  int error;
   const DIRFILE *D;
   unsigned int mode;
   off64_t pos;
 };
 
+/* linterp table datum */
 struct gd_lut_ {
   double x;
   union {
@@ -839,8 +902,6 @@ struct gd_private_entry_ {
   gd_entry_t* entry[GD_MAX_LINCOM];
   int repr[GD_MAX_LINCOM];
 
-  int calculated;
-
   int n_meta;
   union {
     gd_entry_t** meta_entry;
@@ -851,7 +912,7 @@ struct gd_private_entry_ {
   const char **alias_list;
   const char **entry_list[GD_N_ENTRY_LISTS];
   unsigned int entry_list_flags[GD_N_ENTRY_LISTS];
-  const char** string_value_list;
+  const char **string_value_list;
   void *const_value_list;
   gd_carray_t *carray_value_list;
   uint32_t value_list_validity;
@@ -886,20 +947,19 @@ struct gd_private_entry_ {
   } 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_SIE        7
-#define GD_ENC_ZZIP       8
-#define GD_ENC_ZZSLIM     9
-#define GD_ENC_UNKNOWN   10
+/* _GD_FiniRawIO flags */
+#define GD_FINIRAW_KEEP      0x0
+#define GD_FINIRAW_DISCARD   0x1
+#define GD_FINIRAW_DEFER     0x2
+#define GD_FINIRAW_CLOTEMP   0x4
 
-#define GD_N_SUBENCODINGS (GD_ENC_UNKNOWN + 1)
+/* number of subencodings (ie. the length of the _GD_ef array */
+#define GD_N_SUBENCODINGS 12
 
+/* the last record of the _GD_ef array is always the unknown encoding */
+#define GD_ENC_UNKNOWN (GD_N_SUBENCODINGS - 1)
+
+/* external module function provides flags */
 #define GD_EF_NAME    0x0001
 #define GD_EF_OPEN    0x0002
 #define GD_EF_CLOSE   0x0004
@@ -910,23 +970,13 @@ struct gd_private_entry_ {
 #define GD_EF_SYNC    0x0080
 #define GD_EF_MOVE    0x0100
 #define GD_EF_UNLINK  0x0200
+#define GD_EF_STRERR  0x0400
 
-#define GD_FINIRAW_KEEP      0x0
-#define GD_FINIRAW_DISCARD   0x1
-#define GD_FINIRAW_DEFER     0x2
-#define GD_FINIRAW_CLOTEMP   0x4
-
-#define BUFFER_SIZE 9000000
-
-/* helper macro */
-#if defined ARM_ENDIAN_FLOATS || \
-  ((defined WORDS_BIGENDIAN) ^ (defined FLOATS_BIGENDIAN))
-#  define SCREWY_FLOATS
-#endif
-
+/* encoding scheme method prototypes */
 typedef int (*gd_ef_name_t)(DIRFILE *D, const char *, struct gd_raw_file_*,
     const char*, int, int);
-typedef int (*gd_ef_open_t)(int, struct gd_raw_file_*, int, unsigned int);
+typedef int (*gd_ef_open_t)(int, struct gd_raw_file_*, gd_type_t, int,
+    unsigned int);
 typedef off64_t (*gd_ef_seek_t)(struct gd_raw_file_*, off64_t, gd_type_t,
     unsigned int);
 typedef off64_t (*gd_ef_size_t)(int, struct gd_raw_file_*, gd_type_t, int);
@@ -937,20 +987,42 @@ typedef int (*gd_ef_close_t)(struct gd_raw_file_*);
 typedef int (*gd_ef_sync_t)(struct gd_raw_file_*);
 typedef int (*gd_ef_unlink_t)(int, struct gd_raw_file_*);
 typedef int (*gd_ef_move_t)(int, struct gd_raw_file_*, int, char*);
+typedef int (*gd_ef_strerr_t)(const struct gd_raw_file_*, char *, size_t);
 
 /* Encoding scheme flags */
 #define GD_EF_ECOR 0x1 /* post-framework byte-sex correction required */
-#define GD_EF_SWAP 0x2 /* in-framework byte-sex metadata correction required */
+#define GD_EF_SWAP 0x2 /* in-framework byte-sex metadata correction occurs */
 #define GD_EF_OOP  0x4 /* writes occur out-of-place */
 #define GD_EF_EDAT 0x8 /* The /ENCODING datum is used */
+
+/* Just so we're clear on the difference between GD_EF_ECOR and GD_EF_SWAP:
+ *
+ * - ECOR means the data returned by the encoding framework has the byte sex of
+ *   the fragment; GetData needs to swap bytes around after the framework
+ *   finishes if this is different than the machine endianness.  Most binary
+ *   formats set ECOR, but TEXT doesn't, since sscanf() puts stuff into the
+ *   machine endianness.
+ *
+ * - SWAP means that internal workings of the encoding needs to know whether
+ *   the byte sex of the fragment is different than the machine endianness.
+ *   This is set by SIE since its sample indices are stored in the fragment
+ *   endianness, which need to be converted by within the encoding scheme itself
+ *   to be able to read opposite endian data files.
+ *
+ * Note: any encoding scheme could set SWAP instead of ECOR and then perform its
+ *   own byte sex correction to hide it from GetData proper, but this should be
+ *   avoided because it can lead to more byte swapping than necessary.
+ */
+
 /* Encoding schemes */
 extern struct encoding_t {
-  unsigned long int scheme;
-  const char* ext;
-  unsigned int flags; /* flags */
-  const char* affix;
-  const char* ffname;
-  unsigned int provides;
+  unsigned long int scheme; /* scheme number (the gd_open() flag value) */
+  const char* ext;          /* filename extension */
+  unsigned int flags;       /* encoding flags */
+  const char* affix;        /* function name prefix (NULL for internal scheme)*/
+  const char* ffname;       /* /ENCODING directive name */
+  unsigned int provides;    /* bitfield of functions provided by external
+                               module (0 for internal scheme) */
   gd_ef_name_t name;
   gd_ef_open_t open;
   gd_ef_close_t close;
@@ -961,18 +1033,30 @@ extern struct encoding_t {
   gd_ef_sync_t sync;
   gd_ef_move_t move;
   gd_ef_unlink_t unlink;
-} gd_ef_[GD_N_SUBENCODINGS];
+  gd_ef_strerr_t strerr;
+} _GD_ef[GD_N_SUBENCODINGS];
+
+/* parser data */
+struct parser_state {
+  const char *file;
+  int line;
+  int standards;
+  int pedantic;
+  char *ns;
+  size_t nsl;
+  unsigned long flags;
+};
+#define GD_PVERS_GE(p, v) (!(p).pedantic || (p).standards >= (v))
+#define GD_PVERS_LT(p, v) (!(p).pedantic || (p).standards < (v))
 
 /* Format file fragment metadata */
 struct gd_fragment_t {
-  /* Canonical name (full path) */
-  char* cname;
-  /* Subdirectory name */
-  char* sname;
-  /* basename */
-  char *bname;
-  /* External name (the one that appears in the format file) */
-  char* ename;
+  char* cname; /* Canonical name (full path) */
+  char* sname; /* Subdirectory name (path relative to dirfile or absolute) */
+  char *bname; /* basename (filename) */
+  char* ename; /* External name (the one that appears in the format file) */
+  char *ns; /* unused */
+  size_t nsl; /* strlen(ns) */
   void *enc_data;
   int modified;
   int parent;
@@ -996,11 +1080,15 @@ struct gd_dir_t {
   int rc;
 };
 
-/* internal flags */
+/* internal dirfile flags */
 #define GD_MULTISTANDARD   0x20000000 /* have multiple standards in format */
 #define GD_HAVE_VERSION    0x40000000 /* have computed the version */
 #define GD_INVALID         0x80000000 /* the dirfile is invalid */
 
+/* This has been the meaning of GD_PERMISSIVE post-open for a while; let's
+ * alias it to avoid confusing ourselves */
+#define GD_NOSTANDARD      GD_PERMISSIVE /* dirfile conforms to no standard */
+
 /* representation suffixes */
 #define GD_REPR_NONE 0
 #define GD_REPR_REAL 'r'
@@ -1008,6 +1096,7 @@ struct gd_dir_t {
 #define GD_REPR_MOD  'm'
 #define GD_REPR_ARG  'a'
 
+/* the implicit representation */
 #define GD_REPR_AUTO GD_REPR_REAL
 
 /* The DIRFILE struct.  */
@@ -1018,6 +1107,7 @@ struct gd_dirfile_ {
   char* error_string;
   char* error_file;
   int error_line;
+  int stdlib_errno;
 
   /* global data */
   unsigned long int flags;
@@ -1074,8 +1164,7 @@ struct gd_dirfile_ {
 
 /* forward declarations */
 void *_GD_Alloc(DIRFILE*, gd_type_t, size_t) __attribute_malloc__;
-void _GD_ArmEndianise(uint64_t*, int, size_t);
-int _GD_BadInput(DIRFILE *, const gd_entry_t *, int, int);
+int _GD_BadInput(DIRFILE *, const gd_entry_t *, int, gd_entype_t, int);
 
 #define _GD_BadWindop(op) \
   ( \
@@ -1086,12 +1175,14 @@ int _GD_BadInput(DIRFILE *, const gd_entry_t *, int, int);
 
 int _GD_CalculateEntry(DIRFILE *restrict, gd_entry_t *restrict, int);
 char *_GD_CanonicalPath(const char *restrict, const char *restrict);
-gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, char **restrict name, int me,
-    int linenum);
-int _GD_CheckCodeAffixes(DIRFILE *D, const gd_entry_t *P,
-    const char *field_code, int fragment);
-void _GD_CInvertData(DIRFILE *restrict, void *restrict, gd_type_t return_type,
+int _GD_CheckByteSex(gd_type_t, unsigned, unsigned, int, int *restrict);
+gd_entry_t *_GD_CheckParent(DIRFILE *restrict D,
+    const struct parser_state *restrict, char **restrict name, int me);
+int _GD_CheckCodeAffixes(DIRFILE *D, const char *field_code, int fragment,
+    int set_error);
+void _GD_CInvertData(DIRFILE *restrict, void *restrict, gd_type_t,
     GD_DCOMPLEXA(dividend), size_t);
+void _GD_CleanUpRename(struct gd_rename_data_*, int);
 
 /* _GD_ClearError: Everything's A-OK; clear the last error. */
 #define _GD_ClearError(D) (D)->error = 0
@@ -1105,22 +1196,20 @@ gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type);
 const char *_GD_DirName(const DIRFILE *D, int dirfd);
 size_t _GD_DoField(DIRFILE *restrict, gd_entry_t *restrict, int, off64_t,
     size_t, gd_type_t, void *restrict);
-size_t _GD_DoFieldOut(DIRFILE *restrict, gd_entry_t *restrict, int, off64_t,
-    size_t, gd_type_t, const void *restrict);
-size_t _GD_DoStringOut(DIRFILE *restrict D, gd_entry_t *restrict E,
-    const char *data_in);
+size_t _GD_DoFieldOut(DIRFILE *restrict, gd_entry_t *restrict, off64_t, size_t,
+    gd_type_t, const void *restrict);
+off64_t _GD_DoSeek(DIRFILE *restrict, gd_entry_t *restrict,
+    const struct encoding_t *restrict, off64_t, unsigned int mode);
 int _GD_EntryCmp(const void*, const void*);
+gd_entry_t *_GD_FindEntry(DIRFILE *restrict, const char *restrict,
+    unsigned int *restrict, int, int);
 gd_entry_t *_GD_FindField(const DIRFILE *restrict, const char *restrict,
     gd_entry_t *const *, unsigned int, int, unsigned int *restrict);
 gd_entry_t *_GD_FindFieldAndRepr(DIRFILE *restrict, const char *restrict,
     char **restrict, int *restrict, unsigned int *restrict, int, int);
 uint64_t _GD_FindVersion(DIRFILE *D);
-void _GD_FixEndianness(void* databuffer, size_t size, size_t ns);
-#ifdef WORDS_BIGENDIAN
-#define _GD_FileSwapBytes(D,i) ((D)->fragment[i].byte_sex & GD_LITTLE_ENDIAN)
-#else
-#define _GD_FileSwapBytes(D,i) ((D)->fragment[i].byte_sex & GD_BIG_ENDIAN)
-#endif
+void _GD_FixEndianness(void*, size_t, gd_type_t, unsigned, unsigned);
+int _GD_FileSwapBytes(const DIRFILE *restrict, const gd_entry_t *restrict);
 int _GD_FiniRawIO(DIRFILE*, const gd_entry_t*, int, int);
 void _GD_Flush(DIRFILE *restrict, gd_entry_t *restrict, int, int);
 void _GD_FlushMeta(DIRFILE* D, int fragment, int force);
@@ -1132,10 +1221,9 @@ char *_GD_GetLine(FILE *restrict, size_t *restrict, int *restrict);
 int _GD_GetRepr(DIRFILE *restrict, const char *restrict,
     char **restrict, int);
 unsigned int _GD_GetSPF(DIRFILE*, gd_entry_t*);
-int _GD_GrabDir(DIRFILE*, int, const char *restrict);
-int _GD_Include(DIRFILE*, const char *restrict, const char *restrict, int,
-    char **restrict, int, const char *restrict, const char *restrict,
-    int *restrict, unsigned long *restrict, int);
+int _GD_GrabDir(DIRFILE*, int, const char *restrict, int);
+int _GD_Include(DIRFILE*, struct parser_state *restrict, const char *restrict,
+    char **restrict, int, const char *restrict, const char *restrict, int);
 void _GD_InitialiseFramework(void);
 int _GD_InitRawIO(DIRFILE*, const gd_entry_t*, const char*, int,
     const struct encoding_t*, unsigned int, unsigned int, int);
@@ -1157,51 +1245,72 @@ void _GD_LinterpData(DIRFILE *restrict, void *restrict, gd_type_t, int,
 int _GD_ListEntry(const gd_entry_t *E, int meta, int hidden, int noalias,
     int special, gd_entype_t type);
 char *_GD_MakeFullPath(DIRFILE *restrict, int, const char *restrict, int);
+
 #ifdef USE_MODULES
 #define _GD_MakeFullPathOnly gd_MakeFullPathOnly
+#define _GD_MakeTempFile gd_MakeTempFile
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #else
 #define gd_MakeFullPathOnly _GD_MakeFullPathOnly
+#define gd_MakeTempFile _GD_MakeTempFile
 #endif
+
 char *_GD_MakeFullPathOnly(const DIRFILE *D, int dirfd, const char *name);
 int _GD_MakeTempFile(const DIRFILE*, int, char*);
+
+#ifdef USE_MODULES
+#ifdef __cplusplus
+}
+#endif
+#endif
+
 void *_GD_Malloc(DIRFILE *D, size_t size);
 int _GD_MissingFramework(int encoding, unsigned int funcs);
 int _GD_MogrifyFile(DIRFILE *restrict, gd_entry_t *restrict, unsigned long int,
     unsigned long int, off64_t, int, int, char *restrict);
-char *_GD_MungeCode(DIRFILE *restrict, const gd_entry_t *restrict,
+char *_GD_MungeCode(DIRFILE *restrict, const char *restrict, size_t,
     const char *restrict, const char *restrict, const char *restrict,
-    const char *restrict, const char *restrict, int *restrict, int);
-char *_GD_MungeFromFrag(DIRFILE *restrict, const gd_entry_t *restrict, int,
-    const char *restrict, int *restrict);
+    const char *restrict, const char *restrict, char **restrict,
+    int *restrict, unsigned);
 gd_type_t _GD_NativeType(DIRFILE *restrict, gd_entry_t *restrict, int);
 unsigned int _GD_NEntries(DIRFILE*, struct gd_private_entry_*, int,
     unsigned int);
 DIRFILE *_GD_Open(DIRFILE*, int, const char*, unsigned long,
     gd_parser_callback_t, void*);
-gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict, int, char**,
-    const gd_entry_t *restrict, const char *restrict, int, int, int, int,
-    unsigned long, int, char**, const char*);
-char *_GD_ParseFragment(FILE *restrict, DIRFILE *, int, int *restrict,
-    unsigned long int *, int);
+gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict,
+    const struct parser_state *restrict, int, char**,
+    const gd_entry_t *restrict, int, int, int, char **, const char *);
+char *_GD_ParseFragment(FILE *restrict, DIRFILE*, struct parser_state *restrict,
+    int, int);
+void _GD_PerformRename(DIRFILE *restrict, struct gd_rename_data_ *restrict);
+struct gd_rename_data_ *_GD_PrepareRename(DIRFILE *restrict, char *restrict,
+    gd_entry_t *restrict, int, unsigned, int, unsigned);
 void _GD_ReadLinterpFile(DIRFILE *restrict, gd_entry_t *restrict);
 void *_GD_Realloc(DIRFILE *restrict, void *restrict, size_t size);
 void _GD_ReleaseDir(DIRFILE *D, int dirfd);
 int _GD_Seek(DIRFILE *restrict, gd_entry_t *restrict, off64_t offset,
     unsigned int mode);
+void _GD_SetEncIOError(DIRFILE*, int suberror, const struct gd_raw_file_ *);
 void _GD_SetError(DIRFILE*, int, int, const char*, int, const char*);
+void _GD_SetError2(DIRFILE*, int, int, const char*, int, const char*, int);
 int _GD_SetTablePath(DIRFILE *restrict, const gd_entry_t *restrict,
     struct gd_private_entry_ *restrict);
+void _GD_SimpleParserInit(DIRFILE *restrict D, const char *restrict name,
+    struct parser_state *restrict p);
 int _GD_ShutdownDirfile(DIRFILE*, int, int);
 int _GD_StrCmpNull(const char *restrict, const char *restrict);
 char *_GD_Strdup(DIRFILE *restrict, const char *restrict);
 int _GD_Supports(DIRFILE *, const gd_entry_t*, unsigned int funcs);
-int _GD_Tokenise(DIRFILE *restrict, const char *restrict, char **,
-    const char **, int, char **, const char *restrict, int linenum,
-    int standards, int pedantic);
+int _GD_Tokenise(DIRFILE *restrict, const struct parser_state *restrict,
+    const char *restrict, char **, const char **, int, char **);
+int _GD_TokToNum(const char *restrict, int, int, double*, double*, uint64_t*,
+    int64_t*);
 void _GD_UpdateAliases(DIRFILE*, int);
-int _GD_ValidateField(const char*, int, int, int, int*);
-off64_t _GD_WriteSeek(DIRFILE *restrict, gd_entry_t *restrict,
-    const struct encoding_t *restrict, off64_t, unsigned int mode);
+int _GD_ValidateField(const char*, int, int, unsigned, int*);
 ssize_t _GD_WriteOut(const gd_entry_t*, const struct encoding_t*, const void*,
     gd_type_t, size_t, int);
 
@@ -1212,7 +1321,7 @@ int _GD_GenericName(DIRFILE *restrict, const char *restrict,
 int _GD_GenericUnlink(int, struct gd_raw_file_* file);
 
 /* unencoded I/O methods */
-int _GD_RawOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+int _GD_RawOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_RawSeek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_RawRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
@@ -1225,7 +1334,7 @@ off64_t _GD_RawSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
 
 /* text I/O methods */
-int _GD_AsciiOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+int _GD_AsciiOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_AsciiSeek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
@@ -1237,41 +1346,141 @@ int _GD_AsciiClose(struct gd_raw_file_* file);
 off64_t _GD_AsciiSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
 
+/* SIE I/O methods */
+int _GD_SampIndOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
+off64_t _GD_SampIndSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int);
+ssize_t _GD_SampIndRead(struct gd_raw_file_ *restrict, void *restrict,
+    gd_type_t, size_t);
+ssize_t _GD_SampIndWrite(struct gd_raw_file_ *restrict, const void *restrict,
+    gd_type_t, size_t);
+int _GD_SampIndSync(struct gd_raw_file_* file);
+int _GD_SampIndClose(struct gd_raw_file_* file);
+off64_t _GD_SampIndSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+#ifdef USE_MODULES
+#define _GD_Bzip2Open lt_libgetdatabzip2_LTX_GD_Bzip2Open
+#define _GD_Bzip2Seek lt_libgetdatabzip2_LTX_GD_Bzip2Seek
+#define _GD_Bzip2Read lt_libgetdatabzip2_LTX_GD_Bzip2Read
+#define _GD_Bzip2Write lt_libgetdatabzip2_LTX_GD_Bzip2Write
+#define _GD_Bzip2Sync lt_libgetdatabzip2_LTX_GD_Bzip2Sync
+#define _GD_Bzip2Close lt_libgetdatabzip2_LTX_GD_Bzip2Close
+#define _GD_Bzip2Size lt_libgetdatabzip2_LTX_GD_Bzip2Size
+#define _GD_Bzip2Strerr lt_libgetdatabzip2_LTX_GD_Bzip2Strerr
+
+#define _GD_FlacOpen lt_libgetdataflac_LTX_GD_FlacOpen
+#define _GD_FlacSeek lt_libgetdataflac_LTX_GD_FlacSeek
+#define _GD_FlacRead lt_libgetdataflac_LTX_GD_FlacRead
+#define _GD_FlacWrite lt_libgetdataflac_LTX_GD_FlacWrite
+#define _GD_FlacSync lt_libgetdataflac_LTX_GD_FlacSync
+#define _GD_FlacClose lt_libgetdataflac_LTX_GD_FlacClose
+#define _GD_FlacSize lt_libgetdataflac_LTX_GD_FlacSize
+#define _GD_FlacStrerr lt_libgetdataflac_LTX_GD_FlacStrerr
+
+#define _GD_GzipOpen lt_libgetdatagzip_LTX_GD_GzipOpen
+#define _GD_GzipSeek lt_libgetdatagzip_LTX_GD_GzipSeek
+#define _GD_GzipRead lt_libgetdatagzip_LTX_GD_GzipRead
+#define _GD_GzipWrite lt_libgetdatagzip_LTX_GD_GzipWrite
+#define _GD_GzipSync lt_libgetdatagzip_LTX_GD_GzipSync
+#define _GD_GzipClose lt_libgetdatagzip_LTX_GD_GzipClose
+#define _GD_GzipSize lt_libgetdatagzip_LTX_GD_GzipSize
+#define _GD_GzipStrerr lt_libgetdatagzip_LTX_GD_GzipStrerr
+
+#define _GD_LzmaOpen lt_libgetdatalzma_LTX_GD_LzmaOpen
+#define _GD_LzmaSeek lt_libgetdatalzma_LTX_GD_LzmaSeek
+#define _GD_LzmaRead lt_libgetdatalzma_LTX_GD_LzmaRead
+#define _GD_LzmaWrite lt_libgetdatalzma_LTX_GD_LzmaWrite
+#define _GD_LzmaSync lt_libgetdatalzma_LTX_GD_LzmaSync
+#define _GD_LzmaClose lt_libgetdatalzma_LTX_GD_LzmaClose
+#define _GD_LzmaSize lt_libgetdatalzma_LTX_GD_LzmaSize
+#define _GD_LzmaStrerr lt_libgetdatalzma_LTX_GD_LzmaStrerr
+
+#define _GD_SlimOpen lt_libgetdataslim_LTX_GD_SlimOpen
+#define _GD_SlimSeek lt_libgetdataslim_LTX_GD_SlimSeek
+#define _GD_SlimRead lt_libgetdataslim_LTX_GD_SlimRead
+#define _GD_SlimClose lt_libgetdataslim_LTX_GD_SlimClose
+#define _GD_SlimSize lt_libgetdataslim_LTX_GD_SlimSize
+#define _GD_SlimStrerr lt_libgetdataslim_LTX_GD_SlimStrerr
+
+#define _GD_ZzipName lt_libgetdatazzip_LTX_GD_ZzipName
+#define _GD_ZzipOpen lt_libgetdatazzip_LTX_GD_ZzipOpen
+#define _GD_ZzipSeek lt_libgetdatazzip_LTX_GD_ZzipSeek
+#define _GD_ZzipRead lt_libgetdatazzip_LTX_GD_ZzipRead
+#define _GD_ZzipClose lt_libgetdatazzip_LTX_GD_ZzipClose
+#define _GD_ZzipSize lt_libgetdatazzip_LTX_GD_ZzipSize
+#define _GD_ZzipStrerr lt_libgetdatazzip_LTX_GD_ZzipStrerr
+
+#define _GD_ZzslimName lt_libgetdatazzslim_LTX_GD_ZzslimName
+#define _GD_ZzslimOpen lt_libgetdatazzslim_LTX_GD_ZzslimOpen
+#define _GD_ZzslimSeek lt_libgetdatazzslim_LTX_GD_ZzslimSeek
+#define _GD_ZzslimRead lt_libgetdatazzslim_LTX_GD_ZzslimRead
+#define _GD_ZzslimClose lt_libgetdatazzslim_LTX_GD_ZzslimClose
+#define _GD_ZzslimSize lt_libgetdatazzslim_LTX_GD_ZzslimSize
+#define _GD_ZzslimStrerr lt_libgetdatazzslim_LTX_GD_ZzslimStrerr
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#endif
+
 /* bzip I/O methods */
-int _GD_Bzip2Open(int, struct gd_raw_file_* file, int swap, unsigned int);
+int _GD_Bzip2Open(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_Bzip2Seek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_Bzip2Read(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
     size_t);
-int _GD_Bzip2Close(struct gd_raw_file_* file);
-off64_t _GD_Bzip2Size(int, struct gd_raw_file_* file, gd_type_t data_type,
+ssize_t _GD_Bzip2Write(struct gd_raw_file_ *restrict, const void *restrict,
+    gd_type_t, size_t);
+int _GD_Bzip2Sync(struct gd_raw_file_*);
+int _GD_Bzip2Close(struct gd_raw_file_*);
+off64_t _GD_Bzip2Size(int, struct gd_raw_file_*, gd_type_t, int);
+int _GD_Bzip2Strerr(const struct gd_raw_file_*, char*, size_t);
+
+/* flac I/O methods */
+int _GD_FlacOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
+off64_t _GD_FlacSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int);
+ssize_t _GD_FlacRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
+    size_t);
+ssize_t _GD_FlacWrite(struct gd_raw_file_ *restrict, const void *restrict,
+    gd_type_t, size_t);
+int _GD_FlacSync(struct gd_raw_file_*);
+int _GD_FlacClose(struct gd_raw_file_* file);
+off64_t _GD_FlacSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
+int _GD_FlacStrerr(const struct gd_raw_file_*, char*, size_t);
 
 /* gzip I/O methods */
-int _GD_GzipOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+int _GD_GzipOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_GzipSeek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_GzipRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
     size_t);
 ssize_t _GD_GzipWrite(struct gd_raw_file_ *restrict, const void *restrict,
     gd_type_t, size_t);
-int _GD_GzipSync(struct gd_raw_file_* file);
+int _GD_GzipSync(struct gd_raw_file_*);
 int _GD_GzipClose(struct gd_raw_file_* file);
 off64_t _GD_GzipSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
+int _GD_GzipStrerr(const struct gd_raw_file_*, char*, size_t);
 
 /* lzma I/O methods */
-int _GD_LzmaOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+int _GD_LzmaOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_LzmaSeek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_LzmaRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
     size_t);
+ssize_t _GD_LzmaWrite(struct gd_raw_file_ *restrict, const void *restrict,
+    gd_type_t, size_t);
 int _GD_LzmaClose(struct gd_raw_file_* file);
+int _GD_LzmaSync(struct gd_raw_file_ *file);
 off64_t _GD_LzmaSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
+int _GD_LzmaStrerr(const struct gd_raw_file_*, char*, size_t);
 
 /* slim I/O methods */
-int _GD_SlimOpen(int, struct gd_raw_file_* file, int, unsigned int);
+int _GD_SlimOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_SlimSeek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_SlimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
@@ -1279,25 +1488,12 @@ ssize_t _GD_SlimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
 int _GD_SlimClose(struct gd_raw_file_* file);
 off64_t _GD_SlimSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
-
-/* SIE I/O methods */
-int _GD_SampIndOpen(int, struct gd_raw_file_* file, int swap,
-    unsigned int);
-off64_t _GD_SampIndSeek(struct gd_raw_file_* file, off64_t count,
-    gd_type_t data_type, unsigned int);
-ssize_t _GD_SampIndRead(struct gd_raw_file_ *restrict, void *restrict,
-    gd_type_t, size_t);
-ssize_t _GD_SampIndWrite(struct gd_raw_file_ *restrict, const void *restrict,
-    gd_type_t, size_t);
-int _GD_SampIndSync(struct gd_raw_file_* file);
-int _GD_SampIndClose(struct gd_raw_file_* file);
-off64_t _GD_SampIndSize(int, struct gd_raw_file_* file, gd_type_t data_type,
-    int swap);
+int _GD_SlimStrerr(const struct gd_raw_file_*, char*, size_t);
 
 /* zzip I/O methods */
 int _GD_ZzipName(DIRFILE *restrict, const char *restrict,
     struct gd_raw_file_ *restrict, const char *restrict, int, int);
-int _GD_ZzipOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+int _GD_ZzipOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_ZzipSeek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_ZzipRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
@@ -1305,11 +1501,12 @@ ssize_t _GD_ZzipRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
 int _GD_ZzipClose(struct gd_raw_file_* file);
 off64_t _GD_ZzipSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
+int _GD_ZzipStrerr(const struct gd_raw_file_*, char*, size_t);
 
 /* zzslim I/O methods */
 int _GD_ZzslimName(DIRFILE *restrict, const char *restrict,
     struct gd_raw_file_ *restrict, const char *restrict, int, int);
-int _GD_ZzslimOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+int _GD_ZzslimOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int);
 off64_t _GD_ZzslimSeek(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int);
 ssize_t _GD_ZzslimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
@@ -1317,12 +1514,20 @@ ssize_t _GD_ZzslimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
 int _GD_ZzslimClose(struct gd_raw_file_* file);
 off64_t _GD_ZzslimSize(int, struct gd_raw_file_* file, gd_type_t data_type,
     int swap);
+int _GD_ZzslimStrerr(const struct gd_raw_file_*, char*, size_t);
+
+#ifdef USE_MODULES
+#ifdef __cplusplus
+}
+#endif
+#endif
 
 #ifndef __cplusplus
 # undef gd_nothrow
 # define gd_nothrow
 #endif
 
+/* deal with GD_ANON */
 #ifdef GD_C89_API
 # define EN(t,v) u.t.v
 #else
diff --git a/src/legacy.c b/src/legacy.c
index efbcd5d..9d663ec 100644
--- a/src/legacy.c
+++ b/src/legacy.c
@@ -1,6 +1,6 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
  * Copyright (C) 2003-2005 Theodore Kisner
- * Copyright (C) 2005-2012, 2015 D. V. Wiebe
+ * Copyright (C) 2005-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -35,27 +35,28 @@ static DIRFILE _GD_GlobalErrors = {
   .error_string = NULL,
   .error_file = NULL,
   .error_line = 0,
+  .stdlib_errno = 0,
   .flags = GD_INVALID,
 #else
-  0, 0, NULL, NULL, 0, GD_INVALID
+  0, 0, NULL, NULL, 0, 0, GD_INVALID
 #endif
 };
 
 /* old error strings */
 const char *GD_ERROR_CODES[GD_N_ERROR_CODES] = {
   "Success", /* GD_E_OK */
-  "Error opening dirfile", /* GD_E_OPEN */
+  NULL, /* unused */
   "Error in Format file", /* GD_E_FORMAT */
-  NULL, /* GD_E_TRUNC */
+  NULL, /* unused */
   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 */
+  "Bad data type", /* GD_E_BAD_TYPE */
+  "I/O error", /* GD_E_IO */
+  NULL, /* unused */
   "Internal error", /* GD_E_INTERNAL_ERROR */
   "Memory allocation failed", /* GD_E_ALLOC */
   "Request out-of-range", /* GD_E_RANGE */
-  "Could not open interpolation table", /* GD_E_OPEN_LINFILE */
+  "Bad LINTERP table", /* GD_E_LINTERP */
   "Too many levels of recursion", /* GD_E_RECURSE_LEVEL */
   "Bad dirfile", /* GD_E_BAD_DIRFILE */
   "Bad field type", /* GD_E_BAD_FIELD_TYPE */
@@ -77,7 +78,7 @@ const char *GD_ERROR_CODES[GD_N_ERROR_CODES] = {
   "Improper domain", /* GD_E_DOMAIN */
   "Bad representation", /* GD_E_BAD_REPR */
   NULL, /* unused */
-  NULL, /* GD_E_FLUSH */
+  NULL, /* unused */
   NULL, /* GD_E_BOUNDS */
   "Line too long", /* GD_E_LINE_TOO_LONG */
 };
@@ -157,7 +158,7 @@ static DIRFILE *_GD_GetDirfile(const char *filename_in, int mode,
   /* 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*));
+  ptr = realloc(_GD_Dirfiles.D, (_GD_Dirfiles.n + 1) * sizeof(*_GD_Dirfiles.D));
   if (ptr == NULL) {
     *error_code = _GD_GlobalErrors.error = GD_E_ALLOC;
     free(filedir);
@@ -165,7 +166,7 @@ static DIRFILE *_GD_GetDirfile(const char *filename_in, int mode,
     return NULL;
   }
 
-  _GD_Dirfiles.D = (DIRFILE **)ptr;
+  _GD_Dirfiles.D = ptr;
 
   /* Open a dirfile */
   _GD_Dirfiles.D[_GD_Dirfiles.n] = gd_open(filedir, mode);
@@ -467,20 +468,16 @@ struct FormatType *GetFormat(const char *filedir, int *error_code) gd_nothrow
   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.mplexEntries = (struct MPlexEntryType *)malloc(Format.n_mplex *
-      sizeof(struct MPlexEntryType));
-  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));
+  Format.rawEntries = malloc(Format.n_raw * sizeof(*Format.rawEntries));
+  Format.lincomEntries = malloc(Format.n_lincom *
+      sizeof(*Format.lincomEntries));
+  Format.linterpEntries = malloc(Format.n_linterp *
+      sizeof(*Format.linterpEntries));
+  Format.mplexEntries = malloc(Format.n_mplex * sizeof(*Format.mplexEntries));
+  Format.multiplyEntries = malloc(Format.n_multiply *
+      sizeof(*Format.multiplyEntries));
+  Format.bitEntries = malloc(Format.n_bit * sizeof(*Format.bitEntries));
+  Format.phaseEntries = malloc(Format.n_phase * sizeof(*Format.phaseEntries));
 
   if (Format.rawEntries == NULL || Format.lincomEntries == NULL ||
       Format.linterpEntries == NULL || Format.mplexEntries == NULL ||
diff --git a/src/lzma.c b/src/lzma.c
index f3f1db3..647e19e 100644
--- a/src/lzma.c
+++ b/src/lzma.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -24,208 +24,341 @@
 #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
+#define GD_LZMA_DATA_OUT 32767
 #else
-#define GD_LZMA_BUFFER_SIZE 1000000
+#define GD_LZMA_DATA_OUT 1000000
 #endif
+#define GD_LZMA_DATA_IN 4096
+#define GD_LZMA_LOOKBACK 4096
 
 struct gd_lzmadata {
-  lzma_stream xzfile;
+  lzma_stream xz;
   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];
+  int stream_end;
+  int input_eof;
+  int offset;
+  uint8_t data_in[GD_LZMA_DATA_IN];
+  uint8_t data_out[GD_LZMA_DATA_OUT];
 };
 
-/* The bzip encoding scheme uses edata as a gd_lzmadata pointer.  If a file is
+/* total bytes in the output buffer */
+#define NOUT(p) (GD_LZMA_DATA_OUT - (p).xz.avail_out)
+
+/* byte position of the start of the output buffer */
+#define BASE(p) ((p).xz.total_out - NOUT(p))
+
+/* bytes of unused data in output buffer */
+#define READY(p) (NOUT(p) - (p).offset)
+
+/* At EOF */
+#define LZEOF(p) ((p).stream_end || (p).input_eof)
+
+/* The lzma encoding scheme uses edata as a gd_lzmadata pointer.  If a file is
  * open, idata = 0 otherwise idata = -1. */
 
-static struct gd_lzmadata *_GD_LzmaDoOpen(int dirfd, struct gd_raw_file_* file)
+static struct gd_lzmadata *_GD_LzmaDoOpen(int dirfd, struct gd_raw_file_* file,
+    unsigned int mode)
 {
-  struct gd_lzmadata *ptr;
+  struct gd_lzmadata *lzd;
   int fd;
-
-  dtrace("%i, %p", dirfd, file);
-
-  if ((ptr = (struct gd_lzmadata *)malloc(sizeof(struct gd_lzmadata))) == NULL)
-  {
+  lzma_ret e;
+  const char *fdmode = "rb";
+  FILE *stream;
+  const lzma_stream stream_init = LZMA_STREAM_INIT;
+
+  dtrace("%i, %p, %i", dirfd, file, mode);
+
+  if (mode & GD_FILE_READ) {
+    fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666);
+  } else if (mode & GD_FILE_TEMP) {
+    fd = _GD_MakeTempFile(file->D, dirfd, file->name);
+    fdmode = "wb";
+  } else { /* internal error */
+    errno = EINVAL; /* I guess ... ? */
     dreturn("%p", NULL);
     return NULL;
   }
 
-  if ((fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666))
-      == -1)
-  {
-    free(ptr);
+  if (fd < 0) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  if ((ptr->stream = fdopen(fd, "rb")) == NULL) {
+  if ((stream = fdopen(fd, fdmode)) == NULL) {
     close(fd);
-    free(ptr);
     dreturn("%p", NULL);
     return NULL;
   }
 
-  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);
+  if ((lzd = (struct gd_lzmadata *)malloc(sizeof(struct gd_lzmadata))) == NULL)
+  {
     dreturn("%p", NULL);
     return NULL;
   }
+  memset(lzd, 0, sizeof(*lzd));
+
+  lzd->xz = stream_init;
+  lzd->stream = stream;
+  lzd->xz.next_in = lzd->data_in;
+  lzd->xz.next_out = lzd->data_out;
+  lzd->xz.avail_out = GD_LZMA_DATA_OUT;
+  if (mode & GD_FILE_READ)
+    e = lzma_auto_decoder(&lzd->xz, UINT64_MAX, 0);
+  else {
+    e = lzma_easy_encoder(&lzd->xz, 9, LZMA_CHECK_CRC64);
+    memset(lzd->data_in, 0, GD_LZMA_DATA_IN);
+  }
 
-  ptr->read_in = ptr->out_pos = ptr->end = 0;
-  ptr->base = ptr->stream_end = ptr->input_eof = 0;
+  if (e != LZMA_OK) {
+    file->error = e;
+    fclose(lzd->stream);
+    free(lzd);
+    dreturn("%p", NULL);
+    return NULL;
+  }
 
-  dreturn("%p", ptr);
-  return ptr;
+  dreturn("%p", lzd);
+  return lzd;
 }
 
-int _GD_LzmaOpen(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
-    unsigned int mode gd_unused_)
+int _GD_LzmaOpen(int dirfd, struct gd_raw_file_* file,
+    gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode)
 {
-  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
+  dtrace("%i, %p, <unused>, <unused>, 0x%X", dirfd, file, mode);
 
-  file->edata = _GD_LzmaDoOpen(dirfd, file);
+  file->edata = _GD_LzmaDoOpen(dirfd, file, mode);
 
   if (file->edata == NULL) {
     dreturn("%i", 1);
     return 1;
   }
 
-  file->mode = GD_FILE_READ;
+  file->mode = mode;
   file->pos = 0;
   file->idata = 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)
+/* Read and decode until the there's enough data ready in the output buffer, or
+ * it's full, or we hit EOF.  Returns -1 on error, data ready size otherwise.
+ *
+ * This doesn't update next_out, so we don't have to worry about updating
+ * offset.
+ */
+static int _GD_LzmaReady(struct gd_lzmadata *lzd, size_t nreq, int *errnum)
 {
-  int n = 0;
+  lzma_ret e;
+  int ready = READY(*lzd);
 
-  dtrace("%p", ptr);
+  dtrace("%p, %" PRNsize_t " %p", lzd, nreq, errnum);
 
-  if (!ptr->input_eof) {
-    n = fread(ptr->data_in + ptr->read_in, 1, GD_LZMA_BUFFER_SIZE -
-        ptr->read_in, ptr->stream);
+  /* already have enough data, or no more data to read */
+  if (LZEOF(*lzd) || (size_t)ready >= nreq) {
+    dreturn("%i", ready);
+    return ready;
+  }
 
-    if (n < GD_LZMA_BUFFER_SIZE - ptr->read_in) {
-      if (feof(ptr->stream))
-        ptr->input_eof = 1;
-      else {
-        dreturn("%i", -1);
-        return -1;
+  /* coding loop */
+  while (lzd->xz.avail_out > 0 && (size_t)ready < nreq) {
+    /* No input data, so read some */
+    if (lzd->xz.avail_in == 0) {
+      size_t n = fread(lzd->data_in, 1, GD_LZMA_DATA_IN, lzd->stream);
+      if (n == 0) {
+        if (ferror(lzd->stream)) {
+          dreturn("%i", -1);
+          return -1;
+        }
+        /* end of input */
+        lzd->input_eof = 1;
+        break;
       }
+      lzd->xz.avail_in = n;
+      lzd->xz.next_in = lzd->data_in;
     }
-  }
 
-  ptr->xzfile.avail_in = ptr->read_in + n;
+    /* code */
+    e = lzma_code(&lzd->xz, LZMA_RUN);
+    if (e != LZMA_OK && e != LZMA_STREAM_END) {
+      *errnum = e;
+      dreturn("%i", -1);
+      return -1;
+    }
 
-  /* no more data to convert -- end of stream reached */
-  if (ptr->xzfile.avail_in == 0) {
-    ptr->stream_end = 1;
-    dreturn("%i", 0);
-    return 0;
+    ready = READY(*lzd);
+    if (e == LZMA_STREAM_END) {
+      lzd->stream_end = 1;
+      break;
+    }
   }
 
-  /* amount of data = amount already in buffer + amount just now read */
-  ptr->xzerror = lzma_code(&ptr->xzfile, LZMA_RUN);
+  dreturn("%i", ready);
+  return ready;
+}
 
-  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;
+/* clear the output buffer, retaining a bit of data for lookback purposes */
+static void _GD_LzmaClear(struct gd_lzmadata *lzd)
+{
+  int n;
+
+  dtrace("%p", lzd);
+  
+  /* amount of data to keep */
+  n = NOUT(*lzd);
+  if (n > GD_LZMA_LOOKBACK)
+    n = GD_LZMA_LOOKBACK;
+
+  memmove(lzd->data_out, lzd->xz.next_out - n, n);
+  lzd->xz.next_out = lzd->data_out + n; 
+  lzd->xz.avail_out = GD_LZMA_DATA_OUT - n;
+
+  dreturnvoid();
+}
+
+/* flush the output buffer to the stream */
+static int _GD_LzmaFlush(struct gd_lzmadata *lzd)
+{
+  uint8_t *ptr;
+
+  dtrace("%p", lzd);
+
+  ptr = lzd->data_out;
+  while (NOUT(*lzd) > 0) {
+    ssize_t nw = fwrite(ptr, 1, NOUT(*lzd), lzd->stream);
+    if (nw == 0 && ferror(lzd->stream)) {
+      dreturn("%i", 1);
+      return 1;
+    }
+
+    ptr += nw;
+    lzd->xz.avail_out += nw;
   }
 
+  /* reset output buffer */
+  lzd->xz.next_out = lzd->data_out;
+
   dreturn("%i", 0);
   return 0;
 }
 
-off64_t _GD_LzmaSeek(struct gd_raw_file_* file, off64_t count,
-    gd_type_t data_type, unsigned int mode gd_unused_)
+ssize_t _GD_LzmaWrite(struct gd_raw_file_ *file, const void *data,
+    gd_type_t data_type, size_t nmemb)
 {
-  struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+  lzma_ret e;
+  size_t n;
+  struct gd_lzmadata *lzd = (struct gd_lzmadata *)file->edata;
 
-  dtrace("%p, %lli, 0x%X, <unused>", file, (long long)count, data_type);
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
 
-  count *= GD_SIZE(data_type);
+  n = nmemb * GD_SIZE(data_type);
 
-  /* the easy case */
-  if (file->pos == count) {
-    dreturn("%lli", (long long)count);
-    return count;
-  }
+  /* We let liblzma read directly from the caller's buffer */
+  lzd->xz.next_in = data;
+  lzd->xz.avail_in = n;
 
-  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->idata = -1;
-      fclose(ptr->stream);
-      dreturn("%i", 1);
-      return 1;
+  /* code */
+  while (lzd->xz.avail_in > 0) {
+    e = lzma_code(&lzd->xz, LZMA_RUN);
+    if (e != LZMA_OK) {
+      file->error = e;
+      dreturn("%i", -1);
+      return -1;
     }
-    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)) {
+    if (_GD_LzmaFlush(lzd)) {
       dreturn("%i", -1);
       return -1;
     }
+  }
 
-    /* eof */
-    if (ptr->stream_end)
-      break;
+  /* we always write all the input, if successful */
+  dreturn("%" PRNssize_t, (ssize_t)nmemb);
+  return nmemb;
+}
+
+off64_t _GD_LzmaSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int mode)
+{
+  struct gd_lzmadata *lzd;
+  lzma_ret e;
+  uint64_t bcount;
+
+  dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode);
+
+  bcount = count * GD_SIZE(data_type);
+
+  if (mode == GD_FILE_WRITE)
+    lzd = (struct gd_lzmadata *)file[1].edata;
+  else
+    lzd = (struct gd_lzmadata *)file[0].edata;
+
+  /* the easy case -- position is somewhere within our current output buffer */
+  if (bcount < lzd->xz.total_out && bcount >= BASE(*lzd)) {
+    lzd->offset = bcount - BASE(*lzd);
+    file->pos = count;
+
+    dreturn("%lli", (long long)(file->pos));
+    return file->pos;
   }
 
-  ptr->out_pos = (ptr->stream_end && count >= ptr->base + ptr->end) ?  ptr->end
-    : count - ptr->base;
+  if (mode != GD_FILE_WRITE) {
+    if (BASE(*lzd) > bcount) {
+      /* a backwards seek -- rewind to the beginning */
+      lzd->xz.avail_in = 0;
+      lzd->xz.avail_out = GD_LZMA_DATA_OUT;
+      lzd->xz.total_in = lzd->xz.total_out = 0;
+      lzd->xz.next_in = lzd->data_in;
+      lzd->xz.next_out = lzd->data_out;
+      e = lzma_auto_decoder(&lzd->xz, UINT64_MAX, 0);
+      if (e != LZMA_OK) {
+        file->error = e;
+        file->idata = -1;
+        free(lzd);
+        file->edata = NULL;
+        fclose(lzd->stream);
+        dreturn("%i", 1);
+        return 1;
+      }
+      rewind(lzd->stream);
+      lzd->input_eof = lzd->stream_end = 0;
+    }
+
+    /* seek forward the slow way */
+    while (lzd->xz.total_out < bcount) {
+      /* discard output */
+      _GD_LzmaClear(lzd);
+
+      if (_GD_LzmaReady(lzd, lzd->xz.avail_out, &file->error) < 0) {
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      /* eof */
+      if (LZEOF(*lzd))
+        break;
+    }
+
+    if (lzd->xz.total_out < bcount) {
+      /* ran out of data */
+      lzd->offset = NOUT(*lzd);
+      file->pos = lzd->xz.total_out / GD_SIZE(data_type);
+    } else {
+      lzd->offset = bcount - BASE(*lzd);
+      file->pos = count;
+    }
+  } else {
+    /* we only get here when we need to pad */
+    while (lzd->xz.total_in < bcount) {
+      int n = bcount - lzd->xz.total_in;
+      if (n > GD_LZMA_DATA_IN)
+        n = GD_LZMA_DATA_IN;
 
-  file->pos = (ptr->base + ptr->out_pos) / GD_SIZE(data_type);
+      _GD_LzmaWrite(file + 1, lzd->data_in, GD_UINT8, n);
+    }
+    lzd->offset = 0;
+    file->pos = lzd->xz.total_in / GD_SIZE(data_type);
+  }
 
   dreturn("%lli", (long long)(file->pos));
   return file->pos;
@@ -234,103 +367,185 @@ off64_t _GD_LzmaSeek(struct gd_raw_file_* file, off64_t count,
 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);
+  uint64_t bcount;
+  struct gd_lzmadata *lzd = (struct gd_lzmadata *)file->edata;
+  ssize_t nread = 0;
 
   dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
 
-  /* 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 (nmemb > GD_SSIZE_T_MAX / GD_SIZE(data_type))
+    nmemb = GD_SSIZE_T_MAX / GD_SIZE(data_type);
+  bcount = nmemb * GD_SIZE(data_type);
+
+  /* decoding loop */
+  while (bcount > 0) {
+    int bready, nready;
 
-    if (_GD_LzmaDecode(ptr)) {
+    /* clear the output buffer if it's full */
+    if (lzd->xz.avail_out == 0)
+      _GD_LzmaClear(lzd);
+    
+    bready = _GD_LzmaReady(lzd, bcount, &file->error);
+    if (bready < 0) {
       dreturn("%i", -1);
       return -1;
     }
 
-    /* eof */
-    if (ptr->stream_end)
-      break;
-  }
+    /* copy whole samples */
+    nready = bready / GD_SIZE(data_type);
+    if (nready > (ssize_t)nmemb)
+      nready = nmemb;
 
-  /* 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;
-  }
+    bready = nready * GD_SIZE(data_type);
 
-  file->pos += nmemb - nbytes / GD_SIZE(data_type);
+    memcpy(data, lzd->data_out + lzd->offset, bready);
+    lzd->offset += bready;
+    bcount -= bready;
+    data += bready;
+    nread += nready;
 
-  dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
-  return nmemb - nbytes / GD_SIZE(data_type);
+    if (LZEOF(*lzd))
+      break;
+  }
+
+  dreturn("%" PRNssize_t, nread);
+  return nread;
 }
 
 int _GD_LzmaClose(struct gd_raw_file_ *file)
 {
-  struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+  lzma_ret e;
+  struct gd_lzmadata *lzd = (struct gd_lzmadata *)file->edata;
 
   dtrace("%p", file);
 
-  ptr->xzerror = 0;
-  lzma_end(&ptr->xzfile);
-  if (fclose(ptr->stream)) {
+  /* finialise */
+  if (!(file->mode & GD_FILE_READ)) {
+    /* ensure we don't read any more data */
+    lzd->xz.avail_in = 0;
+    for (;;) {
+      e = lzma_code(&lzd->xz, LZMA_FINISH);
+      if (e != LZMA_OK && e != LZMA_STREAM_END) {
+        file->error = e;
+        dreturn("%i", 1);
+        return 1;
+      }
+
+      if (_GD_LzmaFlush(lzd)) {
+        dreturn("%i", 1);
+        return 1;
+      }
+
+      if (e == LZMA_STREAM_END)
+        break;
+    }
+  }
+
+  /* shutdown */
+  lzma_end(&lzd->xz);
+  if (fclose(lzd->stream)) {
     dreturn("%i", 1);
     return 1;
   }
 
   file->idata = -1;
-  file->mode = 0;
   free(file->edata);
+  file->edata = NULL;
   dreturn("%i", 0);
   return 0;
 }
 
+/* We don't flush the encoder since it may degrade compression, but we can
+ * flush the stdio buffer */
+int _GD_LzmaSync(struct gd_raw_file_ *file)
+{
+  int r = 0;
+  dtrace("%p", file);
+
+  if (file->mode & GD_FILE_WRITE) {
+    struct gd_lzmadata *lzd = (struct gd_lzmadata *)file[1].edata;
+
+    r = fflush(lzd->stream);
+  }
+
+  dreturn("%i", r);
+  return r;
+}
+
 off64_t _GD_LzmaSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
     int swap gd_unused_)
 {
-  struct gd_lzmadata *ptr;
-  off_t n;
+  struct gd_lzmadata *lzd;
+  off64_t n;
 
   dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
 
-  ptr = _GD_LzmaDoOpen(dirfd, file);
+  lzd = _GD_LzmaDoOpen(dirfd, file, GD_FILE_READ);
 
-  if (ptr == NULL) {
+  if (lzd == 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);
+  /* read until EOF */
+  while (!LZEOF(*lzd)) {
+    if (_GD_LzmaReady(lzd, GD_LZMA_DATA_OUT, &file->error) < 0) {
       dreturn("%i", -1);
       return -1;
     }
+
+    /* discard output */
+    lzd->xz.next_out = lzd->data_out;
+    lzd->xz.avail_out = GD_LZMA_DATA_OUT;
   }
-  lzma_end(&ptr->xzfile);
-  fclose(ptr->stream);
 
-  n = (ptr->base + ptr->end) / GD_SIZE(data_type);
-  free(ptr);
+  /* liblzma very graciously does the bookkeeping for us */
+  n = lzd->xz.total_out / GD_SIZE(data_type);
+
+  lzma_end(&lzd->xz);
+  fclose(lzd->stream);
+
+  free(lzd);
 
   dreturn("%lli", (long long)n);
   return n;
 }
+
+int _GD_LzmaStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen)
+{
+  int r = 0;
+
+  dtrace("%p, %p, %" PRNsize_t, file, buf, buflen);
+
+  switch(file->error) {
+    case LZMA_OK:
+      r = gd_strerror(errno, buf, buflen);
+      break;
+    case LZMA_MEM_ERROR:
+    case LZMA_MEMLIMIT_ERROR:
+      strncpy(buf, "LZMA: Out of memory", buflen);
+      break;
+    case LZMA_FORMAT_ERROR:
+      strncpy(buf, "LZMA: File format not recognized", buflen);
+      break;
+    case LZMA_OPTIONS_ERROR:
+      strncpy(buf, "LZMA: Invalid or unsupported options", buflen);
+      break;
+    case LZMA_DATA_ERROR:
+      strncpy(buf, "LZMA: Data is corrupt", buflen);
+      break;
+    case LZMA_BUF_ERROR:
+      strncpy(buf, "LZMA: No progress is possible", buflen);
+      break;
+    case LZMA_PROG_ERROR:
+      /* this indicate bugs in the code */
+      strncpy(buf, "Internal error in LZMA encoding", buflen);
+      break;
+    default:
+      snprintf(buf, buflen, "LZMA: Unkown error %i", file->error);
+      break;
+  }
+
+  dreturn("%i", r);
+  return r;
+}
diff --git a/src/mod.c b/src/mod.c
index a458d07..b204aa5 100644
--- a/src/mod.c
+++ b/src/mod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012, 2015 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -29,7 +29,17 @@ static unsigned int gd_max_(unsigned int A, unsigned int B)
 #define GD_AS_NEED_RECALC 2
 #define GD_AS_ERROR       4
 #define GD_AS_MODIFIED    8
-/*  sold snew alit
+/* inputs:
+ *  sin - old scalar name ( == NULL means remove; == "" means keep as-is )
+ *  iin - old scalar index
+ *  lin - old literal value
+ *
+ * outputs:
+ *  sout - new scalar name
+ *  iout - new scalar index
+ *  lout - new literal value
+ *
+ *  sin sout alit
  * 0a N    N0   0     -> do nothing         ()
  * 1  N    N0   1     -> set lout           ()
  * 2  Na   a    01    -> set sout           (free scalar; need recalc)
@@ -79,7 +89,15 @@ static int _GD_AlterScalar(DIRFILE* D, int alter_literal, gd_type_t type,
     /* 2: set a new CONST field from sout; if this is a RAW field, and we've
      *    been asked to move the raw file, _GD_Change is going to need to
      *    recalculate the entry; no need to change lout: it's ignored. */
-    if (!_GD_CheckCodeAffixes(D, NULL, sin, fragment_index)) {
+
+    if (_GD_CheckCodeAffixes(D, sin, fragment_index, 1))
+      ; /* reject codes with bad affixes */
+    else if (iin == -1 && !(D->flags & GD_NOSTANDARD) && D->standards <= 7 &&
+        _GD_TokToNum(sin, D->standards, 1, NULL, NULL, NULL, NULL) != -1)
+    {
+      /* when using early Standards, reject ambiguous field codes */
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_AMBIGUOUS, NULL, 0, sin);
+    } else {
       r = GD_AS_FREE_SCALAR | GD_AS_NEED_RECALC | GD_AS_MODIFIED;
       *sout = _GD_Strdup(D, sin);
       *iout = iin;
@@ -111,7 +129,7 @@ static int _GD_AlterScalar(DIRFILE* D, int alter_literal, gd_type_t type,
   if (D->error)
     r |= GD_AS_ERROR;
 
-  dreturn("%i", r);
+  dreturn("0x%X", r);
   return r;
 }
 
@@ -194,7 +212,7 @@ static int _GD_AlterInField(DIRFILE *D, int i, char **Q, char *const *N,
   dtrace("%p, %i, %p, %p, %p, %i, %i", D, i, Q, N, E, fragment_index, force);
 
   if (force || (N[i] != NULL && strcmp(E[i], N[i]))) {
-    if (_GD_CheckCodeAffixes(D, NULL, N[i], fragment_index)) {
+    if (_GD_CheckCodeAffixes(D, N[i], fragment_index, 1)) {
       dreturn("%i", -1);
       return -1;
     } else if ((Q[i] = _GD_Strdup(D, N[i])) == NULL) {
@@ -249,21 +267,28 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
   memcpy(&Qe, E->e, sizeof(struct gd_private_entry_));
   memcpy(&Q, E, sizeof(gd_entry_t));
 
-  /* hiddenness isn't changeable with this interface */
-  Q.hidden = E->hidden;
+  /* hiddenness can be changed here */
+  if (N->flags & GD_EN_HIDDEN)
+    Q.flags |= GD_EN_HIDDEN;
+  else
+    Q.flags &= ~GD_EN_HIDDEN;
+
+  if ((Q.flags & GD_EN_HIDDEN) != (E->flags & GD_EN_HIDDEN))
+    modified = 1;
 
   switch(E->field_type) {
     case GD_RAW_ENTRY:
       j = _GD_AlterScalar(D, N->EN(raw,spf) && N->EN(raw,spf) != E->EN(raw,spf),
           GD_UINT_TYPE, &Q.EN(raw,spf), &N->EN(raw,spf), Q.scalar, Q.scalar_ind,
-          N->scalar[0], N->scalar_ind[0], E->e->calculated, E->fragment_index);
+          N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC,
+          E->fragment_index);
 
       if (j & GD_AS_ERROR)
         break;
       if (j & GD_AS_FREE_SCALAR)
         scalar_free |= 1;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
 
       Q.EN(raw,data_type) = (N->EN(raw,data_type) == GD_NULL) ?
         E->EN(raw,data_type) : N->EN(raw,data_type);
@@ -290,11 +315,15 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
         void *buffer2;
         struct encoding_t *enc;
 
-        if (j & GD_AS_NEED_RECALC)
+        if (!(Q.flags & GD_EN_CALC))
           if (gd_get_constant(D, Q.scalar[0], GD_UINT_TYPE, &Q.EN(raw,spf)))
             break;
+        
+        if (!(E->flags & GD_EN_CALC))
+          if (!_GD_CalculateEntry(D, E, 1))
+            break;
 
-        nf = BUFFER_SIZE / gd_max_(E->e->u.raw.size,
+        nf = GD_BUFFER_SIZE / gd_max_(E->e->u.raw.size,
             GD_SIZE(Q.EN(raw,data_type))) / gd_max_(E->EN(raw,spf),
             Q.EN(raw,spf));
 
@@ -308,16 +337,17 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
         if (D->error)
           break;
 
-        enc = gd_ef_ + E->e->u.raw.file[0].subenc;
+        enc = _GD_ef + E->e->u.raw.file[0].subenc;
 
         /* open the old file */
-        if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0))
+        if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_READ,
+              _GD_FileSwapBytes(D, E)))
+        {
           break;
-        else if ((*enc->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type),
+        } else if ((*enc->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type),
               GD_FILE_READ) == -1)
         {
-          _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
-              NULL);
+          _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0);
         }
 
         if (D->error)
@@ -325,18 +355,16 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
 
         /* Create a temporary file and open it */
         if (_GD_InitRawIO(D, E, NULL, -1, enc, 0, GD_FILE_WRITE | GD_FILE_TEMP,
-              _GD_FileSwapBytes(D, E->fragment_index)))
+              _GD_FileSwapBytes(D, E)))
           break;
-        else if (_GD_WriteSeek(D, E, enc, 0, GD_FILE_WRITE | GD_FILE_TEMP)
-            == -1)
-        {
+        else if (_GD_DoSeek(D, E, enc, 0, GD_FILE_WRITE | GD_FILE_TEMP) == -1) {
           _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD |
               GD_FINIRAW_CLOTEMP);
           break;
         }
 
-        buffer1 = _GD_Malloc(D, BUFFER_SIZE);
-        buffer2 = _GD_Malloc(D, BUFFER_SIZE);
+        buffer1 = _GD_Malloc(D, GD_BUFFER_SIZE);
+        buffer2 = _GD_Malloc(D, GD_BUFFER_SIZE);
 
         if (D->error) {
           free(buffer1);
@@ -349,8 +377,7 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
               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);
+            _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 1);
             break;
           }
 
@@ -383,8 +410,7 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
               1);
 
           if (nwrote < ns_out) {
-            _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
-                NULL);
+            _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 1);
             break;
           }
         }
@@ -426,7 +452,7 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
           }
       }
 
-      Q.comp_scal = 0;
+      Q.flags &= ~GD_EN_COMPSCAL;
 
       for (i = 0; i < Q.EN(lincom,n_fields); ++i) {
         if (flags & 0x1) {
@@ -441,38 +467,38 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
         }
 
         if (flags & 0x2) {
-          if (N->comp_scal) {
+          if (N->flags & GD_EN_COMPSCAL) {
             j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(lincom,cm)[i],
                   N->EN(lincom,cm)[i]), GD_COMPLEX128, Q.EN(lincom,cm) + i,
                 N->EN(lincom,cm) + i, Q.scalar + i, Q.scalar_ind + i,
-                N->scalar[i], N->scalar_ind[i], E->e->calculated,
+                N->scalar[i], N->scalar_ind[i], E->flags & GD_EN_CALC,
                 E->fragment_index);
             Q.EN(lincom,m)[i] = creal(Q.EN(lincom,cm)[i]);
           } else {
             j = _GD_AlterScalar(D, E->EN(lincom,m)[i] != N->EN(lincom,m)[i],
                 GD_FLOAT64, Q.EN(lincom,m) + i, N->EN(lincom,m) + i,
                 Q.scalar + i, Q.scalar_ind + i, N->scalar[i], N->scalar_ind[i],
-                E->e->calculated, E->fragment_index);
+                E->flags & GD_EN_CALC, E->fragment_index);
             gd_rs2cs_(Q.EN(lincom,cm)[i], Q.EN(lincom,m)[i]);
           }
 
+          if (j & GD_AS_ERROR)
+            break;
           if (j & GD_AS_FREE_SCALAR)
             scalar_free |= 1 << i;
           if (j & GD_AS_MODIFIED)
             modified = 1;
           if (j & GD_AS_NEED_RECALC)
-            Qe.calculated = 0;
-          if (j & GD_AS_MODIFIED)
-            modified = 1;
+            Q.flags &= ~GD_EN_CALC;
         }
 
         if (flags & 0x4) {
-          if (N->comp_scal) {
+          if (N->flags & GD_EN_COMPSCAL) {
             j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(lincom,cb)[i],
                   N->EN(lincom,cb)[i]), GD_COMPLEX128, Q.EN(lincom,cb) + i,
                 N->EN(lincom,cb) + i, Q.scalar + i + GD_MAX_LINCOM,
                 Q.scalar_ind + i + GD_MAX_LINCOM, N->scalar[i +  GD_MAX_LINCOM],
-                N->scalar_ind[i + GD_MAX_LINCOM], E->e->calculated,
+                N->scalar_ind[i + GD_MAX_LINCOM], E->flags & GD_EN_CALC,
                 E->fragment_index);
             Q.EN(lincom,b)[i] = creal(Q.EN(lincom,cb)[i]);
           } else {
@@ -480,25 +506,25 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
                 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, E->fragment_index);
+                E->flags & GD_EN_CALC, E->fragment_index);
             gd_rs2cs_(Q.EN(lincom,cb)[i], Q.EN(lincom,b)[i]);
           }
 
+          if (j & GD_AS_ERROR)
+            break;
           if (j & GD_AS_FREE_SCALAR)
             scalar_free |= 1 << (i + GD_MAX_LINCOM);
           if (j & GD_AS_MODIFIED)
             modified = 1;
           if (j & GD_AS_NEED_RECALC)
-            Qe.calculated = 0;
-          if (j & GD_AS_MODIFIED)
-            modified = 1;
+            Q.flags &= ~GD_EN_CALC;
         }
 
         if (cimag(Q.EN(lincom,cm)[i]) || cimag(Q.EN(lincom,cb)[i]))
-          Q.comp_scal = 1;
+          Q.flags |= GD_EN_COMPSCAL;
       }
 
-      if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+      if ((Q.flags & GD_EN_COMPSCAL) != (E->flags & GD_EN_COMPSCAL))
         modified = 1;
       break;
     case GD_LINTERP_ENTRY:
@@ -516,6 +542,7 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
       {
         Q.EN(linterp,table) = _GD_Strdup(D, N->EN(linterp,table));
         Qe.u.linterp.table_file = NULL;
+        Qe.u.linterp.table_len = -1; /* not read yet */
 
         if (Q.EN(linterp,table) == NULL)
           break;
@@ -534,7 +561,8 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
                 Qe.u.linterp.table_file))
           {
             _GD_ReleaseDir(D, Qe.u.linterp.table_dirfd);
-            _GD_SetError(D, GD_E_RAW_IO, 0, E->EN(linterp,table), errno, 0);
+            _GD_SetError(D, GD_E_IO, GD_E_IO_RENAME, E->EN(linterp,table), 0,
+                NULL);
             break;
           }
         }
@@ -542,6 +570,9 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
         modified = 1;
         free(E->EN(linterp,table));
         free(E->e->u.linterp.table_file);
+        if (E->e->u.linterp.table_dirfd > 0)
+          _GD_ReleaseDir(D, E->e->u.linterp.table_dirfd);
+        free(E->e->u.linterp.lut);
       }
 
       break;
@@ -550,28 +581,28 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
       j = _GD_AlterScalar(D, N->EN(bit,numbits) >= 1 && E->EN(bit,numbits) !=
           N->EN(bit,numbits), GD_INT_TYPE, &Q.EN(bit,numbits),
           &N->EN(bit,numbits), Q.scalar + 1, Q.scalar_ind + 1, N->scalar[1],
-          N->scalar_ind[1], E->e->calculated, E->fragment_index);
+          N->scalar_ind[1], E->flags & GD_EN_CALC, E->fragment_index);
 
       if (j & GD_AS_ERROR)
         break;
       if (j & GD_AS_FREE_SCALAR)
         scalar_free |= 2;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
       if (j & GD_AS_MODIFIED)
         modified = 1;
 
       j = _GD_AlterScalar(D, N->EN(bit,bitnum) >= 0 && E->EN(bit,bitnum) !=
           N->EN(bit,bitnum), GD_INT_TYPE, &Q.EN(bit,bitnum), &N->EN(bit,bitnum),
           Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0],
-          E->e->calculated, E->fragment_index);
+          E->flags & GD_EN_CALC, E->fragment_index);
 
       if (j & GD_AS_ERROR)
         break;
       if (j & GD_AS_FREE_SCALAR)
         scalar_free |= 1;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
       if (j & GD_AS_MODIFIED)
         modified = 1;
 
@@ -616,22 +647,22 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
         field_free = 1;
       }
 
-      Q.comp_scal = 0;
-      if (N->comp_scal) {
+      Q.flags &= ~GD_EN_COMPSCAL;
+      if (N->flags & GD_EN_COMPSCAL) {
         j = _GD_AlterScalar(D, cabs(N->EN(recip,cdividend)) != 0 &&
             !gd_ccmpc_(E->EN(recip,cdividend), N->EN(recip,cdividend)),
             GD_COMPLEX128, &Q.EN(recip,cdividend), &(N->EN(recip,cdividend)),
             Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0],
-            E->e->calculated, E->fragment_index);
+            E->flags & GD_EN_CALC, E->fragment_index);
         Q.EN(recip,dividend) = creal(Q.EN(recip,cdividend));
         if (cimag(Q.EN(recip,cdividend)) != 0)
-          Q.comp_scal = 1;
+          Q.flags |= GD_EN_COMPSCAL;
       } else {
         j = _GD_AlterScalar(D, N->EN(recip,dividend) != 0 &&
             E->EN(recip,dividend) != N->EN(recip,dividend), GD_FLOAT64,
             &Q.EN(recip,dividend), &(N->EN(recip,dividend)), Q.scalar,
-            Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->e->calculated,
-            E->fragment_index);
+            Q.scalar_ind, N->scalar[0], N->scalar_ind[0],
+            E->flags & GD_EN_CALC, E->fragment_index);
         gd_rs2cs_(Q.EN(recip,cdividend), Q.EN(recip,dividend));
       }
 
@@ -640,25 +671,26 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
       if (j & GD_AS_FREE_SCALAR)
         scalar_free = 1;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
       if (j & GD_AS_MODIFIED)
         modified = 1;
 
-      if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+      if ((Q.flags & GD_EN_COMPSCAL) != (E->flags & GD_EN_COMPSCAL))
         modified = 1;
 
       break;
     case GD_PHASE_ENTRY:
       j = _GD_AlterScalar(D, E->EN(phase,shift) != N->EN(phase,shift), GD_INT64,
           &Q.EN(phase,shift), &N->EN(phase,shift), Q.scalar, Q.scalar_ind,
-          N->scalar[0], N->scalar_ind[0], E->e->calculated, E->fragment_index);
+          N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC,
+          E->fragment_index);
 
       if (j & GD_AS_ERROR)
         break;
       if (j & GD_AS_FREE_SCALAR)
         scalar_free |= 2;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
       if (j & GD_AS_MODIFIED)
         modified = 1;
 
@@ -687,40 +719,39 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
       if (Q.EN(polynom,poly_ord) != E->EN(polynom,poly_ord))
         modified = 1;
 
-      Q.comp_scal = 0;
+      if (flags & 0x1) {
+        Q.flags &= ~GD_EN_COMPSCAL;
 
-      if (flags & 0x1)
         for (i = 0; i <= Q.EN(polynom,poly_ord); ++i) {
-          if (N->comp_scal) {
+          if (N->flags & GD_EN_COMPSCAL) {
             j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(polynom,ca)[i],
                   N->EN(polynom,ca)[i]), GD_COMPLEX128, Q.EN(polynom,ca) + i,
                 N->EN(polynom,ca) + i, Q.scalar + i, Q.scalar_ind + i,
-                N->scalar[i], N->scalar_ind[i], E->e->calculated,
+                N->scalar[i], N->scalar_ind[i], E->flags & GD_EN_CALC,
                 E->fragment_index);
             Q.EN(polynom,a)[i] = creal(Q.EN(polynom,ca)[i]);
           } else {
             j = _GD_AlterScalar(D, E->EN(polynom,a)[i] != N->EN(polynom,a)[i],
                 GD_FLOAT64, Q.EN(polynom,a) + i, N->EN(polynom,a) + i,
                 Q.scalar + i, Q.scalar_ind + i, N->scalar[i], N->scalar_ind[i],
-                E->e->calculated, E->fragment_index);
+                E->flags & GD_EN_CALC, E->fragment_index);
             gd_rs2cs_(Q.EN(polynom,ca)[i], Q.EN(polynom,a)[i]);
           }
 
           if (j & GD_AS_FREE_SCALAR)
             scalar_free |= 1 << i;
-          if (j & GD_AS_MODIFIED)
-            modified = 1;
           if (j & GD_AS_NEED_RECALC)
-            Qe.calculated = 0;
+            Q.flags &= ~GD_EN_CALC;
           if (j & GD_AS_MODIFIED)
             modified = 1;
 
           if (cimag(Q.EN(polynom,ca)[i]))
-            Q.comp_scal = 1;
+            Q.flags |= GD_EN_COMPSCAL;
         }
 
-      if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
-        modified = 1;
+        if ((Q.flags & GD_EN_COMPSCAL) != (E->flags & GD_EN_COMPSCAL))
+          modified = 1;
+      }
 
       break;
     case GD_WINDOW_ENTRY:
@@ -737,20 +768,20 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
           j = _GD_AlterScalar(D, E->EN(window,threshold.i) !=
               N->EN(window,threshold.i), GD_INT64, &Q.EN(window,threshold.i),
               &N->EN(window,threshold.i), Q.scalar, Q.scalar_ind, N->scalar[0],
-              N->scalar_ind[0], E->e->calculated, E->fragment_index);
+              N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index);
           break;
         case GD_WINDOP_SET:
         case GD_WINDOP_CLR:
           j = _GD_AlterScalar(D, E->EN(window,threshold.u) !=
               N->EN(window,threshold.u), GD_UINT64, &Q.EN(window,threshold.u),
               &N->EN(window,threshold.u), Q.scalar, Q.scalar_ind, N->scalar[0],
-              N->scalar_ind[0], E->e->calculated, E->fragment_index);
+              N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index);
           break;
         default:
           j = _GD_AlterScalar(D, E->EN(window,threshold.r) !=
               N->EN(window,threshold.r), GD_FLOAT64, &Q.EN(window,threshold.r),
               &N->EN(window,threshold.r), Q.scalar, Q.scalar_ind, N->scalar[0],
-              N->scalar_ind[0], E->e->calculated, E->fragment_index);
+              N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index);
           break;
       }
 
@@ -759,7 +790,7 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
       if (j & GD_AS_FREE_SCALAR)
         scalar_free |= 1;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
       if (j & GD_AS_MODIFIED)
         modified = 1;
 
@@ -786,29 +817,29 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
       j = _GD_AlterScalar(D, N->EN(mplex,period) != -1 &&
           E->EN(mplex,period) != N->EN(mplex,period), GD_INT_TYPE,
           &Q.EN(mplex,period), &N->EN(mplex,period), Q.scalar + 1,
-          Q.scalar_ind + 1, N->scalar[1], N->scalar_ind[1], E->e->calculated,
-          E->fragment_index);
+          Q.scalar_ind + 1, N->scalar[1], N->scalar_ind[1],
+          E->flags & GD_EN_CALC, E->fragment_index);
 
       if (j & GD_AS_ERROR)
         break;
       if (j & GD_AS_FREE_SCALAR)
         scalar_free |= 2;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
       if (j & GD_AS_MODIFIED)
         modified = 1;
 
       j = _GD_AlterScalar(D, E->EN(mplex,count_val) != N->EN(mplex,count_val),
           GD_INT_TYPE, &Q.EN(mplex,count_val), &N->EN(mplex,count_val),
           Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0],
-          E->e->calculated, E->fragment_index);
+          E->flags & GD_EN_CALC, E->fragment_index);
 
       if (j & GD_AS_ERROR)
         break;
       if (j & GD_AS_FREE_SCALAR)
         scalar_free |= 1;
       if (j & GD_AS_NEED_RECALC)
-        Qe.calculated = 0;
+        Q.flags &= ~GD_EN_CALC;
       if (j & GD_AS_MODIFIED)
         modified = 1;
 
@@ -886,48 +917,42 @@ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
       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 = _GD_Malloc(D, GD_SIZE(type) * Q.EN(scalar,array_len));
-      if (Qe.u.scalar.d == NULL) {
-        dreturn("%i", -1);
-        return -1;
-      }
-      memset(Qe.u.scalar.d, 0, GD_SIZE(type) * Q.EN(scalar,array_len));
+        if (Q.EN(scalar,const_type) & 0x40 ||
+            GD_SIZE(Q.EN(scalar,const_type)) == 0)
+        {
+          _GD_SetError(D, GD_E_BAD_TYPE, Q.EN(scalar,const_type), NULL, 0,
+              NULL);
+          break;
+        }
 
-      /* 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);
+        type = _GD_ConstType(D, Q.EN(scalar,const_type));
+        Qe.u.scalar.d = _GD_Malloc(D, GD_SIZE(type) * Q.EN(scalar,array_len));
+        if (Qe.u.scalar.d == NULL)
+          break;
+        memset(Qe.u.scalar.d, 0, GD_SIZE(type) * Q.EN(scalar,array_len));
 
-      _GD_ConvertType(D, E->e->u.scalar.d, _GD_ConstType(D,
-            E->EN(scalar,const_type)), Qe.u.scalar.d, type, n);
+        /* 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);
 
-      if (D->error) {
-        free(Qe.u.scalar.d);
-        dreturn("%i", -1);
-        return -1;
-      }
+        _GD_ConvertType(D, E->e->u.scalar.d, _GD_ConstType(D,
+              E->EN(scalar,const_type)), Qe.u.scalar.d, type, n);
 
-      free(E->e->u.scalar.d);
+        if (D->error) {
+          free(Qe.u.scalar.d);
+          break;
+        }
+
+        free(E->e->u.scalar.d);
+      } else
+        Qe.u.scalar.d = E->e->u.scalar.d;
       break;
     case GD_INDEX_ENTRY:
       /* INDEX may not be modified */
@@ -988,7 +1013,6 @@ int gd_alter_entry(DIRFILE* D, const char* field_code,
 
   /* 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)
@@ -1020,7 +1044,6 @@ int gd_alter_raw(DIRFILE *D, const char *field_code,
   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);
@@ -1049,7 +1072,6 @@ int gd_alter_lincom(DIRFILE* D, const char* field_code, int n_fields,
 
   memset(&N, 0, sizeof(gd_entry_t));
   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_ENTRY_NFIELDS, NULL, n_fields, NULL);
     dreturn("%i", -1);
@@ -1068,7 +1090,6 @@ int gd_alter_lincom(DIRFILE* D, const char* field_code, int n_fields,
 
     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) {
@@ -1118,7 +1139,7 @@ int gd_alter_clincom(DIRFILE* D, const char* field_code, int n_fields,
 
   memset(&N, 0, sizeof(gd_entry_t));
   N.field_type = GD_LINCOM_ENTRY;
-  N.comp_scal = 1;
+  N.flags = GD_EN_COMPSCAL;
   if (n_fields > GD_MAX_LINCOM || n_fields < 0) {
     _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL);
     dreturn("%i", -1);
@@ -1137,7 +1158,6 @@ int gd_alter_clincom(DIRFILE* D, const char* field_code, int n_fields,
 
     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) {
@@ -1185,7 +1205,6 @@ int gd_alter_linterp(DIRFILE* D, const char* field_code, const char* in_field,
   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);
 
@@ -1213,7 +1232,6 @@ int gd_alter_bit(DIRFILE* D, const char* field_code, const char* in_field,
   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;
 
@@ -1243,7 +1261,6 @@ int gd_alter_sbit(DIRFILE* D, const char* field_code, const char* in_field,
   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;
 
@@ -1272,8 +1289,6 @@ int gd_alter_recip(DIRFILE* D, const char* field_code, const char* in_field,
   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);
 
@@ -1286,26 +1301,11 @@ 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;
-  }
-
-  memset(&N, 0, sizeof(gd_entry_t));
-  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);
+  ret = gd_alter_crecip89(D, field_code, in_field, (const double*)(&cdividend));
 
   dreturn("%i", ret);
   return ret;
@@ -1318,7 +1318,7 @@ int gd_alter_crecip89(DIRFILE* D, const char* field_code, const char* in_field,
   int ret;
   gd_entry_t N;
 
-  dtrace("%p, \"%s\", \"%s\", [%g, %g]", D, field_code, in_field,
+  dtrace("%p, \"%s\", \"%s\", %p={%g, %g}", D, field_code, in_field, cdividend,
       (cdividend == NULL) ? 0 : cdividend[0],
       (cdividend == NULL) ? 0 : cdividend[1]);
 
@@ -1339,8 +1339,7 @@ int gd_alter_crecip89(DIRFILE* D, const char* field_code, const char* in_field,
     gd_ra2cs_(N.EN(recip,cdividend), cdividend);
   }
   N.scalar_ind[0] = 0;
-  N.comp_scal = 1;
-  N.e = NULL;
+  N.flags = GD_EN_COMPSCAL;
 
   ret = _GD_Change(D, field_code, &N, 0);
 
@@ -1348,13 +1347,14 @@ int gd_alter_crecip89(DIRFILE* D, const char* field_code, const char* in_field,
   return ret;
 }
 
-int gd_alter_divide(DIRFILE* D, const char* field_code, const char* in_field1,
-    const char* in_field2) gd_nothrow
+static int _GD_AlterYoke(DIRFILE* D, gd_entype_t t, const char* field_code,
+    const char* in_field1, const char* in_field2) gd_nothrow
 {
   int ret;
   gd_entry_t N;
 
-  dtrace("%p, \"%s\", \"%s\", \"%s\"", D, field_code, in_field1, in_field2);
+  dtrace("%p, 0x%X, \"%s\", \"%s\", \"%s\"", D, t, field_code, in_field1,
+      in_field2);
 
   if (D->flags & GD_INVALID) {/* don't crash */
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -1363,10 +1363,9 @@ int gd_alter_divide(DIRFILE* D, const char* field_code, const char* in_field1,
   }
 
   memset(&N, 0, sizeof(gd_entry_t));
-  N.field_type = GD_DIVIDE_ENTRY;
+  N.field_type = t;
   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);
 
@@ -1374,30 +1373,16 @@ int gd_alter_divide(DIRFILE* D, const char* field_code, const char* in_field1,
   return ret;
 }
 
-int gd_alter_multiply(DIRFILE* D, const char* field_code, const char* in_field1,
+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;
-  }
-
-  memset(&N, 0, sizeof(gd_entry_t));
-  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);
+  return _GD_AlterYoke(D, GD_DIVIDE_ENTRY, field_code, in_field1, in_field2);
+}
 
-  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
+{
+  return _GD_AlterYoke(D, GD_MULTIPLY_ENTRY, field_code, in_field1, in_field2);
 }
 
 int gd_alter_phase(DIRFILE* D, const char* field_code, const char* in_field,
@@ -1418,7 +1403,6 @@ int gd_alter_phase(DIRFILE* D, const char* field_code, const char* in_field,
   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);
@@ -1444,7 +1428,6 @@ int gd_alter_const(DIRFILE* D, const char* field_code, gd_type_t const_type)
   memset(&N, 0, sizeof(gd_entry_t));
   N.field_type = GD_CONST_ENTRY;
   N.EN(scalar,const_type) = const_type;
-  N.e = NULL;
 
   ret = _GD_Change(D, field_code, &N, 0);
 
@@ -1470,7 +1453,6 @@ int gd_alter_carray(DIRFILE* D, const char* field_code, gd_type_t const_type,
   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);
 
@@ -1497,7 +1479,6 @@ int gd_alter_polynom(DIRFILE* D, const char* field_code, int poly_ord,
 
   memset(&N, 0, sizeof(gd_entry_t));
   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_ENTRY_POLYORD, NULL, poly_ord, NULL);
     dreturn("%i", -1);
@@ -1517,7 +1498,6 @@ int gd_alter_polynom(DIRFILE* D, const char* field_code, int poly_ord,
     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;
@@ -1554,7 +1534,7 @@ int gd_alter_cpolynom(DIRFILE* D, const char* field_code, int poly_ord,
 
   memset(&N, 0, sizeof(gd_entry_t));
   N.field_type = GD_POLYNOM_ENTRY;
-  N.comp_scal = 1;
+  N.flags = GD_EN_COMPSCAL;
   if (poly_ord > GD_MAX_POLYORD || poly_ord < 0) {
     _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL);
     dreturn("%i", -1);
@@ -1574,7 +1554,6 @@ int gd_alter_cpolynom(DIRFILE* D, const char* field_code, int poly_ord,
     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;
@@ -1594,7 +1573,7 @@ int gd_alter_cpolynom(DIRFILE* D, const char* field_code, int poly_ord,
 
 int gd_alter_window(DIRFILE* D, const char *field_code, const char *in_field,
     const char *check_field, gd_windop_t windop, gd_triplet_t threshold)
-  gd_nothrow
+gd_nothrow
 {
   int ret;
   gd_entry_t N;
@@ -1616,7 +1595,6 @@ int gd_alter_window(DIRFILE* D, const char *field_code, const char *in_field,
   N.EN(window,windop) = windop;
   N.EN(window,threshold) = threshold;
   N.scalar[0] = NULL;
-  N.e = NULL;
 
   ret = _GD_Change(D, field_code, &N, 0);
 
@@ -1626,7 +1604,7 @@ int gd_alter_window(DIRFILE* D, const char *field_code, const char *in_field,
 
 int gd_alter_mplex(DIRFILE* D, const char *field_code, const char *in_field,
     const char *count_field, int count_val, int period)
-  gd_nothrow
+gd_nothrow
 {
   int ret;
   gd_entry_t N;
@@ -1647,7 +1625,6 @@ int gd_alter_mplex(DIRFILE* D, const char *field_code, const char *in_field,
   N.EN(mplex,count_val) = count_val;
   N.EN(mplex,period) = period;
   N.scalar[0] = NULL;
-  N.e = NULL;
 
   ret = _GD_Change(D, field_code, &N, 0);
 
@@ -1661,8 +1638,8 @@ int gd_alter_spec(DIRFILE* D, const char* line, int move)
   char *outstring = NULL, *new_code;
   char *in_cols[MAX_IN_COLS];
   int n_cols, ret;
-  int standards = GD_DIRFILE_STANDARDS_VERSION;
   gd_entry_t *N = NULL;
+  struct parser_state p;
 
   dtrace("%p, \"%s\", %i", D, line, move);
 
@@ -1681,15 +1658,10 @@ int gd_alter_spec(DIRFILE* D, const char* line, int move)
 
   _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, MAX_IN_COLS, in_cols,
-      "dirfile_alter_spec()", 0, standards, D->flags & GD_PERMISSIVE);
+  _GD_SimpleParserInit(D, "gd_alter_spec()", &p);
+  n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS,
+      in_cols);
 
   if (D->error) {
     free(outstring);
@@ -1722,8 +1694,8 @@ int gd_alter_spec(DIRFILE* D, const char* line, int move)
   }
 
   /* 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);
+  N = _GD_ParseFieldSpec(D, &p, n_cols, in_cols, NULL, N->fragment_index, 0, 0,
+      &outstring, tok_pos);
 
   free(outstring);
 
@@ -1733,7 +1705,7 @@ int gd_alter_spec(DIRFILE* D, const char* line, int move)
     return -1;
   }
 
-  /* The parser will have re-applied the prefix and suffix, undo that */
+  /* The parse will have re-applied the prefix and suffix, undo that */
   free(N->field);
   N->field = new_code;
 
@@ -1755,8 +1727,8 @@ int gd_malter_spec(DIRFILE* D, const char* line, const char* parent, int move)
   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;
+  struct parser_state p;
 
   dtrace("%p, \"%s\", \"%s\", %i", D, line, parent, move);
 
@@ -1782,28 +1754,20 @@ int gd_malter_spec(DIRFILE* D, const char* line, const char* parent, int move)
     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, MAX_IN_COLS, in_cols,
-      "dirfile_malter_spec()", 0, standards, D->flags & GD_PERMISSIVE);
+  _GD_SimpleParserInit(D, "gd_malter_spec()", &p);
+  n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS,
+      in_cols);
 
   if (!D->error) {
     /* Let the parser compose the entry */
-    N = _GD_ParseFieldSpec(D, n_cols, in_cols, N, "dirfile_malter_spec()", 0,
-        N->fragment_index, standards, 0, GD_PEDANTIC, 0, &outstring, tok_pos);
+    N = _GD_ParseFieldSpec(D, &p, n_cols, in_cols, N, N->fragment_index, 0, 0,
+        &outstring, tok_pos);
 
     /* The parse will have re-applied the prefix and suffix, undo that */
     free(N->field);
-    if ((N->field = (char*)_GD_Malloc(D, strlen(parent) + strlen(in_cols[0]) +
-            2)))
-    {
+    if ((N->field = _GD_Malloc(D, strlen(parent) + strlen(in_cols[0]) + 2)))
       sprintf(N->field, "%s/%s", parent, in_cols[0]);
-    }
   }
 
   free(outstring);
diff --git a/src/move.c b/src/move.c
index aedeca6..599e434 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -26,11 +26,11 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
 {
   const struct encoding_t* enc_in;
   const struct encoding_t* enc_out;
-  const size_t ns = BUFFER_SIZE / E->e->u.raw.size;
+  const size_t ns = GD_BUFFER_SIZE / E->e->u.raw.size;
   ssize_t nread, nwrote;
   int subencoding = GD_ENC_UNKNOWN;
   int i, ef_swap;
-  int arm_endianise;
+  int arm_fix = 0, endian_fix = 0;
   void *buffer;
 
   dtrace("%p, %p, %lu, %lu, %lli, %i, %i, %p", D, E, encoding, byte_sex,
@@ -55,8 +55,8 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
   {
     subencoding = E->e->u.raw.file[0].subenc;
   } else
-    for (i = 0; gd_ef_[i].scheme != GD_ENC_UNSUPPORTED; i++) {
-      if (gd_ef_[i].scheme == encoding) {
+    for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) {
+      if (_GD_ef[i].scheme == encoding) {
         subencoding = i;
         break;
       }
@@ -69,7 +69,7 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
     return -1;
   }
 
-  enc_out = gd_ef_ + subencoding;
+  enc_out = _GD_ef + subencoding;
 
   /* Check output encoding */
   if (_GD_MissingFramework(subencoding, GD_EF_CLOSE | GD_EF_SEEK | GD_EF_WRITE |
@@ -90,35 +90,43 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
     return -1;
   }
 
-  enc_in = gd_ef_ + E->e->u.raw.file[0].subenc;
-
-  /* Need to do the ARM thing? */
-  arm_endianise = (((byte_sex & GD_ARM_FLAG) && (enc_out->flags & GD_EF_ECOR)) ^
-      ((D->fragment[E->fragment_index].byte_sex & GD_ARM_FLAG) &&
-       (enc_in->flags & GD_EF_ECOR))) && (E->EN(raw,data_type) == GD_FLOAT64 ||
-       E->EN(raw,data_type) == GD_COMPLEX128);
-
-  /* Normalise endiannesses */
-#ifdef WORDS_BIGENDIAN
-  ef_swap = (byte_sex & GD_LITTLE_ENDIAN) ? 1 : 0;
-  byte_sex = ((byte_sex & GD_LITTLE_ENDIAN) &&
-      (enc_out->flags & (GD_EF_ECOR | GD_EF_SWAP))) ^
-    ((D->fragment[E->fragment_index].byte_sex & GD_LITTLE_ENDIAN) &&
-     (enc_in->flags & (GD_EF_ECOR | GD_EF_SWAP)));
-#else
-  ef_swap = (byte_sex & GD_BIG_ENDIAN) ? 1 : 0;
-  byte_sex = ((byte_sex & GD_BIG_ENDIAN) &&
-      (enc_out->flags & (GD_EF_ECOR | GD_EF_SWAP))) ^
-    ((D->fragment[E->fragment_index].byte_sex & GD_BIG_ENDIAN) &&
-     (enc_in->flags & (GD_EF_ECOR | GD_EF_SWAP)));
-#endif
-  /* Now byte_sex is true if endianness conversion is required. */
+  enc_in = _GD_ef + E->e->u.raw.file[0].subenc;
+
+  /* if neither encoding scheme does internal byte swapping, and the data
+   * type can't be endianness swapped, sex differences can't matter */
+  if (GD_SIZE(E->e->u.raw.size) != 1 || (enc_in->flags & GD_EF_SWAP) ||
+      (enc_out->flags & GD_EF_SWAP))
+  {
+    /* figure out whether endianness correction is required */
+    if ((enc_in->flags & GD_EF_ECOR) || (enc_in->flags & GD_EF_ECOR)) {
+      unsigned in_sex = D->fragment[E->fragment_index].byte_sex;
+      unsigned out_sex = byte_sex;
+
+      /* fix endian flags for encoding behaviour */
+      if (!(enc_in->flags & (GD_EF_SWAP | GD_EF_ECOR))) {
+        in_sex = (in_sex & ~(GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) |
+          (out_sex & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN));
+        if (!(enc_in->flags & GD_EF_ECOR))
+          in_sex = (in_sex & ~GD_ARM_FLAG) | (out_sex & GD_ARM_FLAG);
+      }
+
+      if (!(enc_out->flags & (GD_EF_SWAP | GD_EF_ECOR))) {
+        out_sex = (out_sex & ~(GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) |
+          (in_sex & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN));
+        if (!(enc_out->flags & GD_EF_ECOR))
+          out_sex = (out_sex & ~GD_ARM_FLAG) | (in_sex | GD_ARM_FLAG);
+      }
+
+      endian_fix = _GD_CheckByteSex(E->EN(raw,data_type), in_sex, out_sex, 0,
+          &arm_fix);
+    }
+  }
 
   /* If all that's changing is the byte sex, but we don't need to do
    * endianness conversion, don't do anything */
   if (offset == 0 && encoding == D->fragment[E->fragment_index].encoding &&
-      !byte_sex && !arm_endianise && strcmp(new_filebase,
-        E->e->u.raw.filebase) == 0 && D->fragment[new_fragment].dirfd ==
+      !endian_fix && !arm_fix && strcmp(new_filebase, E->e->u.raw.filebase) == 0
+      && D->fragment[new_fragment].dirfd ==
       D->fragment[E->fragment_index].dirfd)
   {
     free(new_filebase);
@@ -138,12 +146,17 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
   }
 
   /* Open the input file, if necessary */
-  if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0)) {
+  if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_READ,
+        _GD_FileSwapBytes(D, E)))
+  {
     free(new_filebase);
     dreturn("%i", -1);
     return -1;
   }
 
+  /* set ef_swap, the output encoding in-framework endian correction flag */
+  ef_swap = _GD_CheckByteSex(E->EN(raw,data_type), byte_sex, 0, 0, NULL);
+
   /* Create the output file and open it. If we're changing encodings, we
    * could write to the new file directly.  However, we use a temporary file
    * anyway just to keep things clean. */
@@ -162,17 +175,17 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
     if ((*enc_in->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type),
           GD_FILE_WRITE) == -1)
     {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0);
     } else
-      _GD_WriteSeek(D, E, enc_out, -offset * E->EN(raw,spf), GD_FILE_WRITE
+      _GD_DoSeek(D, E, enc_out, -offset * E->EN(raw,spf), GD_FILE_WRITE
           | GD_FILE_TEMP);
   } else { /* new offset is more, truncate old file */
     if ((*enc_in->seek)(E->e->u.raw.file, offset * E->EN(raw,spf),
           E->EN(raw,data_type), GD_FILE_READ) == -1)
     {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0);
     } else
-      _GD_WriteSeek(D, E, enc_out, 0, GD_FILE_WRITE | GD_FILE_TEMP);
+      _GD_DoSeek(D, E, enc_out, 0, GD_FILE_WRITE | GD_FILE_TEMP);
   }
 
   if (D->error) {
@@ -181,7 +194,7 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
     return -1;
   }
 
-  if ((buffer = _GD_Malloc(D, BUFFER_SIZE)) == NULL) {
+  if ((buffer = _GD_Malloc(D, GD_BUFFER_SIZE)) == NULL) {
     free(new_filebase);
     dreturn("%i", -1);
     return -1;
@@ -193,30 +206,21 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
         ns);
 
     if (nread < 0) {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0);
       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);
-    }
+    _GD_FixEndianness(buffer, nread, E->EN(raw,data_type),
+        D->fragment[E->fragment_index].byte_sex, byte_sex);
 
     nwrote = _GD_WriteOut(E, enc_out, buffer, E->EN(raw,data_type), nread, 1);
 
     if (nwrote < nread) {
-      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno, NULL);
+      _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 1);
       break;
     }
   }
@@ -242,7 +246,7 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
       E->e->u.raw.file[0].name = NULL;
       E->e->u.raw.file[0].subenc = subencoding;
 
-      if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
+      if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D,
             (const char*)D->fragment[E->fragment_index].enc_data,
             E->e->u.raw.file, new_filebase, 0, 0))
       {
@@ -258,7 +262,7 @@ int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
             D->fragment[E->fragment_index].dirfd) && (*enc_in->unlink)(
               D->fragment[E->fragment_index].dirfd, &temp))
       {
-        _GD_SetError(D, GD_E_RAW_IO, 0, temp.name, errno, NULL);
+        _GD_SetError(D, GD_E_IO, GD_E_IO_UNLINK, temp.name, 0, NULL);
         E->e->u.raw.file[0].name = temp.name;
         E->e->u.raw.file[0].subenc = temp.subenc;
       } else {
@@ -311,13 +315,13 @@ int _GD_StrCmpNull(const char *s1, const char *s2)
   return r;
 }
 
-int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
+int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, unsigned flags)
 {
   char *new_filebase, *new_code;
-  char **new_meta = NULL;
-  int i, dummy;
+  struct gd_rename_data_ *rdat = NULL;
+  int i;
 
-  dtrace("%p, %p, %i, %i", D, E, new_fragment, move_data);
+  dtrace("%p, %p, %i, 0x%X", D, E, new_fragment, flags);
 
   /* check access mode */
   if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
@@ -337,8 +341,12 @@ int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
   }
 
   /* Compose the field's new name */
-  new_filebase = _GD_MungeCode(D, NULL, D->fragment[E->fragment_index].prefix,
-      D->fragment[E->fragment_index].suffix, NULL, NULL, E->field, &dummy, 0);
+
+  /* remove the old affixes */
+  new_filebase = _GD_MungeCode(D, NULL, 0,
+      D->fragment[E->fragment_index].prefix,
+      D->fragment[E->fragment_index].suffix, NULL, NULL, E->field, NULL,
+      NULL, GD_MC_RQ_PARTS);
   
   if (!new_filebase) {
     _GD_InternalError(D); /* the prefix/suffix wasn't found */
@@ -346,7 +354,10 @@ int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
     return -1;
   }
 
-  new_code = _GD_MungeFromFrag(D, NULL, new_fragment, new_filebase, &dummy);
+  /* add the new affixes */
+  new_code = _GD_MungeCode(D, NULL, 0, NULL, NULL,
+      D->fragment[new_fragment].prefix, D->fragment[new_fragment].suffix,
+      new_filebase, NULL, NULL, GD_MC_RQ_PARTS);
 
   if (strcmp(new_code, E->field)) {
     /* duplicate check */
@@ -358,45 +369,22 @@ int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
       return -1;
     }
 
-    /* compose all the new meta field names.  We must do this now in 
-     * a temporary location in case it fails and/or subsequent stuff fails */
-    if (E->e->n_meta > 0) {
-      int nlen = strlen(new_code);
-      int olen = strlen(E->field);
-      new_meta = (char**)_GD_Malloc(D, sizeof(char *) * E->e->n_meta);
-      if (!new_meta) {
-        free(new_filebase);
-        free(new_code);
-        dreturn("%i", -1);
-        return -1;
-      }
-
-      memset(new_meta, 0, sizeof(char *) * E->e->n_meta);
-      for (i = 0; i < E->e->n_meta; ++i) {
-        new_meta[i] = (char*)_GD_Malloc(D,
-            strlen(E->e->p.meta_entry[i]->field) + nlen - olen + 1);
-        if (new_meta[i] == NULL)
-          break;
-        sprintf(new_meta[i], "%s/%s", new_code,
-            E->e->p.meta_entry[i]->field + olen + 1);
-      }
-
-      if (D->error) {
-        for (i = 0; i < E->e->n_meta; ++i)
-          free(new_meta[i]);
-        free(new_meta);
-        free(new_filebase);
-        free(new_code);
-        dreturn("%i", -1);
-        return -1;
-      }
+    /* moving a field can't add or remove a field from the dot list, so
+     * we just set both old_dot and new_dot to one to ensure that the
+     * dot_list is resorted, if necessary */
+    rdat = _GD_PrepareRename(D, new_code, E, 1, 0, 1, flags);
+    if (rdat == NULL) {
+      free(new_filebase);
+      free(new_code);
+      dreturn("%i", -1);
+      return -1;
     }
   } else {
     free(new_code);
     new_code = NULL;
   }
 
-  if (move_data && E->field_type == GD_RAW_ENTRY &&
+  if ((flags & GD_REN_DATA) && E->field_type == GD_RAW_ENTRY &&
       (D->fragment[E->fragment_index].encoding !=
        D->fragment[new_fragment].encoding ||
        D->fragment[E->fragment_index].byte_sex !=
@@ -411,11 +399,7 @@ int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
           D->fragment[new_fragment].frame_offset, 1, new_fragment,
           new_filebase))
     {
-      if (new_meta) {
-        for (i = 0; i < E->e->n_meta; ++i)
-          free(new_meta[i]);
-        free(new_meta);
-      }
+      _GD_CleanUpRename(rdat, 1);
       free(new_code);
       dreturn("%i", -1);
       return -1;
@@ -429,20 +413,13 @@ int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
   D->flags &= ~GD_HAVE_VERSION;
   E->fragment_index = new_fragment;
 
-  /* update meta fields */
-  for (i = 0; i < E->e->n_meta; ++i) {
+  /* update metadata */
+  for (i = 0; i < E->e->n_meta; ++i)
     E->e->p.meta_entry[i]->fragment_index = new_fragment;
-    if (new_meta) {
-      free(E->e->p.meta_entry[i]->field);
-      E->e->p.meta_entry[i]->field = new_meta[i];
-    }
-  }
 
-  if (new_code) {
-    free(new_meta);
-    free(E->field);
-    E->field = new_code;
+  _GD_PerformRename(D, rdat);
 
+  if (new_code) {
     /* resort */
     qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), _GD_EntryCmp);
     qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
@@ -452,12 +429,13 @@ int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
   return 0;
 }
 
-int gd_move(DIRFILE *D, const char *field_code, int new_fragment, int move_data)
+int gd_move(DIRFILE *D, const char *field_code, int new_fragment,
+    unsigned flags)
 {
   gd_entry_t *E;
   int ret;
 
-  dtrace("%p, \"%s\", %i, %i", D, field_code, new_fragment, move_data);
+  dtrace("%p, \"%s\", %i, 0x%X", D, field_code, new_fragment, flags);
 
   if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
@@ -467,7 +445,7 @@ int gd_move(DIRFILE *D, const char *field_code, int new_fragment, int move_data)
 
   _GD_ClearError(D);
 
-  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL);
 
   if (E == NULL) {
     _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
@@ -490,52 +468,7 @@ int gd_move(DIRFILE *D, const char *field_code, int new_fragment, int move_data)
     return 0;
   }
 
-  ret = _GD_Move(D, E, new_fragment, move_data);
-
-  dreturn("%i", ret);
-  return ret;
-}
-
-int gd_move_alias(DIRFILE *D, const char *field_code, int new_fragment)
-  gd_nothrow
-{
-  gd_entry_t *E;
-  int ret;
-
-  dtrace("%p, \"%s\", %i", D, field_code, new_fragment);
-
-  if (D->flags & GD_INVALID) {
-    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  _GD_ClearError(D);
-
-  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL);
-
-  if (E == NULL) {
-    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  if (E->field_type != GD_ALIAS_ENTRY) {
-    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  if (new_fragment < 0 || new_fragment >= D->n_fragment) {
-    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, new_fragment, NULL);
-    dreturn("%i", -1);
-    return -1;
-  } else if (E->fragment_index == new_fragment) {
-    dreturn("%i", 0);
-    return 0;
-  }
-
-  ret = _GD_Move(D, E, new_fragment, 0);
+  ret = _GD_Move(D, E, new_fragment, flags);
 
   dreturn("%i", ret);
   return ret;
diff --git a/src/name.c b/src/name.c
index b51ffa4..0bf594b 100644
--- a/src/name.c
+++ b/src/name.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012, 2015 D. V. Wiebe
+/* Copyright (C) 2008, 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -20,158 +20,246 @@
  */
 #include "internal.h"
 
-/* add/remove/modify the prefix and suffix from a field code */
-char *_GD_MungeCode(DIRFILE *D, const gd_entry_t *P, const char *old_prefix,
-    const char *old_suffix, const char *new_prefix, const char *new_suffix,
-    const char *code, int *offset, int err_ok)
+/* compose/modify a field code.  This function takes care of adding and
+ * removing affixes and namespaces */
+char *_GD_MungeCode(DIRFILE *D, const char *ns, size_t len_newns,
+    const char *old_prefix, const char *old_suffix, const char *new_prefix,
+    const char *new_suffix, const char *code, char **nso, int *offset,
+    unsigned flags)
 {
-  size_t len, oplen = 0, oslen = 0, nplen = 0, nslen = 0, plen = 0, mlen = 0;
-  const char *ptr, *slash;
-  char *new_code;
+  size_t len, len_oldpx = 0, len_oldsx = 0, len_newpx, len_newsx;
+  size_t len_sub = 0, len_oldns;
+  const char *ptr, *slash, *old_ns;
+  char *new_code, *nptr;
 
-  dtrace("%p, %p, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %p, %i", D, P,
-      old_prefix, old_suffix, new_prefix, new_suffix, code, offset, err_ok);
+  dtrace("%p, \"%s\", %" PRNsize_t ", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", "
+      "%p, 0x%X", D, ns, len_newns, old_prefix, old_suffix, new_prefix,
+      new_suffix, code, nso, flags);
 
   if (code == NULL) {
     dreturn("%p", NULL);
     return NULL;
   }
 
+  old_ns = code;
   len = strlen(code);
 
+  /* Check for a required namespace.  In this case, the supplied 'ns' is the
+   * namespace to check for and is not later prepended */
+  if (flags & GD_MC_CHECK_NS && ns) {
+    if (len <= len_newns || strncmp(ns, code, len_newns) ||
+        code[len_newns] != '.')
+    {
+      /* namespace missing */
+      if (flags & GD_MC_RQ_PARTS) {
+        if (flags & GD_MC_ERROR_OK)
+          _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID_NS, NULL, 0, code);
+        else
+          _GD_InternalError(D);
+      }
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    /* don't re-add it if it's there already */
+    ns = NULL;
+  }
+
+  /* find the length of the current namespace tag */
+  if (flags & GD_MC_NO_NS)
+    len_oldns = 0;
+  else
+    for (len_oldns = len; len_oldns > 0; --len_oldns)
+      if (code[len_oldns - 1] == '.')
+        break;
+
+  code += len_oldns;
+  len -= len_oldns;
+
   /* Verify the old prefix is present */
   if (old_prefix) {
-    oplen = strlen(old_prefix);
-    if (strncmp(old_prefix, code, oplen)) {
+    len_oldpx = strlen(old_prefix);
+    if (strncmp(old_prefix, code, len_oldpx)) {
       /* prefix missing */
-      if (err_ok)
-        _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, code);
-      else
-        _GD_InternalError(D);
+      if (flags & GD_MC_RQ_PARTS) {
+        if (flags & GD_MC_ERROR_OK)
+          _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, code);
+        else
+          _GD_InternalError(D);
+      }
       dreturn("%p", NULL);
       return NULL;
     }
-    ptr = code + oplen;
-    len -= oplen;
-  } else
+    ptr = code + len_oldpx;
+    len -= len_oldpx;
+  } else {
     ptr = code;
+    len_oldpx = 0;
+  }
 
   /* look for a /, which could indicate this is a metafield code.  If it is
    * just an illegal name with a / in it, mungeing will screw up, but
    * validation will catch the illegal name later anyways.
    */
   if ((slash = (char*)memchr(ptr, '/', len))) {
-    mlen = len + (ptr - slash);
-    len = slash++ - ptr;
+    len_sub = len + (ptr - slash);
+    len = slash - ptr;
   }
 
   /* Verify the suffix is present */
   if (old_suffix) {
-    oslen = strlen(old_suffix);
-    if (strncmp(old_suffix, ptr + len - oslen, oslen)) {
+    len_oldsx = strlen(old_suffix);
+    if (strncmp(old_suffix, ptr + len - len_oldsx, len_oldsx)) {
       /* suffix missing */
-      if (err_ok)
-        _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, code);
-      else
-        _GD_InternalError(D);
+      if (flags & GD_MC_RQ_PARTS) {
+        if (flags & GD_MC_ERROR_OK)
+          _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, code);
+        else
+          _GD_InternalError(D);
+      }
       dreturn("%p", NULL);
       return NULL;
     }
-    len -= oslen;
+    len -= len_oldsx;
+  } else
+    len_oldsx = 0;
+
+  /* In this case, we're using MungeCode to verify affixes are present, so
+   * nothing more to do, return input code */
+  if (flags & GD_MC_NO_ALLOC) {
+    dreturn("%p", code);
+    return (char*)code;
   }
 
   if (new_prefix)
-    nplen = strlen(new_prefix);
+    len_newpx = strlen(new_prefix);
+  else
+    len_newpx = 0;
 
   if (new_suffix)
-    nslen = strlen(new_suffix);
+    len_newsx = strlen(new_suffix);
+  else
+    len_newsx = 0;
 
-  if (P)
-    plen = strlen(P->field) + 1;
+  if (ns == NULL)
+    len_newns = 0;
 
-  if ((new_code = (char*)_GD_Malloc(D, plen + nplen + len + nslen + mlen + 1))
-      == NULL)
+  /* for the '.' */
+  if (len_newns)
+    len_newns++;
+
+  if ((new_code = _GD_Malloc(D, len_newns + len_oldns + len_newpx + len +
+          len_newsx + len_sub + 1)) == NULL)
   {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  if (P) {
-    strcpy(new_code, P->field);
-    new_code[plen - 1] = '/';
-    strcpy(new_code + plen, ptr);
-  } else {
-    if (nplen > 0)
-      strcpy(new_code, new_prefix);
+  /* compose the new code */
+  nptr = new_code;
+  if (len_newns > 0) {
+    strcpy(nptr, ns);
+    nptr[len_newns - 1] = '.';
+    nptr += len_newns;
+  }
 
-    strncpy(new_code + nplen, ptr, len);
+  if (len_oldns > 0) {
+    strncpy(nptr, old_ns, len_oldns);
+    nptr += len_oldns;
+  }
 
-    if (nslen > 0)
-      strcpy(new_code + nplen + len, new_suffix);
+  if (len_newpx > 0) {
+    strcpy(nptr, new_prefix);
+    nptr += len_newpx;
+  }
 
-    if (slash) {
-      new_code[nplen + len + nslen] = '/';
-      strcpy(new_code + nplen + len + nslen + 1, slash);
-    }
+  strncpy(nptr, ptr, len);
+  nptr += len;
 
-    new_code[nplen + len + nslen + mlen] = '\0';
+  if (len_newsx > 0) {
+    strcpy(nptr, new_suffix);
+    nptr += len_newsx;
   }
 
-  *offset = plen;
+  if (slash) {
+    strcpy(nptr, slash);
+    nptr += len_sub;
+  }
 
-  dreturn("\"%s\" (%i)", new_code, *offset);
-  return new_code;
-}
+  *nptr = '\0';
 
-/* Munge a field code or field name using the prefix and suffix of the given
- * fragment.  Returns a newly malloc'd munged code, or NULL on error */
-char *_GD_MungeFromFrag(DIRFILE *D, const gd_entry_t *P, int me,
-    const char *code, int *offset)
-{
-  char *new_code;
-  dtrace("%p, %p, %i, \"%s\", %p", D, P, me, code, offset);
+  /* A field called "INDEX" can never take a namespace.   We have to check this
+   * late because the field name "INDEX" could be built up via /INCLUDE affixes
+   * (as crazy as that may be) */
+  if (len_newns + len_oldns > 0 &&
+      strncmp(new_code + len_newns + len_oldns, "INDEX", 5) == 0
+      && (new_code[len_newns + len_oldns + 5] == '\0'
+        || new_code[len_newns + len_oldns + 5] == '/'))
+  {
+    char *index = _GD_Strdup(D, new_code + len_newns + len_oldns);
+    free(new_code);
+    if (index == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
 
-  new_code = _GD_MungeCode(D, P, NULL, NULL, D->fragment[me].prefix,
-      D->fragment[me].suffix, code, offset, 1);
+    new_code = index;
+  }
+
+  if (nso)
+    *nso = new_code + len_newns + len_oldns;
+  
+  if (offset)
+    *offset = len_newns + len_oldns;
 
-  dreturn("\"%s\"", new_code);
+  dreturn("\"%s\" (%i, %p)", new_code, offset ? *offset : -1,
+      nso ? *nso : NULL);
   return new_code;
 }
 
-/* Return non-zero if the a field codes doesn't contain the correct affixes. */
-int _GD_CheckCodeAffixes(DIRFILE *D, const gd_entry_t *P,
-    const char *field_code, int fragment)
+/* Return non-zero if the a field code doesn't contain the correct affixes or
+ * namespace. */
+int _GD_CheckCodeAffixes(DIRFILE *D, const char *field_code, int fragment,
+    int set_error)
 {
-  int dummy;
-
-  dtrace("%p, %p, \"%s\", %i", D, P, field_code, fragment);
+  dtrace("%p, \"%s\", %i, %i", D, field_code, fragment, set_error);
 
   if (field_code == NULL) {
     dreturn("%i", 0);
     return 0;
   }
 
-  free(_GD_MungeCode(D, P, D->fragment[fragment].prefix,
-        D->fragment[fragment].suffix, NULL, NULL, field_code, &dummy, 1));
+  if (_GD_MungeCode(D, D->fragment[fragment].ns, D->fragment[fragment].nsl,
+      D->fragment[fragment].prefix, D->fragment[fragment].suffix, NULL, NULL,
+      field_code, NULL, NULL, GD_MC_NO_ALLOC | GD_MC_CHECK_NS |
+      (set_error ? (GD_MC_RQ_PARTS | GD_MC_ERROR_OK) : 0)))
+  {
+    /* success */
+    dreturn("%i", 0);
+    return 0;
+  }
 
-  dreturn("%i", D->error);
-  return D->error;
+  dreturn("%i", 1);
+  return 1;
 }
 
-/* Check for a valid field name -- returns 1 on error */
+/* Check for a valid name -- returns 1 on error */
 int _GD_ValidateField(const char* field_code, int standards, int strict,
-    int affix, int* is_dot)
+    unsigned type, int* is_dot)
 {
   const size_t len = strlen(field_code);
-  size_t i, local_dot = 0;
+  size_t i;
+  int local_dot = 0, last_dot;
 
-  dtrace("\"%s\", %i, %i, %i, %p", field_code, standards, strict, affix,
+  dtrace("\"%s\", %i, %i, %u, %p", field_code, standards, strict, type,
       is_dot);
 
+  /* field codes may not start with a dot */
+  last_dot = (type == GD_VF_CODE && (!strict || standards >= 10)) ? 1 : 0;
+
   if (is_dot)
     *is_dot = 0;
 
-  if (!affix && (field_code[0] == '\0' || (strict &&
+  if ((type == GD_VF_NAME) && (field_code[0] == '\0' || (strict &&
           ((len > 50 && standards < 5) || (len > 16 && standards < 3)))))
   {
     dreturn("%i", 1);
@@ -192,14 +280,32 @@ int _GD_ValidateField(const char* field_code, int standards, int strict,
       dreturn("%i", 1);
       return 1;
     } else if (field_code[i] == '.') {
-      if (affix || is_dot == NULL || (standards >= 6 && strict)) {
+      if (type == GD_VF_NS ||
+          (type == GD_VF_CODE && (!strict || standards >= 10)))
+      {
+        if (last_dot) { /* multiple consecutive dots are forbidden */
+          dreturn("%i", 1);
+          return 1;
+        }
+        last_dot = 1;
+      } else if (type == GD_VF_AFFIX || is_dot == NULL ||
+          (standards >= 6 && strict))
+      {
         dreturn("%i", 1);
         return 1;
       } else
         local_dot = 1;
-    }
+    } else
+      last_dot = 0;
+
+  /* Field codes may not end in a dot */
+  if (type == GD_VF_CODE && last_dot) {
+    dreturn("%i", 1);
+    return 1;
+  }
 
-  if (!affix) {
+  /* forbidden field names */
+  if (type == GD_VF_NAME) {
     if (strict && standards < 8)
       if ((strcmp("FRAMEOFFSET", field_code) == 0 && standards >= 1)
           || (strcmp("ENCODING", field_code) == 0 && standards >= 6)
@@ -213,172 +319,322 @@ int _GD_ValidateField(const char* field_code, int standards, int strict,
         dreturn("%i", 1);
         return 1;
       }
-
-    if (is_dot)
-      *is_dot = local_dot;
   }
 
-  dreturn("%i", 0);
+  if (is_dot)
+    *is_dot = local_dot;
+
+  dreturn("%i (%i)", 0, local_dot);
   return 0;
 }
 
-#define GD_UPDI 0x1
-#define GD_UPDU 0x2
-/* pass == 0: finalise clear
- * pass == 1: initialise clear
- * pass == 2: finalise update
- * pass == 3: initialise update
+/* Compare field codes candidate and code. Returns:
+ * 0    if they're identical
+ * '.'  if they're the same code, but candidate has a representation suffix
+ * '/'  if candidate is a subfield of code
+ * -1   otherwise
  */
-static char **_GD_UpdateScalar(DIRFILE *D, gd_entry_t *T, const gd_entry_t *E,
-    const char *old_name, char **list, size_t len, int n, int pass, int *nl)
+static int _GD_MatchCode(const char *candidate, const char *code, size_t len,
+    int meta_ok)
 {
-  char **ptr;
-  size_t old_len;
+  int c;
+
+  dtrace("\"%s\", \"%s\", %" PRNsize_t ", %i", candidate, code, len,
+      meta_ok);
 
-  dtrace("%p, %p, %p, \"%s\", %p, %" PRNsize_t ", %i, %i, %i", D, T, E,
-      old_name, list, len, n, pass, *nl);
+  if (strncmp(candidate, code, len)) {
+    /* field not matched */
+    dreturn("%i (m)", -1);
+    return -1;
+  }
+
+  /* partial match only */
+  c = candidate[len];
+  if (c && c != '.' && (!meta_ok || c != '/')) {
+    dreturn("%i (p)", -1);
+    return -1;
+  }
 
-  old_len = strlen(old_name);
-  if (strncmp(T->scalar[n], old_name, old_len) ||
-      !(T->scalar[n][old_len] == 0 || T->scalar[n][old_len] == '.'))
+  dreturn("%i", c);
+  return c;
+}
+
+int _GD_MakeNewCode(DIRFILE *D, const char *old_code, int frag,
+    const gd_entry_t *E, int repr, int c, struct gd_rename_data_ *rdat)
+{
+  char **ptr, *base_code;
+  int ret = 0;
+
+  dtrace("%p, \"%s\", %i, %p, %i, %i, %p", D, old_code, frag, E, repr, c, rdat);
+
+  if ((ptr = _GD_Realloc(D, rdat->code_list, sizeof(*ptr) * (rdat->n_code + 1)))
+      == NULL)
   {
-    dreturn("%p (-)", list);
-    return list;
+    dreturn("%i", -1);
+    return -1;
   }
+  rdat->code_list = ptr;
 
-  if (pass & GD_UPDI) { /* pass 1 or 3 */
-    if ((ptr = (char**)_GD_Realloc(D, list, sizeof(char *) * (*nl + 1)))
-        == NULL)
-    {
-      *nl = -1;
-      dreturn("%p", list);
-      return list;
+  /* extract representation suffix, if necessary (if c is nil, we already
+   * know there's no representation) */
+  if (E == NULL && (c == '.' || c == '/')) {
+    repr = _GD_GetRepr(D, old_code, &base_code, 0);
+    if (D->error) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else
+    base_code = (char*)old_code;
+
+  if (c == '/') { /* a meta subfield of the field we're renaming */
+    size_t base_len = strlen(base_code);
+    rdat->code_list[rdat->n_code] = (char*)_GD_Malloc(D, base_len +
+        rdat->new_len - rdat->old_len + ((repr == GD_REPR_NONE) ? 1 : 3));
+    if (D->error) {
+      ret = -1;
+      goto DONE;
+    }
+    sprintf(rdat->code_list[rdat->n_code], "%s%s%s", rdat->new_code,
+        base_code + rdat->old_len,
+        (repr == GD_REPR_NONE) ? "" : (repr == GD_REPR_REAL) ? ".r" :
+        (repr == GD_REPR_IMAG) ? ".i" : (repr == GD_REPR_MOD) ? ".m" : ".a");
+  } else {
+    rdat->code_list[rdat->n_code] = (char*)_GD_Malloc(D, rdat->new_len +
+        ((repr == GD_REPR_NONE) ? 1 : 3));
+    if (D->error) {
+      ret = -1;
+      goto DONE;
     }
-    list = ptr;
-    list[(*nl)++] = (char*)_GD_Malloc(D, len + 3);
-  } else if (pass == 0) {
-    if (!T->e->calculated)
-      _GD_CalculateEntry(D, T, 0);
-  } else if (pass == 2) {
-    T->e->calculated = 0;
-    D->fragment[T->fragment_index].modified = 1;
-    free(T->scalar[n]);
-    T->scalar[n] = list[(*nl)++];
-
-    sprintf(T->scalar[n], "%s%s", E->field,
-        (T->e->repr[n] == GD_REPR_NONE) ? "" :
-        (T->e->repr[n] == GD_REPR_REAL) ? ".r" :
-        (T->e->repr[n] == GD_REPR_IMAG) ? ".i" :
-        (T->e->repr[n] == GD_REPR_MOD) ? ".m" : ".a");
-  }
-
-  dreturn("%p (%i)", list, *nl);
-  return list;
+    sprintf(rdat->code_list[rdat->n_code], "%s%s", rdat->new_code,
+        (repr == GD_REPR_NONE) ? "" : (repr == GD_REPR_REAL) ? ".r" :
+        (repr == GD_REPR_IMAG) ? ".i" : (repr == GD_REPR_MOD) ? ".m" : ".a");
+  }
+  /* check that we haven't made a code that's invalid in the destination
+   * fragment
+   */
+  if (_GD_CheckCodeAffixes(D, rdat->code_list[rdat->n_code], frag,
+        !(rdat->flags & GD_REN_FORCE)))
+  {
+    free(rdat->code_list[rdat->n_code]);
+    if (rdat->flags & GD_REN_FORCE) {
+      rdat->code_list[rdat->n_code] = NULL;
+      rdat->n_code++;
+    } else
+      ret = -1;
+  } else
+    rdat->n_code++;
+
+DONE:
+  /* clean up after GetRepr */
+  if (base_code != old_code)
+    free(base_code);
+
+  dreturn("%i", ret);
+  return ret;
 }
 
-/* pass == 0: clear cached derived entries
- * pass == 1: unused
- * pass == 2: finalise re-writen derivd channels
- * pass == 3: initialise re-writen derived channels
- */
-static char **_GD_UpdateInField(DIRFILE *D, gd_entry_t *T, const gd_entry_t *E,
-    const char *old_name, char **list, size_t len, int n, int pass, int *nl)
+static void _GD_SetNewCode(DIRFILE *D, char **code, int frag,
+    struct gd_rename_data_ *rdat)
 {
-  char **ptr;
-  int m = n;
-  dtrace("%p, %p, %p, \"%s\", %p, %" PRNsize_t ", %i, %i, %i", D, T, E,
-      old_name, list, len, n, pass, *nl);
-
-  if (T->field_type == GD_ALIAS_ENTRY)
-    m = 1;
-  else if (pass != 0 && T->e->entry[n] == NULL)
-    _GD_BadInput(D, T, n, 0);
-
-  if (E->field_type == GD_ALIAS_ENTRY) {
-    /* it's hard to detect the use of an alias other than by inspecting the
-     * name itself */
-    size_t len = strlen(old_name);
-    if (strncmp(T->in_fields[n], old_name, len) ||
-        !(T->in_fields[n][len] == 0 || T->in_fields[n][len] == '.'))
-    {
-        dreturn("%p (a-)", list);
-        return list;
+  dtrace("%p, %p, %i, %p", D, code, frag, rdat);
+
+  /* a NULL here is a field we couldn't update but the rename was forced via
+   * GD_REN_FORCE
+   */
+  if (rdat->code_list[rdat->n_code]) {
+    D->fragment[frag].modified = 1;
+    free(*code);
+    *code = rdat->code_list[rdat->n_code];
+  }
+  rdat->n_code++;
+
+  dreturnvoid();
+}
+
+/* internal update flags */
+#define GD_UPDI 0x1 /* initialise */
+#define GD_UPDU 0x2 /* update */
+
+#define GD_UP_DO_CL 0
+#define GD_UP_IN_CL (GD_UPDI)
+#define GD_UP_DO_UP (GD_UPDU)
+#define GD_UP_IN_UP (GD_UPDI | GD_UPDU)
+static int _GD_UpdateScalar(DIRFILE *D, gd_entry_t *T,
+    struct gd_rename_data_ *rdat, int n, int search_meta, unsigned mode)
+{
+  int c;
+
+  dtrace("%p, %p, %p, %i, %i, %u", D, T, rdat, n, search_meta, mode);
+
+  /* nothing to do */
+  if (T->scalar[n] == NULL) {
+    dreturn("%i (-)", 0);
+    return 0;
+  }
+
+  c = _GD_MatchCode(T->scalar[n], rdat->old_code, rdat->old_len, search_meta);
+  if (c < 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (!(mode & GD_UPDI)) /* clear the cache */
+    T->flags &= ~GD_EN_CALC;
+
+  if (mode == GD_UP_IN_UP) { /* create new field codes */
+    if (_GD_MakeNewCode(D, T->scalar[n], T->fragment_index, NULL, 0, c, rdat)) {
+      dreturn("%i", -1);
+      return -1;
     }
-  } else if (T->e->entry[m] != E) {
-    dreturn("%p (-)", list);
-    return list;
+  } else if (mode == GD_UP_DO_UP) /* move the new field codes into place */
+    _GD_SetNewCode(D, T->scalar + n, T->fragment_index, rdat);
+
+  dreturn("%i (%i)", 0, rdat->n_code);
+  return 0;
+}
+
+static int _GD_UpdateInField(DIRFILE *D, gd_entry_t *T,
+    struct gd_rename_data_ *rdat, int n, int search_meta, unsigned mode)
+{
+  int c;
+
+  dtrace("%p, %p, %p, %i, %i, %u", D, T, rdat, n, search_meta, mode);
+
+  c = _GD_MatchCode(T->in_fields[n], rdat->old_code, rdat->old_len,
+      search_meta);
+  if (c < 0) {
+    dreturn("%i", 0);
+    return 0;
   }
 
-  if (pass == 0)
-    T->e->entry[m] = NULL;
-  else if (pass == 3) {
-    if ((ptr = (char**)_GD_Realloc(D, list, sizeof(char *) * (*nl + 1)))
-        == NULL)
+  if (!(mode & GD_UPDI)) { /* clear the cache */
+    T->e->entry[n] = NULL;
+    if (T->field_type == GD_ALIAS_ENTRY)
+      T->e->entry[1] = NULL;
+  }
+
+  if (mode == GD_UP_IN_UP) { /* create new field codes */
+    if (_GD_MakeNewCode(D, T->in_fields[n], T->fragment_index, T->e->entry[n],
+          T->e->repr[n], c, rdat))
     {
-      *nl = -1;
-      dreturn("%p", list);
-      return list;
+      dreturn("%i", -1);
+      return -1;
     }
-    list = ptr;
-    list[(*nl)++] = (char*)_GD_Malloc(D, len + 3);
-  } else if (pass == 2) {
-    D->fragment[T->fragment_index].modified = 1;
-    free(T->in_fields[n]);
-    T->in_fields[n] = list[(*nl)++];
-
-    sprintf(T->in_fields[n], "%s%s", E->field,
-        (T->e->repr[n] == GD_REPR_NONE) ? "" :
-        (T->e->repr[n] == GD_REPR_REAL) ? ".r" :
-        (T->e->repr[n] == GD_REPR_IMAG) ? ".i" :
-        (T->e->repr[n] == GD_REPR_MOD) ? ".m" : ".a");
-  }
-
-  dreturn("%p (%i)", list, *nl);
-  return list;
+  } else if (mode == GD_UP_DO_UP) /* move the new field codes into place */
+    _GD_SetNewCode(D, T->in_fields + n, T->fragment_index, rdat);
+
+
+  dreturn("%i (%i)", 0, rdat->n_code);
+  return 0;
 }
 
-static char **_GD_InvalidateConst(DIRFILE *D, const gd_entry_t *E,
-    const char *old_name, char **list, size_t len, int pass, int *nl)
+/* search for and update field metadata to account for a renamed field -- this
+ * is a combination of the old _GD_InvalidateVect and _GD_InvalidateConst */
+static int _GD_UpdateInputs(DIRFILE *D, struct gd_rename_data_ *rdat,
+    int perform)
 {
-  int i;
   unsigned u;
+  int i;
 
-  dtrace("%p, %p, \"%s\", %p, %" PRNsize_t ", %i, %p", D, E, old_name, list,
-      len, pass, nl);
+  /* look for meta fields */
+  const int search_meta = (rdat->E->e->n_meta != -1);
 
-  /* aliases prevent us from just running over this field's client list */
-  for (u = 0; u < D->n_entries; ++u)
-    if (D->entry[u] != E) {
-      switch (D->entry[u]->field_type) {
-        case GD_LINCOM_ENTRY:
+  /* classes of things to update */
+  const int update_scalars = (search_meta ||
+      (rdat->E->field_type & GD_SCALAR_ENTRY_BIT));
+  const int update_vectors = (search_meta ||
+      !(rdat->E->field_type & GD_SCALAR_ENTRY_BIT));
+  const int update_aliases = !(rdat->flags & GD_REN_DANGLE);
+
+  /* update mode for scalars and vectors */
+  const int mode = ((rdat->flags & GD_REN_UPDB) ? GD_UPDU : 0) |
+    (perform ? 0 : GD_UPDI);
+  /* update mode for aliases */
+  const int amode = (update_aliases ? GD_UPDU : 0) |
+    (perform ? 0 : GD_UPDI);
+
+  dtrace("%p, %p, %i", D, rdat, perform);
+
+  /* reset the code count */
+  rdat->n_code = 0;
+
+  for (u = 0; u < D->n_entries; ++u) {
+    switch (D->entry[u]->field_type) {
+      case GD_LINCOM_ENTRY:
+        if (update_vectors)
           for (i = 0; i < D->entry[u]->EN(lincom,n_fields); ++i) {
-            list = _GD_UpdateScalar(D, D->entry[u], E, old_name, list, len, i,
-                pass, nl);
-            list = _GD_UpdateScalar(D, D->entry[u], E, old_name, list, len,
-                i + GD_MAX_LINCOM, pass, nl);
+            if (_GD_UpdateInField(D, D->entry[u], rdat, i, search_meta, mode)) {
+              dreturn("%i", -1);
+              return -1;
+            }
+          }
+        break;
+      case GD_MULTIPLY_ENTRY:
+      case GD_DIVIDE_ENTRY:
+      case GD_WINDOW_ENTRY:
+      case GD_MPLEX_ENTRY:
+        if (update_vectors)
+          if (_GD_UpdateInField(D, D->entry[u], rdat, 1, search_meta, mode)) {
+            dreturn("%i", -1);
+            return -1;
           }
+        /* Fallthrough */
+      case GD_LINTERP_ENTRY:
+      case GD_BIT_ENTRY:
+      case GD_PHASE_ENTRY:
+      case GD_POLYNOM_ENTRY:
+      case GD_RECIP_ENTRY:
+      case GD_SBIT_ENTRY:
+        if (update_vectors)
+          if (_GD_UpdateInField(D, D->entry[u], rdat, 0, search_meta, mode)) {
+            dreturn("%i", -1);
+            return -1;
+          }
+        break;
+      case GD_INDEX_ENTRY:
+      case GD_RAW_ENTRY:
+      case GD_NO_ENTRY:
+      case GD_CONST_ENTRY:
+      case GD_CARRAY_ENTRY:
+      case GD_STRING_ENTRY:
+      case GD_ALIAS_ENTRY:
+        break;
+    }
+    if (update_scalars)
+      switch (D->entry[u]->field_type) {
+        case GD_LINCOM_ENTRY:
+          for (i = 0; i < D->entry[u]->EN(lincom,n_fields); ++i)
+            if (_GD_UpdateScalar(D, D->entry[u], rdat, i, search_meta, mode) ||
+                _GD_UpdateScalar(D, D->entry[u], rdat, i + GD_MAX_LINCOM,
+                  search_meta, mode))
+            {
+              dreturn("%i", -1);
+              return -1;
+            }
           break;
         case GD_POLYNOM_ENTRY:
           for (i = 0; i <= D->entry[u]->EN(polynom,poly_ord); ++i)
-            list = _GD_UpdateScalar(D, D->entry[u], E, old_name, list, len, i,
-                pass, nl);
+            if (_GD_UpdateScalar(D, D->entry[u], rdat, i, search_meta, mode)) {
+              dreturn("%i", -1);
+              return -1;
+            }
           break;
         case GD_BIT_ENTRY:
         case GD_SBIT_ENTRY:
         case GD_MPLEX_ENTRY:
-          list = _GD_UpdateScalar(D, D->entry[u], E, old_name, list, len, 1,
-              pass, nl);
+          if (_GD_UpdateScalar(D,D->entry[u], rdat, 1, search_meta, mode)) {
+            dreturn("%i", -1);
+            return -1;
+          }
           /* Fallthrough */
         case GD_PHASE_ENTRY:
         case GD_RAW_ENTRY:
         case GD_RECIP_ENTRY:
         case GD_WINDOW_ENTRY:
-          list = _GD_UpdateScalar(D, D->entry[u], E, old_name, list, len, 0,
-              pass, nl);
-          break;
-        case GD_ALIAS_ENTRY:
-          list = _GD_UpdateInField(D, D->entry[u], E, old_name, list, len, 0,
-              pass, nl);
+          if (_GD_UpdateScalar(D,D->entry[u], rdat, 0, search_meta, mode)) {
+            dreturn("%i", -1);
+            return -1;
+          }
           break;
         case GD_NO_ENTRY:
         case GD_LINTERP_ENTRY:
@@ -388,59 +644,192 @@ static char **_GD_InvalidateConst(DIRFILE *D, const gd_entry_t *E,
         case GD_STRING_ENTRY:
         case GD_CONST_ENTRY:
         case GD_CARRAY_ENTRY:
+        case GD_ALIAS_ENTRY:
           break;
       }
+    if (update_aliases && D->entry[u]->field_type == GD_ALIAS_ENTRY)
+      if (_GD_UpdateInField(D, D->entry[u], rdat, 0, search_meta, amode)) {
+        dreturn("%i", -1);
+        return -1;
+      }
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* delete rename data */
+void _GD_CleanUpRename(struct gd_rename_data_ *rdat, int abort)
+{
+  int i;
+
+  dtrace("%p, %i", rdat, abort);
+
+  if (rdat) {
+    if (abort) {
+      if (rdat->meta_name)
+        for (i = 0; i < rdat->n_meta; ++i)
+          free(rdat->meta_name[i]);
+      if (rdat->code_list)
+        for (i = 0; i < rdat->n_code; ++i)
+          free(rdat->code_list[i]);
     }
+    free(rdat->code_list);
+    free(rdat->meta_name);
+    free(rdat->old_code);
+    free(rdat);
+  }
 
-  dreturn("%p", list);
-  return list;
+  dreturnvoid();
 }
 
-static char **_GD_InvalidateVect(DIRFILE *D, const gd_entry_t *E,
-    const char *old_name, char **list, size_t len, int pass, int *nl)
+/* perform a database update due to a renamed field */
+void _GD_PerformRename(DIRFILE *restrict D,
+    struct gd_rename_data_ *restrict rdat)
 {
-  unsigned u;
+  int i;
 
-  dtrace("%p, %p, %p, %" PRNsize_t ", %i, %p", D, E, list, len, pass, nl);
+  dtrace("%p, %p", D, rdat);
 
-  for (u = 0; u < D->n_entries; ++u) {
-    if (D->entry[u] != E)
-      switch (D->entry[u]->field_type) {
-        case GD_LINCOM_ENTRY:
-          list = _GD_UpdateInField(D, D->entry[u], E, old_name, list, len, 2,
-              pass, nl);
-          /* Fallthrough */
-        case GD_MULTIPLY_ENTRY:
-        case GD_DIVIDE_ENTRY:
-        case GD_WINDOW_ENTRY:
-        case GD_MPLEX_ENTRY:
-          list = _GD_UpdateInField(D, D->entry[u], E, old_name, list, len, 1,
-              pass, nl);
-          /* Fallthrough */
-        case GD_ALIAS_ENTRY:
-        case GD_LINTERP_ENTRY:
-        case GD_BIT_ENTRY:
-        case GD_PHASE_ENTRY:
-        case GD_POLYNOM_ENTRY:
-        case GD_RECIP_ENTRY:
-        case GD_SBIT_ENTRY:
-          list = _GD_UpdateInField(D, D->entry[u], E, old_name, list, len, 0,
-              pass, nl);
-          break;
-        case GD_INDEX_ENTRY:
-        case GD_RAW_ENTRY:
-        case GD_NO_ENTRY:
-        case GD_CONST_ENTRY:
-        case GD_CARRAY_ENTRY:
-        case GD_STRING_ENTRY:
-          break;
-      }
-    if (*nl == -1)
-      break;
+  if (rdat == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  /* update meta field names */
+  for (i = 0; i < rdat->n_meta; ++i) {
+    free(rdat->meta_entry[i]->field);
+    rdat->meta_entry[i]->field = rdat->meta_name[i];
+  }
+
+  /* rename the field */
+  free(rdat->E->field);
+  rdat->E->field = rdat->new_code;
+
+  /* update derived/client fields/aliases */
+  _GD_UpdateInputs(D, rdat, 1);
+
+  /* Update the dot list */
+  if (rdat->old_dot && !rdat->new_dot) {
+    memmove(D->dot_list + rdat->dot_ind, D->dot_list + rdat->dot_ind + 1,
+        sizeof(gd_entry_t*) * (--D->n_dot - rdat->dot_ind));
+    rdat->E->flags &= ~GD_EN_DOTTED;
+  } else if (rdat->new_dot && !rdat->old_dot) {
+    D->dot_list[D->n_dot++] = rdat->E;
+    rdat->E->flags |= GD_EN_DOTTED;
+  }
+
+  /* re-sort the lists */
+  qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), _GD_EntryCmp);
+  if (D->dot_list && rdat->new_dot)
+    qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
+
+  /* Invalidate the field lists */
+  if (rdat->E->e->n_meta == -1) {
+    rdat->E->e->p.parent->e->value_list_validity = 0;
+    rdat->E->e->p.parent->e->entry_list_validity = 0;
+  } else {
+    D->value_list_validity = 0;
+    D->entry_list_validity = 0;
+  }
+
+  /* rehash the aliases */
+  _GD_UpdateAliases(D, 1);
+
+  /* done */
+  _GD_CleanUpRename(rdat, 0);
+
+  dreturnvoid();
+}
+
+/* prepare for a database update due to a renamed field */
+struct gd_rename_data_ *_GD_PrepareRename(DIRFILE *restrict D,
+    char *restrict new_code, gd_entry_t *restrict E, int old_dot,
+    unsigned dot_ind, int new_dot, unsigned flags)
+{
+  int i;
+  struct gd_rename_data_ *rdat;
+
+  dtrace("%p, \"%s\", %p, %i, %u, %i, 0x%X", D, new_code, E, old_dot,
+      dot_ind, new_dot, flags);
+
+  /* Resize the dot list; this must be done early in case it fails; it's
+   * not a big deal if something else fails later: it will just be slightly too
+   * big */
+  if (new_dot && !old_dot) {
+    gd_entry_t** ptr = _GD_Realloc(D, D->dot_list, sizeof(*ptr) *
+        (D->n_dot + 1));
+
+    if (ptr == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    D->dot_list = ptr;
+  }
+
+  rdat = _GD_Malloc(D, sizeof(*rdat));
+  if (rdat == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(rdat, 0, sizeof(*rdat));
+
+  rdat->n_meta = E->e->n_meta;
+  rdat->meta_entry = E->e->p.meta_entry;
+  rdat->flags = flags;
+  rdat->E = E;
+  rdat->old_code = _GD_Strdup(D, E->field);
+  rdat->old_len = strlen(E->field);
+  rdat->new_code = new_code;
+  rdat->new_len = strlen(new_code);
+  rdat->new_dot = new_dot;
+  rdat->old_dot = old_dot;
+  rdat->dot_ind = dot_ind;
+
+  /* resolve field type */
+  if (E->field_type == GD_ALIAS_ENTRY && E->e->entry[0])
+    rdat->type = E->e->entry[0]->field_type;
+  else
+    rdat->type = E->field_type;
+
+  /* update other fields' metadata */
+  if (_GD_UpdateInputs(D, rdat, 0)) {
+    _GD_CleanUpRename(rdat, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (rdat->n_meta > 0) {
+    /* compose all the new meta field names under a top-level field.  We must do
+     * this now in a temporary location in case it fails and/or subsequent stuff
+     * fails */
+    rdat->meta_name = _GD_Malloc(D, sizeof(*rdat->meta_name) * rdat->n_meta);
+    if (!rdat->meta_name) {
+      _GD_CleanUpRename(rdat, 1);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    memset(rdat->meta_name, 0, sizeof(char *) * rdat->n_meta);
+    for (i = 0; i < rdat->n_meta; ++i) {
+      rdat->meta_name[i] = _GD_Malloc(D, strlen(rdat->meta_entry[i]->field)
+          + rdat->new_len - rdat->old_len + 1);
+      if (rdat->meta_name[i] == NULL)
+        break;
+      sprintf(rdat->meta_name[i], "%s/%s", new_code, rdat->meta_entry[i]->field
+          + rdat->old_len + 1);
+    }
+  }
+
+  if (D->error) {
+    _GD_CleanUpRename(rdat, 1);
+    dreturn("%p", NULL);
+    return NULL;
   }
 
-  dreturn("%p", list);
-  return list;
+  dreturn("%p", rdat);
+  return rdat;
 }
 
 static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
@@ -448,35 +837,20 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
 {
   gd_entry_t *Q;
   char *name;
-  int dummy, new_dot;
+  int new_dot;
+  struct gd_rename_data_ *rdat = NULL;
 
   dtrace("%p, %p, \"%s\", %i, %u, 0x%X", D, E, new_name, old_dot, dot_ind,
       flags);
 
-  /* check access mode */
-  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
-    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  /* check metadata protection */
-  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) {
-    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
-        D->fragment[E->fragment_index].cname);
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  if (_GD_ValidateField(new_name, D->standards, 1, 0, &new_dot)) {
+  if (_GD_ValidateField(new_name, D->standards, 1, GD_VF_CODE, &new_dot)) {
     _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, new_name);
     dreturn("%i", -1);
     return -1;
   }
 
   if (E->e->n_meta == -1) {
-    name = (char*)_GD_Malloc(D, strlen(E->e->p.parent->field) + strlen(new_name)
-        + 2);
+    name = _GD_Malloc(D, strlen(E->e->p.parent->field) + strlen(new_name) + 2);
     if (name == NULL) {
       dreturn("%i", -1);
       return -1;
@@ -484,20 +858,16 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
     sprintf(name, "%s/%s", E->e->p.parent->field, new_name);
   } else {
     /* Verify prefix and suffix */
-    name = _GD_MungeCode(D, NULL, D->fragment[E->fragment_index].prefix,
-        D->fragment[E->fragment_index].suffix, NULL, NULL, new_name, &dummy, 1);
-    if (name == NULL || name[0] == '\0') {
-      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, new_name);
+    if (_GD_CheckCodeAffixes(D, new_name, E->fragment_index, 1)) {
       dreturn("%i", -1);
       return -1;
     }
-    free(name);
-    name = _GD_Strdup(D, new_name);
-  }
 
-  if (D->error) {
-    dreturn("%i", -1);
-    return -1;
+    name = _GD_Strdup(D, new_name);
+    if (name == NULL) {
+      dreturn("%i", -1);
+      return -1;
+    }
   }
 
   /* Duplicate check */
@@ -516,6 +886,15 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
     return -1;
   }
 
+  /* prep for metadata update */
+  rdat = _GD_PrepareRename(D, name, E, old_dot, dot_ind, new_dot, flags);
+
+  if (rdat == NULL) {
+    free(name);
+    dreturn("%i", -1);
+    return -1;
+  }
+
   if (E->field_type == GD_RAW_ENTRY) {
     /* Compose the new filename */
     char *filebase = _GD_Strdup(D, new_name);
@@ -534,21 +913,6 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
       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 **)_GD_Realloc(D, D->dot_list,
-          sizeof(gd_entry_t*) * (D->n_dot + 1));
-
-      if (ptr == NULL) {
-        free(name);
-        free(filebase);
-        dreturn("%i", -1);
-        return -1;
-      }
-
-      D->dot_list = ptr;
-    }
-
     if (flags & GD_REN_DATA) {
       struct gd_raw_file_ temp;
 
@@ -571,7 +935,7 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
 
       memcpy(&temp, E->e->u.raw.file, sizeof(struct gd_raw_file_));
       temp.name = NULL;
-      if ((*gd_ef_[temp.subenc].name)(D,
+      if ((*_GD_ef[temp.subenc].name)(D,
             (const char*)D->fragment[E->fragment_index].enc_data, &temp,
             filebase, 0, 0))
       {
@@ -581,7 +945,7 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
         return -1;
       }
 
-      if ((*gd_ef_[temp.subenc].name)(D,
+      if ((*_GD_ef[temp.subenc].name)(D,
             (const char*)D->fragment[E->fragment_index].enc_data,
             E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
       {
@@ -591,11 +955,11 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
         return -1;
       }
 
-      if ((*gd_ef_[E->e->u.raw.file[0].subenc].move)(
+      if ((*_GD_ef[E->e->u.raw.file[0].subenc].move)(
             D->fragment[E->fragment_index].dirfd, E->e->u.raw.file,
             D->fragment[E->fragment_index].dirfd, temp.name))
       {
-        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+        _GD_SetEncIOError(D, GD_E_IO_RENAME, E->e->u.raw.file + 0);
         free(filebase);
         dreturn("%i", -1);
         return -1;
@@ -612,31 +976,12 @@ static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
     E->e->u.raw.filebase = filebase;
   }
 
-  free(E->field);
-  E->field = name;
-
   D->fragment[E->fragment_index].modified = 1;
 
-  /* 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*), _GD_EntryCmp);
-  if (new_dot)
-    qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
+  /* Update database metadata */
+  _GD_PerformRename(D, rdat);
 
-  /* Invalidate the field lists */
-  if (E->e->n_meta == -1) {
-    E->e->p.parent->e->value_list_validity = 0;
-    E->e->p.parent->e->entry_list_validity = 0;
-  } else {
-    D->value_list_validity = 0;
-    D->entry_list_validity = 0;
-  }
+  D->flags &= ~GD_HAVE_VERSION;
 
   dreturn("%i", 0);
   return 0;
@@ -646,11 +991,8 @@ int gd_rename(DIRFILE *D, const char *old_code, const char *new_name,
     unsigned flags)
 {
   gd_entry_t *E = NULL;
-  int ret, i, nl = 0, old_dot = 0;
-  size_t len;
-  gd_entype_t type;
+  int ret, old_dot = 0;
   unsigned dot_ind = 0;
-  char **code_list = NULL;
 
   dtrace("%p, \"%s\", \"%s\", 0x%X", D, old_code, new_name, flags);
 
@@ -662,7 +1004,12 @@ int gd_rename(DIRFILE *D, const char *old_code, const char *new_name,
 
   _GD_ClearError(D);
 
-  len = strlen(new_name);
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
 
   /* check for a dotted field name */
   if (D->n_dot > 0)
@@ -679,60 +1026,22 @@ int gd_rename(DIRFILE *D, const char *old_code, const char *new_name,
     return -1;
   }
 
-  type = E->field_type;
-
-  if (type == GD_INDEX_ENTRY) {
+  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;
   }
 
-  /* resolve field type */
-  if (type == GD_ALIAS_ENTRY && E->e->entry[0])
-    type = E->e->entry[0]->field_type;
-
-  /* check derived/client fields */
-  if (type == GD_CARRAY_ENTRY || type == GD_CONST_ENTRY)
-    code_list = _GD_InvalidateConst(D, E, old_code, code_list, len,
-        GD_UPDI | (flags & GD_REN_UPDB ? GD_UPDU : 0), &nl);
-  else if (type != GD_STRING_ENTRY)
-    if (flags & GD_REN_UPDB)
-      code_list = _GD_InvalidateVect(D, E, old_code, code_list, len,
-          GD_UPDI | GD_UPDU, &nl);
-
-  if (D->error) {
-    if (code_list) {
-      for (i = 0; i < nl; ++i)
-        free(code_list[i]);
-      free(code_list);
-    }
+  /* check metadata protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
     dreturn("%i", -1);
     return -1;
   }
 
   ret = _GD_Rename(D, E, new_name, old_dot, dot_ind, flags);
 
-  if (!ret) {
-    nl = 0;
-    /* update derived/client fields */
-    if (type == GD_CARRAY_ENTRY || type == GD_CONST_ENTRY)
-      _GD_InvalidateConst(D, E, old_code, code_list, 0,
-          flags & GD_REN_UPDB ? GD_UPDU : 0, &nl);
-    else if (type != GD_STRING_ENTRY)
-      _GD_InvalidateVect(D, E, old_code, code_list, 0,
-          flags & GD_REN_UPDB ? GD_UPDU : 0, &nl);
-  }
-
-  /* rehash the aliases */
-  _GD_UpdateAliases(D, 1);
-
-  if (code_list) {
-    if (D->error)
-      for (i = 0; i < nl; ++i)
-        free(code_list[i]);
-    free(code_list);
-  }
-
   dreturn("%i", ret);
   return ret;
 }
diff --git a/src/nan.h b/src/nan.h
deleted file mode 100644
index d9da387..0000000
--- a/src/nan.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2010, 2012 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#ifndef GETDATA_NAN_H
-#define GETDATA_NAN_H
-
-#include <math.h>
-
-#ifndef NAN
-# if HAVE_NAN
-#  define NAN nan("")
-# else
-#  define NAN gd_strtod("NAN", NULL)
-# endif
-#endif
-
-#endif
diff --git a/src/native.c b/src/native.c
index 5116030..11375ac 100644
--- a/src/native.c
+++ b/src/native.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2012 D. V. Wiebe
+/* Copyright (C) 2009-2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,17 +39,17 @@ gd_type_t _GD_NativeType(DIRFILE *restrict D, gd_entry_t *restrict E, int repr)
       type = E->EN(raw,data_type);
       break;
     case GD_LINCOM_ENTRY:
-      if (!E->e->calculated)
+      if (!(E->flags & GD_EN_CALC))
         _GD_CalculateEntry(D, E, 1);
 
-      if (E->comp_scal) {
+      if (E->flags & GD_EN_COMPSCAL) {
         type = GD_COMPLEX128;
         break;
       }
 
       type = GD_FLOAT64;
       for (i = 0; i < E->EN(lincom,n_fields); ++i) {
-        if (_GD_BadInput(D, E, i, 1))
+        if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1))
           break;
 
         if (_GD_NativeType(D, E->e->entry[i], E->e->repr[i]) & GD_COMPLEX) {
@@ -70,19 +70,25 @@ gd_type_t _GD_NativeType(DIRFILE *restrict D, gd_entry_t *restrict E, int repr)
       break;
     case GD_MULTIPLY_ENTRY:
     case GD_DIVIDE_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) ||
+          _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1))
+      {
         break;
+      }
 
       type = (_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX
           || _GD_NativeType(D, E->e->entry[1], E->e->repr[1]) & GD_COMPLEX)
         ? GD_COMPLEX128 : GD_FLOAT64;
       break;
     case GD_RECIP_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (!(E->flags & GD_EN_CALC))
+        _GD_CalculateEntry(D, E, 1);
+
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       type = ((_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX)
-          || E->comp_scal) ?  GD_COMPLEX128 : GD_FLOAT64;
+          || (E->flags & GD_EN_COMPSCAL)) ? GD_COMPLEX128 : GD_FLOAT64;
       break;
     case GD_BIT_ENTRY:
     case GD_INDEX_ENTRY:
@@ -91,21 +97,21 @@ gd_type_t _GD_NativeType(DIRFILE *restrict D, gd_entry_t *restrict E, int repr)
     case GD_PHASE_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       type = _GD_NativeType(D, E->e->entry[0], E->e->repr[0]);
       break;
     case GD_POLYNOM_ENTRY:
-      if (!E->e->calculated)
+      if (!(E->flags & GD_EN_CALC))
         _GD_CalculateEntry(D, E, 1);
 
-      if (E->comp_scal) {
+      if (E->flags & GD_EN_COMPSCAL) {
         type = GD_COMPLEX128;
         break;
       }
 
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       type = (_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX) ?
@@ -117,7 +123,7 @@ gd_type_t _GD_NativeType(DIRFILE *restrict D, gd_entry_t *restrict E, int repr)
       break;
     case GD_CONST_ENTRY:
     case GD_CARRAY_ENTRY:
-      type = E->EN(scalar,const_type);
+      type = _GD_ConstType(D, E->EN(scalar,const_type));
       break;
     case GD_STRING_ENTRY:
       type = GD_NULL;
diff --git a/src/nfields.c b/src/nfields.c
index 0b35eae..45cc1c9 100644
--- a/src/nfields.c
+++ b/src/nfields.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2008, 2010, 2012, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
diff --git a/src/nframes.c b/src/nframes.c
index d88d564..71c9a7b 100644
--- a/src/nframes.c
+++ b/src/nframes.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
- * Copyright (C) 2005-2011 D. V. Wiebe
+ * Copyright (C) 2005-2009, 2011-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ off64_t gd_nframes64(DIRFILE* D)
     return 0;
   }
 
-  if ((*gd_ef_[D->reference_field->e->u.raw.file[0].subenc].name)(D,
+  if ((*_GD_ef[D->reference_field->e->u.raw.file[0].subenc].name)(D,
         (const char*)D->fragment[D->reference_field->fragment_index].enc_data,
         D->reference_field->e->u.raw.file,
         D->reference_field->e->u.raw.filebase, 0, 0))
@@ -55,15 +55,25 @@ off64_t gd_nframes64(DIRFILE* D)
     return 0;
   }
 
-  nf = (*gd_ef_[D->reference_field->e->u.raw.file[0].subenc].size)(
+  /* If the reference field is open for writing, close it first to flush the
+   * data
+   */
+  if (D->reference_field->e->u.raw.file[0].mode & GD_FILE_WRITE) {
+    _GD_FiniRawIO(D, D->reference_field, D->reference_field->fragment_index,
+        GD_FINIRAW_KEEP);
+    if (D->error) {
+      dreturn("%i", 0);
+      return 0;
+    }
+  }
+
+  nf = (*_GD_ef[D->reference_field->e->u.raw.file[0].subenc].size)(
       D->fragment[D->reference_field->fragment_index].dirfd,
-      D->reference_field->e->u.raw.file,
-      D->reference_field->EN(raw,data_type), _GD_FileSwapBytes(D,
-        D->reference_field->fragment_index));
+      D->reference_field->e->u.raw.file, D->reference_field->EN(raw,data_type),
+      _GD_FileSwapBytes(D, D->reference_field));
 
   if (nf < 0) {
-    _GD_SetError(D, GD_E_RAW_IO, 0, D->reference_field->e->u.raw.file[0].name,
-        errno, NULL);
+    _GD_SetEncIOError(D, GD_E_IO_READ, D->reference_field->e->u.raw.file);
     dreturn("%lli", 0LL);
     return 0;
   }
diff --git a/src/open.c b/src/open.c
index fa03f3b..d3a5f2c 100644
--- a/src/open.c
+++ b/src/open.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
- * Copyright (C) 2005-2012, 2014 D. V. Wiebe
+ * Copyright (C) 2005-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
     /* only need to duplicate the fd of the root directory; otherwise this
      * function will close the fd */
     if (root && (fd = dup(dirfd)) == -1) {
-      _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_DIR, dirfile, errno, NULL);
+      _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, dirfile, 0, NULL);
       dreturn("%i", -1);
       return -1;
     }
@@ -66,12 +66,12 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
 #endif
 
   if (dir == NULL) {
-    _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_DIR, dirfile, errno, NULL);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, dirfile, 0, NULL);
     dreturn("%i", -1);
     return -1;
   }
 
-  if ((lamb = (struct dirent*)_GD_Malloc(D, dirent_len)) == NULL) {
+  if ((lamb = _GD_Malloc(D, dirent_len)) == NULL) {
     closedir(dir);
     dreturn("%i", -1);
     return -1;
@@ -88,7 +88,7 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
       continue; /* skip parent dir */
     }
 
-    name = (char *)_GD_Malloc(D, dirfile_len + strlen(lamb->d_name) + 2);
+    name = _GD_Malloc(D, dirfile_len + strlen(lamb->d_name) + 2);
     if (name == NULL) {
       free(lamb);
       closedir(dir);
@@ -106,7 +106,7 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
 #endif
        )
     {
-      _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_STAT, name, errno, NULL);
+      _GD_SetError(D, GD_E_IO, 0, name, 0, NULL);
       free(name);
       closedir(dir);
       dreturn("%i", -1);
@@ -139,7 +139,7 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
 #endif
             )
         {
-          _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_UNLINK, name, errno, NULL);
+          _GD_SetError(D, GD_E_IO, GD_E_IO_UNLINK, name, 0, NULL);
           free(lamb);
           free(name);
           closedir(dir);
@@ -162,7 +162,7 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
 #endif
               ) < 0)
           {
-            _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_STAT, name, errno, NULL);
+            _GD_SetError(D, GD_E_IO, 0, name, 0, NULL);
             free(lamb);
             closedir(dir);
             free(name);
@@ -181,7 +181,7 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
               rmdir(name)
 #endif
              ) {
-            _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_UNLINK, name, errno, NULL);
+            _GD_SetError(D, GD_E_IO, GD_E_IO_UNLINK, name, 0, NULL);
             free(lamb);
             free(name);
             closedir(dir);
@@ -197,7 +197,7 @@ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
   closedir(dir);
 
   if (ret) {
-    _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_DIR, dirfile, errno, NULL);
+    _GD_SetError(D, GD_E_IO, GD_E_IO_READ, dirfile, 0, NULL);
     dreturn("%i", -1);
     return -1;
   }
@@ -219,7 +219,7 @@ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
 
   /* naively try to open the format file */
   if (dirfd < 0)
-    format_error = ENOENT;
+    ; /* Directory error */
   else if ((fd = gd_OpenAt(D, dirfd, "format", O_RDONLY | O_BINARY, 0666)) < 0)
   {
     format_error = errno;
@@ -235,39 +235,32 @@ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
   } else
     dir_error = 0;
 
-  /* First, cast out our four failure modes */
+  /* First, cast out our failure modes */
 
-  /* unable to read the format file */
-  if (format_error == EACCES || dir_error == EACCES) {
-    char *format_file = (char *)malloc(strlen(dirfile) + 8);
-    sprintf(format_file, "%s%cformat", dirfile, GD_DIRSEP);
-    _GD_SetError(D, GD_E_OPEN, GD_E_OPEN_NO_ACCESS, format_file, 0, NULL);
+  /* Error reading the directory, and we weren't asked to create it */
+  if (dir_error == EACCES || (dirfd < 0 && !(D->flags & GD_CREAT))) {
+    _GD_SetError2(D, GD_E_IO, GD_E_IO_OPEN, dirfile, 0, NULL, dir_error);
     free(dirfile);
-    free(format_file);
     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, dirfile, 0, NULL);
-    free(dirfile);
-    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, dirfile, format_error,
-        NULL);
+  /* Error reading the format file, and we weren't asked to create it; do
+   * nothing else. */
+  if (format_error == EACCES || (format_error && !(D->flags & GD_CREAT))) {
+    char *format_file = (char *)malloc(strlen(dirfile) + 8);
+    sprintf(format_file, "%s%cformat", dirfile, GD_DIRSEP);
+    _GD_SetError2(D, GD_E_IO, GD_E_IO_OPEN, format_file, 0, NULL, format_error);
+    free(format_file);
     free(dirfile);
     dreturn("%p", NULL);
     return NULL;
   }
 
   /* It does exist, but we were asked to exclusively create it */
-  if (!format_error && (D->flags & GD_CREAT) && (D->flags & GD_EXCL)) {
+  if (!format_error && dirfd >= 0 && (D->flags & GD_CREAT)
+      && (D->flags & GD_EXCL))
+  {
     _GD_SetError(D, GD_E_EXISTS, 0, NULL, 0, NULL);
     free(dirfile);
     close(fd);
@@ -285,7 +278,7 @@ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
    * 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) {
+  if (D->flags & GD_TRUNC && !format_error && dirfd >= 0) {
     close(fd);
 
     /* can't truncate a read-only dirfile */
@@ -305,20 +298,17 @@ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
   }
 
   /* Create, if needed */
-  if ((D->flags & GD_CREAT && format_error) || (D->flags & GD_TRUNC))
+  if ((D->flags & GD_CREAT && (dirfd < 0 || 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);
-      free(dirfile);
-      dreturn("%p", NULL);
-      return NULL;
-    }
+    /* a newly created dirfile ignores the specified access mode */
+    if ((D->flags & GD_ACCMODE) == GD_RDONLY)
+      D->flags |= GD_RDWR;
 
     /* attempt to create the dirfile directory, if not present */
-    if (dir_error) {
+    if (dirfd < 0) {
       if (mkdir(dirfile, 0777) < 0) {
-        _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_DIR, dirfile, errno, NULL);
+        _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_DIR, dirfile, 0, NULL);
         free(dirfile);
         dreturn("%p", NULL);
         return NULL;
@@ -330,7 +320,7 @@ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
       dirfd = 0;
 #else
       if ((dirfd = open(dirfile, O_RDONLY)) < 0) {
-        _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_OPEN, dirfile, errno, NULL);
+        _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_OPEN, dirfile, 0, NULL);
         free(dirfile);
         dreturn("%p", NULL);
         return NULL;
@@ -343,8 +333,8 @@ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
             (format_trunc ? O_TRUNC : O_EXCL), 0666)) < 0)
     {
       char *format_file = (char *)malloc(strlen(dirfile) + 8);
-      strcat(strcpy(format_file, dirfile), "/format");
-      _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, errno, NULL);
+      sprintf(format_file, "%s/format", dirfile);
+      _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, 0, NULL);
       free(dirfile);
       free(format_file);
 #ifndef GD_NO_DIR_OPEN
@@ -363,14 +353,14 @@ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
   /* associate a stream with the format file */
   if ((fp = fdopen(fd, "rb")) == NULL) {
     char *format_file = (char *)malloc(strlen(dirfile) + 8);
-    strcat(strcpy(format_file, dirfile), "/format");
-    _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, errno, NULL);
+    sprintf(format_file, "%s/format", dirfile);
+    _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, 0, NULL);
     free(dirfile);
     free(format_file);
     close(fd);
 #ifndef GD_NO_DIR_OPEN
-      if (dirfd >= 0)
-        close(dirfd);
+    if (dirfd >= 0)
+      close(dirfd);
 #endif
     dreturn("%p", NULL);
     return NULL;
@@ -429,6 +419,7 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
   gd_entry_t* E;
   int dirfd_error = 0;
   time_t mtime = 0;
+  struct parser_state p;
 
 #ifdef GD_NO_DIR_OPEN
   gd_stat64_t statbuf;
@@ -442,23 +433,24 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
   /* canonicalise the path to protect us against the caller chdir'ing away */
   dirfile = _GD_CanonicalPath(NULL, filedir);
 
+  if (dirfile) {
 #ifdef GD_NO_DIR_OPEN
   /* if we can't cache directory descriptors, we just have to remember paths.
    * so stat the path to see if it exists (and is a directory) */
-  if (dirfile) {
     if (gd_stat64(dirfile, &statbuf))
       dirfd_error = errno;
     else if (!S_ISDIR(statbuf.st_mode))
       dirfd_error = ENOTDIR;
     else
       dirfd = 0;
-  }
 #else
-  /* quickly, before it goes away, grab the directory (if it exists) */
-  if (dirfd == -1)
-    dirfd = open(dirfile, O_RDONLY);
-  dirfd_error = errno;
+    /* quickly, before it goes away, grab the directory (if it exists) */
+    if (dirfd == -1)
+      dirfd = open(dirfile, O_RDONLY);
+    dirfd_error = errno;
 #endif
+  } else
+    dirfd_error = errno;
   _GD_InitialiseFramework();
 
   if (D == NULL)
@@ -488,7 +480,7 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
   D->lookback = GD_DEFAULT_LOOKBACK;
 
   if (dirfile == NULL) {
-    _GD_SetError(D, GD_E_RAW_IO, 0, filedir, errno, NULL);
+    _GD_SetError2(D, GD_E_IO, 0, filedir, 0, NULL, dirfd_error);
 #ifndef GD_NO_DIR_OPEN
     if (dirfd >= 0)
       close(dirfd);
@@ -500,15 +492,14 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
   /* Add the INDEX entry */
   D->n_entries = 1;
 
-  D->entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*));
+  D->entry = _GD_Malloc(D, sizeof(*D->entry));
   if (D->entry)
-    D->entry[0] = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+    D->entry[0] = _GD_Malloc(D, sizeof(**D->entry));
 
   if (D->error) {
     free(dirfile);
 #ifndef GD_NO_DIR_OPEN
-    if (dirfd >= 0)
-      close(dirfd);
+    close(dirfd);
 #endif
     dreturn("%p", D);
     return D;
@@ -516,8 +507,7 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
 
   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_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_));
+  D->entry[0]->e = _GD_Malloc(D, sizeof(*D->entry[0]->e));
   D->entry[0]->field = _GD_Strdup(D, "INDEX");
   if (D->error) {
     free(dirfile);
@@ -528,13 +518,14 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
     return D;
   }
   memset(D->entry[0]->e, 0, sizeof(struct gd_private_entry_));
-  D->entry[0]->e->calculated = 1;
+  D->entry[0]->flags = GD_EN_CALC;
 
   /* open the format file (or create it) */
   if ((fp = _GD_CreateDirfile(D, dirfd, dirfd_error, dirfile, &mtime)) == NULL)
   {
 #ifndef GD_NO_DIR_OPEN
-    close(dirfd);
+    if (dirfd >= 0)
+      close(dirfd);
 #endif
     D->name = NULL; /* so a subsequent gd_discard() doesn't go awry. */
     dreturn("%p", D);
@@ -555,8 +546,7 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
   /* Parse the file.  This will take care of any necessary inclusions */
   D->n_fragment = 1;
 
-  D->fragment = (struct gd_fragment_t *)_GD_Malloc(D,
-      sizeof(struct gd_fragment_t));
+  D->fragment = _GD_Malloc(D, sizeof(*D->fragment));
   if (D->error) {
     dreturn("%p", D);
     return D;
@@ -567,7 +557,7 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
     if (errno == ENOMEM)
       _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
     else
-      _GD_SetError(D, GD_E_OPEN, GD_E_OPEN_PATH, dirfile, 0, NULL);
+      _GD_SetError(D, GD_E_IO, 0, dirfile, 0, NULL);
   }
 
   D->fragment[0].bname = _GD_Strdup(D, "format");
@@ -598,8 +588,17 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
   D->fragment[0].vers = (flags & GD_PEDANTIC) ? GD_DIRFILE_STANDARDS_VERSION :
     0;
   D->fragment[0].suffix = D->fragment[0].prefix = NULL;
-
-  ref_name = _GD_ParseFragment(fp, D, 0, &D->standards, &D->flags, 1);
+  D->fragment[0].ns = NULL;
+
+  /* parser proto-state */
+  p.line = 0;
+  p.file = NULL;
+  p.standards = GD_DIRFILE_STANDARDS_VERSION;
+  p.pedantic = flags & GD_PEDANTIC;
+  p.flags = D->flags;
+  p.ns = NULL;
+  p.nsl = 0;
+  ref_name = _GD_ParseFragment(fp, D, &p, 0, 1);
   fclose(fp);
 
   if (D->error != GD_E_OK) {
@@ -607,6 +606,13 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
     return D;
   }
 
+  /* export the parser data */
+  D->standards = p.standards;
+  if (p.pedantic)
+    D->flags |= GD_PEDANTIC;
+  else
+    D->flags &= ~GD_PEDANTIC;
+
   /* Find the reference field */
   if (ref_name != NULL) {
     E = _GD_FindField(D, ref_name, D->entry, D->n_entries, 1, NULL);
@@ -631,12 +637,12 @@ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
     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;
+      D->flags &= ~GD_NOSTANDARD;
     } else
       /* non-conformant dirfile, flag it */
-      D->flags |= GD_PERMISSIVE;
+      D->flags |= GD_NOSTANDARD;
   } else
-    D->flags &= ~GD_PERMISSIVE;
+    D->flags &= ~GD_NOSTANDARD;
 
   dreturn("%p", D);
   return D;
diff --git a/src/parse.c b/src/parse.c
index 92fa322..81d598a 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -26,8 +26,7 @@ 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))
+  if (type[0] != '\0' && type[1] == '\0' && (!pedantic || standards < 8))
     t = _GD_LegacyType(type[0]);
   else if (pedantic && standards < 5)
     t = GD_UNKNOWN;
@@ -110,85 +109,365 @@ static gd_windop_t _GD_WindOp(const char *op)
   return o;
 }
 
+/* Convert a string to a number.  The non-NULL pointers provided dictate the
+ * returned type.  Returns -1 if it wasn't a number or -2 if it was but was
+ * out of range */
+int _GD_TokToNum(const char *restrict token, int standards, int pedantic,
+    double *re, double *im, uint64_t *u, int64_t *i)
+{
+  int64_t ir = 0, ii = 0;
+  uint64_t ur = 0, ui = 0;
+  double dr = 0, di = 0;
+  char *endptr = NULL;
+  gd_type_t rt = GD_UNKNOWN, it = GD_UNKNOWN;
+  const int base = (!pedantic || standards >= 9) ? 0 : 10;
+
+  dtrace("\"%s\", %i, %i, %p, %p, %p, %p", token, standards, pedantic, re, im,
+      u, i);
+
+  /* we have to run the token through both strtod and strtol because neither of
+   * these handles all the allowed syntax */
+
+  /* the real part */
+  errno = 0;
+  ir = gd_strtoll(token, &endptr, base);
+  if (!errno && (*endptr == '\0' || *endptr == ';'))
+    rt = GD_INT64;
+
+  if (rt == GD_UNKNOWN && errno == ERANGE) {
+    /* could be a uint64 > 2**63 */
+    errno = 0;
+    ur = gd_strtoull(token, &endptr, base);
+    if (!errno && (*endptr == '\0' || *endptr == ';'))
+      rt = GD_UINT64;
+  }
+
+  if (rt == GD_UNKNOWN) { /* all that's left to try */
+    errno = 0;
+    dr = gd_strtod(token, &endptr);
+
+    if (!errno && (*endptr == '\0' || *endptr == ';'))
+      rt = GD_FLOAT64;
+  }
+
+  /* check for real-part success */
+  if (rt == GD_UNKNOWN) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* if there's no semicolon, set the imaginary part to zero */
+  if (*endptr == '\0') {
+    it = GD_NULL;
+  } else {
+    /* convert imaginary part the same way */
+    token = endptr + 1;
+    errno = 0;
+    ii = gd_strtoll(token, &endptr, base);
+    if (!errno && *endptr == '\0')
+      it = (ii == 0) ? GD_NULL : GD_INT64;
+
+    if (it == GD_UNKNOWN && errno == ERANGE) {
+      /* could be a uint64 > 2**63 */
+      errno = 0;
+      ui = gd_strtoull(token, &endptr, base);
+      if (!errno && *endptr == '\0')
+        it = (ui == 0) ? GD_NULL : GD_UINT64;
+    }
+
+    if (it == GD_UNKNOWN) { /* all that's left to try */
+      errno = 0;
+      di = gd_strtod(token, &endptr);
+
+      if (!errno && *endptr == '\0')
+        it = (di == 0) ? GD_NULL : GD_FLOAT64;
+    }
+
+    /* check for imaginary-part success */
+    if (it == GD_UNKNOWN) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    if (!im && it != GD_NULL) { /* reject unwanted complex value */
+      dreturn("%i", -2);
+      return -2;
+    }
+  }
+
+  /* return the desired value, if possible */
+  if (re) { /* float or complex */
+    if (rt == GD_FLOAT64)
+      *re = dr;
+    else if (rt == GD_INT64)
+      *re = ir;
+    else
+      *re = ur;
+
+    if (im) { /* complex */
+      if (it == GD_NULL)
+        *im = 0;
+      else if (it == GD_FLOAT64)
+        *im = di;
+      else if (it == GD_INT64)
+        *im = ii;
+      else if (it == GD_UINT64)
+        *im = ui;
+    }
+  } else if (u) { /* unsigned int -- reject negative values */
+    if (rt == GD_UINT64) 
+      *u = ur;
+    else if (rt == GD_INT64) {
+      if (ir < 0) {
+        dreturn("%i", -2);
+        return -2;
+      }
+      *u = ir;
+    } else {
+      if (dr < 0) {
+        dreturn("%i", -2);
+        return -2;
+      }
+      *u = dr;
+    }
+  } else if (i) { /* int */
+    if (rt == GD_INT64)
+      *i = ir;
+    else if (rt == GD_FLOAT64)
+      *i = dr;
+    else { /* this must be an overflow */
+      dreturn("%i", -2);
+      return -2;
+    }
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* Compose a subfield code from a parent code and a subfield name -- this
+ * used to be done in _GD_MungeCode */
+static char *_GD_SubfieldCode(DIRFILE *D, const gd_entry_t *P, const char *code,
+    char **nso, int *offset)
+{
+  size_t len, len_par;
+  char *new_code;
+
+  dtrace("%p, %p, \"%s\", %p, %p", D, P, code, nso, offset);
+
+  if (code == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  len = strlen(code);
+  len_par = strlen(P->field) + 1;
+
+  if ((new_code = _GD_Malloc(D, len_par + len + 1)) == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  strcpy(new_code, P->field);
+  new_code[len_par - 1] = '/';
+  strcpy(new_code + len_par, code);
+
+  if (offset)
+    *offset = len_par;
+
+  /* find the namespace, if necessary */
+  if (nso) {
+    size_t i;
+    for (i = strlen(new_code); i > 0; --i)
+      if (new_code[i - 1] == ',')
+        break;
+
+    *nso = new_code + i;
+  }
+
+  dreturn("\"%s\" (%i, %p)", new_code, offset ? *offset : -1,
+      nso ? *nso : NULL);
+  return new_code;
+}
+
+/* Create a field code using the prefix and suffix of the given fragment and the
+ * current namespace.
+ *
+ * Returns a newly malloc'd code, or NULL on error.  nso points to the portion
+ * of the code immediately after the namespace prefix.  Offset is the offset
+ * from the start of the code to the field name (ie. the character following
+ * / for a metafield. */
+static char *_GD_CodeFromFrag(DIRFILE *restrict D,
+    const struct parser_state *restrict p, const gd_entry_t *restrict P, int me,
+    const char *code, char **nso, int *offset)
+{
+  char *new_code;
+
+  dtrace("%p, %p, %p, %i, \"%s\", %p", D, p, P, me, code, offset);
+
+  if (P)
+    new_code = _GD_SubfieldCode(D, P, code, nso, offset);
+  else {
+    const char *ns = p->ns;
+    size_t nsl = p->nsl;
+
+    /* set fragment root space, if necessary */
+    if (!ns) {
+      ns = D->fragment[me].ns;
+      nsl = D->fragment[me].nsl;
+    }
+
+    new_code = _GD_MungeCode(D, ns, nsl, NULL, NULL, D->fragment[me].prefix,
+        D->fragment[me].suffix, code, nso, offset,
+        GD_MC_RQ_PARTS | GD_MC_ERROR_OK | GD_MC_NO_NS);
+  }
+
+  dreturn("\"%s\"", new_code);
+  return new_code;
+}
+
+/* Canonicalise a field code used to specify an input field (scalar or vector)
+ */
+static char *_GD_InputCode(DIRFILE *D, const struct parser_state *restrict p,
+    int me, const char *token)
+{
+  char *code;
+  const char *ns = p->ns;
+  size_t nsl = p->nsl;
+  unsigned flags = GD_MC_RQ_PARTS | GD_MC_ERROR_OK;
+
+  dtrace("%p, %p, %i, \"%s\"", D, p, me, token);
+
+  if (token[0] == '.') { /* absolute name */
+    token++;
+    ns = D->fragment[me].ns;
+    nsl = D->fragment[me].nsl;
+  } else if (ns == NULL) {
+    ns = D->fragment[me].ns;
+    nsl = D->fragment[me].nsl;
+  }
+
+  code = _GD_MungeCode(D, ns, nsl, NULL, NULL, D->fragment[me].prefix,
+      D->fragment[me].suffix, token, NULL, NULL, flags);
+
+  dreturn("\"%s\"", code);
+  return code;
+}
+  
+/* Create E->field; frees the entry and returns non-zero on error. */
+static int _GD_SetField(DIRFILE *restrict D,
+    const struct parser_state *restrict p, gd_entry_t *restrict E,
+    const gd_entry_t *restrict P, int me, const char *restrict name, int no_dot)
+{
+  int offset;
+  int is_dot = 0;
+
+  dtrace("%p, %p, %p, %p, %i, \"%s\", %i", D, p, E, P, me, name, no_dot);
+
+  E->field = _GD_CodeFromFrag(D, p, P, me, name, NULL, &offset);
+  if (E->field && _GD_ValidateField(E->field + offset, p->standards,
+        p->pedantic, GD_VF_NAME, (p->ns || no_dot) ? NULL : &is_dot))
+  {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, p->file, p->line, name);
+  }
+
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    dreturn("%i", 1);
+    return 1;
+  }
+ 
+  if (is_dot)
+    E->flags |= GD_EN_DOTTED;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
 /* Returns a newly malloc'd string containing the scalar field name, or NULL on
  * numeric literal or error */
-static char *_GD_SetScalar(DIRFILE *restrict D, const char *restrict token,
-    void *restrict data, int type, int me, const char *restrict format_file,
-    int line, int *restrict index, int *restrict comp_scal, int standards,
-    int pedantic)
+static char *_GD_SetScalar(DIRFILE *restrict D,
+    const struct parser_state *restrict p, const char *restrict token,
+    void *restrict data, gd_type_t type, int me, int *restrict index,
+    unsigned *restrict flags)
 {
-  char *ptr = NULL;
-  char *lt;
-  int dummy;
-
-  dtrace("%p, \"%s\", %p, 0x%X, \"%s\", %i, %p, %p, %i, %i", D, token, data,
-      type, format_file, line, index, comp_scal, standards, pedantic);
-
-  if (type & (GD_COMPLEX | GD_IEEE754)) {
-    /* try to convert to double */
-    const char *semicolon;
-    double i = 0;
-    double d = gd_strtod(token, &ptr);
-
-    /* check for a complex value -- look for the semicolon */
-    for (semicolon = token; *semicolon; ++semicolon)
-      if (*semicolon == ';')
-        break;
+  char *lt, *ptr;
+  int i;
 
-    /* there were trailing characters in the double or real part of complex */
-    if (ptr != semicolon) {
-      ptr = _GD_Strdup(D, token);
-      if (ptr == NULL) {
+  dtrace("%p, %p, \"%s\", %p, 0x%X, %p, %p", D, p, token, data, type, index,
+      flags);
+
+  /* try a numerical conversion */
+  if (type & GD_COMPLEX) {
+    double re, im;
+
+    i = _GD_TokToNum(token, p->standards, p->pedantic, &re, &im, NULL, NULL);
+
+    if (i == -2) { /* malformed number */
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line,
+          token);
+      dreturn("%p", NULL);
+      return NULL;
+    } else if (i == -1) { /* assume it's a field name */
+      ptr = _GD_InputCode(D, p, me, token);
+      if (D->error) {
         dreturn("%p", NULL);
         return NULL;
       }
       goto carray_check;
     }
 
-    /* If there was a semicolon, try to extract the imaginary part */
-    if (*semicolon == ';') {
-      /* 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;
-      }
+    /* flag */
+    if (im && flags)
+      *flags |= GD_EN_COMPSCAL;
 
-      i = gd_strtod(semicolon + 1, &ptr);
+    /* store the number */
+    if (type == GD_COMPLEX128) {
+      *(double *)data = re;
+      *((double *)data + 1) = im;
+    } else if (type == GD_COMPLEX64) {
+      *(float *)data = (float)re;
+      *((float *)data + 1) = (float)im;
+    } else
+      _GD_InternalError(D);
+  } else if (type & GD_IEEE754) {
+    double d;
 
-      /* 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);
+    i = _GD_TokToNum(token, p->standards, p->pedantic, &d, NULL, NULL, NULL);
+
+    if (i == -2) { /* malformed number */
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line,
+          token);
+      dreturn("%p", NULL);
+      return NULL;
+    } else if (i == -1) { /* assume it's a field name */
+      ptr = _GD_InputCode(D, p, me, token);
+      if (D->error) {
         dreturn("%p", NULL);
         return NULL;
       }
-
-      *comp_scal = 1;
+      goto carray_check;
     }
 
-    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)
+    /* store the number */
+    if (type == GD_FLOAT64)
       *(double *)data = d;
     else if (type == GD_FLOAT32)
       *(float *)data = (float)d;
     else
       _GD_InternalError(D);
   } else if (type & GD_SIGNED) {
-    /* try to convert to long long int */
-    long long int lli = gd_strtoll(token, &ptr,
-        (!pedantic || standards >= 9) ? 0 : 10);
+    int64_t lli;
+
+    i = _GD_TokToNum(token, p->standards, p->pedantic, NULL, NULL, NULL, &lli);
 
-    /* there were trailing characters in the long long int */
-    if (*ptr != '\0') {
-      ptr = _GD_MungeFromFrag(D, NULL, me, token, &dummy);
+    if (i == -2) { /* malformed number */
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line,
+          token);
+      dreturn("%p", NULL);
+      return NULL;
+    } else if (i == -1) { /* assume it's a field name */
+      ptr = _GD_InputCode(D, p, me, token);
       if (D->error) {
         dreturn("%p", NULL);
         return NULL;
@@ -207,13 +486,17 @@ static char *_GD_SetScalar(DIRFILE *restrict D, const char *restrict token,
     else
       _GD_InternalError(D);
   } else {
-    /* try to convert to unsigned long long int */
-    unsigned long long int ulli = gd_strtoull(token, &ptr,
-        (!pedantic || standards >= 9) ? 0 : 10);
+    uint64_t ulli;
+
+    i = _GD_TokToNum(token, p->standards, p->pedantic, NULL, NULL, &ulli, NULL);
 
-    /* there were trailing characters in the unsigned long long int */
-    if (*ptr != '\0') {
-      ptr = _GD_MungeFromFrag(D, NULL, me, token, &dummy);
+    if (i == -2) { /* malformed number */
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line,
+          token);
+      dreturn("%p", NULL);
+      return NULL;
+    } else if (i == -1) { /* assume it's a field name */
+      ptr = _GD_InputCode(D, p, me, token);
       if (D->error) {
         dreturn("%p", NULL);
         return NULL;
@@ -237,15 +520,24 @@ static char *_GD_SetScalar(DIRFILE *restrict D, const char *restrict token,
   return NULL;
 
 carray_check:
-  /* look for a < delimeter */
+  /* look a < > delimeters */
   *index = -1;
-  for (lt = ptr; *lt; ++lt)
+  for (lt = ptr; *lt; ++lt) {
     if (*lt == '<') {
+      char *endptr = NULL;
+
       *lt = '\0';
-      *index = atoi(lt + 1);
-      break;
-    }
+      *index = (int)strtol(lt + 1, &endptr, 0);
 
+      if (*endptr != '>') {
+        /* invalid CARRAY index, undo the elision */
+        *lt = '<';
+        *index = -1;
+      } else
+        break;
+    }
+  }
+  
   dreturn("\"%s\" (%i)", ptr, *index);
   return ptr;
 }
@@ -253,25 +545,23 @@ carray_check:
 /* _GD_ParseRaw: parse a RAW entry in the format file
 */
 static gd_entry_t *_GD_ParseRaw(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
 
   /* META RAW fields are prohibited */
   if (parent != NULL) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_METARAW, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_METARAW, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -297,31 +587,24 @@ static gd_entry_t *_GD_ParseRaw(DIRFILE *restrict D,
   E->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN; /* don't know the encoding
                                                     subscheme yet */
 
-  E->field = _GD_MungeFromFrag(D, NULL, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, NULL, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
   E->e->u.raw.filebase = _GD_Strdup(D, in_cols[0]);
-  E->EN(raw,data_type) = _GD_RawType(in_cols[2], standards, pedantic);
+  E->EN(raw,data_type) = _GD_RawType(in_cols[2], p->standards, p->pedantic);
   E->e->u.raw.size = GD_SIZE(E->EN(raw,data_type));
 
   if (E->e->u.raw.size == 0 || E->EN(raw,data_type) & 0x40)
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, format_file, line,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, p->file, p->line,
         in_cols[2]);
-  else if ((E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(raw,spf),
-          GD_UINT_TYPE, me, format_file, line, E->scalar_ind, NULL, standards,
-          pedantic)) == NULL)
+  else if ((E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(raw,spf),
+          GD_UINT_TYPE, me, E->scalar_ind, NULL)) == NULL)
   {
-    E->e->calculated = 1;
-    if (E->EN(raw,spf) <= 0)
-      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_SPF, format_file, line,
+    E->flags |= GD_EN_CALC;
+    if (!D->error && E->EN(raw,spf) <= 0)
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_SPF, p->file, p->line,
           in_cols[3]);
   }
 
@@ -337,19 +620,18 @@ static gd_entry_t *_GD_ParseRaw(DIRFILE *restrict D,
 /* _GD_ParseLincom: parse a LINCOM entry in the format file.
 */
 static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
-  int i, offset;
+  int i;
   char* ptr = NULL;
   gd_entry_t *E;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 3) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -372,18 +654,12 @@ static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D,
 
   E->field_type = GD_LINCOM_ENTRY;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->e->calculated = 1;
+  E->flags |= GD_EN_CALC;
   E->EN(lincom,n_fields) = (int)(strtol(in_cols[2], &ptr, 10));
   if (*ptr != '\0') {
     E->EN(lincom,n_fields) = (n_cols - 2) / 3;
@@ -391,7 +667,7 @@ static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D,
     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_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
       _GD_FreeE(D, E, 1);
       dreturn("%p", NULL);
       return NULL;
@@ -403,26 +679,24 @@ static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D,
 
   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,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_FIELDS, p->file, p->line,
         in_cols[2]);
   else if (n_cols < E->EN(lincom,n_fields) * 3 + 3)
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
   else
     for (i = 0; i < E->EN(lincom,n_fields); i++) {
-      E->in_fields[i] = _GD_MungeFromFrag(D, NULL, me, in_cols[i * 3 + 3],
-          &offset);
-      E->scalar[i] = _GD_SetScalar(D, in_cols[i * 3 + 4], &E->EN(lincom,cm)[i],
-          GD_COMPLEX128, me, format_file, line, E->scalar_ind + i,
-          &E->comp_scal, standards, pedantic);
+      E->in_fields[i] = _GD_InputCode(D, p, me, in_cols[i * 3 + 3]);
+      E->scalar[i] = _GD_SetScalar(D, p, in_cols[i * 3 + 4],
+          &E->EN(lincom,cm)[i], GD_COMPLEX128, me, E->scalar_ind + i,
+          &E->flags);
       E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]);
-      E->scalar[i + GD_MAX_LINCOM] = _GD_SetScalar(D, in_cols[i * 3 + 5],
-          &E->EN(lincom,cb)[i], GD_COMPLEX128, me, format_file, line,
-          E->scalar_ind + i + GD_MAX_LINCOM, &E->comp_scal, standards,
-          pedantic);
+      E->scalar[i + GD_MAX_LINCOM] = _GD_SetScalar(D, p, in_cols[i * 3 + 5],
+          &E->EN(lincom,cb)[i], GD_COMPLEX128, me,
+          E->scalar_ind + i + GD_MAX_LINCOM, &E->flags);
       E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
 
       if (E->scalar[i] != NULL || E->scalar[i + GD_MAX_LINCOM] != NULL)
-        E->e->calculated = 0;
+        E->flags &= ~GD_EN_CALC;
     }
 
   if (D->error != GD_E_OK) {
@@ -437,18 +711,16 @@ static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D,
 /* _GD_ParseLinterp: parse a LINTERP entry in the format file.
 */
 static gd_entry_t *_GD_ParseLinterp(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -472,21 +744,15 @@ static gd_entry_t *_GD_ParseLinterp(DIRFILE *restrict D,
   E->field_type = GD_LINTERP_ENTRY;
   E->in_fields[0] = NULL;
   E->e->entry[0] = NULL;
-  E->e->calculated = 1;
+  E->flags |= GD_EN_CALC;
   E->EN(linterp,table) = NULL;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
   E->e->u.linterp.table_len = -1; /* linterp file not read yet */
 
   E->EN(linterp,table) = _GD_Strdup(D, in_cols[3]);
@@ -500,21 +766,21 @@ static gd_entry_t *_GD_ParseLinterp(DIRFILE *restrict D,
   return E;
 }
 
-/* _GD_ParseMultiply: parse MULTIPLY entry in format file.
+/* _GD_ParseYoke: parse a field specified by two input fields only (MULTIPLY,
+ * DIVIDE)
 */
-static gd_entry_t *_GD_ParseMultiply(DIRFILE *restrict D,
+static gd_entry_t *_GD_ParseYoke(DIRFILE *restrict D, gd_entype_t type,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, 0x%X, %p, %p, %i, %p, %i", D, type, p, in_cols, n_cols, parent,
+      me);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -535,24 +801,18 @@ static gd_entry_t *_GD_ParseMultiply(DIRFILE *restrict D,
   }
   memset(E->e, 0, sizeof(struct gd_private_entry_));
 
-  E->field_type = GD_MULTIPLY_ENTRY;
+  E->field_type = type;
   E->in_fields[0] = E->in_fields[1] = NULL;
   E->e->entry[0] = E->e->entry[1] = NULL;
-  E->e->calculated = 1;
+  E->flags |= GD_EN_CALC;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
-  E->in_fields[1] = _GD_MungeFromFrag(D, NULL, me, in_cols[3], &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
+  E->in_fields[1] = _GD_InputCode(D, p, me, in_cols[3]);
 
   if (D->error) {
     _GD_FreeE(D, E, 1);
@@ -566,18 +826,16 @@ static gd_entry_t *_GD_ParseMultiply(DIRFILE *restrict D,
 /* _GD_ParseRecip: parse RECIP entry in format file.
 */
 static gd_entry_t *_GD_ParseRecip(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -601,26 +859,17 @@ static gd_entry_t *_GD_ParseRecip(DIRFILE *restrict D,
   E->field_type = GD_RECIP_ENTRY;
   E->in_fields[0] = NULL;
   E->e->entry[0] = NULL;
-  E->e->calculated = 0;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
 
-  E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(recip,cdividend),
-      GD_COMPLEX128, me, format_file, line, E->scalar_ind, &E->comp_scal,
-      standards, pedantic);
+  E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(recip,cdividend),
+      GD_COMPLEX128, me, E->scalar_ind, &E->flags);
   E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
-  E->comp_scal = (cimag(E->EN(recip,cdividend)) == 0) ? 0 : 1;
 
   if (D->error != GD_E_OK) {
     _GD_FreeE(D, E, 1);
@@ -634,18 +883,16 @@ static gd_entry_t *_GD_ParseRecip(DIRFILE *restrict D,
 /* _GD_ParseWindow: parse WINDOW entry in format file.
 */
 static gd_entry_t *_GD_ParseWindow(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 6) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -668,23 +915,17 @@ static gd_entry_t *_GD_ParseWindow(DIRFILE *restrict D,
 
   E->field_type = GD_WINDOW_ENTRY;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
-  E->in_fields[1] = _GD_MungeFromFrag(D, NULL, me, in_cols[3], &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
+  E->in_fields[1] = _GD_InputCode(D, p, me, in_cols[3]);
 
   E->EN(window,windop) = _GD_WindOp(in_cols[4]);
   if (E->EN(window,windop) == GD_WINDOP_UNK) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_WINDOP, format_file, line,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_WINDOP, p->file, p->line,
         in_cols[4]);
     _GD_FreeE(D, E, 1);
     dreturn("%p", NULL);
@@ -694,20 +935,17 @@ static gd_entry_t *_GD_ParseWindow(DIRFILE *restrict D,
   switch (E->EN(window,windop)) {
     case GD_WINDOP_EQ:
     case GD_WINDOP_NE:
-      E->scalar[0] = _GD_SetScalar(D, in_cols[5], &E->EN(window,threshold.i),
-          GD_INT64, me, format_file, line, E->scalar_ind, NULL, standards,
-          pedantic);
+      E->scalar[0] = _GD_SetScalar(D, p, in_cols[5], &E->EN(window,threshold.i),
+          GD_INT64, me, E->scalar_ind, NULL);
       break;
     case GD_WINDOP_SET:
     case GD_WINDOP_CLR:
-      E->scalar[0] = _GD_SetScalar(D, in_cols[5], &E->EN(window,threshold.u),
-          GD_UINT64, me, format_file, line, E->scalar_ind, NULL, standards,
-          pedantic);
+      E->scalar[0] = _GD_SetScalar(D, p, in_cols[5], &E->EN(window,threshold.u),
+          GD_UINT64, me, E->scalar_ind, NULL);
       break;
     default:
-      E->scalar[0] = _GD_SetScalar(D, in_cols[5], &E->EN(window,threshold.r),
-          GD_FLOAT64, me, format_file, line, E->scalar_ind, NULL, standards,
-          pedantic);
+      E->scalar[0] = _GD_SetScalar(D, p, in_cols[5], &E->EN(window,threshold.r),
+          GD_FLOAT64, me, E->scalar_ind, NULL);
       break;
   }
 
@@ -723,18 +961,16 @@ static gd_entry_t *_GD_ParseWindow(DIRFILE *restrict D,
 /* _GD_ParseMplex: parse MPLEX entry in format file.
 */
 static gd_entry_t *_GD_ParseMplex(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 5) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -757,31 +993,23 @@ static gd_entry_t *_GD_ParseMplex(DIRFILE *restrict D,
 
   E->field_type = GD_MPLEX_ENTRY;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
-  E->in_fields[1] = _GD_MungeFromFrag(D, NULL, me, in_cols[3], &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
+  E->in_fields[1] = _GD_InputCode(D, p, me, in_cols[3]);
 
-  E->scalar[0] = _GD_SetScalar(D, in_cols[4], &E->EN(mplex,count_val),
-      GD_INT_TYPE, me, format_file, line, E->scalar_ind, NULL, standards,
-      pedantic);
+  E->scalar[0] = _GD_SetScalar(D, p, in_cols[4], &E->EN(mplex,count_val),
+      GD_INT_TYPE, me, E->scalar_ind, NULL);
 
-  /* the count max, if present */
+  /* the period, if present */
   if (n_cols > 5) {
-    E->scalar[1] = _GD_SetScalar(D, in_cols[5], &E->EN(mplex,period),
-        GD_INT_TYPE, me, format_file, line, E->scalar_ind + 1, NULL, standards,
-        pedantic);
+    E->scalar[1] = _GD_SetScalar(D, p, in_cols[5], &E->EN(mplex,period),
+        GD_INT_TYPE, me, E->scalar_ind + 1, NULL);
     if (E->scalar[1] == NULL && E->EN(mplex,period) < 0)
-      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_MPLEXVAL, format_file, line,
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_MPLEXVAL, p->file, p->line,
         in_cols[5]);
   }
 
@@ -794,86 +1022,20 @@ static gd_entry_t *_GD_ParseMplex(DIRFILE *restrict D,
   return E;
 }
 
-/* _GD_ParseDivide: parse DIVIDE entry in format file.
-*/
-static gd_entry_t *_GD_ParseDivide(DIRFILE *restrict D,
-    char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
-{
-  gd_entry_t *E;
-  int offset;
-
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, 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 *)_GD_Malloc(D, sizeof(gd_entry_t));
-  if (E == NULL) {
-    dreturn("%p", NULL);
-    return NULL;
-  }
-  memset(E, 0, sizeof(gd_entry_t));
-
-  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
-      sizeof(struct gd_private_entry_));
-  if (E->e == NULL) {
-    free(E);
-    dreturn("%p", NULL);
-    return NULL;
-  }
-  memset(E->e, 0, sizeof(struct gd_private_entry_));
-
-  E->field_type = GD_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_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
-    dreturn("%p", NULL);
-    return NULL;
-  }
-
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
-  E->in_fields[1] = _GD_MungeFromFrag(D, NULL, me, in_cols[3], &offset);
-
-  if (D->error) {
-    _GD_FreeE(D, 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 *restrict D, int is_signed,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %i, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, is_signed,
-      in_cols, n_cols, parent, format_file, line, me, standards, pedantic,
-      is_dot);
+  dtrace("%p, %i, %p, %p, %i, %p, %i", D, is_signed, p, in_cols, n_cols, parent,
+      me);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -897,39 +1059,35 @@ static gd_entry_t *_GD_ParseBit(DIRFILE *restrict D, int is_signed,
   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->flags |= GD_EN_CALC;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
-  E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(bit,bitnum), GD_INT_TYPE,
-      me, format_file, line, E->scalar_ind, NULL, standards, pedantic);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
+  E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(bit,bitnum),
+      GD_INT_TYPE, me, E->scalar_ind, NULL);
 
   if (n_cols > 4)
-    E->scalar[1] = _GD_SetScalar(D, in_cols[4], &E->EN(bit,numbits),
-        GD_INT_TYPE, me, format_file, line, E->scalar_ind + 1, NULL, standards,
-        pedantic);
+    E->scalar[1] = _GD_SetScalar(D, p, in_cols[4], &E->EN(bit,numbits),
+        GD_INT_TYPE, me, E->scalar_ind + 1, NULL);
   else
     E->EN(bit,numbits) = 1;
 
   if (E->scalar[0] != NULL || E->scalar[1] != NULL)
-    E->e->calculated = 0;
+    E->flags &= ~GD_EN_CALC;
 
   if (E->scalar[1] == NULL && E->EN(bit,numbits) < 1)
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NUMBITS, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NUMBITS, p->file, p->line, NULL);
   else if (E->scalar[0] == NULL && E->EN(bit,bitnum) < 0)
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITNUM, 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);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITNUM, p->file, p->line, NULL);
+  else if ((E->flags & GD_EN_CALC) &&
+      E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63)
+  {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITSIZE, p->file, p->line, NULL);
+  }
 
   if (D->error != GD_E_OK) {
     _GD_FreeE(D, E, 1);
@@ -943,18 +1101,16 @@ static gd_entry_t *_GD_ParseBit(DIRFILE *restrict D, int is_signed,
 /* _GD_ParsePhase: parse PHASE entry in formats file.
 */
 static gd_entry_t *_GD_ParsePhase(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -979,24 +1135,17 @@ static gd_entry_t *_GD_ParsePhase(DIRFILE *restrict D,
   E->in_fields[0] = NULL;
   E->e->entry[0] = NULL;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
 
-  if ((E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(phase,shift),
-          GD_INT64, me, format_file, line, E->scalar_ind, NULL, standards,
-          pedantic)) == NULL)
+  if ((E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(phase,shift),
+          GD_INT64, me, E->scalar_ind, NULL)) == NULL)
   {
-    E->e->calculated = 1;
+    E->flags |= GD_EN_CALC;
   }
 
   if (D->error != GD_E_OK) {
@@ -1011,18 +1160,17 @@ static gd_entry_t *_GD_ParsePhase(DIRFILE *restrict D,
 /* _GD_ParsePolynom: parse a POLYNOM in the format file.
 */
 static gd_entry_t *_GD_ParsePolynom(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
-  int i, offset;
+  int i;
   gd_entry_t *E;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 5) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -1044,13 +1192,7 @@ static gd_entry_t *_GD_ParsePolynom(DIRFILE *restrict D,
   memset(E->e, 0, sizeof(struct gd_private_entry_));
 
   E->field_type = GD_POLYNOM_ENTRY;
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
@@ -1061,18 +1203,17 @@ static gd_entry_t *_GD_ParsePolynom(DIRFILE *restrict D,
   if (E->EN(polynom,poly_ord) > GD_MAX_POLYORD)
     E->EN(polynom,poly_ord) = GD_MAX_POLYORD;
 
-  E->e->calculated = 1;
+  E->flags |= GD_EN_CALC;
 
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]);
 
   for (i = 0; i <= E->EN(polynom,poly_ord); i++) {
-    E->scalar[i] = _GD_SetScalar(D, in_cols[i + 3], &E->EN(polynom,ca)[i],
-        GD_COMPLEX128, me, format_file, line, E->scalar_ind + i, &E->comp_scal,
-        standards, pedantic);
+    E->scalar[i] = _GD_SetScalar(D, p, in_cols[i + 3], &E->EN(polynom,ca)[i],
+        GD_COMPLEX128, me, E->scalar_ind + i, &E->flags);
     E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
 
     if (E->scalar[i] != NULL)
-      E->e->calculated = 0;
+      E->flags &= ~GD_EN_CALC;
   }
 
   if (D->error != GD_E_OK) {
@@ -1121,20 +1262,19 @@ gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type)
 /* _GD_ParseConst: parse CONST entry in formats file.
 */
 static gd_entry_t *_GD_ParseConst(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   int offset;
   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);
+  dtrace("%p, %p, %p, %i, %p", D, p, in_cols, n_cols, parent);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -1156,25 +1296,19 @@ static gd_entry_t *_GD_ParseConst(DIRFILE *restrict D,
   memset(E->e, 0, sizeof(struct gd_private_entry_));
 
   E->field_type = GD_CONST_ENTRY;
-  E->e->calculated = 1;
+  E->flags |= GD_EN_CALC;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->EN(scalar,const_type) = _GD_RawType(in_cols[2], standards, pedantic);
+  E->EN(scalar,const_type) = _GD_RawType(in_cols[2], p->standards, p->pedantic);
   E->EN(scalar,array_len) = -1;
 
   if (GD_SIZE(E->EN(scalar,const_type)) == 0 || E->EN(scalar,const_type) & 0x40)
   {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, format_file, line,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, p->file, p->line,
         in_cols[2]);
     _GD_FreeE(D, E, 1);
     dreturn("%p", NULL);
@@ -1190,11 +1324,11 @@ static gd_entry_t *_GD_ParseConst(DIRFILE *restrict D,
     return NULL;
   }
 
-  ptr = _GD_SetScalar(D, in_cols[3], E->e->u.scalar.d, type, me, format_file,
-      line, &offset, &offset, standards, pedantic);
+  ptr = _GD_SetScalar(D, p, in_cols[3], E->e->u.scalar.d, type, me, &offset,
+      NULL);
   if (ptr) {
     free(ptr);
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line,
         in_cols[3]);
   }
 
@@ -1207,27 +1341,25 @@ static gd_entry_t *_GD_ParseConst(DIRFILE *restrict D,
   return E;
 }
 
-/* _GD_ParseCarray: parse CARRAY entry in formats file.
+/* _GD_ParseArray: parse [CS]ARRAY entry in formats file.
 */
-static gd_entry_t *_GD_ParseCarray(DIRFILE *restrict D,
-    char *in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent,
-    const char *restrict format_file, int line, int me, int standards,
-    int pedantic, int *restrict is_dot, char **outstring, const char *tok_pos)
+static gd_entry_t *_GD_ParseArray(DIRFILE *restrict D,
+    const struct parser_state *restrict p, char *in_cols[MAX_IN_COLS],
+    int n_cols, const gd_entry_t *restrict parent, int me, char **outstring,
+    const char *tok_pos)
 {
-  int offset;
-  int c, first, new_z, s, z;
-  size_t n;
-  gd_type_t t;
+  int offset, c, first, s;
+  size_t n = 0, data_size = 0, new_size;
+  gd_type_t t = GD_NULL;
   char* ptr;
-  void *data;
+  void *data = NULL;
   gd_entry_t *E;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p, %p, %p", D, in_cols,
-      n_cols, parent, format_file, line, me, standards, pedantic, is_dot,
+  dtrace("%p, %p, %p, %i, %p, %i, %p, %p", D, p, in_cols, n_cols, parent, me,
       outstring, tok_pos);
 
   if (n_cols < 4) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -1249,44 +1381,33 @@ static gd_entry_t *_GD_ParseCarray(DIRFILE *restrict D,
   memset(E->e, 0, sizeof(struct gd_private_entry_));
 
   E->field_type = GD_CARRAY_ENTRY;
-  E->e->calculated = 1;
+  E->flags |= GD_EN_CALC;
 
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
     dreturn("%p", NULL);
     return NULL;
   }
 
-  E->EN(scalar,const_type) = _GD_RawType(in_cols[2], standards, pedantic);
+  E->EN(scalar,const_type) = _GD_RawType(in_cols[2], p->standards,
+      p->pedantic);
+  t = _GD_ConstType(D, E->EN(scalar,const_type));
+  first = 3;
+  s = GD_SIZE(t);
 
   if (GD_SIZE(E->EN(scalar,const_type)) == 0 || E->EN(raw,data_type) & 0x40) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, format_file, line,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, p->file, p->line,
         in_cols[2]);
-  }
-
-  if (D->error) {
     _GD_FreeE(D, 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);
+  new_size = MAX_IN_COLS - first;
 
   for (;;) {
-    if (z < new_z) {
-      void *new_data = (char *)_GD_Realloc(D, data, new_z * s);
+    if (data_size < new_size) {
+      void *new_data = _GD_Realloc(D, data, new_size * s);
       if (new_data == NULL) {
         free(data);
         _GD_FreeE(D, E, 1);
@@ -1294,25 +1415,25 @@ static gd_entry_t *_GD_ParseCarray(DIRFILE *restrict D,
         return NULL;
       }
       data = new_data;
-      z = new_z;
+      data_size = new_size;
     }
 
     for (c = first; c < n_cols; ++c) {
-      ptr = _GD_SetScalar(D, in_cols[c], (char *)data + s * n++, t, me,
-          format_file, line, &offset, &offset, standards, pedantic);
+      if (n == GD_SIZE_T_MAX)
+        break;
+
+      ptr = _GD_SetScalar(D, p, in_cols[c], (char *)data + s * n++, t, me,
+          &offset, NULL);
 
       if (ptr) {
         free(ptr);
         free(data);
         _GD_FreeE(D, E, 1);
-        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line,
             in_cols[c]);
         dreturn("%p", NULL);
         return NULL;
       }
-
-      if (n == GD_MAX_CARRAY_LENGTH)
-        break;
     }
 
     if (n_cols < MAX_IN_COLS)
@@ -1320,12 +1441,12 @@ static gd_entry_t *_GD_ParseCarray(DIRFILE *restrict D,
 
     /* get more tokens */
     free(*outstring);
-    n_cols = _GD_Tokenise(D, tok_pos, outstring, &tok_pos, MAX_IN_COLS, in_cols,
-        format_file, line, standards, pedantic);
+    n_cols = _GD_Tokenise(D, p, tok_pos, outstring, &tok_pos, MAX_IN_COLS,
+        in_cols);
     if (n_cols == 0 || D->error)
       break;
     first = 0;
-    new_z = z + n_cols;
+    new_size = data_size + n_cols;
   }
   /* save the list */
   E->e->u.scalar.d = data;
@@ -1343,18 +1464,16 @@ static gd_entry_t *_GD_ParseCarray(DIRFILE *restrict D,
 /* _GD_ParseString: parse STRING entry in formats file.
 */
 static gd_entry_t *_GD_ParseString(DIRFILE *restrict D,
+    const struct parser_state *restrict p,
     char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
-    const gd_entry_t *restrict parent, const char *restrict format_file,
-    int line, int me, int standards, int pedantic, int *restrict is_dot)
+    const gd_entry_t *restrict parent, int me)
 {
   gd_entry_t *E;
-  int offset;
 
-  dtrace("%p, %p, %i, %p, \"%s\", %i, %i, %i, %i, %p", D, in_cols, n_cols,
-      parent, format_file, line, me, standards, pedantic, is_dot);
+  dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me);
 
   if (n_cols < 3) {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
     dreturn("%p", NULL);
     return NULL;
   }
@@ -1377,19 +1496,17 @@ static gd_entry_t *_GD_ParseString(DIRFILE *restrict D,
 
   E->field_type = GD_STRING_ENTRY;
   E->e->u.string = _GD_Strdup(D, in_cols[2]);
-  E->e->calculated = 1;
-
-  E->field = _GD_MungeFromFrag(D, parent, me, in_cols[0], &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        is_dot))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
-        in_cols[0]);
-  }
+  E->flags |= GD_EN_CALC;
 
   if (D->error) {
     _GD_FreeE(D, E, 1);
-    E = NULL;
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) {
+    dreturn("%p", NULL);
+    return NULL;
   }
 
   dreturn("%p", E);
@@ -1399,7 +1516,7 @@ static gd_entry_t *_GD_ParseString(DIRFILE *restrict D,
 static int _GD_UTF8Encode(DIRFILE *restrict D, const char *restrict format_file,
     int linenum, char **restrict op, uint32_t value)
 {
-  dtrace("%p, %p, %llx", D, op, (long long)value);
+  dtrace("%p, %p, %llx", D, op, (unsigned long long)value);
 
   if (value > 0x10FFFF || value == 0) {
     _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, format_file, linenum,
@@ -1433,14 +1550,13 @@ static int _GD_UTF8Encode(DIRFILE *restrict D, const char *restrict format_file,
  * and points *name to the metaname part.  me == -1 implies we're not in the
  * parser, but called from _GD_Add.
  */
-gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, char **restrict name, int me,
-    int linenum)
+gd_entry_t *_GD_CheckParent(DIRFILE *restrict D,
+    const struct parser_state *p, char **restrict name, int me)
 {
-  int dummy;
   char *cptr, *munged_code;
   gd_entry_t *P = NULL;
 
-  dtrace("%p, \"%s\", %i, %i", D, *name, me, linenum);
+  dtrace("%p, %p, \"%s\", %i", D, p, *name, me);
 
   for (cptr = *name + 1; *cptr != '\0'; ++cptr)
     if (*cptr == '/') {
@@ -1448,7 +1564,7 @@ gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, char **restrict name, int me,
       if (me == -1)
         munged_code = strdup(*name);
       else
-        munged_code = _GD_MungeFromFrag(D, NULL, me, *name, &dummy);
+        munged_code = _GD_CodeFromFrag(D, p, NULL, me, *name, NULL, NULL);
       if (munged_code) {
         P = _GD_FindField(D, munged_code, D->entry, D->n_entries, 0, NULL);
         free(munged_code);
@@ -1460,17 +1576,17 @@ gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, char **restrict name, int me,
           dreturn("%p", NULL);
           return NULL;
         }
-        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD,
-            D->fragment[me].cname, linenum, *name);
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD, p->file, p->line,
+            *name);
       } else if (P->field_type == GD_ALIAS_ENTRY) {
         if (me == -1)
           P = P->e->entry[0]; /* just de-alias */
         else
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ALIAS, D->fragment[me].cname,
-              linenum, *name);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ALIAS, p->file, p->line,
+              *name);
       } else if (P->fragment_index != me && me != -1)
-        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION,
-            D->fragment[me].cname, linenum, *name);
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION, p->file, p->line,
+            *name);
 
       if (D->error) {
         dreturn("%p", NULL);
@@ -1488,30 +1604,26 @@ gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, char **restrict name, int me,
 
 /* _GD_ParseFieldSpec: Parse a format file line fragment containing a field
  * specification */
-gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict D, int n_cols, char **in_cols,
-    const gd_entry_t *restrict P, const char *restrict format_file, int linenum,
-    int me, int standards, int creat, unsigned long flags, int insert,
+gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict D,
+    const struct parser_state *restrict p, int n_cols, char **in_cols,
+    const gd_entry_t *restrict P, int me, int creat, int insert,
     char **outstring, const char *tok_pos)
 {
   gd_entry_t* E = NULL;
   void *ptr;
-  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);
+  dtrace("%p, %p, %i, %p, %p, %i, %i, %i, %p, %p", D, p, n_cols, in_cols, P, me,
+      creat, insert, outstring, tok_pos);
 
   /* Check for barth-style metafield definition */
-  if (P == NULL && (!pedantic || standards >= 7)) {
-    P = _GD_CheckParent(D, in_cols + 0, me, linenum);
+  if (P == NULL && GD_PVERS_GE(*p, 7)) {
+    P = _GD_CheckParent(D, p, in_cols + 0, me);
     if (P) {
       if (n_cols < 2)
-        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
-            linenum, NULL);
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
       else
-        E = _GD_ParseFieldSpec(D, n_cols, in_cols, P, D->fragment[me].cname,
-            linenum, me, standards, creat, flags, insert, outstring, tok_pos);
+        E = _GD_ParseFieldSpec(D, p, n_cols, in_cols, P, me, creat, insert,
+            outstring, tok_pos);
       dreturn("%p", (!insert) ? E : NULL);
       return (!insert) ? E : NULL;
     }
@@ -1525,100 +1637,128 @@ gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict D, int n_cols, char **in_cols,
   D->entry = (gd_entry_t **)ptr;
 
   if (n_cols < 2)
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, linenum,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line,
         NULL);
-  else if (P == NULL && (strcmp(in_cols[0], "INDEX") == 0 || (pedantic &&
-          standards < 6 && strcmp(in_cols[0], "FILEFRAM") == 0)))
+  else if (P == NULL && (strcmp(in_cols[0], "INDEX") == 0 || (p->pedantic &&
+          p->standards < 6 && strcmp(in_cols[0], "FILEFRAM") == 0)))
     /* reserved field name */
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_RES_NAME, format_file, linenum,
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_RES_NAME, p->file, p->line,
         NULL);
-  else if (strcmp(in_cols[1], "RAW") == 0) {
-    E = _GD_ParseRaw(D, in_cols, n_cols, P, format_file, linenum, me, 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, GD_E_UNENC_UNDET, 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
-        _GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_WRITE | GD_FILE_TOUCH, 0);
-    }
+  else
+    switch (in_cols[1][0]) {
+      case 'B':
+        if (strcmp(in_cols[1], "BIT") == 0)
+          E = _GD_ParseBit(D, 0, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'C':
+        if (strcmp(in_cols[1], "CARRAY") == 0 && GD_PVERS_GE(*p, 8))
+          E = _GD_ParseArray(D, p, in_cols, n_cols, P, me, outstring,
+              tok_pos);
+        else if (strcmp(in_cols[1], "CONST") == 0 && GD_PVERS_GE(*p, 6))
+          E = _GD_ParseConst(D, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'D':
+        if (strcmp(in_cols[1], "DIVIDE") == 0 && GD_PVERS_GE(*p, 8))
+          E = _GD_ParseYoke(D, GD_DIVIDE_ENTRY, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'L':
+        if (strcmp(in_cols[1], "LINCOM") == 0)
+          E = _GD_ParseLincom(D, p, in_cols, n_cols, P, me);
+        else if (strcmp(in_cols[1], "LINTERP") == 0)
+          E = _GD_ParseLinterp(D, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'M':
+        if (strcmp(in_cols[1], "MPLEX") == 0 && GD_PVERS_GE(*p, 9))
+          E = _GD_ParseMplex(D, p, in_cols, n_cols, P, me);
+        else if (strcmp(in_cols[1], "MULTIPLY") == 0 && GD_PVERS_GE(*p, 2))
+          E = _GD_ParseYoke(D, GD_MULTIPLY_ENTRY, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'P':
+        if (strcmp(in_cols[1], "PHASE") == 0 && GD_PVERS_GE(*p, 4))
+          E = _GD_ParsePhase(D, p, in_cols, n_cols, P, me);
+        else if (strcmp(in_cols[1], "POLYNOM") == 0 && GD_PVERS_GE(*p, 7))
+          E = _GD_ParsePolynom(D, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'R':
+        if (strcmp(in_cols[1], "RAW") == 0) {
+          E = _GD_ParseRaw(D, p, in_cols, n_cols, P, me);
+
+          /* Create the binary file, if requested */
+          if (!D->error && creat) {
+            /* If this fragment is protected, we can't do anything */
+            if (D->fragment[me].protection != GD_PROTECT_NONE)
+              _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+                  D->fragment[me].cname);
+            /* If the encoding scheme is unknown, we can't add the field */
+            if (D->fragment[me].encoding == GD_AUTO_ENCODED)
+              _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, NULL, 0,
+                  NULL);
+            else if (D->fragment[me].encoding == GD_ENC_UNSUPPORTED)
+              /* If the encoding scheme is unsupported, can't add the field */
+              _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL);
+            else
+              _GD_InitRawIO(D, E, NULL, -1, NULL, 0,
+                  GD_FILE_WRITE | GD_FILE_TOUCH, _GD_FileSwapBytes(D, E));
+          }
 
-    /* Is this the first raw field ever defined? */
-    if (!D->error && D->fragment[E->fragment_index].ref_name == NULL)
-      if (D->reference_field == NULL)
-        D->reference_field = E;
-  } else if (strcmp(in_cols[1], "LINCOM") == 0)
-    E = _GD_ParseLincom(D, in_cols, n_cols, P, format_file, linenum, me,
-        standards, pedantic, &is_dot);
-  else if (strcmp(in_cols[1], "LINTERP") == 0)
-    E = _GD_ParseLinterp(D, in_cols, n_cols, P, format_file, linenum, me,
-        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, me,
-        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, me,
-        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, me,
-        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, me,
-        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, me,
-        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, me,
-        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, me,
-        standards, pedantic, &is_dot);
-  else if (strcmp(in_cols[1], "WINDOW") == 0 && (!pedantic || standards >= 9))
-    E = _GD_ParseWindow(D, in_cols, n_cols, P, format_file, linenum, me,
-        standards, pedantic, &is_dot);
-  else if (strcmp(in_cols[1], "MPLEX") == 0 && (!pedantic || standards >= 9))
-    E = _GD_ParseMplex(D, in_cols, n_cols, P, format_file, linenum, me,
-        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, me,
-        standards, pedantic, &is_dot);
-  else if (strcmp(in_cols[1], "CARRAY") == 0 && (!pedantic || standards >= 8))
-    E = _GD_ParseCarray(D, in_cols, n_cols, P, format_file, linenum, me,
-        standards, pedantic, &is_dot, outstring, tok_pos);
-  else if (strcmp(in_cols[1], "STRING") == 0 && (!pedantic || standards >= 6))
-    E = _GD_ParseString(D, in_cols, n_cols, P, format_file, linenum, me,
-        standards, pedantic, &is_dot);
-  else if (standards <= GD_DIRFILE_STANDARDS_VERSION || pedantic)
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_LINE, format_file, linenum,
-        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], "RECIP") == 0 && GD_PVERS_GE(*p, 8))
+          E = _GD_ParseRecip(D, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'S':
+        if (strcmp(in_cols[1], "SBIT") == 0 && GD_PVERS_GE(*p, 7))
+          E = _GD_ParseBit(D, 1, p, in_cols, n_cols, P, me);
+        else if (strcmp(in_cols[1], "STRING") == 0 && GD_PVERS_GE(*p, 6))
+          E = _GD_ParseString(D, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      case 'W':
+        if (strcmp(in_cols[1], "WINDOW") == 0 && GD_PVERS_GE(*p, 9))
+          E = _GD_ParseWindow(D, p, in_cols, n_cols, P, me);
+        else
+          goto NO_MATCH;
+        break;
+      default:
+NO_MATCH:
+        /* We ignore indecipherable lines if we seen a /VERSION greater than
+         * what we know about and we're not in pedantic mode */
+        if (p->standards <= GD_DIRFILE_STANDARDS_VERSION || p->pedantic)
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_LINE, p->file, p->line,
+              NULL);
+    }
 
   if (insert && D->error == GD_E_OK && E != NULL) {
-    /* the Format file fragment index */
     unsigned int u;
 
-    E->fragment_index = me;
-
     /* Check for duplicate */
     if (_GD_FindField(D, E->field, D->entry, D->n_entries, 0, &u)) {
-      if (~flags & GD_IGNORE_DUPS)
-        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, format_file,
-            linenum, E->field);
+      if (~p->flags & GD_IGNORE_DUPS)
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, p->file, p->line,
+            E->field);
       _GD_FreeE(D, E, 1);
       dreturn("%p", NULL);
       return NULL;
     }
 
-    if (is_dot) {
+    if (E->flags & GD_EN_DOTTED) {
       ptr = _GD_Realloc(D, D->dot_list, (D->n_dot + 1) * sizeof(gd_entry_t*));
       if (ptr == NULL) {
         _GD_FreeE(D, E, 1);
@@ -1640,12 +1780,18 @@ gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict D, int n_cols, char **in_cols,
         dreturn ("%p", NULL);
         return NULL;
       }
+
+      /* Nothing may fail from now on */
+
       P->e->p.meta_entry = (gd_entry_t **)ptr;
       P->e->p.meta_entry[P->e->n_meta++] = E;
     }
 
+    /* the Format file fragment index */
+    E->fragment_index = me;
+
     /* update the dot list if necessary */
-    if (is_dot) {
+    if (E->flags & GD_EN_DOTTED) {
       D->dot_list[D->n_dot++] = E;
       qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
     }
@@ -1670,9 +1816,9 @@ gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict D, int n_cols, char **in_cols,
 #define ACC_MODE_OCTAL 1
 #define ACC_MODE_HEX   2
 #define ACC_MODE_UTF8  3
-int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
-    char **outstring, const char **pos, int tok_want, char **in_cols,
-    const char *restrict format_file, int linenum, int standards, int pedantic)
+int _GD_Tokenise(DIRFILE *restrict D, const struct parser_state *restrict p,
+    const char *restrict instring, char **outstring, const char **pos,
+    int tok_want, char **in_cols)
 {
   const char* ip;
   char* op;
@@ -1684,9 +1830,8 @@ int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
   int n_acc = 0;
   int acc_mode = ACC_MODE_NONE;
 
-  dtrace("%p, \"%s\", %p, %p, %i, %p, \"%s\", %i, %i, %i", D, instring,
-      outstring, pos, tok_want, in_cols, format_file, linenum, standards,
-      pedantic);
+  dtrace("%p, %p, \"%s\", %p, %p, %i, %p", D, p, instring, outstring, pos,
+      tok_want, in_cols);
 
   op = *outstring = _GD_Strdup(D, instring);
   if (op == NULL) {
@@ -1713,8 +1858,8 @@ int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
 
         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);
+            _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, p->file,
+                p->line, NULL);
             break;
           }
 
@@ -1738,8 +1883,8 @@ int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
 
         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);
+            _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, p->file,
+                p->line, NULL);
             break;
           }
 
@@ -1752,7 +1897,7 @@ int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
         } else if (acc_mode == ACC_MODE_UTF8 && (n_acc == 7 ||
               accumulator > 0x10FFFF || !isxdigit(*ip)))
         {
-          if (_GD_UTF8Encode(D, format_file, linenum, &op, accumulator))
+          if (_GD_UTF8Encode(D, p->file, p->line, &op, accumulator))
             break; /* syntax error */
 
           if (!isxdigit(*ip))
@@ -1825,9 +1970,9 @@ int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
         }
       }
     } else {
-      if (*ip == '\\' && (!pedantic || standards >= 6))
+      if (*ip == '\\' && GD_PVERS_GE(*p, 6))
         escaped_char = 1;
-      else if (*ip == '"' && (!pedantic || standards >= 6)) {
+      else if (*ip == '"' && GD_PVERS_GE(*p, 6)) {
         if ((quotated = !quotated)) {
           if (ws) {
             if (n_cols >= tok_want)
@@ -1862,8 +2007,9 @@ int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
   if (quotated || escaped_char) {
     if (*ip == 0 || *ip == '\n') {
       /* Unterminated token */
-      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_UNTERM, format_file, linenum,
-          NULL);
+      if (D->error == 0)
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_UNTERM, p->file, p->line,
+            NULL);
     } else {
       /* a partial tokenisation where we've landed on top of " or \ when
        * finishing up; back up a space */
@@ -1879,21 +2025,19 @@ int _GD_Tokenise(DIRFILE *restrict D, const char *restrict instring,
 }
 
 /* _GD_ParseAlias: set up an alias
- */
-static void _GD_ParseAlias(DIRFILE *restrict D, char **restrict name,
-    const char *restrict target, int me, int line, int standards, int pedantic,
-    int ignore_dups)
+*/
+static void _GD_ParseAlias(DIRFILE *restrict D,
+    const struct parser_state *restrict p, char **restrict name,
+    const char *restrict target, int me)
 {
   gd_entry_t **new_meta_list = NULL;
   gd_entry_t *E, *P = NULL;
   unsigned int u;
-  int offset;
   void *ptr;
 
-  dtrace("%p, \"%s\", \"%s\", %i, %i, %i, %i, %i", D, *name, target, me, line,
-      standards, pedantic, ignore_dups);
+  dtrace("%p, %p, \"%s\", \"%s\", %i", D, p, *name, target, me);
 
-  P = _GD_CheckParent(D, name, me, line);
+  P = _GD_CheckParent(D, p, name, me);
   if (D->error) {
     dreturnvoid();
     return;
@@ -1924,27 +2068,24 @@ static void _GD_ParseAlias(DIRFILE *restrict D, char **restrict name,
 
   E->field_type = GD_ALIAS_ENTRY;
   E->fragment_index = me;
-  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, target, &offset);
+  E->in_fields[0] = _GD_InputCode(D, p, me, target);
 
-  E->field = _GD_MungeFromFrag(D, P, me, *name, &offset);
-  if (E->field && _GD_ValidateField(E->field + offset, standards, pedantic, 0,
-        NULL))
-  {
-    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, D->fragment[me].cname,
-        line, *name);
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    dreturnvoid();
+    return;
   }
 
-  if (D->error != GD_E_OK) {
-    _GD_FreeE(D, E, 1);
+  if (_GD_SetField(D, p, E, P, me, *name, 1)) {
     dreturnvoid();
     return;
   }
 
   /* Check for duplicate */
   if (_GD_FindField(D, E->field, D->entry, D->n_entries, 0, &u)) {
-    if (!ignore_dups)
-      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, D->fragment[me].cname,
-          line, E->field);
+    if (!(p->flags & GD_IGNORE_DUPS))
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, p->file, p->line,
+          E->field);
     _GD_FreeE(D, E, 1);
     dreturnvoid();
     return;
@@ -1982,32 +2123,31 @@ static void _GD_ParseAlias(DIRFILE *restrict D, char **restrict name,
 /* _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 *restrict standards, int linenum, char **restrict ref_name,
-    unsigned long *flags, char **outstring, const char *tok_pos)
+static int _GD_ParseDirective(DIRFILE *D, struct parser_state *restrict p,
+    char **in_cols, int n_cols, int me, char **restrict ref_name,
+    char **outstring, const char *tok_pos)
 {
   const char* ptr;
   char *munged_code;
-  int i, dummy, matched = 0;
-  int pedantic = *flags & GD_PEDANTIC;
+  int i, matched = 0;
   gd_entry_t *E = NULL;
 
-  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);
+  dtrace("%p, %p, %p, %i, %i, %p, %p, %p", D, p, in_cols, n_cols, me, ref_name,
+      outstring, tok_pos);
 
   /* Starting with Standards Version 8, the forward slash is required. */
-  if (*standards >= 8 && pedantic && in_cols[0][0] != '/') {
+  if (p->standards >= 8 && p->pedantic && in_cols[0][0] != '/') {
     dreturn("%i", 0);
     return 0;
   }
 
   /* set up for possibly slashed reserved words */
   ptr = in_cols[0];
-  if (*standards >= 5 || !pedantic)
+  if (GD_PVERS_GE(*p, 5))
     if (in_cols[0][0] == '/')
       ptr++;
 
-  if (!pedantic && in_cols[0][0] != '/' && n_cols > 2)
+  if (!p->pedantic && in_cols[0][0] != '/' && n_cols > 2)
     /* check for a field spec masquerading as a directive */
     if ((strcmp(in_cols[1], "RAW") == 0) ||
         (strcmp(in_cols[1], "LINCOM") == 0) ||
@@ -2026,52 +2166,51 @@ static int _GD_ParseDirective(DIRFILE *D, char **in_cols, int n_cols,
 
   switch(ptr[0]) {
     case 'A':
-      if (strcmp(ptr, "ALIAS") == 0 && (!pedantic || *standards >= 9)) {
+      if (strcmp(ptr, "ALIAS") == 0 && GD_PVERS_GE(*p, 9)) {
         matched = 1;
         if (n_cols < 3) {
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
-              linenum, NULL);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line,
+              NULL);
           break;
         }
 
-        _GD_ParseAlias(D, in_cols + 1, in_cols[2], me, linenum, *standards,
-            pedantic, *flags & GD_IGNORE_DUPS);
+        _GD_ParseAlias(D, p, in_cols + 1, in_cols[2], me);
       }
       break;
     case 'E':
-      if (strcmp(ptr, "ENCODING") == 0 && (!pedantic || *standards >= 6)) {
+      if (strcmp(ptr, "ENCODING") == 0 && GD_PVERS_GE(*p, 6)) {
         matched = 1;
-        if (!(*flags & GD_FORCE_ENCODING)) {
+        if (!(p->flags & GD_FORCE_ENCODING)) {
           D->fragment[me].encoding = GD_ENC_UNSUPPORTED;
           for (i = 0; i < GD_N_SUBENCODINGS - 1; ++i)
-            if (strcmp(in_cols[1], gd_ef_[i].ffname) == 0) {
-              D->fragment[me].encoding = gd_ef_[i].scheme;
+            if (strcmp(in_cols[1], _GD_ef[i].ffname) == 0) {
+              D->fragment[me].encoding = _GD_ef[i].scheme;
               free(D->fragment[me].enc_data);
-              if (n_cols > 2 && gd_ef_[i].flags & GD_EF_EDAT)
+              if (n_cols > 2 && _GD_ef[i].flags & GD_EF_EDAT)
                 D->fragment[me].enc_data = _GD_Strdup(D, in_cols[2]);
               else
                 D->fragment[me].enc_data = NULL;
               break;
             }
         }
-      } else if (strcmp(ptr, "ENDIAN") == 0 && (!pedantic || *standards >= 5)) {
+      } else if (strcmp(ptr, "ENDIAN") == 0 && GD_PVERS_GE(*p, 5)) {
         matched = 1;
-        if (!(*flags & GD_FORCE_ENDIAN)) {
+        if (!(p->flags & GD_FORCE_ENDIAN)) {
           if (strcmp(in_cols[1], "big") == 0)
             D->fragment[me].byte_sex = GD_BIG_ENDIAN;
           else if (strcmp(in_cols[1], "little") == 0)
             D->fragment[me].byte_sex = GD_LITTLE_ENDIAN;
           else
-            _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN,
-            D->fragment[me].cname, linenum, NULL);
-          if (n_cols > 2 && (!pedantic || *standards >= 8)) {
+            _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN, p->file, p->line,
+                NULL);
+          if (n_cols > 2 && GD_PVERS_GE(*p, 8)) {
             if (strcmp(in_cols[2], "arm") == 0) {
 #if ! defined(ARM_ENDIAN_DOUBLES)
               D->fragment[me].byte_sex |= GD_ARM_FLAG;
 #endif
             } else
-              _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN,
-                  D->fragment[me].cname, linenum, NULL);
+              _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN, p->file, p->line,
+                  NULL);
           }
 #ifdef ARM_ENDIAN_DOUBLES
           else
@@ -2081,87 +2220,89 @@ static int _GD_ParseDirective(DIRFILE *D, char **in_cols, int n_cols,
       }
       break;
     case 'F':
-      if (strcmp(ptr, "FRAMEOFFSET") == 0 && (!pedantic || *standards >= 1)) {
+      if (strcmp(ptr, "FRAMEOFFSET") == 0 && GD_PVERS_GE(*p, 1)) {
         matched = 1;
         D->fragment[me].frame_offset = gd_strtoll(in_cols[1], NULL,
-            (!pedantic || *standards >= 9) ? 0 : 10);
+            GD_PVERS_GE(*p, 9) ? 0 : 10);
       }
       break;
     case 'H':
-      if (strcmp(ptr, "HIDDEN") == 0 && (!pedantic || *standards >= 9)) {
+      if (strcmp(ptr, "HIDDEN") == 0 && GD_PVERS_GE(*p, 9)) {
         matched = 1;
-        munged_code = _GD_MungeFromFrag(D, NULL, me, in_cols[1], &dummy);
+        munged_code = _GD_CodeFromFrag(D, p, NULL, me, in_cols[1], NULL, NULL);
         if (munged_code)
           E = _GD_FindField(D, munged_code, D->entry, D->n_entries, 0, NULL);
         free(munged_code);
 
         if (E == NULL)
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD,
-              D->fragment[me].cname, linenum, in_cols[1]);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD, p->file, p->line,
+              in_cols[1]);
         else if (E->fragment_index != me)
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION,
-              D->fragment[me].cname, linenum, in_cols[1]);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION, p->file, p->line,
+              in_cols[1]);
         else
-          E->hidden = 1;
+          E->flags |= GD_EN_HIDDEN;
       }
       break;
     case 'I':
-      if (strcmp(ptr, "INCLUDE") == 0 && (!pedantic || *standards >= 3)) {
+      if (strcmp(ptr, "INCLUDE") == 0 && GD_PVERS_GE(*p, 3)) {
         char *new_ref = NULL;
         int frag;
-        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));
+        unsigned long oldflags = p->flags;
+
         matched = 1;
 
-        frag = _GD_Include(D, in_cols[1], D->fragment[me].cname, linenum,
-            &new_ref, me, (n_cols > 2) ? in_cols[2] : NULL,
-            (n_cols > 3) ? in_cols[3] : NULL, standards, &subflags, 0);
+        p->flags = D->fragment[me].encoding | D->fragment[me].byte_sex |
+          (p->flags & (GD_PEDANTIC | GD_PERMISSIVE | GD_FORCE_ENDIAN |
+                       GD_FORCE_ENCODING | GD_IGNORE_DUPS | GD_IGNORE_REFS));
+
+        frag = _GD_Include(D, p, in_cols[1], &new_ref, me,
+            (n_cols > 2) ? in_cols[2] : NULL, (n_cols > 3) ? in_cols[3] : NULL,
+            0);
 
         if (new_ref) {
           free(*ref_name);
           *ref_name = new_ref;
         }
 
-        if ((pedantic = subflags & GD_PEDANTIC))
-          *flags |= GD_PEDANTIC;
+        p->flags = oldflags;
+        if (p->pedantic)
+          p->flags |= GD_PEDANTIC;
         if (frag != -1)
           D->fragment[me].vers |= D->fragment[frag].vers;
       }
       break;
     case 'M':
-      if (strcmp(ptr, "META") == 0 && (!pedantic || *standards >= 6)) {
+      if (strcmp(ptr, "META") == 0 && GD_PVERS_GE(*p, 6)) {
         matched = 1;
-        munged_code = _GD_MungeFromFrag(D, NULL, me, in_cols[1], &dummy);
+        munged_code = _GD_CodeFromFrag(D, p, NULL, me, in_cols[1], NULL, NULL);
         if (munged_code) {
           E = _GD_FindField(D, munged_code, D->entry, D->n_entries, 0, NULL);
           free(munged_code);
         }
 
         if (E == NULL)
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD,
-              D->fragment[me].cname, linenum, in_cols[1]);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD, p->file, p->line,
+              in_cols[1]);
         else if (E->field_type == GD_ALIAS_ENTRY)
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ALIAS, D->fragment[me].cname,
-              linenum, in_cols[1]);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ALIAS, p->file, p->line,
+              in_cols[1]);
         else if (E->fragment_index != me)
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION,
-              D->fragment[me].cname, linenum, in_cols[1]);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION, p->file, p->line,
+              in_cols[1]);
         else if (E->e->n_meta == -1)
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_META_META,
-              D->fragment[me].cname, linenum, in_cols[1]);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_META_META, p->file, p->line,
+              in_cols[1]);
         else if (n_cols < 4)
-          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
-              linenum, NULL);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line,
+              NULL);
         else
-          _GD_ParseFieldSpec(D, n_cols - 2, in_cols + 2, E,
-              D->fragment[me].cname, linenum, me, *standards, 0, *flags, 1,
+          _GD_ParseFieldSpec(D, p, n_cols - 2, in_cols + 2, E, me, 0, 1,
               outstring, tok_pos);
       }
       break;
     case 'P':
-      if (strcmp(ptr, "PROTECT") == 0 && (!pedantic || *standards >= 6)) {
+      if (strcmp(ptr, "PROTECT") == 0 && GD_PVERS_GE(*p, 6)) {
         matched = 1;
         if (strcmp(in_cols[1], "none") == 0)
           D->fragment[me].protection = GD_PROTECT_NONE;
@@ -2172,25 +2313,25 @@ static int _GD_ParseDirective(DIRFILE *D, char **in_cols, int n_cols,
         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]);
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_PROTECT, p->file, p->line,
+              in_cols[1]);
       }
       break;
     case 'R':
-      if (strcmp(ptr, "REFERENCE") == 0 && (!pedantic || *standards >= 6)) {
+      if (strcmp(ptr, "REFERENCE") == 0 && GD_PVERS_GE(*p, 6)) {
         matched = 1;
         free(*ref_name);
-        *ref_name = _GD_MungeFromFrag(D, NULL, me, in_cols[1], &dummy);
+        *ref_name = _GD_InputCode(D, p, me, in_cols[1]);
       }
       break;
     case 'V':
-      if (strcmp(ptr, "VERSION") == 0 && (!pedantic || *standards >= 5)) {
+      if (strcmp(ptr, "VERSION") == 0 && GD_PVERS_GE(*p, 5)) {
         matched = 1;
-        *standards = atoi(in_cols[1]);
-        if (!pedantic && ~(*flags) & GD_PERMISSIVE)
-          *flags |= (pedantic = GD_PEDANTIC);
-        if (pedantic)
-          D->fragment[me].vers |= 1ULL << *standards;
+        p->standards = atoi(in_cols[1]);
+        if (!p->pedantic && ~(p->flags) & GD_PERMISSIVE)
+          p->flags |= (p->pedantic = GD_PEDANTIC);
+        if (p->pedantic)
+          D->fragment[me].vers |= 1ULL << p->standards;
       }
       break;
   }
@@ -2261,8 +2402,8 @@ void _GD_UpdateAliases(DIRFILE *D, int reset)
  *
  *       Returns NULL unless this fragment contains a REFERENCE directive.
  */
-char *_GD_ParseFragment(FILE *restrict fp, DIRFILE *D, int me,
-    int *restrict standards, unsigned long *flags, int resolve)
+char *_GD_ParseFragment(FILE *restrict fp, DIRFILE *D, struct parser_state *p,
+    int me, int resolve)
 {
   char *instring = NULL;
   char *outstring = NULL;
@@ -2283,30 +2424,31 @@ char *_GD_ParseFragment(FILE *restrict fp, DIRFILE *D, int me,
   int saved_line = 0;
   char* saved_token = NULL;
 
-  dtrace("%p, %p, %i, %p, %p, %i", fp, D, me, standards, flags, resolve);
+  dtrace("%p, %p, %p, %i, %i", fp, D, p, me, resolve);
+
+  /* update the parser */
+  p->line = 0;
+  p->file = D->fragment[me].cname;
 
   /* start parsing */
   while (rescan || (instring = _GD_GetLine(fp, &n, &linenum))) {
     rescan = 0;
-    n_cols = _GD_Tokenise(D, instring, &outstring, &tok_pos, MAX_IN_COLS,
-        in_cols, D->fragment[me].cname, linenum, *standards,
-        *flags & GD_PEDANTIC);
+    n_cols = _GD_Tokenise(D, p, instring, &outstring, &tok_pos, MAX_IN_COLS,
+        in_cols);
 
     if (n_cols == 0) {/* a blank line */
       free(outstring);
       continue;
     }
     else if (n_cols < 2) /* any valid, non-blank line has at least two tokens */
-      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
-          linenum, NULL);
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL);
 
     if (D->error == GD_E_OK)
-      match = _GD_ParseDirective(D, in_cols, n_cols, me, standards, linenum,
-          &ref_name, flags, &outstring, tok_pos);
+      match = _GD_ParseDirective(D, p, in_cols, n_cols, me, &ref_name,
+          &outstring, tok_pos);
 
     if (D->error == GD_E_OK && !match)
-      first_raw = _GD_ParseFieldSpec(D, n_cols, in_cols, NULL,
-          D->fragment[me].cname, linenum, me, *standards, 0, *flags, 1,
+      first_raw = _GD_ParseFieldSpec(D, p, n_cols, in_cols, NULL, me, 0, 1,
           &outstring, tok_pos);
 
     if (D->error == GD_E_FORMAT) {
@@ -2369,7 +2511,7 @@ char *_GD_ParseFragment(FILE *restrict fp, DIRFILE *D, int me,
       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,
+    _GD_SetError(D, GD_E_LINE_TOO_LONG, 0, p->file, p->line,
         NULL);
 
   /* restore a saved error, if we have one */
@@ -2395,11 +2537,36 @@ char *_GD_ParseFragment(FILE *restrict fp, DIRFILE *D, int me,
   return ref_name;
 }
 
+void _GD_SimpleParserInit(DIRFILE *D, const char *name,
+    struct parser_state *p)
+{
+  dtrace("%p, \"%s\", %p", D, name, p);
+
+  if (~D->flags & GD_HAVE_VERSION)
+    _GD_FindVersion(D);
+
+  p->file = name;
+  p->line = 0;
+  if (D->av) {
+    p->standards = D->standards;
+    p->pedantic = 1;
+  } else {
+    p->standards = GD_DIRFILE_STANDARDS_VERSION;
+    p->pedantic = 0;
+  }
+  p->ns = NULL;
+  p->nsl = 0;
+  p->flags = 0;
+
+  dreturnvoid();
+}
+
 /* public access to the GetData tokeniser */
 char *gd_strtok(DIRFILE *D, const char *string) gd_nothrow
 {
   char *outstring, *in_col;
   int n_cols;
+  struct parser_state p;
 
   dtrace("%p, \"%s\"", D, string);
 
@@ -2425,8 +2592,9 @@ char *gd_strtok(DIRFILE *D, const char *string) gd_nothrow
   }
 
   /* tokenise! */
-  n_cols = _GD_Tokenise(D, D->tok_pos, &outstring, (const char **)&D->tok_pos,
-      1, &in_col, "gd_strtok()", 0, D->standards, D->flags & GD_PERMISSIVE);
+  _GD_SimpleParserInit(D, "gd_strtok()", &p);
+  n_cols = _GD_Tokenise(D, &p, D->tok_pos, &outstring,
+      (const char **)&D->tok_pos, 1, &in_col);
 
   if (D->error || n_cols < 1) {
     free(D->tok_base);
diff --git a/src/protect.c b/src/protect.c
index 56c5576..9108434 100644
--- a/src/protect.c
+++ b/src/protect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2010 D. V. Wiebe
+/* Copyright (C) 2008, 2010, 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
diff --git a/src/putdata.c b/src/putdata.c
index d982ca7..0f10c2b 100644
--- a/src/putdata.c
+++ b/src/putdata.c
@@ -1,6 +1,6 @@
 /* Copyright (C) 2003-2005 C. Barth Netterfield
  * Copyright (C) 2003-2005 Theodore Kisner
- * Copyright (C) 2005-2014 D. V. Wiebe
+ * Copyright (C) 2005-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,52 +67,33 @@ static size_t _GD_DoRawOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  if (gd_ef_[E->e->u.raw.file[0].subenc].flags & GD_EF_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);
-    }
+  /* fix endianness, if necessary */
+  if (_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_ECOR)
+    _GD_FixEndianness(databuffer, ns, E->EN(raw,data_type), 0,
+        D->fragment[E->fragment_index].byte_sex);
 
-    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 (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_WRITE, 0)) {
+  if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_WRITE,
+        _GD_FileSwapBytes(D, E)))
+  {
     free(databuffer);
     dreturn("%i", 0);
     return 0;
   }
 
-  if (_GD_WriteSeek(D, E, gd_ef_ + E->e->u.raw.file[0].subenc, s0,
-        GD_FILE_WRITE) == -1)
+  if (_GD_DoSeek(D, E, _GD_ef + E->e->u.raw.file[0].subenc, s0, GD_FILE_WRITE)
+      == -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_WriteOut(E, gd_ef_ + E->e->u.raw.file[0].subenc, databuffer,
+  n_wrote = _GD_WriteOut(E, _GD_ef + E->e->u.raw.file[0].subenc, databuffer,
       E->EN(raw,data_type), ns, 0);
 
   if (n_wrote < 0) {
-    _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+    _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0);
     n_wrote = 0;
   }
 
@@ -134,7 +115,13 @@ static size_t _GD_DoLinterpOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
       num_samp, data_type, data_in);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+  
+  if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]);
     dreturn("%i", 0);
     return 0;
   }
@@ -177,7 +164,7 @@ static size_t _GD_DoLinterpOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  tmpbuf = (double *)_GD_Alloc(D, GD_FLOAT64, num_samp);
+  tmpbuf = _GD_Alloc(D, GD_FLOAT64, num_samp);
   if (tmpbuf == NULL) {
     free(tmpbuf);
     dreturn("%i", 0);
@@ -193,8 +180,7 @@ static size_t _GD_DoLinterpOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   }
 
   /* Make the reverse lut */
-  tmp_lut = (struct gd_lut_ *)_GD_Malloc(D, E->e->u.linterp.table_len *
-      sizeof(struct gd_lut_));
+  tmp_lut = _GD_Malloc(D, E->e->u.linterp.table_len * sizeof(*tmp_lut));
   if (tmp_lut == NULL) {
     free(tmpbuf);
     dreturn("%i", 0);
@@ -216,8 +202,8 @@ static size_t _GD_DoLinterpOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
-      num_samp, GD_FLOAT64, tmpbuf);
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, GD_FLOAT64,
+      tmpbuf);
 
   free(tmpbuf);
 
@@ -244,7 +230,13 @@ static size_t _GD_DoLincomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]);
     dreturn("%i", 0);
     return 0;
   }
@@ -259,7 +251,7 @@ static size_t _GD_DoLincomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
 
   memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type));
 
-  if (E->comp_scal) {
+  if (E->flags & GD_EN_COMPSCAL) {
 #ifdef GD_NO_C99_API
     double cm[1][2];
     double cb[1][2];
@@ -293,8 +285,8 @@ static size_t _GD_DoLincomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
-      num_samp, data_type, tmpbuf);
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type,
+      tmpbuf);
   free(tmpbuf);
 
   dreturn("%" PRNsize_t, n_wrote);
@@ -314,13 +306,19 @@ static size_t _GD_DoBitOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
       num_samp, data_type, data_in);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]);
     dreturn("%i", 0);
     return 0;
   }
 
-  tmpbuf = (uint64_t *)_GD_Alloc(D, GD_UINT64, num_samp);
-  readbuf = (uint64_t *)_GD_Alloc(D, GD_UINT64, num_samp);
+  tmpbuf = _GD_Alloc(D, GD_UINT64, num_samp);
+  readbuf = _GD_Alloc(D, GD_UINT64, num_samp);
 
   if (tmpbuf == NULL || readbuf == NULL) {
     free(tmpbuf);
@@ -350,8 +348,8 @@ static size_t _GD_DoBitOut(DIRFILE *restrict D, gd_entry_t *restrict E,
       (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);
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, GD_UINT64,
+      (void*)readbuf);
 
   free(readbuf);
   free(tmpbuf);
@@ -369,13 +367,19 @@ static size_t _GD_DoPhaseOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
       num_samp, data_type, data_in);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     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);
+  if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp + E->EN(phase,shift),
+      num_samp, data_type, data_in);
 
   dreturn("%" PRNsize_t, n_wrote);
 
@@ -392,7 +396,13 @@ static size_t _GD_DoRecipOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
       num_samp, data_type, data_in);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]);
     dreturn("%i", 0);
     return 0;
   }
@@ -408,7 +418,7 @@ static size_t _GD_DoRecipOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type));
 
   /* calculate x = a/y instead of y = a/x */
-  if (E->comp_scal)
+  if (E->flags & GD_EN_COMPSCAL)
     _GD_CInvertData(D, tmpbuf, data_type, E->EN(recip,cdividend), num_samp);
   else
     _GD_InvertData(D, tmpbuf, data_type, E->EN(recip,dividend), num_samp);
@@ -419,8 +429,8 @@ static size_t _GD_DoRecipOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
-      num_samp, data_type, tmpbuf);
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type,
+      tmpbuf);
   free(tmpbuf);
 
   dreturn("%" PRNsize_t, n_wrote);
@@ -446,7 +456,13 @@ static size_t _GD_DoPolynomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]);
     dreturn("%i", 0);
     return 0;
   }
@@ -467,7 +483,7 @@ static size_t _GD_DoPolynomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
 
   memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type));
 
-  if (E->comp_scal) {
+  if (E->flags & GD_EN_COMPSCAL) {
 #ifdef GD_NO_C99_API
     double cm[1][2];
     double cb[1][2];
@@ -501,8 +517,8 @@ static size_t _GD_DoPolynomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
-      num_samp, data_type, tmpbuf);
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type,
+      tmpbuf);
   free(tmpbuf);
 
   dreturn("%" PRNsize_t, n_wrote);
@@ -566,12 +582,18 @@ static size_t _GD_DoMplexOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
       num_samp, data_type, data_in);
 
-  if (_GD_BadInput(D, E, 0, 1)) {
+  if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
 
-  if (_GD_BadInput(D, E, 1, 1)) {
+  if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) {
     dreturn("%i", 0);
     return 0;
   }
@@ -589,7 +611,7 @@ static size_t _GD_DoMplexOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   first_samp2 = first_samp * spf2 / spf1;
 
   tmpbuf = _GD_Alloc(D, data_type, num_samp);
-  cntbuf = (int*)_GD_Alloc(D, GD_INT_TYPE, num_samp2);
+  cntbuf = _GD_Alloc(D, GD_INT_TYPE, num_samp2);
 
   if (tmpbuf == NULL || cntbuf == NULL) {
     free(cntbuf);
@@ -621,8 +643,8 @@ static size_t _GD_DoMplexOut(DIRFILE *restrict D, gd_entry_t *restrict E,
 
   /* and write it. */
   if (!D->error)
-    n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
-        num_samp, data_type, tmpbuf);
+    n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type,
+        tmpbuf);
   free(tmpbuf);
 
   dreturn("%" PRNsize_t, n_wrote);
@@ -657,14 +679,14 @@ static size_t _GD_DoConstOut(DIRFILE *restrict D, gd_entry_t *restrict E,
   return 1;
 }
 
-size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
+size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     off64_t first_samp, size_t num_samp, gd_type_t data_type,
     const void *restrict data_in)
 {
   size_t n_wrote = 0;
 
-  dtrace("%p, %p, %i, %lli, %" PRNsize_t ", 0x%X, %p", D, E, repr,
-      (long long)first_samp, num_samp, data_type, data_in);
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
 
   if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
     _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
@@ -673,7 +695,7 @@ size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
     return 0;
   }
 
-  if (!E->e->calculated) {
+  if (!(E->flags & GD_EN_CALC)) {
     _GD_CalculateEntry(D, E, 1);
 
     if (D->error) {
@@ -683,15 +705,6 @@ size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
     }
   }
 
-  /* 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);
-    D->recurse_level--;
-    dreturn("%i", 0);
-    return 0;
-  }
-
   /* this call will throw GD_E_DOMAIN if a problem arises; however, that only
    * happens in cases where the field has multiple inputs, which putdata will
    * reject anyways; so we ignore this error for a more relevant one later
@@ -717,12 +730,6 @@ size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
     case GD_MPLEX_ENTRY:
       n_wrote = _GD_DoMplexOut(D, E, first_samp, num_samp, data_type, data_in);
       break;
-    case GD_MULTIPLY_ENTRY:
-    case GD_DIVIDE_ENTRY:
-    case GD_WINDOW_ENTRY:
-    case GD_INDEX_ENTRY:
-      _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field);
-      break;
     case GD_RECIP_ENTRY:
       n_wrote = _GD_DoRecipOut(D, E, first_samp, num_samp, data_type, data_in);
       break;
@@ -737,6 +744,12 @@ size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
     case GD_CARRAY_ENTRY:
       n_wrote = _GD_DoConstOut(D, E, first_samp, num_samp, data_type, data_in);
       break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_INDEX_ENTRY:
+      _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field);
+      break;
     case GD_STRING_ENTRY:
     case GD_ALIAS_ENTRY:
     case GD_NO_ENTRY:
@@ -750,18 +763,16 @@ size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
 }
 
 /* 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,
+size_t gd_putdata64(DIRFILE* D, const char *field_code, off64_t first_frame,
     off64_t first_samp, size_t num_frames, size_t num_samp, gd_type_t data_type,
     const void *data_in)
 {
   size_t n_wrote = 0;
   gd_entry_t *entry;
-  char* field_code;
-  int repr;
   unsigned int spf = 0;
 
   dtrace("%p, \"%s\", %lli, %lli, %" PRNsize_t ", %" PRNsize_t ", 0x%X, %p", D,
-      field_code_in, (long long)first_frame, (long long)first_samp, num_frames,
+      field_code, (long long)first_frame, (long long)first_samp, num_frames,
       num_samp, data_type, data_in);
 
   if (D->flags & GD_INVALID) {/* don't crash */
@@ -778,10 +789,10 @@ size_t gd_putdata64(DIRFILE* D, const char *field_code_in, off64_t first_frame,
 
   _GD_ClearError(D);
 
-  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
-      1);
+  entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
 
-  if (D->error) {
+  if (entry == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
     dreturn("%i", 0);
     return 0;
   }
@@ -789,9 +800,6 @@ size_t gd_putdata64(DIRFILE* D, const char *field_code_in, off64_t first_frame,
   if (entry->field_type & GD_SCALAR_ENTRY_BIT)
     _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
 
-  if (field_code != field_code_in)
-    free(field_code);
-
   if (D->error) {
     dreturn("%i", 0);
     return 0;
@@ -827,8 +835,7 @@ size_t gd_putdata64(DIRFILE* D, const char *field_code_in, off64_t first_frame,
     return 0;
   }
  
-  n_wrote = _GD_DoFieldOut(D, entry, repr, first_samp, num_samp, data_type,
-      data_in);
+  n_wrote = _GD_DoFieldOut(D, entry, first_samp, num_samp, data_type, data_in);
 
   dreturn("%" PRNsize_t, n_wrote);
   return n_wrote;
diff --git a/src/raw.c b/src/raw.c
index c48baae..a49c1fa 100644
--- a/src/raw.c
+++ b/src/raw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2010, 2011, 2015 D. V. Wiebe
+/* Copyright (C) 2008, 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -20,10 +20,10 @@
  */
 #include "internal.h"
 
-int _GD_RawOpen(int fd, struct gd_raw_file_* file, int swap gd_unused_,
-    unsigned int mode)
+int _GD_RawOpen(int fd, struct gd_raw_file_* file,
+    gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode)
 {
-  dtrace("%i, %p, <unused>, 0x%X", fd, file, mode);
+  dtrace("%i, %p, <unused>, <unused>, 0x%X", fd, file, mode);
 
   if (!(mode & GD_FILE_TEMP)) {
     if (file->mode & mode) {
@@ -34,14 +34,21 @@ int _GD_RawOpen(int fd, struct gd_raw_file_* file, int swap gd_unused_,
 
     file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE) ?
           (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666);
-  } else
-    file->idata = fd;
+
+  } else {
+    file->idata = _GD_MakeTempFile(file->D, fd, file->name);
+  }
+
+  if (file->idata < 0) {
+    dreturn("%i", 1);
+    return 1;
+  }
 
   file->pos = 0;
   file->mode = mode | GD_FILE_READ;
 
-  dreturn("%i", file->idata < 0);
-  return (file->idata < 0);
+  dreturn("%i", 0);
+  return 0;
 }
 
 off64_t _GD_RawSeek(struct gd_raw_file_* file, off64_t count,
@@ -69,7 +76,6 @@ off64_t _GD_RawSeek(struct gd_raw_file_* file, off64_t count,
   }
 
   pos /= GD_SIZE(data_type);
-
   file->pos = pos;
 
   dreturn("%lli", (long long)pos);
@@ -114,7 +120,14 @@ ssize_t _GD_RawWrite(struct gd_raw_file_ *restrict file,
 
 int _GD_RawSync(struct gd_raw_file_ *file)
 {
-  return fsync(file->idata);
+  int r;
+
+  dtrace("%p", file);
+
+  r = fsync(file->idata);
+
+  dreturn("%i", r);
+  return r;
 }
 
 int _GD_RawClose(struct gd_raw_file_ *file)
diff --git a/src/sie.c b/src/sie.c
index 3338c49..58ce09e 100644
--- a/src/sie.c
+++ b/src/sie.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe
+/* Copyright (C) 2011-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,14 +62,14 @@ static int _GD_SampIndDoOpen(int fdin, struct gd_raw_file_ *file,
   if (!(mode & GD_FILE_TEMP)) {
     fd = gd_OpenAt(file->D, fdin, file->name, ((mode & GD_FILE_WRITE) ?
           (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666);
+  } else {
+    fd = _GD_MakeTempFile(file->D, fdin, file->name);
+  }
 
-    if (fd < 0) {
-      dreturn("%i", -1);
-      return -1;
-    }
-  } else
-    fd = fdin;
-
+  if (fd < 0) {
+    dreturn("%i", -1);
+    return -1;
+  }
   stream = fdopen(fd, (mode & GD_FILE_WRITE) ? "rb+" : "rb");
 
   if (stream == NULL) {
@@ -86,10 +86,10 @@ static int _GD_SampIndDoOpen(int fdin, struct gd_raw_file_ *file,
   return fd;
 }
 
-int _GD_SampIndOpen(int fd, struct gd_raw_file_ *file, int swap,
-    unsigned int mode)
+int _GD_SampIndOpen(int fd, struct gd_raw_file_ *file,
+    gd_type_t data_type gd_unused_, int swap, unsigned int mode)
 {
-  dtrace("%i, %p, %i, 0x%X", fd, file, swap, mode);
+  dtrace("%i, %p, <unused>, %i, 0x%X", fd, file, swap, mode);
 
   if (file->mode & mode) {
     dreturn("%i", 0);
diff --git a/src/slim.c b/src/slim.c
index 8499e05..cf55642 100644
--- a/src/slim.c
+++ b/src/slim.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+/* Copyright (C) 2008, 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,39 +18,87 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
+#ifdef ZZSLIM
+#define GD_SLIM(x) _GD_Zzslim ## x
+#else
+#define GD_SLIM(x) _GD_Slim ## x
 #include "internal.h"
+#endif
 
 #ifdef HAVE_SLIMLIB_H
 #include <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
+struct gd_slimdata {
+  SLIMFILE *f;
+  char *filepath;
+};
+
+static struct gd_slimdata *GD_SLIM(DoOpen)(int dirfd, struct gd_raw_file_* file)
+{
+  struct gd_slimdata *gdsl;
+
+  dtrace("%i, %p", dirfd, file);
+
+  /* slimdopen in slimlib-2.6.7 and earlier contains a bug resulting in a SEGV,
+   * so disable this for now */
+#if 0
+  /* #ifdef HAVE_SLIMDOPEN */
+  {
+    int fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666);
+    if (fd < 0) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    file->edata = slimdopen(fd, "r");
+
+    if (file->edata == NULL) {
+      close(fd);
+      dreturn("%i", 1);
+      return 1;
+    }
+  }
+#else
+  {
+    gdsl = malloc(sizeof *gdsl);
+    if (gdsl == NULL) {
+      file->error = ENOMEM;
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    /* this is easily broken, but the best we can do in this case */
+    gdsl->filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name);
+    if (gdsl->filepath == NULL) {
+      file->error = errno;
+      free(gdsl);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    gdsl->f = slimopen(gdsl->filepath, "r");
+  }
 #endif
 
-/* The slim encoding scheme uses edata as a slimfile pointer.  If a file is
- * open, idata = 0 otherwise idata = -1. */
+  if (gdsl->f == NULL) {
+    free(gdsl->filepath);
+    free(gdsl);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  dreturn("%p", gdsl);
+  return gdsl;
+}
 
-int _GD_SlimOpen(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
+int GD_SLIM(Open)(int dirfd, struct gd_raw_file_* file,
+    gd_type_t data_type gd_unused_, int swap gd_unused_,
     unsigned int mode gd_unused_)
 {
-  char *filepath;
-
-  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
-
-  /* this is easily broken, but the best we can do for now... */
-  filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name);
-  if (filepath == NULL) {
-    dreturn("%i", 1);
-    return 1;
-  }
+  dtrace("%i, %p, <unused>, <unused>, <unused>", dirfd, file);
 
-  file->edata = slimopen(filepath, "r");
-  free(filepath);
+  file->edata = GD_SLIM(DoOpen)(dirfd, file);
 
   if (file->edata == NULL) {
     dreturn("%i", 1);
@@ -63,47 +111,56 @@ int _GD_SlimOpen(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
   return 0;
 }
 
-off64_t _GD_SlimSeek(struct gd_raw_file_* file, off64_t count,
+off64_t GD_SLIM(Seek)(struct gd_raw_file_* file, off64_t count,
     gd_type_t data_type, unsigned int mode gd_unused_)
 {
-  off64_t n;
+  struct gd_slimdata *gdsl = file->edata;
 
   dtrace("%p, %lli, 0x%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;
+  /* slimlib appears to do a rewind before every SEEK_SET ! */
+  if (slimseek(gdsl->f, (long)count * GD_SIZE(data_type), SEEK_SET))
+  {
+    /* Handle seeks past the EOF */
+    off64_t size = slimrawsize(gdsl->filepath) / GD_SIZE(data_type);
+    if (count < size || slimseek(gdsl->f, size, SEEK_SET)) {
+      dreturn("%i", -1);
+      return -1;
+    }
+    count = size;
   }
 
-  dreturn("%lli", (long long)(n / GD_SIZE(data_type)));
-  return n;
+  file->pos = count;
+  dreturn("%lli", (long long)count);
+  return count;
 }
 
-ssize_t _GD_SlimRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
+ssize_t GD_SLIM(Read)(struct gd_raw_file_ *restrict file, void *restrict ptr,
     gd_type_t data_type, size_t nmemb)
 {
   ssize_t n;
+  struct gd_slimdata *gdsl = file->edata;
 
   dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
 
-  n = slimread(ptr, GD_SIZE(data_type), nmemb, (SLIMFILE *)file->edata);
+  n = slimread(ptr, GD_SIZE(data_type), nmemb, gdsl->f);
 
   dreturn("%" PRNsize_t, n);
   return n;
 }
 
-int _GD_SlimClose(struct gd_raw_file_ *file)
+int GD_SLIM(Close)(struct gd_raw_file_ *file)
 {
   int ret;
+  struct gd_slimdata *gdsl = file->edata;
 
   dtrace("%p", file);
 
-  ret = slimclose((SLIMFILE *)file->edata);
+  ret = slimclose(gdsl->f);
   if (!ret) {
     file->idata = -1;
+    free(gdsl->filepath);
+    free(file->edata);
     file->edata = NULL;
     file->mode = 0;
   }
@@ -112,23 +169,40 @@ int _GD_SlimClose(struct gd_raw_file_ *file)
   return ret;
 }
 
-off64_t _GD_SlimSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
+off64_t GD_SLIM(Size)(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
     int swap gd_unused_)
 {
-  char *filepath;
   off64_t size;
 
   dtrace("%i, %p, 0x%X", dirfd, file, data_type);
 
-  /* this is easily broken, but the best we can do for now... */
-  filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name);
-  if (filepath == NULL) {
-    dreturn("%i", 1);
-    return 1;
+  /* slimdrawsize in slimlib-2.6.7 and earlier contains a bug resulting in a
+   * SEGV, so disable this for now */
+#if 0
+  /* #ifdef HAVE_SLIMDRAWSIZE */
+  {
+    int fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666);
+    if (fd < 0) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    size = slimdrawsize(fd);
+    close(fd);
   }
-
-  size = slimrawsize(filepath);
-  free(filepath);
+#else
+  {
+    /* this is easily broken, but the best we can do in this case */
+    char *filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name);
+    if (filepath == NULL) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    size = slimrawsize(filepath);
+    free(filepath);
+  }
+#endif
 
   if (size < 0) {
     dreturn("%i", -1);
@@ -140,3 +214,18 @@ off64_t _GD_SlimSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
   dreturn("%lli", (long long)size);
   return size;
 }
+
+int GD_SLIM(Strerr)(const struct gd_raw_file_ *file, char *buf, size_t buflen)
+{
+  int r = 0;
+
+  dtrace("%p, %p, %" PRNsize_t, file, buf, buflen);
+
+  if (file->error)
+    r = gd_strerror(file->error, buf, buflen);
+  else /* the slimlib C API has no error reporting */
+    strncpy(buf, "SLIMLIB: Unspecified error", buflen);
+
+  dreturn("%i", r);
+  return r;
+}
diff --git a/src/spf.c b/src/spf.c
index f6e7057..202ee63 100644
--- a/src/spf.c
+++ b/src/spf.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
- * Copyright (C) 2005-2012 D. V. Wiebe
+ * Copyright (C) 2005-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ unsigned int _GD_GetSPF(DIRFILE *D, gd_entry_t *E)
 
   switch(E->field_type) {
     case GD_RAW_ENTRY:
-      if (!E->e->calculated)
+      if (!(E->flags & GD_EN_CALC))
         _GD_CalculateEntry(D, E, 1);
       if (!D->error)
         spf = E->EN(raw,spf);
@@ -54,7 +54,7 @@ unsigned int _GD_GetSPF(DIRFILE *D, gd_entry_t *E)
     case GD_SBIT_ENTRY:
     case GD_WINDOW_ENTRY:
     case GD_MPLEX_ENTRY:
-      if (_GD_BadInput(D, E, 0, 1))
+      if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1))
         break;
 
       spf = _GD_GetSPF(D, E->e->entry[0]);
@@ -77,14 +77,12 @@ unsigned int _GD_GetSPF(DIRFILE *D, gd_entry_t *E)
 
 /* Get the number of samples for each frame for the given field
 */
-unsigned int gd_spf(DIRFILE* D, const char *field_code_in) gd_nothrow
+unsigned int gd_spf(DIRFILE* D, const char *field_code) gd_nothrow
 {
   unsigned int spf = 0;
   gd_entry_t* entry;
-  char* field_code;
-  int repr;
 
-  dtrace("%p, \"%s\"", D, field_code_in);
+  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);
@@ -97,8 +95,7 @@ unsigned int gd_spf(DIRFILE* D, const char *field_code_in) gd_nothrow
   /* 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,
-      1);
+  entry = _GD_FindEntry(D, field_code, NULL, 1, 1);
 
   if (D->error) {
     dreturn("%u", 0);
@@ -110,9 +107,6 @@ unsigned int gd_spf(DIRFILE* D, const char *field_code_in) gd_nothrow
   else 
     spf = _GD_GetSPF(D, entry);
 
-  if (field_code != field_code_in)
-    free(field_code);
-
   dreturn("%u", spf);
   return spf;
 }
diff --git a/src/string.c b/src/string.c
index d52fc59..d581746 100644
--- a/src/string.c
+++ b/src/string.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2010 D. V. Wiebe
+/* Copyright (C) 2008, 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -20,47 +20,96 @@
  */
 #include "internal.h"
 
-size_t gd_get_string(DIRFILE* D, const char *field_code, size_t len,
-    char *data_out) gd_nothrow
+static int gd_get_sarray_slice(DIRFILE *D, const char *field_code,
+    unsigned long start, size_t n, const char **data_out)
+gd_nothrow
 {
-  size_t n_read = 0;
-  gd_entry_t *entry;
+  gd_entry_t *E;
 
-  dtrace("%p, \"%s\", %" PRNsize_t ", %p", D, field_code, len, data_out);
+  dtrace("%p, \"%s\", %lu, %" PRNsize_t ", %p", D, field_code, start, n,
+      data_out);
 
-  if (D->flags & GD_INVALID) {/* don't crash */
+  if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
-    dreturn("%i", 0);
-    return 0;
+    dreturn("%i", -1);
+    return -1;
   }
 
   _GD_ClearError(D);
 
-  entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
-    
-  if (entry == NULL)
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+
+  if (E == NULL) {
     _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
-  else if (entry && entry->field_type != GD_STRING_ENTRY)
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (E->field_type != GD_STRING_ENTRY) {
     _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
-  else {
-    if (len > 0 && data_out != NULL)
-      strncpy(data_out, entry->e->u.string, len);
+    dreturn("%i", -1);
+    return -1;
+  } else if (start + n > ((E->field_type == GD_STRING_ENTRY) ? 1 :
+        E->EN(scalar,array_len)))
+  {
+    _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
 
-    n_read = strlen(entry->e->u.string) + 1;
+  /* nothing to do */
+  if (n == 0) {
+    dreturn("%i", 0);
+    return 0;
   }
 
+  if (E->field_type == GD_STRING_ENTRY)
+    data_out[0] = E->e->u.string;
+  else
+    memcpy(data_out, ((const char **)E->e->u.scalar.d) + start,
+        n * sizeof(const char*));
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+size_t gd_get_string(DIRFILE *D, const char *field_code, size_t len,
+    char *data_out) gd_nothrow
+{
+  size_t n_read;
+  const char *ptr;
+
+  dtrace("%p, \"%s\", %" PRNsize_t ", %p", D, field_code, len, data_out);
+
+  /* get string */
+  if (gd_get_sarray_slice(D, field_code, 0, 1, &ptr)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* copy into user buffer */
+  if (len > 0 && data_out != NULL)
+    strncpy(data_out, ptr, len);
+
+  n_read = strlen(ptr) + 1;
+
   dreturn("%" PRNsize_t, n_read);
   return n_read;
 }
 
-size_t _GD_DoStringOut(DIRFILE *restrict D, gd_entry_t *restrict E,
-    const char *data_in)
+static size_t _GD_PutSarraySlice(DIRFILE *restrict D, gd_entry_t *restrict E,
+    unsigned long first, size_t n, const char **data_in)
 {
-  char* ptr = E->e->u.string;
+  size_t len;
 
-  dtrace("%p, %p, %p", D, E, data_in);
+  dtrace("%p, %p, %lu, %" PRNsize_t ", %p", D, E, first, n, data_in);
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
 
-  /* 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);
@@ -68,50 +117,89 @@ size_t _GD_DoStringOut(DIRFILE *restrict D, gd_entry_t *restrict E,
     return 0;
   }
 
-  E->e->u.string = _GD_Strdup(D, data_in);
-  if (E->e->u.string == NULL) {
-    E->e->u.string = ptr;
+  if (first + n > ((E->field_type == GD_STRING_ENTRY) ? 1 :
+        E->EN(scalar,array_len)))
+  {
+    _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
     dreturn("%i", 0);
     return 0;
   }
-  free(ptr);
+
+  if (n == 0) {
+    /* succesfully did nothing. */
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  if (E->field_type == GD_STRING_ENTRY) {
+    char *ptr = E->e->u.string;
+    E->e->u.string = _GD_Strdup(D, *data_in);
+    if (E->e->u.string == NULL) {
+      E->e->u.string = ptr;
+      dreturn("%i", 0);
+      return 0;
+    }
+    free(ptr);
+  } else {
+    /* copy */
+    size_t i;
+    char **new_data = _GD_Malloc(D, n * sizeof(char*));
+    if (new_data == NULL) {
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    memset(new_data, 0, n * sizeof(char*));
+    for (i = 0; i < n; ++i)
+      new_data[i] = _GD_Strdup(D, data_in[i]);
+
+    if (D->error) {
+      for (i = 0; i < n; ++i)
+        free(new_data[i]);
+      free(new_data);
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    /* replace elements */
+    for (i = 0; i < n; ++i) {
+      free(((char**)E->e->u.scalar.d)[i + first]);
+      ((char**)E->e->u.scalar.d)[i + first] = new_data[i];
+    }
+    free(new_data);
+  }
+
   D->fragment[E->fragment_index].modified = 1;
 
-  dreturn("%" PRNsize_t, strlen(E->e->u.string) + 1);
-  return strlen(E->e->u.string) + 1;
+  len = strlen(data_in[0]) + 1;
+  dreturn("%" PRNsize_t, len);
+  return len;
 }
 
-/* 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)
+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;
+  gd_entry_t *E;
 
   dtrace("%p, \"%s\", \"%s\"", D, field_code, data_in);
 
-  if (D->flags & GD_INVALID) {/* don't crash */
+  if (D->flags & GD_INVALID) {
     _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
     dreturn("%i", 0);
     return 0;
   }
 
-  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
-    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
-    dreturn("%i", 0);
-    return 0;
-  }
-
   _GD_ClearError(D);
 
-  entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
 
-  if (entry == NULL)
+  if (E == NULL)
     _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
-  else if (entry->field_type != GD_STRING_ENTRY)
+  else if (E->field_type != GD_STRING_ENTRY) {
     _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
-  else 
-    n_wrote = _GD_DoStringOut(D, entry, data_in);
+  } else 
+    n_wrote = _GD_PutSarraySlice(D, E, 0, 1, &data_in);
 
   dreturn("%" PRNsize_t, n_wrote);
   return n_wrote;
diff --git a/src/types.c b/src/types.c
index 270dc02..4588233 100644
--- a/src/types.c
+++ b/src/types.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2002-2005 C. Barth Netterfield
- * Copyright (C) 2005-2010, 2014 D. V. Wiebe
+ * Copyright (C) 2005-2010, 2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
diff --git a/src/zzip.c b/src/zzip.c
index 176e3a6..3c7508c 100644
--- a/src/zzip.c
+++ b/src/zzip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -24,91 +24,101 @@
 #include <zzip/lib.h>
 #endif
 
-#ifdef USE_MODULES
-#define _GD_ZzipName libgetdatazzip_LTX_GD_ZzipName
-#define _GD_ZzipOpen libgetdatazzip_LTX_GD_ZzipOpen
-#define _GD_ZzipSeek libgetdatazzip_LTX_GD_ZzipSeek
-#define _GD_ZzipRead libgetdatazzip_LTX_GD_ZzipRead
-#define _GD_ZzipClose libgetdatazzip_LTX_GD_ZzipClose
-#define _GD_ZzipSize libgetdatazzip_LTX_GD_ZzipSize
-#endif
-
-/* The zzip encoding scheme looks just like the regular ol' C IO. */
+struct gd_zzipdata {
+  ZZIP_DIR *dir;
+  ZZIP_FILE *file;
+  zzip_error_t err;
+};
 
-int _GD_ZzipName(DIRFILE *restrict D, const char *restrict enc_data,
+/* A ZZip "name" looks like this:
+ *
+ * <enc_data>.zip\0<base>
+ */
+int _GD_ZzipName(DIRFILE *restrict D gd_unused_, const char *restrict enc_data,
     struct gd_raw_file_ *restrict file, const char *restrict base,
-    int temp gd_unused_, int resolv)
+    int temp gd_unused_, int resolv gd_unused_)
 {
   size_t enc_len;
 
-  dtrace("%p, \"%s\", %p, \"%s\", <unused>, %i", D, enc_data, file, base,
-      resolv);
+  dtrace("%p, \"%s\", %p, \"%s\", <unused>, <unused>", D, enc_data, file, base);
 
-  if (enc_data == NULL)
-    enc_data = "raw";
-
-  enc_len = strlen(enc_data);
-  
-  if (resolv) {
-    free(file->name);
-    file->name = (char*)malloc(enc_len + 5);
-    if (file->name == NULL) {
-      dreturn("%i", -1);
-      return -1;
-    }
-
-    strcpy(file->name, enc_data);
-    strcpy(file->name + enc_len, ".zip");
+  if (file->name == NULL) {
+    if (enc_data == NULL)
+      enc_data = "raw";
 
-    dreturn("%i (%s)", 0, file->name);
-    return 0;
-  }
+    enc_len = strlen(enc_data);
 
-  if (file->name == NULL) {
-    file->D = D;
-    file->name = (char *)malloc(strlen(base) + strlen(enc_data) + 2);
+    file->name = (char*)malloc(enc_len + 5 + strlen(base) + 1);
     if (file->name == NULL) {
-      _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
       dreturn("%i", -1);
       return -1;
     }
 
-    strcpy(file->name, enc_data);
-    file->name[enc_len] = '/';
-    strcpy(file->name + enc_len + 1, base);
+    sprintf(file->name, "%s.zip_%s", enc_data, base);
+    /* Now replace the '_' with a NUL */
+    file->name[enc_len + 4] = '\0';
   }
 
-  dreturn("%i (%s)", 0, file->name);
+  dreturn("%i (%s\\0%s)", 0, file->name, file->name + enc_len + 5);
   return 0;
 }
 
-int _GD_ZzipOpen(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
-    unsigned int mode gd_unused_)
+/* This function opens both a ZZIP_DIR (the containing archive) and a ZZIP_FILE,
+ * the target data file
+ */
+static struct gd_zzipdata *_GD_ZzipDoOpen(int dirfd, struct gd_raw_file_* file)
 {
-  char *ptr1, *ptr2;
-  size_t len;
+  struct gd_zzipdata *gdzz;
+  int fd;
 
-  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
+  dtrace("%i, %p", dirfd, file);
 
-  /* zziplib doesn't seem to have a way to do these path shenannigans nicely */
-  ptr1 = gd_MakeFullPathOnly(file->D, dirfd, "");
-  if (ptr1 == NULL) {
-    dreturn("%i", 1);
-    return 1;
+  /* open the zip file.  */
+  if ((fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY)) < 0) {
+    file->error = -1;
+    dreturn("%p", NULL);
+    return NULL;
   }
 
-  len = strlen(ptr1);
-  ptr2 = (char*)realloc(ptr1, len + strlen(file->name) + 2);
-  if (ptr2 == NULL) {
-    dreturn("%i", 1);
-    return 1;
+  if ((gdzz = malloc(sizeof *gdzz)) == NULL) {
+    close(fd);
+    file->error = ENOMEM;
+    dreturn("%p", NULL);
+    return NULL;
   }
 
-  ptr2[len] = '/';
-  strcpy(ptr2 + len + 1, file->name);
+  /* Pass file to libzzip. */
+  if ((gdzz->dir = zzip_dir_fdopen(fd, &gdzz->err)) == NULL) {
+    file->error = gdzz->err;
+    close(fd);
+    free(gdzz);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Now open the data file inside the archive, it's name is at the tail end of
+   * file->name after the NUL */
+  if ((gdzz->file = zzip_file_open(gdzz->dir,
+          file->name + strlen(file->name) + 1, O_RDONLY)) == NULL)
+  {
+    file->error = gdzz->err;
+    zzip_dir_close(gdzz->dir);
+    free(gdzz);
+    dreturn("%p", NULL);
+    return NULL;
+  }
 
-  file->edata = zzip_open(ptr2, O_RDONLY);
-  free(ptr2);
+  dreturn("%p", gdzz);
+  return gdzz;
+}
+
+int _GD_ZzipOpen(int dirfd, struct gd_raw_file_* file,
+    gd_type_t data_type gd_unused_, int swap gd_unused_,
+    unsigned int mode gd_unused_)
+{
+  dtrace("%i, %p, <unused>, <unused>, <unused>", dirfd, file);
+
+  file->edata = _GD_ZzipDoOpen(dirfd, file);
 
   if (file->edata == NULL) {
     file->idata = -1;
@@ -127,14 +137,31 @@ off64_t _GD_ZzipSeek(struct gd_raw_file_* file, off64_t count,
 {
   off64_t n;
 
+  struct gd_zzipdata *gdzz = file->edata;
+
   dtrace("%p, %lli, 0x%X, <unused>", file, (long long)count, data_type);
 
-  n = file->pos = (off64_t)zzip_seek((ZZIP_FILE*)file->edata,
-      (off_t)(count * GD_SIZE(data_type)), SEEK_SET);
+  n = (off64_t)zzip_seek(gdzz->file, (zzip_off_t)(count * GD_SIZE(data_type)),
+      SEEK_SET);
+
+  if (n < 0) {
+    /* Maybe we tried to seek past the EOF? */
+    n = (off64_t)zzip_seek(gdzz->file, 0, SEEK_END);
 
-  if (n >= 0)
+    if (n > count * GD_SIZE(data_type)) {
+      /* we didn't: there was just an error; try again */
+      n = (off64_t)zzip_seek(gdzz->file,
+          (zzip_off_t)(count * GD_SIZE(data_type)), SEEK_SET);
+    }
+  }
+    
+  if (n < 0)
+    file->error = gdzz->err;
+  else
     n /= GD_SIZE(data_type);
 
+  file->pos = n;
+
   dreturn("%lli", (long long)n);
   return n;
 }
@@ -144,79 +171,92 @@ ssize_t _GD_ZzipRead(struct gd_raw_file_ *restrict file, void *restrict data,
 {
   ssize_t n;
 
+  struct gd_zzipdata *gdzz = file->edata;
+
   dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
 
-  n = zzip_read((ZZIP_FILE*)file->edata, data, GD_SIZE(data_type) * nmemb);
+  n = zzip_read(gdzz->file, data, GD_SIZE(data_type) * nmemb);
 
-  if (n >= 0)
+  if (n < 0)
+    file->error = gdzz->err;
+  else 
     n /= GD_SIZE(data_type);
 
+  file->pos += n;
+
   dreturn("%lli", (long long)n);
   return n;
 }
 
 int _GD_ZzipClose(struct gd_raw_file_ *file)
 {
-  int ret;
+  struct gd_zzipdata *gdzz = file->edata;
 
   dtrace("%p", file);
 
-  ret = zzip_close((ZZIP_FILE*)file->edata);
-
-  if (!ret) {
-    file->idata = -1;
-    file->edata = NULL;
+  if (zzip_file_close(gdzz->file) || zzip_dir_close(gdzz->dir)) {
+    file->error = gdzz->err;
+    dreturn("%i", 1);
+    return 1;
   }
 
-  dreturn("%i", ret);
-  return ret;
+  file->idata = -1;
+  free(file->edata);
+  file->edata = NULL;
+
+  dreturn("%i", 0);
+  return 0;
 }
 
 off64_t _GD_ZzipSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
     int swap gd_unused_)
 {
-  ssize_t len;
-  char *ptr1, *ptr2;
-  ZZIP_FILE *fp;
   off64_t size = 0;
+  struct gd_zzipdata *gdzz;
 
   dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
 
-  /* zziplib doesn't seem to have a way to do these path shenannigans nicely */
-  ptr1 = gd_MakeFullPathOnly(file->D, dirfd, "");
-  if (ptr1 == NULL) {
-    dreturn("%i", 1);
-    return 1;
-  }
-
-  len = strlen(ptr1);
-  ptr2 = (char*)realloc(ptr1, len + strlen(file->name) + 2);
-  if (ptr2 == NULL) {
-    dreturn("%i", 1);
-    return 1;
-  }
-
-  ptr2[len] = '/';
-  strcpy(ptr2 + len + 1, file->name);
+  gdzz = _GD_ZzipDoOpen(dirfd, file);
 
-  fp = zzip_open(ptr2, O_RDONLY);
-  free(ptr2);
-
-  if (fp == NULL) {
-    file->idata = -1;
+  if (gdzz == NULL) {
     dreturn("%i", -1);
     return -1;
   }
 
-  if ((size = (off64_t)zzip_seek(fp, 0, SEEK_END)) == -1) {
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  zzip_close(fp);
+  if ((size = (off64_t)zzip_seek(gdzz->file, 0, SEEK_END)) == -1)
+    file->error = gdzz->err;
+  else
+    size /= GD_SIZE(data_type);
 
-  size /= GD_SIZE(data_type);
+  zzip_file_close(gdzz->file);
+  zzip_dir_close(gdzz->dir);
 
   dreturn("%lli", (long long)size);
   return size;
 }
+
+int _GD_ZzipStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen)
+{
+  int r = 0;
+
+  dtrace("%p, %p, %" PRNsize_t, file, buf, buflen);
+
+  switch (file->error) {
+    case ZZIP_OUTOFMEM:
+      strncpy(buf, "ZZIP: Out of memory", buflen);
+      break;
+    case ZZIP_DIR_OPEN:
+    case ZZIP_DIR_STAT:
+    case ZZIP_DIR_SEEK:
+    case ZZIP_DIR_READ:
+    case -1:
+      r = gd_strerror(errno, buf, buflen);
+      break;
+    default:
+      snprintf(buf, buflen, "ZZIP: Unkown error 0x%X", file->error);
+      break;
+  }
+
+  dreturn("%i", r);
+  return r;
+}
diff --git a/src/zzslim.c b/src/zzslim.c
index f126243..024d619 100644
--- a/src/zzslim.c
+++ b/src/zzslim.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2010, 2011, 2012 D. V. Wiebe
+/* Copyright (C) 2012-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -20,22 +20,6 @@
  */
 #include "internal.h"
 
-#ifdef HAVE_SLIMLIB_H
-#include <slimlib.h>
-#endif
-
-#ifdef USE_MODULES
-#define _GD_ZzslimName libgetdatazzslim_LTX_GD_ZzslimName
-#define _GD_ZzslimOpen libgetdatazzslim_LTX_GD_ZzslimOpen
-#define _GD_ZzslimSeek libgetdatazzslim_LTX_GD_ZzslimSeek
-#define _GD_ZzslimRead libgetdatazzslim_LTX_GD_ZzslimRead
-#define _GD_ZzslimClose libgetdatazzslim_LTX_GD_ZzslimClose
-#define _GD_ZzslimSize libgetdatazzslim_LTX_GD_ZzslimSize
-#endif
-
-/* The zzslim encoding scheme uses edata as a slimfile pointer.  If a file is
- * open, idata = 0 otherwise idata = -1. */
-
 int _GD_ZzslimName(DIRFILE *restrict D, const char *restrict enc_data,
     struct gd_raw_file_ *restrict file, const char *restrict base,
     int temp gd_unused_, int resolv)
@@ -67,115 +51,12 @@ int _GD_ZzslimName(DIRFILE *restrict D, const char *restrict enc_data,
 
     strcpy(file->name, enc_data);
     file->name[enc_len] = '/';
-    strcat(strcpy(file->name + enc_len + 1, base), ".slm");
+    sprintf(file->name + enc_len + 1, "%s.slm", base);
   }
 
   dreturn("%i (%s)", 0, file->name);
   return 0;
 }
 
-int _GD_ZzslimOpen(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
-    unsigned int mode gd_unused_)
-{
-  char *filepath;
-
-  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
-
-  /* this is easily broken, but the best we can do for now... */
-  filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name);
-  if (filepath == NULL) {
-    dreturn("%i", 1);
-    return 1;
-  }
-
-  file->edata = slimopen(filepath, "r");
-  free(filepath);
-
-  if (file->edata == NULL) {
-    dreturn("%i", 1);
-    return 1;
-  }
-
-  file->mode = GD_RDONLY;
-  file->idata = 0;
-  dreturn("%i", 0);
-  return 0;
-}
-
-off64_t _GD_ZzslimSeek(struct gd_raw_file_* file, off64_t count,
-    gd_type_t data_type, unsigned int mode gd_unused_)
-{
-  off64_t n;
-
-  dtrace("%p, %lli, 0x%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_ZzslimRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
-    gd_type_t data_type, size_t nmemb)
-{
-  ssize_t n;
-
-  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
-
-  n = slimread(ptr, GD_SIZE(data_type), nmemb, (SLIMFILE *)file->edata);
-
-  dreturn("%" PRNsize_t, n);
-  return n;
-}
-
-int _GD_ZzslimClose(struct gd_raw_file_ *file)
-{
-  int ret;
-
-  dtrace("%p", file);
-
-  ret = slimclose((SLIMFILE *)file->edata);
-  if (!ret) {
-    file->idata = -1;
-    file->edata = NULL;
-    file->mode = 0;
-  }
-
-  dreturn("%i", ret);
-  return ret;
-}
-
-off64_t _GD_ZzslimSize(int dirfd, struct gd_raw_file_ *file,
-    gd_type_t data_type, int swap gd_unused_)
-{
-  char *filepath;
-  off64_t size;
-
-  dtrace("%i, %p, 0x%X", dirfd, file, data_type);
-
-  /* this is easily broken, but the best we can do for now... */
-  filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name);
-  if (filepath == NULL) {
-    dreturn("%i", 1);
-    return 1;
-  }
-
-  size = slimrawsize(filepath);
-  free(filepath);
-
-  if (size < 0) {
-    dreturn("%i", -1);
-    return -1;
-  }
-
-  size /= GD_SIZE(data_type);
-
-  dreturn("%lli", (long long)size);
-  return size;
-}
+#define ZZSLIM
+#include "slim.c"
diff --git a/test/Makefile.am b/test/Makefile.am
index c1a235b..b7bbe27 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,4 @@
-# (C) 2008-2012 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -20,31 +20,24 @@
 #
 AUTOMAKE_OPTIONS = foreign serial-tests
 
-if CC_WALL
-WALL=-Wall
-endif
-
-if CC_WEXTRA
-WEXTRA=-Wextra
-endif
-
 LDADD=../src/libgetdata.la
-AM_CPPFLAGS=${WALL} $(WEXTRA) -I$(top_srcdir)/src
+AM_CPPFLAGS=${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src
 
 EXTRA_DIST=test.h
 
-ADD_TESTS=add add_affix add_alias add_alias_affix add_alias_meta add_bit \
-					add_bit_bitnum add_bit_bitsize add_bit_invalid add_bit_numbits \
-					add_bit_scalars add_carray add_clincom add_code add_const \
-					add_cpolynom add_crecip add_crecip89 add_dangle_dup add_divide \
-					add_divide_invalid add_duplicate add_format add_invalid add_lincom \
-					add_lincom_affix add_lincom_invalid add_lincom_nfields add_linterp \
+ADD_TESTS=add_add add_affix add_alias add_alias_affix add_alias_meta \
+					add_amb_code7 add_bit add_bit_bitnum add_bit_bitsize add_bit_invalid \
+					add_bit_numbits add_bit_scalars add_carray add_clincom add_code \
+					add_const add_cpolynom add_crecip add_crecip89 add_dangle_dup \
+					add_divide add_divide_invalid add_dot5 add_dot6 add_duplicate \
+					add_format add_invalid add_lincom add_lincom_affix \
+					add_lincom_invalid add_lincom_nfields add_linterp \
 					add_linterp_invalid add_meta add_meta_alias add_mplex \
 					add_mplex_scalars add_multiply add_multiply_invalid add_phase \
 					add_phase_invalid add_polynom add_polynom_scalar add_protect add_raw \
 					add_raw_include add_raw_invalid add_raw_spf add_raw_spf_scalar \
-					add_raw_type add_rdonly add_recip add_resolv add_sbit add_scalar \
-					add_scalar_carray add_scalar_carray_bad add_sort add_spec \
+					add_raw_sub add_raw_type add_rdonly add_recip add_resolv add_sbit \
+					add_scalar add_scalar_carray add_scalar_carray_bad add_sort add_spec \
 					add_spec_directive add_spec_invalid add_spec_meta add_spec_resolv \
 					add_string add_string_affix add_type add_window add_window_op
 
@@ -53,31 +46,34 @@ ALIAS_TESTS=alias_list alias_list_alias alias_list_missing alias_num \
 						alias_target_missing
 
 ALTER_TESTS=alter_bit_bitnum alter_bit_numbits alter_carray_len \
-						alter_carray_type alter_const alter_const_c2r alter_cpolynom \
-						alter_crecip \
-						alter_crecip89 alter_crecip_zero alter_divide alter_entry \
-						alter_entry_affix alter_entry_hidden alter_entry_recode \
-						alter_entry_scalar2a alter_entry_scalar2n alter_entry_scalar3 \
-						alter_entry_scalar4 alter_lincom_23 alter_lincom_32 \
+						alter_carray_type alter_clincom alter_const alter_const_c2r \
+						alter_const_r2c alter_const_r2r alter_cpolynom alter_cpolynom_null \
+						alter_crecip alter_crecip89 alter_crecip89_null alter_crecip_zero \
+						alter_divide alter_entry alter_entry_affix alter_entry_hidden \
+						alter_entry_lincom alter_entry_recode alter_entry_recode_recalc \
+						alter_entry_scalar1 alter_entry_scalar2a alter_entry_scalar2n \
+						alter_entry_scalar3 alter_entry_scalar3c alter_entry_scalar4 \
+						alter_entry_scalar_amb alter_index alter_lincom_23 alter_lincom_32 \
 						alter_lincom_affix alter_lincom_input alter_lincom_offset \
 						alter_lincom_slope alter_linterp alter_linterp_move alter_mplex \
 						alter_mspec alter_mspec_affix alter_multiply alter_phase \
 						alter_polynom_coeff alter_polynom_input alter_polynom_ord \
 						alter_raw_spf alter_raw_type alter_recip alter_recip_zero \
 						alter_scalar_affix alter_spec alter_spec_affix alter_spec_meta \
-						alter_window
-
-ASCII_TESTS=ascii_add ascii_get ascii_get_get ascii_nframes ascii_put
+						alter_spec_polynom alter_window
 
-BOF_TESTS=bof bof_lincom bof_phase
+ASCII_TESTS=ascii_add ascii_get ascii_get_complex ascii_get_get ascii_get_here \
+						ascii_get_sub ascii_nframes ascii_put ascii_put_here ascii_seek \
+						ascii_seek_far ascii_sync
 
-BZIP_TESTS=bzip_get bzip_get_get bzip_move_from bzip_nframes
+BOF_TESTS=bof bof_bit bof_index bof_lincom bof_phase bof_phase_neg
 
-CVLIST_TESTS=cvlist cvlist_array cvlist_array_hidden cvlist_array_meta \
-						 cvlist_array_meta_hidden cvlist_hidden cvlist_invalid cvlist_meta \
-						 cvlist_meta_hidden cvlist_meta_invalid
+BZIP_TESTS=bzip_add bzip_get bzip_get_far bzip_get_get bzip_get_get2 \
+					 bzip_get_put bzip_move_from bzip_move_to bzip_nframes bzip_put \
+					 bzip_put_back bzip_put_endian bzip_put_get bzip_put_pad \
+					 bzip_put_sub bzip_seek bzip_seek_far bzip_sync
 
-CLOSE_TESTS=close close_bad close_discard close_null
+CLOSE_TESTS=close_bad close_close close_discard close_null
 
 CONVERT_TESTS=convert_complex128_complex64 convert_complex128_float64 \
 							convert_complex128_int64 convert_complex128_uint64 \
@@ -128,22 +124,31 @@ CONVERT_TESTS=convert_complex128_complex64 convert_complex128_float64 \
 							convert_uint8_int64 convert_uint8_int8 convert_uint8_uint16 \
 							convert_uint8_uint32 convert_uint8_uint64
 
-CREAT_TESTS=creat creat_excl creat_rdonly
+CREAT_TESTS=creat creat_excl creat_rdonly creat_rdonly_exists
+
+CVLIST_TESTS=cvlist cvlist_array cvlist_array0 cvlist_array_free \
+						 cvlist_array_hidden cvlist_array_meta cvlist_array_meta0 \
+						 cvlist_array_meta_free cvlist_array_meta_hidden cvlist_hidden \
+						 cvlist_invalid cvlist_meta cvlist_meta0 cvlist_meta_hidden \
+						 cvlist_meta_invalid
 
-DEL_TESTS=del del_carray del_carray_deref del_const del_const_deref \
-					del_const_force del_data del_derived del_derived_after \
-					del_derived_force del_meta del_meta_force
+DEL_TESTS=del_alias del_carray del_carray_deref del_const del_const_deref \
+					del_const_force del_data del_data_enoent del_data_open del_derived \
+					del_derived_after del_derived_force del_del del_meta del_meta_force \
+					del_ref
+
+DESYNC_TESTS=desync desync_flush desync_path desync_reopen desync_reopen_inv
 
 DFES_TESTS=dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \
 					 dfes_null dfes_phase dfes_raw dfes_recip dfes_zero
 
-DESYNC_TESTS=desync desync_flush desync_reopen desync_reopen_inv
-
 ELIST_TESTS=elist_alias elist_hidden elist_noalias elist_scalar
 
-ENCODE_TESTS=encode_alter encode_get encode_move
+ENCODE_TESTS=encode_alter encode_alter_all encode_alter_open encode_get \
+						 encode_recode encode_recode_open encode_support
 
-ENDIAN_TESTS=endian_alter endian_alter_sie endian_get endian_move
+ENDIAN_TESTS=endian_alter endian_alter_all endian_alter_sie endian_get \
+						 endian_move
 
 ENTRY_TESTS=entry_bad_code entry_bit entry_bit_scalar entry_divide \
 						entry_invalid entry_lincom entry_lincom_scalar entry_linterp \
@@ -153,33 +158,40 @@ ENTRY_TESTS=entry_bad_code entry_bit entry_bit_scalar entry_divide \
 						entry_scalar_repr entry_recip entry_type entry_type_alias \
 						entry_window entry_window_scalar
 
-EOF_TESTS=eof eof_index eof_lincom eof_phase
+EOF_TESTS=eof eof_bit eof_index eof_lincom eof_phase eof_phase_neg
 
 ERROR_TESTS=error error_error error_num error_short error_verbose \
 						error_verbose_prefix
 
 FILE_TESTS=file file_code file_type
 
-FLIST_TESTS=flist flist_hidden flist_invalid flist_meta flist_meta_hidden \
-						flist_meta_invalid flist_type flist_type_hidden flist_type_invalid \
-						flist_type_meta flist_type_meta_hidden flist_type_meta_invalid
+FLAC_TESTS=flac_add flac_get_big flac_get_far flac_get_get flac_get_get2 \
+					 flac_get_little flac_nframes flac_put_big flac_put_complex128 \
+					 flac_put_float64 flac_put_int32 flac_put_little flac_seek \
+					 flac_seek_far flac_sync
+
+FLIST_TESTS=flist flist0 flist2 flist_hidden flist_invalid flist_meta \
+						flist_meta2 flist_meta_hidden flist_meta_invalid flist_type \
+						flist_type_hidden flist_type_invalid flist_type_meta \
+						flist_type_meta_hidden flist_type_meta_invalid
 
-FLUSH_TESTS=flush flush_all flush_bad_code flush_hex flush_invalid flush_meta \
-						flush_ref flush_spec
+FLUSH_TESTS=flush_all flush_amb_code flush_bad_code flush_flush flush_hex \
+						flush_invalid flush_lincom flush_lincom1 flush_meta flush_mult \
+						flush_raw_close flush_ref flush_spec flush_string flush_sync
 
-FOFFS_TESTS=foffs_alter foffs_get foffs_move
+FOFFS_TESTS=foffs_alter foffs_alter_all foffs_get foffs_move
 
 FRAGMENT_TESTS=fragment_affix fragment_affix_alter fragment_affix_alter2 \
+							 fragment_affix_alter_code fragment_affix_alter_nop \
 							 fragment_affix_dup fragment_index fragment_index_alias \
 							 fragment_name fragment_name_oor fragment_num fragment_parent
 
 GET_TESTS=get64 get_affix get_bad_code get_bit get_carray get_carray_len \
 					get_carray_c2r get_carray_slice get_char get_clincom get_complex128 \
-					get_complex64 get_const get_const_complex get_const_repr \
-					get_cpolynom get_cpolynom1 get_cpolynom_int get_divide \
-					get_divide_ccin get_divide_crin \
-					get_divide_crinr get_divide_rcin get_divide_s get_endian8 \
-					get_endian16 get_endian32 \
+					get_complex64 get_const get_const_carray get_const_complex \
+					get_const_repr get_cpolynom get_cpolynom1 get_cpolynom_int get_dim \
+					get_divide get_divide_ccin get_divide_crin get_divide_crinr \
+					get_divide_rcin get_divide_s get_endian8 get_endian16 get_endian32 \
 					get_endian64 get_endian_complex128_arm get_endian_complex128_big \
 					get_endian_complex128_little get_endian_complex64_arm \
 					get_endian_complex64_big get_endian_complex64_little \
@@ -187,68 +199,88 @@ GET_TESTS=get64 get_affix get_bad_code get_bit get_carray get_carray_len \
 					get_endian_float32_little get_endian_float64_arm \
 					get_endian_float64_big get_endian_float64_little get_ff get_float32 \
 					get_float64 get_foffs get_foffs2 get_fs get_here get_here_foffs \
-					get_heres \
-					get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 \
-					get_lincom2 get_lincom3 get_lincom_noin get_lincom_non \
-					get_lincom_null get_lincom_spf get_linterp get_linterp_noin \
-					get_linterp_notab get_linterp_sort get_mplex get_mplex_bof \
-					get_mplex_lb get_mplex_lball get_mplex_nolb get_multiply \
+					get_heres get_index_complex get_int8 get_int16 get_int32 \
+					get_int64 get_invalid get_lincom1 get_lincom2 get_lincom2s \
+					get_lincom3 get_lincom3s get_lincom_mdt get_lincom_noin \
+					get_lincom_non get_lincom_null get_lincom_spf get_linterp \
+					get_linterp1 get_linterp_abs get_linterp_complex get_linterp_empty \
+					get_linterp_noin get_linterp_notab get_linterp_sort get_mplex \
+					get_mplex_bof get_mplex_complex get_mplex_lb get_mplex_lball \
+					get_mplex_nolb get_mplex_s get_mplex_saved get_multiply \
 					get_multiply_ccin get_multiply_crin get_multiply_crinr \
-					get_multiply_noin get_multiply_rcin get_multiply_s get_nonexistent \
-					get_null get_off64 get_phase \
-					get_phase_affix get_polynom get_polynom_cmpin \
-					get_polynom_noin get_recip \
-					get_recip_const get_recurse get_rofs get_sbit get_sf get_ss get_type \
-					get_uint16 get_uint32 get_uint64 get_window get_window_clr \
-					get_window_ge get_window_gt get_window_le get_window_lt \
-					get_window_ne get_window_set get_zero
+					get_multiply_noin get_multiply_rcin get_multiply_s get_neg get_none \
+					get_nonexistent get_null get_off64 get_phase get_phase_affix \
+					get_polynom get_polynom_cmpin get_polynom_noin get_recip \
+					get_recip_const get_recurse get_rofs get_sbit get_sf get_ss \
+					get_string get_type get_uint16 get_uint32 get_uint64 get_window \
+					get_window_clr get_window_complex get_window_ge get_window_gt \
+					get_window_le get_window_lt get_window_ne get_window_s \
+					get_window_set get_zero get_zero_complex get_zero_float
 
 GLOBAL_TESTS=global_flags global_name global_ref global_ref_empty global_ref_set
 
-GZIP_TESTS=gzip_add gzip_get gzip_get_get gzip_get_get2 gzip_get_put \
-					 gzip_move_from gzip_move_to gzip_nframes gzip_put gzip_put_get
+GZIP_TESTS=gzip_add gzip_del gzip_get gzip_get_far gzip_get_get gzip_get_get2 \
+					 gzip_get_put gzip_move_from gzip_move_to gzip_nframes gzip_put \
+					 gzip_put_back gzip_put_endian gzip_put_get gzip_put_nframes \
+					 gzip_put_off gzip_put_pad gzip_put_sub gzip_seek gzip_seek_far \
+					 gzip_seek_put gzip_sync
 
-HEADER_TESTS=header_complex
+HEADER_TESTS=header_complex header_off64t
 
 HIDE_TESTS=hide hide_hidden hide_unhide
 
-INCLUDE_TESTS=include include_accmode include_affix include_auto include_cb \
-							include_creat include_ignore include_index include_invalid \
-							include_nonexistent include_pc include_ref include_sub \
-							include_syntax
+INCLUDE_TESTS=include_accmode include_affix include_auto include_cb \
+							include_creat include_ignore include_include include_index \
+							include_invalid include_nonexistent include_pc \
+							include_ref include_sub include_syntax
 
-INDEX_TESTS=index index_domain index_range
+INDEX_TESTS=index_domain index_index index_range index_s index_subset
 
 if INCLUDE_LEGACY_API
-LEGACY_TESTS=legacy_get legacy_get_put legacy_get_rofs legacy_nframes \
-			legacy_nonexistent legacy_put legacy_spf
+LEGACY_TESTS=legacy_error legacy_estring legacy_format legacy_get \
+						 legacy_get_put legacy_get_rofs legacy_nframes legacy_nonexistent \
+						 legacy_put legacy_spf
 endif
 
-LZMA_TESTS=lzma_get lzma_nframes
+LZMA_TESTS=lzma_get lzma_nframes lzma_put lzma_xz_add lzma_xz_get \
+					 lzma_xz_get_far lzma_xz_get_get lzma_xz_get_get2 lzma_xz_get_put \
+					 lzma_xz_move_to lzma_xz_nframes lzma_xz_put lzma_xz_put_back \
+					 lzma_xz_put_endian lzma_xz_put_get lzma_xz_put_pad lzma_xz_seek \
+					 lzma_xz_seek_far lzma_xz_sync
 
 MADD_TESTS=madd madd_affix madd_alias madd_alias_affix madd_bit \
 					 madd_bit_invalid madd_carray madd_clincom madd_const madd_cpolynom \
-					 madd_crecip madd_crecip89 madd_divide madd_index madd_lincom \
-					 madd_lincom_invalid madd_linterp madd_linterp_invalid madd_mplex \
-					 madd_multiply madd_multiply_invalid madd_phase madd_phase_invalid \
-					 madd_polynom madd_recip madd_sbit madd_spec madd_spec_directive \
-					 madd_spec_invalid madd_spec_resolv madd_string madd_window
-
-MOVE_TESTS=move move_affix move_affix_dup move_alias 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_affix name_affix_bad name_alias name_dup name_move \
-					 name_move_alias name_updb name_updb_alias name_updb_const \
-					 name_updb_const_alias
+					 madd_crecip madd_crecip89 madd_divide madd_index \
+					 madd_lincom madd_lincom_invalid madd_linterp madd_linterp_invalid \
+					 madd_mplex madd_multiply madd_multiply_invalid madd_phase \
+					 madd_phase_invalid madd_polynom madd_recip madd_sbit \
+					 madd_spec madd_spec_directive madd_spec_invalid \
+					 madd_spec_resolv madd_string madd_window
+
+MOVE_TESTS=move_affix move_affix_dup move_affix_meta move_affix_updb \
+					 move_alias move_data_enc_ar move_data_enc_ra move_data_endian \
+					 move_data_foffs move_data_foffs_neg move_data_nop move_index \
+					 move_meta move_move move_protect move_subdir
+
+NAME_TESTS=name_affix name_affix_bad name_alias name_dangle name_dot5 \
+					 name_dot5r name_dot9 name_dup name_meta name_move name_move_alias \
+					 name_name name_updb name_updb_affix name_updb_alias \
+					 name_updb_carray name_updb_const name_updb_const_alias
+
+NATIVE_TESTS=native_bit native_const native_index native_lincom \
+						 native_lincom_cmpin native_lincom_cmpscal native_linterp \
+						 native_linterp_cmp native_mult native_mult1 native_mult2 \
+						 native_polynom native_polynom_cmpin native_polynom_cmpscal \
+						 native_raw native_phase native_recip native_recip_cmpin \
+						 native_recip_cmpscal native_sbit native_string
 
 NENTRIES_TESTS=nentries_alias nentries_hidden nentries_noalias nentries_scalar
 
-NFIELDS_TESTS=nfields nfields_hidden nfields_invalid nfields_type \
+NFIELDS_TESTS=nfields_hidden nfields_invalid nfields_nfields nfields_type \
 							nfields_type_hidden nfields_type_invalid nfields_vector \
 							nfields_vector_hidden nfields_vector_invalid
 
-NFRAMES_TESTS=nframes nframes64 nframes_empty nframes_invalid \
+NFRAMES_TESTS=nframes64 nframes_empty nframes_invalid nframes_nframes \
 							nframes_off64 nframes_spf
 
 NMETA_TESTS=nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \
@@ -256,10 +288,11 @@ NMETA_TESTS=nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \
 						nmeta_vectors nmeta_vectors_del nmeta_vectors_hidden \
 						nmeta_vectors_invalid nmeta_vectors_parent
 
-OPEN_TESTS=open open_abs open_cb_abort open_cb_cont open_cb_ignore \
-					 open_cb_invalid open_cb_rescan open_eaccess open_nonexistent \
-					 open_notdirfile open_rofs open_sym_a open_sym_al open_sym_at \
-					 open_sym_c open_sym_cl open_sym_ct open_sym_p open_sym_pl open_sym_pt
+OPEN_TESTS=open_abs open_cb_abort open_cb_cont open_cb_ignore open_cb_invalid \
+					 open_cb_rescan open_cb_rescan_alloc open_eaccess open_invalid \
+					 open_nonexistent open_notdirfile open_open open_rofs open_sym_al \
+					 open_sym_at open_sym_c open_sym_cl open_sym_ct open_sym_d \
+					 open_sym_l open_sym_p open_sym_pl open_sym_pt
 
 PARSE_TESTS=parse_alias parse_alias_code parse_alias_dup parse_alias_meta \
 						parse_alias_missing parse_badline parse_bit parse_bit4 \
@@ -272,41 +305,46 @@ PARSE_TESTS=parse_alias parse_alias_code parse_alias_dup parse_alias_meta \
 						parse_foffs_include parse_foffs_slash parse_hex parse_hidden \
 						parse_hidden_field parse_hidden_meta parse_include \
 						parse_include_absolute parse_include_absrel \
-						parse_include_affix_ref parse_include_dir parse_include_loop \
-						parse_include_nonexistent parse_include_prefix \
-						parse_include_prefix_dup parse_include_preprefix \
-						parse_include_ref parse_include_relabs parse_include_relrel \
-						parse_include_slash parse_include_suffix parse_include_sufsuffix \
-						parse_index parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 \
+						parse_include_affix_bad parse_include_affix_ref parse_include_dir \
+						parse_include_loop parse_include_nonexistent parse_include_prefix \
+						parse_include_prefix_dup parse_include_preprefix parse_include_ref \
+						parse_include_relabs parse_include_relrel parse_include_slash \
+						parse_include_suffix parse_include_sufsuffix parse_index \
+						parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 \
 						parse_lincom_nfields parse_lincom_nofields parse_lincom_non \
 						parse_lincom_non_ncols parse_lincom_scalar parse_linterp \
-						parse_linterp_ncols parse_malias parse_malias_dup \
-						parse_malias_meta parse_meta parse_meta_affix parse_meta_alias \
-						parse_meta_implicit parse_meta_implicit2 parse_meta_implicit_affix \
-						parse_meta_index parse_meta_index2 parse_meta_jump \
-						parse_meta_malias parse_meta_meta parse_meta_parent parse_meta_raw \
-						parse_mplex parse_mplex_ncols parse_mplex_nomax parse_mplex_scalar \
+						parse_linterp_ncols parse_literal_cmpbad parse_literal_fltcmp \
+						parse_literal_fltcmp0 parse_literal_intcmp parse_literal_intcmp0 \
+						parse_literal_uintcmp parse_literal_uintcmp0 parse_malias \
+						parse_malias_dup parse_malias_meta parse_meta parse_meta_affix \
+						parse_meta_alias parse_meta_frag parse_meta_implicit \
+						parse_meta_implicit2 parse_meta_implicit_affix parse_meta_index \
+						parse_meta_index2 parse_meta_jump parse_meta_malias \
+						parse_meta_meta parse_meta_parent parse_meta_raw parse_mplex \
+						parse_mplex_ncols parse_mplex_nomax parse_mplex_scalar \
 						parse_multiply parse_multiply_ncols parse_name parse_name_dot \
-						parse_name_ext parse_name_pedantic parse_ncols parse_phase \
-						parse_phase_ncols parse_phase_scalar parse_polynom \
+						parse_name_ext parse_name_pedantic parse_ncols parse_octal_zero \
+						parse_phase parse_phase_ncols parse_phase_scalar parse_polynom \
 						parse_polynom_ncols1 parse_polynom_ncols2 parse_polynom_scalar \
 						parse_protect_all parse_protect_bad parse_protect_data \
 						parse_protect_format parse_protect_none parse_quote \
-						parse_quote_mismatch parse_raw parse_raw_char parse_raw_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_utf8 parse_utf8_invalid \
-						parse_utf8_zero parse_version \
-						parse_version_89 parse_version_98 parse_version_include \
-						parse_version_permissive parse_version_p8 parse_version_p9 \
-						parse_version_slash parse_whitespace parse_window \
-						parse_window_ncols parse_window_op parse_window_scalar
-
-PROTECT_TESTS=protect_alter protect_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 \
+						parse_quote_mismatch parse_raw parse_raw_char parse_raw_char_bad \
+						parse_raw_ncols parse_raw_scalar parse_raw_spf parse_raw_type \
+						parse_recip parse_ref parse_ref_nonexistent parse_sbit \
+						parse_scalar1 parse_scalar2 parse_scalar_repr parse_sort \
+						parse_string parse_string_ncols parse_string_null parse_utf8 \
+						parse_utf8_invalid parse_utf8_zero parse_version parse_version_89 \
+						parse_version_98 parse_version_include parse_version_permissive \
+						parse_version_p8 parse_version_p9 parse_version_slash \
+						parse_whitespace parse_window parse_window_ncols parse_window_op \
+						parse_window_scalar
+
+PROTECT_TESTS=protect_alter protect_alter_all protect_get
+
+PUT_TESTS=put64 put_bad_code put_bit put_bof put_carray put_carray_client \
+					put_carray_slice put_char put_clincom1 put_complex128 put_complex64 \
+					put_const put_const_protect put_cpolynom put_crecip put_divide \
+					put_endian8 put_endian16 put_endian32 put_endian64 \
 					put_endian_complex128_arm put_endian_complex128_big \
 					put_endian_complex128_little put_endian_complex64_arm \
 					put_endian_complex64_big put_endian_complex64_little \
@@ -316,46 +354,46 @@ PUT_TESTS=put64 put_bad_code put_bit put_bof put_carray put_carray_slice \
 					put_float64 put_foffs put_fs put_here put_heres put_int8 put_int16 \
 					put_int32 put_int64 put_invalid put_lincom1 put_lincom2 \
 					put_lincom_noin put_linterp put_linterp_noin put_linterp_nomono \
-					put_linterp_notab put_linterp_reverse put_mplex put_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 \
-					put_window put_zero
+					put_linterp_notab put_linterp_reverse put_mplex put_mplex_complex \
+					put_multiply put_nofile put_null put_off64 put_phase put_phase_noin \
+					put_polynom1 put_polynom2 put_polynom_noin put_protect put_rdonly \
+					put_recip put_recurse put_repr put_rofs put_sbit put_sf put_ss \
+					put_string put_string_protect put_sub put_type put_uint16 put_uint32 \
+					put_uint64 put_window put_zero
 
 REF_TESTS=ref ref_none ref_two
 
-REPR_TESTS=repr_a repr_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
+REPR_TESTS=repr_a repr_bad repr_float32 repr_float64 repr_i repr_int16 \
+					 repr_int32 repr_int64 repr_int8 repr_m repr_r repr_real_a \
+					 repr_real_i repr_real_m repr_real_r repr_uint16 repr_uint32 \
+					 repr_uint64 repr_uint8
 
-SEEK_TESTS=seek64 seek_cur seek_end seek_foffs seek_foffs2 seek_neg seek_set
+SEEK_TESTS=seek64 seek_cur seek_end seek_far seek_foffs seek_foffs2 seek_index \
+					 seek_lincom seek_mult seek_neg seek_phase seek_set seek_sub
 
 SIE_TESTS=sie_get_big sie_get_little sie_move_from sie_move_to sie_nframes_big \
-					sie_nframes_little sie_put_big sie_put_append sie_put_append2 \
-					sie_put_back sie_put_little sie_put_many sie_put_newo sie_put_newo0 \
+					sie_nframes_little sie_put_append sie_put_append2 sie_put_back \
+					sie_put_big sie_put_little sie_put_many sie_put_newo sie_put_newo0 \
 					sie_put_pad sie_put_pad0 sie_put_trunc sie_put_trunc2 \
-					sie_put_trunc_nf sie_sync
+					sie_put_trunc_nf sie_seek sie_seek_far sie_sync
 
-SLIM_TESTS=slim_get slim_nframes
+SLIM_TESTS=slim_get slim_nframes slim_seek slim_seek_far
 
-SVLIST_TESTS=svlist svlist_hidden svlist_invalid svlist_meta \
-						 svlist_meta_hidden svlist_meta_invalid
+SVLIST_TESTS=svlist svlist0 svlist2 svlist_hidden svlist_invalid svlist_meta \
+						 svlist_meta0 svlist_meta_hidden svlist_meta_invalid
 
-SPF_TESTS=spf spf_alias spf_alias_missing spf_alias_meta \
-					spf_divide spf_lincom spf_multiply \
-					spf_polynom spf_recip spf_recurse
+SPF_TESTS=spf_alias spf_alias_missing spf_alias_meta spf_divide spf_lincom \
+					spf_multiply spf_polynom spf_raw spf_recip spf_recurse
 
 TABLE_TESTS=table table_code table_type
 
-TELL_TESTS=tell tell64 tell_multidiv
+TELL_TESTS=tell tell64 tell_multidiv tell_sub
 
 TOK_TESTS=tok_arg tok_escape tok_quote
 
 TRUNC_TESTS=trunc trunc_dir trunc_rdonly trunc_rofs trunc_truncsub
 
-UNCLUDE_TESTS=unclude unclude_del unclude_move
+UNCLUDE_TESTS=unclude unclude_del unclude_move unclude_open
 
 VERSION_TESTS=version_0 version_0_write version_1 version_1_write version_2 \
 							version_2_write version_3 version_3_write version_4 \
@@ -367,28 +405,26 @@ VERSION_TESTS=version_0 version_0_write version_1 version_1_write version_2 \
 VLIST_TESTS=vlist vlist_alias vlist_hidden vlist_invalid vlist_meta \
 						vlist_meta_hidden vlist_meta_invalid
 
-XZ_TESTS=xz_get xz_nframes
-
-ZZIP_TESTS=zzip_data zzip_get zzip_get_get zzip_nframes
+ZZIP_TESTS=zzip_data zzip_get zzip_get_get zzip_nframes zzip_seek zzip_seek_far
 
-ZZSLIM_TESTS=zzslim_get zzslim_nframes
+ZZSLIM_TESTS=zzslim_get zzslim_nframes zzslim_seek zzslim_seek_far
 
 TESTS=$(ADD_TESTS)      $(ALIAS_TESTS)    $(ALTER_TESTS)    $(ASCII_TESTS)    \
 			$(BOF_TESTS)      $(BZIP_TESTS)     $(CLOSE_TESTS)    $(CONVERT_TESTS)  \
 			$(CREAT_TESTS)    $(CVLIST_TESTS)   $(DEL_TESTS)      $(DFES_TESTS)     \
 			$(DESYNC_TESTS)   $(ELIST_TESTS)    $(ENCODE_TESTS)   $(ENDIAN_TESTS)   \
 			$(ENTRY_TESTS)    $(EOF_TESTS)      $(ERROR_TESTS)    $(FILE_TESTS)     \
-			$(FLIST_TESTS)    $(FLUSH_TESTS)    $(FOFFS_TESTS)    $(FRAGMENT_TESTS) \
-			$(GET_TESTS)      $(GLOBAL_TESTS)   $(GZIP_TESTS)     $(HEADER_TESTS)   \
-			$(HIDE_TESTS)     $(INCLUDE_TESTS)  $(INDEX_TESTS)    $(LEGACY_TESTS)   \
-			$(LZMA_TESTS)     $(MADD_TESTS)     $(MOVE_TESTS)     $(NAME_TESTS)     \
-			$(NENTRIES_TESTS) $(NFIELDS_TESTS)  $(NFRAMES_TESTS)  $(NMETA_TESTS)    \
-			$(OPEN_TESTS)     $(PARSE_TESTS)    $(PROTECT_TESTS)  $(PUT_TESTS)      \
-			$(REF_TESTS)      $(REPR_TESTS)     $(SEEK_TESTS)     $(SIE_TESTS)      \
-			$(SLIM_TESTS)     $(SPF_TESTS)      $(SVLIST_TESTS)   $(TABLE_TESTS)    \
-			$(TELL_TESTS)     $(TOK_TESTS)      $(TRUNC_TESTS)    $(UNCLUDE_TESTS)  \
-			$(VERSION_TESTS)  $(VLIST_TESTS)    $(XZ_TESTS)       $(ZZIP_TESTS)     \
-			$(ZZSLIM_TESTS)
+			$(FLAC_TESTS)     $(FLIST_TESTS)    $(FLUSH_TESTS)    $(FOFFS_TESTS)    \
+			$(FRAGMENT_TESTS) $(GET_TESTS)      $(GLOBAL_TESTS)   $(GZIP_TESTS)     \
+			$(HEADER_TESTS)   $(HIDE_TESTS)     $(INCLUDE_TESTS)  $(INDEX_TESTS)    \
+			$(LEGACY_TESTS)   $(LZMA_TESTS)     $(MADD_TESTS)     $(MOVE_TESTS)     \
+			$(NAME_TESTS)     $(NATIVE_TESTS)   $(NENTRIES_TESTS) $(NFIELDS_TESTS)  \
+			$(NFRAMES_TESTS)  $(NMETA_TESTS)    $(OPEN_TESTS)     $(PARSE_TESTS)    \
+			$(PROTECT_TESTS)  $(PUT_TESTS)      $(REF_TESTS)      $(REPR_TESTS)     \
+			$(SEEK_TESTS)     $(SIE_TESTS)      $(SLIM_TESTS)     $(SPF_TESTS)      \
+			$(SVLIST_TESTS)   $(TABLE_TESTS)    $(TELL_TESTS)     $(TOK_TESTS)      \
+			$(TRUNC_TESTS)    $(UNCLUDE_TESTS)  $(VERSION_TESTS)  $(VLIST_TESTS)    \
+			$(ZZIP_TESTS)     $(ZZSLIM_TESTS)
 
 check_PROGRAMS=$(TESTS)
 
diff --git a/test/Makefile.in b/test/Makefile.in
index dac0099..8882142 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -97,8 +97,8 @@ TESTS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
 	$(am__EXEEXT_52) $(am__EXEEXT_53) $(am__EXEEXT_54) \
 	$(am__EXEEXT_55) $(am__EXEEXT_56) $(am__EXEEXT_57) \
 	$(am__EXEEXT_58) $(am__EXEEXT_59) $(am__EXEEXT_60) \
-	$(am__EXEEXT_61)
-check_PROGRAMS = $(am__EXEEXT_62)
+	$(am__EXEEXT_61) $(am__EXEEXT_62)
+check_PROGRAMS = $(am__EXEEXT_63)
 subdir = test
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
@@ -106,10 +106,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -119,17 +117,18 @@ CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
 	$(top_builddir)/src/getdata.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am__EXEEXT_1 = add$(EXEEXT) add_affix$(EXEEXT) add_alias$(EXEEXT) \
+am__EXEEXT_1 = add_add$(EXEEXT) add_affix$(EXEEXT) add_alias$(EXEEXT) \
 	add_alias_affix$(EXEEXT) add_alias_meta$(EXEEXT) \
-	add_bit$(EXEEXT) add_bit_bitnum$(EXEEXT) \
-	add_bit_bitsize$(EXEEXT) add_bit_invalid$(EXEEXT) \
-	add_bit_numbits$(EXEEXT) add_bit_scalars$(EXEEXT) \
-	add_carray$(EXEEXT) add_clincom$(EXEEXT) add_code$(EXEEXT) \
-	add_const$(EXEEXT) add_cpolynom$(EXEEXT) add_crecip$(EXEEXT) \
+	add_amb_code7$(EXEEXT) add_bit$(EXEEXT) \
+	add_bit_bitnum$(EXEEXT) add_bit_bitsize$(EXEEXT) \
+	add_bit_invalid$(EXEEXT) add_bit_numbits$(EXEEXT) \
+	add_bit_scalars$(EXEEXT) add_carray$(EXEEXT) \
+	add_clincom$(EXEEXT) add_code$(EXEEXT) add_const$(EXEEXT) \
+	add_cpolynom$(EXEEXT) add_crecip$(EXEEXT) \
 	add_crecip89$(EXEEXT) add_dangle_dup$(EXEEXT) \
 	add_divide$(EXEEXT) add_divide_invalid$(EXEEXT) \
-	add_duplicate$(EXEEXT) add_format$(EXEEXT) \
-	add_invalid$(EXEEXT) add_lincom$(EXEEXT) \
+	add_dot5$(EXEEXT) add_dot6$(EXEEXT) add_duplicate$(EXEEXT) \
+	add_format$(EXEEXT) add_invalid$(EXEEXT) add_lincom$(EXEEXT) \
 	add_lincom_affix$(EXEEXT) add_lincom_invalid$(EXEEXT) \
 	add_lincom_nfields$(EXEEXT) add_linterp$(EXEEXT) \
 	add_linterp_invalid$(EXEEXT) add_meta$(EXEEXT) \
@@ -140,9 +139,9 @@ am__EXEEXT_1 = add$(EXEEXT) add_affix$(EXEEXT) add_alias$(EXEEXT) \
 	add_polynom_scalar$(EXEEXT) add_protect$(EXEEXT) \
 	add_raw$(EXEEXT) add_raw_include$(EXEEXT) \
 	add_raw_invalid$(EXEEXT) add_raw_spf$(EXEEXT) \
-	add_raw_spf_scalar$(EXEEXT) add_raw_type$(EXEEXT) \
-	add_rdonly$(EXEEXT) add_recip$(EXEEXT) add_resolv$(EXEEXT) \
-	add_sbit$(EXEEXT) add_scalar$(EXEEXT) \
+	add_raw_spf_scalar$(EXEEXT) add_raw_sub$(EXEEXT) \
+	add_raw_type$(EXEEXT) add_rdonly$(EXEEXT) add_recip$(EXEEXT) \
+	add_resolv$(EXEEXT) add_sbit$(EXEEXT) add_scalar$(EXEEXT) \
 	add_scalar_carray$(EXEEXT) add_scalar_carray_bad$(EXEEXT) \
 	add_sort$(EXEEXT) add_spec$(EXEEXT) \
 	add_spec_directive$(EXEEXT) add_spec_invalid$(EXEEXT) \
@@ -156,33 +155,49 @@ am__EXEEXT_2 = alias_list$(EXEEXT) alias_list_alias$(EXEEXT) \
 	alias_target_missing$(EXEEXT)
 am__EXEEXT_3 = alter_bit_bitnum$(EXEEXT) alter_bit_numbits$(EXEEXT) \
 	alter_carray_len$(EXEEXT) alter_carray_type$(EXEEXT) \
-	alter_const$(EXEEXT) alter_const_c2r$(EXEEXT) \
-	alter_cpolynom$(EXEEXT) alter_crecip$(EXEEXT) \
-	alter_crecip89$(EXEEXT) alter_crecip_zero$(EXEEXT) \
-	alter_divide$(EXEEXT) alter_entry$(EXEEXT) \
-	alter_entry_affix$(EXEEXT) alter_entry_hidden$(EXEEXT) \
-	alter_entry_recode$(EXEEXT) alter_entry_scalar2a$(EXEEXT) \
+	alter_clincom$(EXEEXT) alter_const$(EXEEXT) \
+	alter_const_c2r$(EXEEXT) alter_const_r2c$(EXEEXT) \
+	alter_const_r2r$(EXEEXT) alter_cpolynom$(EXEEXT) \
+	alter_cpolynom_null$(EXEEXT) alter_crecip$(EXEEXT) \
+	alter_crecip89$(EXEEXT) alter_crecip89_null$(EXEEXT) \
+	alter_crecip_zero$(EXEEXT) alter_divide$(EXEEXT) \
+	alter_entry$(EXEEXT) alter_entry_affix$(EXEEXT) \
+	alter_entry_hidden$(EXEEXT) alter_entry_lincom$(EXEEXT) \
+	alter_entry_recode$(EXEEXT) alter_entry_recode_recalc$(EXEEXT) \
+	alter_entry_scalar1$(EXEEXT) alter_entry_scalar2a$(EXEEXT) \
 	alter_entry_scalar2n$(EXEEXT) alter_entry_scalar3$(EXEEXT) \
-	alter_entry_scalar4$(EXEEXT) alter_lincom_23$(EXEEXT) \
-	alter_lincom_32$(EXEEXT) alter_lincom_affix$(EXEEXT) \
-	alter_lincom_input$(EXEEXT) alter_lincom_offset$(EXEEXT) \
-	alter_lincom_slope$(EXEEXT) alter_linterp$(EXEEXT) \
-	alter_linterp_move$(EXEEXT) alter_mplex$(EXEEXT) \
-	alter_mspec$(EXEEXT) alter_mspec_affix$(EXEEXT) \
-	alter_multiply$(EXEEXT) alter_phase$(EXEEXT) \
-	alter_polynom_coeff$(EXEEXT) alter_polynom_input$(EXEEXT) \
-	alter_polynom_ord$(EXEEXT) alter_raw_spf$(EXEEXT) \
-	alter_raw_type$(EXEEXT) alter_recip$(EXEEXT) \
-	alter_recip_zero$(EXEEXT) alter_scalar_affix$(EXEEXT) \
-	alter_spec$(EXEEXT) alter_spec_affix$(EXEEXT) \
-	alter_spec_meta$(EXEEXT) alter_window$(EXEEXT)
+	alter_entry_scalar3c$(EXEEXT) alter_entry_scalar4$(EXEEXT) \
+	alter_entry_scalar_amb$(EXEEXT) alter_index$(EXEEXT) \
+	alter_lincom_23$(EXEEXT) alter_lincom_32$(EXEEXT) \
+	alter_lincom_affix$(EXEEXT) alter_lincom_input$(EXEEXT) \
+	alter_lincom_offset$(EXEEXT) alter_lincom_slope$(EXEEXT) \
+	alter_linterp$(EXEEXT) alter_linterp_move$(EXEEXT) \
+	alter_mplex$(EXEEXT) alter_mspec$(EXEEXT) \
+	alter_mspec_affix$(EXEEXT) alter_multiply$(EXEEXT) \
+	alter_phase$(EXEEXT) alter_polynom_coeff$(EXEEXT) \
+	alter_polynom_input$(EXEEXT) alter_polynom_ord$(EXEEXT) \
+	alter_raw_spf$(EXEEXT) alter_raw_type$(EXEEXT) \
+	alter_recip$(EXEEXT) alter_recip_zero$(EXEEXT) \
+	alter_scalar_affix$(EXEEXT) alter_spec$(EXEEXT) \
+	alter_spec_affix$(EXEEXT) alter_spec_meta$(EXEEXT) \
+	alter_spec_polynom$(EXEEXT) alter_window$(EXEEXT)
 am__EXEEXT_4 = ascii_add$(EXEEXT) ascii_get$(EXEEXT) \
-	ascii_get_get$(EXEEXT) ascii_nframes$(EXEEXT) \
-	ascii_put$(EXEEXT)
-am__EXEEXT_5 = bof$(EXEEXT) bof_lincom$(EXEEXT) bof_phase$(EXEEXT)
-am__EXEEXT_6 = bzip_get$(EXEEXT) bzip_get_get$(EXEEXT) \
-	bzip_move_from$(EXEEXT) bzip_nframes$(EXEEXT)
-am__EXEEXT_7 = close$(EXEEXT) close_bad$(EXEEXT) \
+	ascii_get_complex$(EXEEXT) ascii_get_get$(EXEEXT) \
+	ascii_get_here$(EXEEXT) ascii_get_sub$(EXEEXT) \
+	ascii_nframes$(EXEEXT) ascii_put$(EXEEXT) \
+	ascii_put_here$(EXEEXT) ascii_seek$(EXEEXT) \
+	ascii_seek_far$(EXEEXT) ascii_sync$(EXEEXT)
+am__EXEEXT_5 = bof$(EXEEXT) bof_bit$(EXEEXT) bof_index$(EXEEXT) \
+	bof_lincom$(EXEEXT) bof_phase$(EXEEXT) bof_phase_neg$(EXEEXT)
+am__EXEEXT_6 = bzip_add$(EXEEXT) bzip_get$(EXEEXT) \
+	bzip_get_far$(EXEEXT) bzip_get_get$(EXEEXT) \
+	bzip_get_get2$(EXEEXT) bzip_get_put$(EXEEXT) \
+	bzip_move_from$(EXEEXT) bzip_move_to$(EXEEXT) \
+	bzip_nframes$(EXEEXT) bzip_put$(EXEEXT) bzip_put_back$(EXEEXT) \
+	bzip_put_endian$(EXEEXT) bzip_put_get$(EXEEXT) \
+	bzip_put_pad$(EXEEXT) bzip_put_sub$(EXEEXT) bzip_seek$(EXEEXT) \
+	bzip_seek_far$(EXEEXT) bzip_sync$(EXEEXT)
+am__EXEEXT_7 = close_bad$(EXEEXT) close_close$(EXEEXT) \
 	close_discard$(EXEEXT) close_null$(EXEEXT)
 am__EXEEXT_8 = convert_complex128_complex64$(EXEEXT) \
 	convert_complex128_float64$(EXEEXT) \
@@ -261,30 +276,39 @@ am__EXEEXT_8 = convert_complex128_complex64$(EXEEXT) \
 	convert_uint8_uint16$(EXEEXT) convert_uint8_uint32$(EXEEXT) \
 	convert_uint8_uint64$(EXEEXT)
 am__EXEEXT_9 = creat$(EXEEXT) creat_excl$(EXEEXT) \
-	creat_rdonly$(EXEEXT)
+	creat_rdonly$(EXEEXT) creat_rdonly_exists$(EXEEXT)
 am__EXEEXT_10 = cvlist$(EXEEXT) cvlist_array$(EXEEXT) \
+	cvlist_array0$(EXEEXT) cvlist_array_free$(EXEEXT) \
 	cvlist_array_hidden$(EXEEXT) cvlist_array_meta$(EXEEXT) \
+	cvlist_array_meta0$(EXEEXT) cvlist_array_meta_free$(EXEEXT) \
 	cvlist_array_meta_hidden$(EXEEXT) cvlist_hidden$(EXEEXT) \
 	cvlist_invalid$(EXEEXT) cvlist_meta$(EXEEXT) \
-	cvlist_meta_hidden$(EXEEXT) cvlist_meta_invalid$(EXEEXT)
-am__EXEEXT_11 = del$(EXEEXT) del_carray$(EXEEXT) \
+	cvlist_meta0$(EXEEXT) cvlist_meta_hidden$(EXEEXT) \
+	cvlist_meta_invalid$(EXEEXT)
+am__EXEEXT_11 = del_alias$(EXEEXT) del_carray$(EXEEXT) \
 	del_carray_deref$(EXEEXT) del_const$(EXEEXT) \
 	del_const_deref$(EXEEXT) del_const_force$(EXEEXT) \
-	del_data$(EXEEXT) del_derived$(EXEEXT) \
+	del_data$(EXEEXT) del_data_enoent$(EXEEXT) \
+	del_data_open$(EXEEXT) del_derived$(EXEEXT) \
 	del_derived_after$(EXEEXT) del_derived_force$(EXEEXT) \
-	del_meta$(EXEEXT) del_meta_force$(EXEEXT)
+	del_del$(EXEEXT) del_meta$(EXEEXT) del_meta_force$(EXEEXT) \
+	del_ref$(EXEEXT)
 am__EXEEXT_12 = dfes_bit$(EXEEXT) dfes_divide$(EXEEXT) \
 	dfes_lincom$(EXEEXT) dfes_linterp$(EXEEXT) \
 	dfes_multiply$(EXEEXT) dfes_null$(EXEEXT) dfes_phase$(EXEEXT) \
 	dfes_raw$(EXEEXT) dfes_recip$(EXEEXT) dfes_zero$(EXEEXT)
 am__EXEEXT_13 = desync$(EXEEXT) desync_flush$(EXEEXT) \
-	desync_reopen$(EXEEXT) desync_reopen_inv$(EXEEXT)
+	desync_path$(EXEEXT) desync_reopen$(EXEEXT) \
+	desync_reopen_inv$(EXEEXT)
 am__EXEEXT_14 = elist_alias$(EXEEXT) elist_hidden$(EXEEXT) \
 	elist_noalias$(EXEEXT) elist_scalar$(EXEEXT)
-am__EXEEXT_15 = encode_alter$(EXEEXT) encode_get$(EXEEXT) \
-	encode_move$(EXEEXT)
-am__EXEEXT_16 = endian_alter$(EXEEXT) endian_alter_sie$(EXEEXT) \
-	endian_get$(EXEEXT) endian_move$(EXEEXT)
+am__EXEEXT_15 = encode_alter$(EXEEXT) encode_alter_all$(EXEEXT) \
+	encode_alter_open$(EXEEXT) encode_get$(EXEEXT) \
+	encode_recode$(EXEEXT) encode_recode_open$(EXEEXT) \
+	encode_support$(EXEEXT)
+am__EXEEXT_16 = endian_alter$(EXEEXT) endian_alter_all$(EXEEXT) \
+	endian_alter_sie$(EXEEXT) endian_get$(EXEEXT) \
+	endian_move$(EXEEXT)
 am__EXEEXT_17 = entry_bad_code$(EXEEXT) entry_bit$(EXEEXT) \
 	entry_bit_scalar$(EXEEXT) entry_divide$(EXEEXT) \
 	entry_invalid$(EXEEXT) entry_lincom$(EXEEXT) \
@@ -298,44 +322,58 @@ am__EXEEXT_17 = entry_bad_code$(EXEEXT) entry_bit$(EXEEXT) \
 	entry_recip$(EXEEXT) entry_type$(EXEEXT) \
 	entry_type_alias$(EXEEXT) entry_window$(EXEEXT) \
 	entry_window_scalar$(EXEEXT)
-am__EXEEXT_18 = eof$(EXEEXT) eof_index$(EXEEXT) eof_lincom$(EXEEXT) \
-	eof_phase$(EXEEXT)
+am__EXEEXT_18 = eof$(EXEEXT) eof_bit$(EXEEXT) eof_index$(EXEEXT) \
+	eof_lincom$(EXEEXT) eof_phase$(EXEEXT) eof_phase_neg$(EXEEXT)
 am__EXEEXT_19 = error$(EXEEXT) error_error$(EXEEXT) error_num$(EXEEXT) \
 	error_short$(EXEEXT) error_verbose$(EXEEXT) \
 	error_verbose_prefix$(EXEEXT)
 am__EXEEXT_20 = file$(EXEEXT) file_code$(EXEEXT) file_type$(EXEEXT)
-am__EXEEXT_21 = flist$(EXEEXT) flist_hidden$(EXEEXT) \
-	flist_invalid$(EXEEXT) flist_meta$(EXEEXT) \
+am__EXEEXT_21 = flac_add$(EXEEXT) flac_get_big$(EXEEXT) \
+	flac_get_far$(EXEEXT) flac_get_get$(EXEEXT) \
+	flac_get_get2$(EXEEXT) flac_get_little$(EXEEXT) \
+	flac_nframes$(EXEEXT) flac_put_big$(EXEEXT) \
+	flac_put_complex128$(EXEEXT) flac_put_float64$(EXEEXT) \
+	flac_put_int32$(EXEEXT) flac_put_little$(EXEEXT) \
+	flac_seek$(EXEEXT) flac_seek_far$(EXEEXT) flac_sync$(EXEEXT)
+am__EXEEXT_22 = flist$(EXEEXT) flist0$(EXEEXT) flist2$(EXEEXT) \
+	flist_hidden$(EXEEXT) flist_invalid$(EXEEXT) \
+	flist_meta$(EXEEXT) flist_meta2$(EXEEXT) \
 	flist_meta_hidden$(EXEEXT) flist_meta_invalid$(EXEEXT) \
 	flist_type$(EXEEXT) flist_type_hidden$(EXEEXT) \
 	flist_type_invalid$(EXEEXT) flist_type_meta$(EXEEXT) \
 	flist_type_meta_hidden$(EXEEXT) \
 	flist_type_meta_invalid$(EXEEXT)
-am__EXEEXT_22 = flush$(EXEEXT) flush_all$(EXEEXT) \
-	flush_bad_code$(EXEEXT) flush_hex$(EXEEXT) \
-	flush_invalid$(EXEEXT) flush_meta$(EXEEXT) flush_ref$(EXEEXT) \
-	flush_spec$(EXEEXT)
-am__EXEEXT_23 = foffs_alter$(EXEEXT) foffs_get$(EXEEXT) \
-	foffs_move$(EXEEXT)
-am__EXEEXT_24 = fragment_affix$(EXEEXT) fragment_affix_alter$(EXEEXT) \
-	fragment_affix_alter2$(EXEEXT) fragment_affix_dup$(EXEEXT) \
+am__EXEEXT_23 = flush_all$(EXEEXT) flush_amb_code$(EXEEXT) \
+	flush_bad_code$(EXEEXT) flush_flush$(EXEEXT) \
+	flush_hex$(EXEEXT) flush_invalid$(EXEEXT) \
+	flush_lincom$(EXEEXT) flush_lincom1$(EXEEXT) \
+	flush_meta$(EXEEXT) flush_mult$(EXEEXT) \
+	flush_raw_close$(EXEEXT) flush_ref$(EXEEXT) \
+	flush_spec$(EXEEXT) flush_string$(EXEEXT) flush_sync$(EXEEXT)
+am__EXEEXT_24 = foffs_alter$(EXEEXT) foffs_alter_all$(EXEEXT) \
+	foffs_get$(EXEEXT) foffs_move$(EXEEXT)
+am__EXEEXT_25 = fragment_affix$(EXEEXT) fragment_affix_alter$(EXEEXT) \
+	fragment_affix_alter2$(EXEEXT) \
+	fragment_affix_alter_code$(EXEEXT) \
+	fragment_affix_alter_nop$(EXEEXT) fragment_affix_dup$(EXEEXT) \
 	fragment_index$(EXEEXT) fragment_index_alias$(EXEEXT) \
 	fragment_name$(EXEEXT) fragment_name_oor$(EXEEXT) \
 	fragment_num$(EXEEXT) fragment_parent$(EXEEXT)
-am__EXEEXT_25 = get64$(EXEEXT) get_affix$(EXEEXT) \
+am__EXEEXT_26 = get64$(EXEEXT) get_affix$(EXEEXT) \
 	get_bad_code$(EXEEXT) get_bit$(EXEEXT) get_carray$(EXEEXT) \
 	get_carray_len$(EXEEXT) get_carray_c2r$(EXEEXT) \
 	get_carray_slice$(EXEEXT) get_char$(EXEEXT) \
 	get_clincom$(EXEEXT) get_complex128$(EXEEXT) \
 	get_complex64$(EXEEXT) get_const$(EXEEXT) \
-	get_const_complex$(EXEEXT) get_const_repr$(EXEEXT) \
-	get_cpolynom$(EXEEXT) get_cpolynom1$(EXEEXT) \
-	get_cpolynom_int$(EXEEXT) get_divide$(EXEEXT) \
-	get_divide_ccin$(EXEEXT) get_divide_crin$(EXEEXT) \
-	get_divide_crinr$(EXEEXT) get_divide_rcin$(EXEEXT) \
-	get_divide_s$(EXEEXT) get_endian8$(EXEEXT) \
-	get_endian16$(EXEEXT) get_endian32$(EXEEXT) \
-	get_endian64$(EXEEXT) get_endian_complex128_arm$(EXEEXT) \
+	get_const_carray$(EXEEXT) get_const_complex$(EXEEXT) \
+	get_const_repr$(EXEEXT) get_cpolynom$(EXEEXT) \
+	get_cpolynom1$(EXEEXT) get_cpolynom_int$(EXEEXT) \
+	get_dim$(EXEEXT) get_divide$(EXEEXT) get_divide_ccin$(EXEEXT) \
+	get_divide_crin$(EXEEXT) get_divide_crinr$(EXEEXT) \
+	get_divide_rcin$(EXEEXT) get_divide_s$(EXEEXT) \
+	get_endian8$(EXEEXT) get_endian16$(EXEEXT) \
+	get_endian32$(EXEEXT) get_endian64$(EXEEXT) \
+	get_endian_complex128_arm$(EXEEXT) \
 	get_endian_complex128_big$(EXEEXT) \
 	get_endian_complex128_little$(EXEEXT) \
 	get_endian_complex64_arm$(EXEEXT) \
@@ -349,61 +387,86 @@ am__EXEEXT_25 = get64$(EXEEXT) get_affix$(EXEEXT) \
 	get_endian_float64_little$(EXEEXT) get_ff$(EXEEXT) \
 	get_float32$(EXEEXT) get_float64$(EXEEXT) get_foffs$(EXEEXT) \
 	get_foffs2$(EXEEXT) get_fs$(EXEEXT) get_here$(EXEEXT) \
-	get_here_foffs$(EXEEXT) get_heres$(EXEEXT) get_int8$(EXEEXT) \
+	get_here_foffs$(EXEEXT) get_heres$(EXEEXT) \
+	get_index_complex$(EXEEXT) get_int8$(EXEEXT) \
 	get_int16$(EXEEXT) get_int32$(EXEEXT) get_int64$(EXEEXT) \
 	get_invalid$(EXEEXT) get_lincom1$(EXEEXT) get_lincom2$(EXEEXT) \
-	get_lincom3$(EXEEXT) get_lincom_noin$(EXEEXT) \
-	get_lincom_non$(EXEEXT) get_lincom_null$(EXEEXT) \
-	get_lincom_spf$(EXEEXT) get_linterp$(EXEEXT) \
-	get_linterp_noin$(EXEEXT) get_linterp_notab$(EXEEXT) \
-	get_linterp_sort$(EXEEXT) get_mplex$(EXEEXT) \
-	get_mplex_bof$(EXEEXT) get_mplex_lb$(EXEEXT) \
+	get_lincom2s$(EXEEXT) get_lincom3$(EXEEXT) \
+	get_lincom3s$(EXEEXT) get_lincom_mdt$(EXEEXT) \
+	get_lincom_noin$(EXEEXT) get_lincom_non$(EXEEXT) \
+	get_lincom_null$(EXEEXT) get_lincom_spf$(EXEEXT) \
+	get_linterp$(EXEEXT) get_linterp1$(EXEEXT) \
+	get_linterp_abs$(EXEEXT) get_linterp_complex$(EXEEXT) \
+	get_linterp_empty$(EXEEXT) get_linterp_noin$(EXEEXT) \
+	get_linterp_notab$(EXEEXT) get_linterp_sort$(EXEEXT) \
+	get_mplex$(EXEEXT) get_mplex_bof$(EXEEXT) \
+	get_mplex_complex$(EXEEXT) get_mplex_lb$(EXEEXT) \
 	get_mplex_lball$(EXEEXT) get_mplex_nolb$(EXEEXT) \
+	get_mplex_s$(EXEEXT) get_mplex_saved$(EXEEXT) \
 	get_multiply$(EXEEXT) get_multiply_ccin$(EXEEXT) \
 	get_multiply_crin$(EXEEXT) get_multiply_crinr$(EXEEXT) \
 	get_multiply_noin$(EXEEXT) get_multiply_rcin$(EXEEXT) \
-	get_multiply_s$(EXEEXT) get_nonexistent$(EXEEXT) \
-	get_null$(EXEEXT) get_off64$(EXEEXT) get_phase$(EXEEXT) \
-	get_phase_affix$(EXEEXT) get_polynom$(EXEEXT) \
-	get_polynom_cmpin$(EXEEXT) get_polynom_noin$(EXEEXT) \
-	get_recip$(EXEEXT) get_recip_const$(EXEEXT) \
-	get_recurse$(EXEEXT) get_rofs$(EXEEXT) get_sbit$(EXEEXT) \
-	get_sf$(EXEEXT) get_ss$(EXEEXT) get_type$(EXEEXT) \
+	get_multiply_s$(EXEEXT) get_neg$(EXEEXT) get_none$(EXEEXT) \
+	get_nonexistent$(EXEEXT) get_null$(EXEEXT) get_off64$(EXEEXT) \
+	get_phase$(EXEEXT) get_phase_affix$(EXEEXT) \
+	get_polynom$(EXEEXT) get_polynom_cmpin$(EXEEXT) \
+	get_polynom_noin$(EXEEXT) get_recip$(EXEEXT) \
+	get_recip_const$(EXEEXT) get_recurse$(EXEEXT) \
+	get_rofs$(EXEEXT) get_sbit$(EXEEXT) get_sf$(EXEEXT) \
+	get_ss$(EXEEXT) get_string$(EXEEXT) get_type$(EXEEXT) \
 	get_uint16$(EXEEXT) get_uint32$(EXEEXT) get_uint64$(EXEEXT) \
 	get_window$(EXEEXT) get_window_clr$(EXEEXT) \
-	get_window_ge$(EXEEXT) get_window_gt$(EXEEXT) \
-	get_window_le$(EXEEXT) get_window_lt$(EXEEXT) \
-	get_window_ne$(EXEEXT) get_window_set$(EXEEXT) \
-	get_zero$(EXEEXT)
-am__EXEEXT_26 = global_flags$(EXEEXT) global_name$(EXEEXT) \
+	get_window_complex$(EXEEXT) get_window_ge$(EXEEXT) \
+	get_window_gt$(EXEEXT) get_window_le$(EXEEXT) \
+	get_window_lt$(EXEEXT) get_window_ne$(EXEEXT) \
+	get_window_s$(EXEEXT) get_window_set$(EXEEXT) \
+	get_zero$(EXEEXT) get_zero_complex$(EXEEXT) \
+	get_zero_float$(EXEEXT)
+am__EXEEXT_27 = global_flags$(EXEEXT) global_name$(EXEEXT) \
 	global_ref$(EXEEXT) global_ref_empty$(EXEEXT) \
 	global_ref_set$(EXEEXT)
-am__EXEEXT_27 = gzip_add$(EXEEXT) gzip_get$(EXEEXT) \
-	gzip_get_get$(EXEEXT) gzip_get_get2$(EXEEXT) \
-	gzip_get_put$(EXEEXT) gzip_move_from$(EXEEXT) \
-	gzip_move_to$(EXEEXT) gzip_nframes$(EXEEXT) gzip_put$(EXEEXT) \
-	gzip_put_get$(EXEEXT)
-am__EXEEXT_28 = header_complex$(EXEEXT)
-am__EXEEXT_29 = hide$(EXEEXT) hide_hidden$(EXEEXT) \
+am__EXEEXT_28 = gzip_add$(EXEEXT) gzip_del$(EXEEXT) gzip_get$(EXEEXT) \
+	gzip_get_far$(EXEEXT) gzip_get_get$(EXEEXT) \
+	gzip_get_get2$(EXEEXT) gzip_get_put$(EXEEXT) \
+	gzip_move_from$(EXEEXT) gzip_move_to$(EXEEXT) \
+	gzip_nframes$(EXEEXT) gzip_put$(EXEEXT) gzip_put_back$(EXEEXT) \
+	gzip_put_endian$(EXEEXT) gzip_put_get$(EXEEXT) \
+	gzip_put_nframes$(EXEEXT) gzip_put_off$(EXEEXT) \
+	gzip_put_pad$(EXEEXT) gzip_put_sub$(EXEEXT) gzip_seek$(EXEEXT) \
+	gzip_seek_far$(EXEEXT) gzip_seek_put$(EXEEXT) \
+	gzip_sync$(EXEEXT)
+am__EXEEXT_29 = header_complex$(EXEEXT) header_off64t$(EXEEXT)
+am__EXEEXT_30 = hide$(EXEEXT) hide_hidden$(EXEEXT) \
 	hide_unhide$(EXEEXT)
-am__EXEEXT_30 = include$(EXEEXT) include_accmode$(EXEEXT) \
-	include_affix$(EXEEXT) include_auto$(EXEEXT) \
-	include_cb$(EXEEXT) include_creat$(EXEEXT) \
-	include_ignore$(EXEEXT) include_index$(EXEEXT) \
+am__EXEEXT_31 = include_accmode$(EXEEXT) include_affix$(EXEEXT) \
+	include_auto$(EXEEXT) include_cb$(EXEEXT) \
+	include_creat$(EXEEXT) include_ignore$(EXEEXT) \
+	include_include$(EXEEXT) include_index$(EXEEXT) \
 	include_invalid$(EXEEXT) include_nonexistent$(EXEEXT) \
 	include_pc$(EXEEXT) include_ref$(EXEEXT) include_sub$(EXEEXT) \
 	include_syntax$(EXEEXT)
-am__EXEEXT_31 = index$(EXEEXT) index_domain$(EXEEXT) \
-	index_range$(EXEEXT)
- at INCLUDE_LEGACY_API_TRUE@am__EXEEXT_32 = legacy_get$(EXEEXT) \
+am__EXEEXT_32 = index_domain$(EXEEXT) index_index$(EXEEXT) \
+	index_range$(EXEEXT) index_s$(EXEEXT) index_subset$(EXEEXT)
+ at INCLUDE_LEGACY_API_TRUE@am__EXEEXT_33 = legacy_error$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_estring$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_format$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_get$(EXEEXT) \
 @INCLUDE_LEGACY_API_TRUE@	legacy_get_put$(EXEEXT) \
 @INCLUDE_LEGACY_API_TRUE@	legacy_get_rofs$(EXEEXT) \
 @INCLUDE_LEGACY_API_TRUE@	legacy_nframes$(EXEEXT) \
 @INCLUDE_LEGACY_API_TRUE@	legacy_nonexistent$(EXEEXT) \
 @INCLUDE_LEGACY_API_TRUE@	legacy_put$(EXEEXT) \
 @INCLUDE_LEGACY_API_TRUE@	legacy_spf$(EXEEXT)
-am__EXEEXT_33 = lzma_get$(EXEEXT) lzma_nframes$(EXEEXT)
-am__EXEEXT_34 = madd$(EXEEXT) madd_affix$(EXEEXT) madd_alias$(EXEEXT) \
+am__EXEEXT_34 = lzma_get$(EXEEXT) lzma_nframes$(EXEEXT) \
+	lzma_put$(EXEEXT) lzma_xz_add$(EXEEXT) lzma_xz_get$(EXEEXT) \
+	lzma_xz_get_far$(EXEEXT) lzma_xz_get_get$(EXEEXT) \
+	lzma_xz_get_get2$(EXEEXT) lzma_xz_get_put$(EXEEXT) \
+	lzma_xz_move_to$(EXEEXT) lzma_xz_nframes$(EXEEXT) \
+	lzma_xz_put$(EXEEXT) lzma_xz_put_back$(EXEEXT) \
+	lzma_xz_put_endian$(EXEEXT) lzma_xz_put_get$(EXEEXT) \
+	lzma_xz_put_pad$(EXEEXT) lzma_xz_seek$(EXEEXT) \
+	lzma_xz_seek_far$(EXEEXT) lzma_xz_sync$(EXEEXT)
+am__EXEEXT_35 = madd$(EXEEXT) madd_affix$(EXEEXT) madd_alias$(EXEEXT) \
 	madd_alias_affix$(EXEEXT) madd_bit$(EXEEXT) \
 	madd_bit_invalid$(EXEEXT) madd_carray$(EXEEXT) \
 	madd_clincom$(EXEEXT) madd_const$(EXEEXT) \
@@ -418,43 +481,59 @@ am__EXEEXT_34 = madd$(EXEEXT) madd_affix$(EXEEXT) madd_alias$(EXEEXT) \
 	madd_spec$(EXEEXT) madd_spec_directive$(EXEEXT) \
 	madd_spec_invalid$(EXEEXT) madd_spec_resolv$(EXEEXT) \
 	madd_string$(EXEEXT) madd_window$(EXEEXT)
-am__EXEEXT_35 = move$(EXEEXT) move_affix$(EXEEXT) \
-	move_affix_dup$(EXEEXT) move_alias$(EXEEXT) \
-	move_data_enc_ar$(EXEEXT) move_data_enc_ra$(EXEEXT) \
-	move_data_endian$(EXEEXT) move_data_foffs$(EXEEXT) \
+am__EXEEXT_36 = move_affix$(EXEEXT) move_affix_dup$(EXEEXT) \
+	move_affix_meta$(EXEEXT) move_affix_updb$(EXEEXT) \
+	move_alias$(EXEEXT) move_data_enc_ar$(EXEEXT) \
+	move_data_enc_ra$(EXEEXT) move_data_endian$(EXEEXT) \
+	move_data_foffs$(EXEEXT) move_data_foffs_neg$(EXEEXT) \
 	move_data_nop$(EXEEXT) move_index$(EXEEXT) move_meta$(EXEEXT) \
-	move_protect$(EXEEXT) move_subdir$(EXEEXT)
-am__EXEEXT_36 = name$(EXEEXT) name_affix$(EXEEXT) \
-	name_affix_bad$(EXEEXT) name_alias$(EXEEXT) name_dup$(EXEEXT) \
-	name_move$(EXEEXT) name_move_alias$(EXEEXT) name_updb$(EXEEXT) \
-	name_updb_alias$(EXEEXT) name_updb_const$(EXEEXT) \
-	name_updb_const_alias$(EXEEXT)
-am__EXEEXT_37 = nentries_alias$(EXEEXT) nentries_hidden$(EXEEXT) \
+	move_move$(EXEEXT) move_protect$(EXEEXT) move_subdir$(EXEEXT)
+am__EXEEXT_37 = name_affix$(EXEEXT) name_affix_bad$(EXEEXT) \
+	name_alias$(EXEEXT) name_dangle$(EXEEXT) name_dot5$(EXEEXT) \
+	name_dot5r$(EXEEXT) name_dot9$(EXEEXT) name_dup$(EXEEXT) \
+	name_meta$(EXEEXT) name_move$(EXEEXT) name_move_alias$(EXEEXT) \
+	name_name$(EXEEXT) name_updb$(EXEEXT) name_updb_affix$(EXEEXT) \
+	name_updb_alias$(EXEEXT) name_updb_carray$(EXEEXT) \
+	name_updb_const$(EXEEXT) name_updb_const_alias$(EXEEXT)
+am__EXEEXT_38 = native_bit$(EXEEXT) native_const$(EXEEXT) \
+	native_index$(EXEEXT) native_lincom$(EXEEXT) \
+	native_lincom_cmpin$(EXEEXT) native_lincom_cmpscal$(EXEEXT) \
+	native_linterp$(EXEEXT) native_linterp_cmp$(EXEEXT) \
+	native_mult$(EXEEXT) native_mult1$(EXEEXT) \
+	native_mult2$(EXEEXT) native_polynom$(EXEEXT) \
+	native_polynom_cmpin$(EXEEXT) native_polynom_cmpscal$(EXEEXT) \
+	native_raw$(EXEEXT) native_phase$(EXEEXT) \
+	native_recip$(EXEEXT) native_recip_cmpin$(EXEEXT) \
+	native_recip_cmpscal$(EXEEXT) native_sbit$(EXEEXT) \
+	native_string$(EXEEXT)
+am__EXEEXT_39 = nentries_alias$(EXEEXT) nentries_hidden$(EXEEXT) \
 	nentries_noalias$(EXEEXT) nentries_scalar$(EXEEXT)
-am__EXEEXT_38 = nfields$(EXEEXT) nfields_hidden$(EXEEXT) \
-	nfields_invalid$(EXEEXT) nfields_type$(EXEEXT) \
+am__EXEEXT_40 = nfields_hidden$(EXEEXT) nfields_invalid$(EXEEXT) \
+	nfields_nfields$(EXEEXT) nfields_type$(EXEEXT) \
 	nfields_type_hidden$(EXEEXT) nfields_type_invalid$(EXEEXT) \
 	nfields_vector$(EXEEXT) nfields_vector_hidden$(EXEEXT) \
 	nfields_vector_invalid$(EXEEXT)
-am__EXEEXT_39 = nframes$(EXEEXT) nframes64$(EXEEXT) \
-	nframes_empty$(EXEEXT) nframes_invalid$(EXEEXT) \
+am__EXEEXT_41 = nframes64$(EXEEXT) nframes_empty$(EXEEXT) \
+	nframes_invalid$(EXEEXT) nframes_nframes$(EXEEXT) \
 	nframes_off64$(EXEEXT) nframes_spf$(EXEEXT)
-am__EXEEXT_40 = nmeta$(EXEEXT) nmeta_hidden$(EXEEXT) \
+am__EXEEXT_42 = nmeta$(EXEEXT) nmeta_hidden$(EXEEXT) \
 	nmeta_invalid$(EXEEXT) nmeta_parent$(EXEEXT) \
 	nmeta_type$(EXEEXT) nmeta_type_hidden$(EXEEXT) \
 	nmeta_type_invalid$(EXEEXT) nmeta_type_parent$(EXEEXT) \
 	nmeta_vectors$(EXEEXT) nmeta_vectors_del$(EXEEXT) \
 	nmeta_vectors_hidden$(EXEEXT) nmeta_vectors_invalid$(EXEEXT) \
 	nmeta_vectors_parent$(EXEEXT)
-am__EXEEXT_41 = open$(EXEEXT) open_abs$(EXEEXT) open_cb_abort$(EXEEXT) \
+am__EXEEXT_43 = open_abs$(EXEEXT) open_cb_abort$(EXEEXT) \
 	open_cb_cont$(EXEEXT) open_cb_ignore$(EXEEXT) \
 	open_cb_invalid$(EXEEXT) open_cb_rescan$(EXEEXT) \
-	open_eaccess$(EXEEXT) open_nonexistent$(EXEEXT) \
-	open_notdirfile$(EXEEXT) open_rofs$(EXEEXT) \
-	open_sym_a$(EXEEXT) open_sym_al$(EXEEXT) open_sym_at$(EXEEXT) \
-	open_sym_c$(EXEEXT) open_sym_cl$(EXEEXT) open_sym_ct$(EXEEXT) \
-	open_sym_p$(EXEEXT) open_sym_pl$(EXEEXT) open_sym_pt$(EXEEXT)
-am__EXEEXT_42 = parse_alias$(EXEEXT) parse_alias_code$(EXEEXT) \
+	open_cb_rescan_alloc$(EXEEXT) open_eaccess$(EXEEXT) \
+	open_invalid$(EXEEXT) open_nonexistent$(EXEEXT) \
+	open_notdirfile$(EXEEXT) open_open$(EXEEXT) open_rofs$(EXEEXT) \
+	open_sym_al$(EXEEXT) open_sym_at$(EXEEXT) open_sym_c$(EXEEXT) \
+	open_sym_cl$(EXEEXT) open_sym_ct$(EXEEXT) open_sym_d$(EXEEXT) \
+	open_sym_l$(EXEEXT) open_sym_p$(EXEEXT) open_sym_pl$(EXEEXT) \
+	open_sym_pt$(EXEEXT)
+am__EXEEXT_44 = parse_alias$(EXEEXT) parse_alias_code$(EXEEXT) \
 	parse_alias_dup$(EXEEXT) parse_alias_meta$(EXEEXT) \
 	parse_alias_missing$(EXEEXT) parse_badline$(EXEEXT) \
 	parse_bit$(EXEEXT) parse_bit4$(EXEEXT) \
@@ -473,6 +552,7 @@ am__EXEEXT_42 = parse_alias$(EXEEXT) parse_alias_code$(EXEEXT) \
 	parse_hidden$(EXEEXT) parse_hidden_field$(EXEEXT) \
 	parse_hidden_meta$(EXEEXT) parse_include$(EXEEXT) \
 	parse_include_absolute$(EXEEXT) parse_include_absrel$(EXEEXT) \
+	parse_include_affix_bad$(EXEEXT) \
 	parse_include_affix_ref$(EXEEXT) parse_include_dir$(EXEEXT) \
 	parse_include_loop$(EXEEXT) parse_include_nonexistent$(EXEEXT) \
 	parse_include_prefix$(EXEEXT) \
@@ -486,9 +566,13 @@ am__EXEEXT_42 = parse_alias$(EXEEXT) parse_alias_code$(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_malias$(EXEEXT) parse_malias_dup$(EXEEXT) \
-	parse_malias_meta$(EXEEXT) parse_meta$(EXEEXT) \
-	parse_meta_affix$(EXEEXT) parse_meta_alias$(EXEEXT) \
+	parse_literal_cmpbad$(EXEEXT) parse_literal_fltcmp$(EXEEXT) \
+	parse_literal_fltcmp0$(EXEEXT) parse_literal_intcmp$(EXEEXT) \
+	parse_literal_intcmp0$(EXEEXT) parse_literal_uintcmp$(EXEEXT) \
+	parse_literal_uintcmp0$(EXEEXT) parse_malias$(EXEEXT) \
+	parse_malias_dup$(EXEEXT) parse_malias_meta$(EXEEXT) \
+	parse_meta$(EXEEXT) parse_meta_affix$(EXEEXT) \
+	parse_meta_alias$(EXEEXT) parse_meta_frag$(EXEEXT) \
 	parse_meta_implicit$(EXEEXT) parse_meta_implicit2$(EXEEXT) \
 	parse_meta_implicit_affix$(EXEEXT) parse_meta_index$(EXEEXT) \
 	parse_meta_index2$(EXEEXT) parse_meta_jump$(EXEEXT) \
@@ -499,19 +583,22 @@ am__EXEEXT_42 = parse_alias$(EXEEXT) parse_alias_code$(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_ncols$(EXEEXT) parse_octal_zero$(EXEEXT) \
+	parse_phase$(EXEEXT) parse_phase_ncols$(EXEEXT) \
+	parse_phase_scalar$(EXEEXT) parse_polynom$(EXEEXT) \
+	parse_polynom_ncols1$(EXEEXT) parse_polynom_ncols2$(EXEEXT) \
+	parse_polynom_scalar$(EXEEXT) parse_protect_all$(EXEEXT) \
+	parse_protect_bad$(EXEEXT) parse_protect_data$(EXEEXT) \
+	parse_protect_format$(EXEEXT) parse_protect_none$(EXEEXT) \
+	parse_quote$(EXEEXT) parse_quote_mismatch$(EXEEXT) \
+	parse_raw$(EXEEXT) parse_raw_char$(EXEEXT) \
+	parse_raw_char_bad$(EXEEXT) parse_raw_ncols$(EXEEXT) \
 	parse_raw_scalar$(EXEEXT) parse_raw_spf$(EXEEXT) \
 	parse_raw_type$(EXEEXT) parse_recip$(EXEEXT) \
 	parse_ref$(EXEEXT) parse_ref_nonexistent$(EXEEXT) \
-	parse_sbit$(EXEEXT) parse_sort$(EXEEXT) parse_string$(EXEEXT) \
+	parse_sbit$(EXEEXT) parse_scalar1$(EXEEXT) \
+	parse_scalar2$(EXEEXT) parse_scalar_repr$(EXEEXT) \
+	parse_sort$(EXEEXT) parse_string$(EXEEXT) \
 	parse_string_ncols$(EXEEXT) parse_string_null$(EXEEXT) \
 	parse_utf8$(EXEEXT) parse_utf8_invalid$(EXEEXT) \
 	parse_utf8_zero$(EXEEXT) parse_version$(EXEEXT) \
@@ -522,12 +609,15 @@ am__EXEEXT_42 = parse_alias$(EXEEXT) parse_alias_code$(EXEEXT) \
 	parse_whitespace$(EXEEXT) parse_window$(EXEEXT) \
 	parse_window_ncols$(EXEEXT) parse_window_op$(EXEEXT) \
 	parse_window_scalar$(EXEEXT)
-am__EXEEXT_43 = protect_alter$(EXEEXT) protect_get$(EXEEXT)
-am__EXEEXT_44 = put64$(EXEEXT) 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) \
+am__EXEEXT_45 = protect_alter$(EXEEXT) protect_alter_all$(EXEEXT) \
+	protect_get$(EXEEXT)
+am__EXEEXT_46 = put64$(EXEEXT) put_bad_code$(EXEEXT) put_bit$(EXEEXT) \
+	put_bof$(EXEEXT) put_carray$(EXEEXT) \
+	put_carray_client$(EXEEXT) put_carray_slice$(EXEEXT) \
+	put_char$(EXEEXT) put_clincom1$(EXEEXT) \
+	put_complex128$(EXEEXT) put_complex64$(EXEEXT) \
+	put_const$(EXEEXT) put_const_protect$(EXEEXT) \
+	put_cpolynom$(EXEEXT) put_crecip$(EXEEXT) put_divide$(EXEEXT) \
 	put_endian8$(EXEEXT) put_endian16$(EXEEXT) \
 	put_endian32$(EXEEXT) put_endian64$(EXEEXT) \
 	put_endian_complex128_arm$(EXEEXT) \
@@ -550,55 +640,62 @@ am__EXEEXT_44 = put64$(EXEEXT) put_bad_code$(EXEEXT) put_bit$(EXEEXT) \
 	put_linterp$(EXEEXT) put_linterp_noin$(EXEEXT) \
 	put_linterp_nomono$(EXEEXT) put_linterp_notab$(EXEEXT) \
 	put_linterp_reverse$(EXEEXT) put_mplex$(EXEEXT) \
-	put_multiply$(EXEEXT) put_null$(EXEEXT) put_off64$(EXEEXT) \
+	put_mplex_complex$(EXEEXT) put_multiply$(EXEEXT) \
+	put_nofile$(EXEEXT) put_null$(EXEEXT) put_off64$(EXEEXT) \
 	put_phase$(EXEEXT) put_phase_noin$(EXEEXT) \
 	put_polynom1$(EXEEXT) put_polynom2$(EXEEXT) \
 	put_polynom_noin$(EXEEXT) put_protect$(EXEEXT) \
 	put_rdonly$(EXEEXT) put_recip$(EXEEXT) put_recurse$(EXEEXT) \
 	put_repr$(EXEEXT) put_rofs$(EXEEXT) put_sbit$(EXEEXT) \
 	put_sf$(EXEEXT) put_ss$(EXEEXT) put_string$(EXEEXT) \
-	put_string_protect$(EXEEXT) put_type$(EXEEXT) \
+	put_string_protect$(EXEEXT) put_sub$(EXEEXT) put_type$(EXEEXT) \
 	put_uint16$(EXEEXT) put_uint32$(EXEEXT) put_uint64$(EXEEXT) \
 	put_window$(EXEEXT) put_zero$(EXEEXT)
-am__EXEEXT_45 = ref$(EXEEXT) ref_none$(EXEEXT) ref_two$(EXEEXT)
-am__EXEEXT_46 = 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_47 = seek64$(EXEEXT) seek_cur$(EXEEXT) seek_end$(EXEEXT) \
-	seek_foffs$(EXEEXT) seek_foffs2$(EXEEXT) seek_neg$(EXEEXT) \
-	seek_set$(EXEEXT)
-am__EXEEXT_48 = sie_get_big$(EXEEXT) sie_get_little$(EXEEXT) \
+am__EXEEXT_47 = ref$(EXEEXT) ref_none$(EXEEXT) ref_two$(EXEEXT)
+am__EXEEXT_48 = repr_a$(EXEEXT) repr_bad$(EXEEXT) \
+	repr_float32$(EXEEXT) repr_float64$(EXEEXT) repr_i$(EXEEXT) \
+	repr_int16$(EXEEXT) repr_int32$(EXEEXT) repr_int64$(EXEEXT) \
+	repr_int8$(EXEEXT) repr_m$(EXEEXT) repr_r$(EXEEXT) \
+	repr_real_a$(EXEEXT) repr_real_i$(EXEEXT) repr_real_m$(EXEEXT) \
+	repr_real_r$(EXEEXT) repr_uint16$(EXEEXT) repr_uint32$(EXEEXT) \
+	repr_uint64$(EXEEXT) repr_uint8$(EXEEXT)
+am__EXEEXT_49 = seek64$(EXEEXT) seek_cur$(EXEEXT) seek_end$(EXEEXT) \
+	seek_far$(EXEEXT) seek_foffs$(EXEEXT) seek_foffs2$(EXEEXT) \
+	seek_index$(EXEEXT) seek_lincom$(EXEEXT) seek_mult$(EXEEXT) \
+	seek_neg$(EXEEXT) seek_phase$(EXEEXT) seek_set$(EXEEXT) \
+	seek_sub$(EXEEXT)
+am__EXEEXT_50 = sie_get_big$(EXEEXT) sie_get_little$(EXEEXT) \
 	sie_move_from$(EXEEXT) sie_move_to$(EXEEXT) \
 	sie_nframes_big$(EXEEXT) sie_nframes_little$(EXEEXT) \
-	sie_put_big$(EXEEXT) sie_put_append$(EXEEXT) \
-	sie_put_append2$(EXEEXT) sie_put_back$(EXEEXT) \
+	sie_put_append$(EXEEXT) sie_put_append2$(EXEEXT) \
+	sie_put_back$(EXEEXT) sie_put_big$(EXEEXT) \
 	sie_put_little$(EXEEXT) sie_put_many$(EXEEXT) \
 	sie_put_newo$(EXEEXT) sie_put_newo0$(EXEEXT) \
 	sie_put_pad$(EXEEXT) sie_put_pad0$(EXEEXT) \
 	sie_put_trunc$(EXEEXT) sie_put_trunc2$(EXEEXT) \
-	sie_put_trunc_nf$(EXEEXT) sie_sync$(EXEEXT)
-am__EXEEXT_49 = slim_get$(EXEEXT) slim_nframes$(EXEEXT)
-am__EXEEXT_50 = spf$(EXEEXT) spf_alias$(EXEEXT) \
-	spf_alias_missing$(EXEEXT) spf_alias_meta$(EXEEXT) \
-	spf_divide$(EXEEXT) spf_lincom$(EXEEXT) spf_multiply$(EXEEXT) \
-	spf_polynom$(EXEEXT) spf_recip$(EXEEXT) spf_recurse$(EXEEXT)
-am__EXEEXT_51 = svlist$(EXEEXT) svlist_hidden$(EXEEXT) \
-	svlist_invalid$(EXEEXT) svlist_meta$(EXEEXT) \
+	sie_put_trunc_nf$(EXEEXT) sie_seek$(EXEEXT) \
+	sie_seek_far$(EXEEXT) sie_sync$(EXEEXT)
+am__EXEEXT_51 = slim_get$(EXEEXT) slim_nframes$(EXEEXT) \
+	slim_seek$(EXEEXT) slim_seek_far$(EXEEXT)
+am__EXEEXT_52 = spf_alias$(EXEEXT) spf_alias_missing$(EXEEXT) \
+	spf_alias_meta$(EXEEXT) spf_divide$(EXEEXT) \
+	spf_lincom$(EXEEXT) spf_multiply$(EXEEXT) spf_polynom$(EXEEXT) \
+	spf_raw$(EXEEXT) spf_recip$(EXEEXT) spf_recurse$(EXEEXT)
+am__EXEEXT_53 = svlist$(EXEEXT) svlist0$(EXEEXT) svlist2$(EXEEXT) \
+	svlist_hidden$(EXEEXT) svlist_invalid$(EXEEXT) \
+	svlist_meta$(EXEEXT) svlist_meta0$(EXEEXT) \
 	svlist_meta_hidden$(EXEEXT) svlist_meta_invalid$(EXEEXT)
-am__EXEEXT_52 = table$(EXEEXT) table_code$(EXEEXT) table_type$(EXEEXT)
-am__EXEEXT_53 = tell$(EXEEXT) tell64$(EXEEXT) tell_multidiv$(EXEEXT)
-am__EXEEXT_54 = tok_arg$(EXEEXT) tok_escape$(EXEEXT) \
+am__EXEEXT_54 = table$(EXEEXT) table_code$(EXEEXT) table_type$(EXEEXT)
+am__EXEEXT_55 = tell$(EXEEXT) tell64$(EXEEXT) tell_multidiv$(EXEEXT) \
+	tell_sub$(EXEEXT)
+am__EXEEXT_56 = tok_arg$(EXEEXT) tok_escape$(EXEEXT) \
 	tok_quote$(EXEEXT)
-am__EXEEXT_55 = trunc$(EXEEXT) trunc_dir$(EXEEXT) \
+am__EXEEXT_57 = trunc$(EXEEXT) trunc_dir$(EXEEXT) \
 	trunc_rdonly$(EXEEXT) trunc_rofs$(EXEEXT) \
 	trunc_truncsub$(EXEEXT)
-am__EXEEXT_56 = unclude$(EXEEXT) unclude_del$(EXEEXT) \
-	unclude_move$(EXEEXT)
-am__EXEEXT_57 = version_0$(EXEEXT) version_0_write$(EXEEXT) \
+am__EXEEXT_58 = unclude$(EXEEXT) unclude_del$(EXEEXT) \
+	unclude_move$(EXEEXT) unclude_open$(EXEEXT)
+am__EXEEXT_59 = version_0$(EXEEXT) version_0_write$(EXEEXT) \
 	version_1$(EXEEXT) version_1_write$(EXEEXT) version_2$(EXEEXT) \
 	version_2_write$(EXEEXT) version_3$(EXEEXT) \
 	version_3_write$(EXEEXT) version_4$(EXEEXT) \
@@ -610,15 +707,16 @@ am__EXEEXT_57 = version_0$(EXEEXT) version_0_write$(EXEEXT) \
 	version_8$(EXEEXT) version_8_strict$(EXEEXT) \
 	version_8_write$(EXEEXT) version_9$(EXEEXT) \
 	version_9_strict$(EXEEXT) version_9_write$(EXEEXT)
-am__EXEEXT_58 = vlist$(EXEEXT) vlist_alias$(EXEEXT) \
+am__EXEEXT_60 = vlist$(EXEEXT) vlist_alias$(EXEEXT) \
 	vlist_hidden$(EXEEXT) vlist_invalid$(EXEEXT) \
 	vlist_meta$(EXEEXT) vlist_meta_hidden$(EXEEXT) \
 	vlist_meta_invalid$(EXEEXT)
-am__EXEEXT_59 = xz_get$(EXEEXT) xz_nframes$(EXEEXT)
-am__EXEEXT_60 = zzip_data$(EXEEXT) zzip_get$(EXEEXT) \
-	zzip_get_get$(EXEEXT) zzip_nframes$(EXEEXT)
-am__EXEEXT_61 = zzslim_get$(EXEEXT) zzslim_nframes$(EXEEXT)
-am__EXEEXT_62 = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
+am__EXEEXT_61 = zzip_data$(EXEEXT) zzip_get$(EXEEXT) \
+	zzip_get_get$(EXEEXT) zzip_nframes$(EXEEXT) zzip_seek$(EXEEXT) \
+	zzip_seek_far$(EXEEXT)
+am__EXEEXT_62 = zzslim_get$(EXEEXT) zzslim_nframes$(EXEEXT) \
+	zzslim_seek$(EXEEXT) zzslim_seek_far$(EXEEXT)
+am__EXEEXT_63 = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
 	$(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
 	$(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \
 	$(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \
@@ -638,11 +736,11 @@ am__EXEEXT_62 = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
 	$(am__EXEEXT_52) $(am__EXEEXT_53) $(am__EXEEXT_54) \
 	$(am__EXEEXT_55) $(am__EXEEXT_56) $(am__EXEEXT_57) \
 	$(am__EXEEXT_58) $(am__EXEEXT_59) $(am__EXEEXT_60) \
-	$(am__EXEEXT_61)
-add_SOURCES = add.c
-add_OBJECTS = add.$(OBJEXT)
-add_LDADD = $(LDADD)
-add_DEPENDENCIES = ../src/libgetdata.la
+	$(am__EXEEXT_61) $(am__EXEEXT_62)
+add_add_SOURCES = add_add.c
+add_add_OBJECTS = add_add.$(OBJEXT)
+add_add_LDADD = $(LDADD)
+add_add_DEPENDENCIES = ../src/libgetdata.la
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -663,6 +761,10 @@ add_alias_meta_SOURCES = add_alias_meta.c
 add_alias_meta_OBJECTS = add_alias_meta.$(OBJEXT)
 add_alias_meta_LDADD = $(LDADD)
 add_alias_meta_DEPENDENCIES = ../src/libgetdata.la
+add_amb_code7_SOURCES = add_amb_code7.c
+add_amb_code7_OBJECTS = add_amb_code7.$(OBJEXT)
+add_amb_code7_LDADD = $(LDADD)
+add_amb_code7_DEPENDENCIES = ../src/libgetdata.la
 add_bit_SOURCES = add_bit.c
 add_bit_OBJECTS = add_bit.$(OBJEXT)
 add_bit_LDADD = $(LDADD)
@@ -727,6 +829,14 @@ add_divide_invalid_SOURCES = add_divide_invalid.c
 add_divide_invalid_OBJECTS = add_divide_invalid.$(OBJEXT)
 add_divide_invalid_LDADD = $(LDADD)
 add_divide_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_dot5_SOURCES = add_dot5.c
+add_dot5_OBJECTS = add_dot5.$(OBJEXT)
+add_dot5_LDADD = $(LDADD)
+add_dot5_DEPENDENCIES = ../src/libgetdata.la
+add_dot6_SOURCES = add_dot6.c
+add_dot6_OBJECTS = add_dot6.$(OBJEXT)
+add_dot6_LDADD = $(LDADD)
+add_dot6_DEPENDENCIES = ../src/libgetdata.la
 add_duplicate_SOURCES = add_duplicate.c
 add_duplicate_OBJECTS = add_duplicate.$(OBJEXT)
 add_duplicate_LDADD = $(LDADD)
@@ -827,6 +937,10 @@ add_raw_spf_scalar_SOURCES = add_raw_spf_scalar.c
 add_raw_spf_scalar_OBJECTS = add_raw_spf_scalar.$(OBJEXT)
 add_raw_spf_scalar_LDADD = $(LDADD)
 add_raw_spf_scalar_DEPENDENCIES = ../src/libgetdata.la
+add_raw_sub_SOURCES = add_raw_sub.c
+add_raw_sub_OBJECTS = add_raw_sub.$(OBJEXT)
+add_raw_sub_LDADD = $(LDADD)
+add_raw_sub_DEPENDENCIES = ../src/libgetdata.la
 add_raw_type_SOURCES = add_raw_type.c
 add_raw_type_OBJECTS = add_raw_type.$(OBJEXT)
 add_raw_type_LDADD = $(LDADD)
@@ -955,6 +1069,10 @@ alter_carray_type_SOURCES = alter_carray_type.c
 alter_carray_type_OBJECTS = alter_carray_type.$(OBJEXT)
 alter_carray_type_LDADD = $(LDADD)
 alter_carray_type_DEPENDENCIES = ../src/libgetdata.la
+alter_clincom_SOURCES = alter_clincom.c
+alter_clincom_OBJECTS = alter_clincom.$(OBJEXT)
+alter_clincom_LDADD = $(LDADD)
+alter_clincom_DEPENDENCIES = ../src/libgetdata.la
 alter_const_SOURCES = alter_const.c
 alter_const_OBJECTS = alter_const.$(OBJEXT)
 alter_const_LDADD = $(LDADD)
@@ -963,10 +1081,22 @@ alter_const_c2r_SOURCES = alter_const_c2r.c
 alter_const_c2r_OBJECTS = alter_const_c2r.$(OBJEXT)
 alter_const_c2r_LDADD = $(LDADD)
 alter_const_c2r_DEPENDENCIES = ../src/libgetdata.la
+alter_const_r2c_SOURCES = alter_const_r2c.c
+alter_const_r2c_OBJECTS = alter_const_r2c.$(OBJEXT)
+alter_const_r2c_LDADD = $(LDADD)
+alter_const_r2c_DEPENDENCIES = ../src/libgetdata.la
+alter_const_r2r_SOURCES = alter_const_r2r.c
+alter_const_r2r_OBJECTS = alter_const_r2r.$(OBJEXT)
+alter_const_r2r_LDADD = $(LDADD)
+alter_const_r2r_DEPENDENCIES = ../src/libgetdata.la
 alter_cpolynom_SOURCES = alter_cpolynom.c
 alter_cpolynom_OBJECTS = alter_cpolynom.$(OBJEXT)
 alter_cpolynom_LDADD = $(LDADD)
 alter_cpolynom_DEPENDENCIES = ../src/libgetdata.la
+alter_cpolynom_null_SOURCES = alter_cpolynom_null.c
+alter_cpolynom_null_OBJECTS = alter_cpolynom_null.$(OBJEXT)
+alter_cpolynom_null_LDADD = $(LDADD)
+alter_cpolynom_null_DEPENDENCIES = ../src/libgetdata.la
 alter_crecip_SOURCES = alter_crecip.c
 alter_crecip_OBJECTS = alter_crecip.$(OBJEXT)
 alter_crecip_LDADD = $(LDADD)
@@ -975,6 +1105,10 @@ alter_crecip89_SOURCES = alter_crecip89.c
 alter_crecip89_OBJECTS = alter_crecip89.$(OBJEXT)
 alter_crecip89_LDADD = $(LDADD)
 alter_crecip89_DEPENDENCIES = ../src/libgetdata.la
+alter_crecip89_null_SOURCES = alter_crecip89_null.c
+alter_crecip89_null_OBJECTS = alter_crecip89_null.$(OBJEXT)
+alter_crecip89_null_LDADD = $(LDADD)
+alter_crecip89_null_DEPENDENCIES = ../src/libgetdata.la
 alter_crecip_zero_SOURCES = alter_crecip_zero.c
 alter_crecip_zero_OBJECTS = alter_crecip_zero.$(OBJEXT)
 alter_crecip_zero_LDADD = $(LDADD)
@@ -995,10 +1129,23 @@ alter_entry_hidden_SOURCES = alter_entry_hidden.c
 alter_entry_hidden_OBJECTS = alter_entry_hidden.$(OBJEXT)
 alter_entry_hidden_LDADD = $(LDADD)
 alter_entry_hidden_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_lincom_SOURCES = alter_entry_lincom.c
+alter_entry_lincom_OBJECTS = alter_entry_lincom.$(OBJEXT)
+alter_entry_lincom_LDADD = $(LDADD)
+alter_entry_lincom_DEPENDENCIES = ../src/libgetdata.la
 alter_entry_recode_SOURCES = alter_entry_recode.c
 alter_entry_recode_OBJECTS = alter_entry_recode.$(OBJEXT)
 alter_entry_recode_LDADD = $(LDADD)
 alter_entry_recode_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_recode_recalc_SOURCES = alter_entry_recode_recalc.c
+alter_entry_recode_recalc_OBJECTS =  \
+	alter_entry_recode_recalc.$(OBJEXT)
+alter_entry_recode_recalc_LDADD = $(LDADD)
+alter_entry_recode_recalc_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_scalar1_SOURCES = alter_entry_scalar1.c
+alter_entry_scalar1_OBJECTS = alter_entry_scalar1.$(OBJEXT)
+alter_entry_scalar1_LDADD = $(LDADD)
+alter_entry_scalar1_DEPENDENCIES = ../src/libgetdata.la
 alter_entry_scalar2a_SOURCES = alter_entry_scalar2a.c
 alter_entry_scalar2a_OBJECTS = alter_entry_scalar2a.$(OBJEXT)
 alter_entry_scalar2a_LDADD = $(LDADD)
@@ -1011,10 +1158,22 @@ alter_entry_scalar3_SOURCES = alter_entry_scalar3.c
 alter_entry_scalar3_OBJECTS = alter_entry_scalar3.$(OBJEXT)
 alter_entry_scalar3_LDADD = $(LDADD)
 alter_entry_scalar3_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_scalar3c_SOURCES = alter_entry_scalar3c.c
+alter_entry_scalar3c_OBJECTS = alter_entry_scalar3c.$(OBJEXT)
+alter_entry_scalar3c_LDADD = $(LDADD)
+alter_entry_scalar3c_DEPENDENCIES = ../src/libgetdata.la
 alter_entry_scalar4_SOURCES = alter_entry_scalar4.c
 alter_entry_scalar4_OBJECTS = alter_entry_scalar4.$(OBJEXT)
 alter_entry_scalar4_LDADD = $(LDADD)
 alter_entry_scalar4_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_scalar_amb_SOURCES = alter_entry_scalar_amb.c
+alter_entry_scalar_amb_OBJECTS = alter_entry_scalar_amb.$(OBJEXT)
+alter_entry_scalar_amb_LDADD = $(LDADD)
+alter_entry_scalar_amb_DEPENDENCIES = ../src/libgetdata.la
+alter_index_SOURCES = alter_index.c
+alter_index_OBJECTS = alter_index.$(OBJEXT)
+alter_index_LDADD = $(LDADD)
+alter_index_DEPENDENCIES = ../src/libgetdata.la
 alter_lincom_23_SOURCES = alter_lincom_23.c
 alter_lincom_23_OBJECTS = alter_lincom_23.$(OBJEXT)
 alter_lincom_23_LDADD = $(LDADD)
@@ -1111,6 +1270,10 @@ alter_spec_meta_SOURCES = alter_spec_meta.c
 alter_spec_meta_OBJECTS = alter_spec_meta.$(OBJEXT)
 alter_spec_meta_LDADD = $(LDADD)
 alter_spec_meta_DEPENDENCIES = ../src/libgetdata.la
+alter_spec_polynom_SOURCES = alter_spec_polynom.c
+alter_spec_polynom_OBJECTS = alter_spec_polynom.$(OBJEXT)
+alter_spec_polynom_LDADD = $(LDADD)
+alter_spec_polynom_DEPENDENCIES = ../src/libgetdata.la
 alter_window_SOURCES = alter_window.c
 alter_window_OBJECTS = alter_window.$(OBJEXT)
 alter_window_LDADD = $(LDADD)
@@ -1123,10 +1286,22 @@ ascii_get_SOURCES = ascii_get.c
 ascii_get_OBJECTS = ascii_get.$(OBJEXT)
 ascii_get_LDADD = $(LDADD)
 ascii_get_DEPENDENCIES = ../src/libgetdata.la
+ascii_get_complex_SOURCES = ascii_get_complex.c
+ascii_get_complex_OBJECTS = ascii_get_complex.$(OBJEXT)
+ascii_get_complex_LDADD = $(LDADD)
+ascii_get_complex_DEPENDENCIES = ../src/libgetdata.la
 ascii_get_get_SOURCES = ascii_get_get.c
 ascii_get_get_OBJECTS = ascii_get_get.$(OBJEXT)
 ascii_get_get_LDADD = $(LDADD)
 ascii_get_get_DEPENDENCIES = ../src/libgetdata.la
+ascii_get_here_SOURCES = ascii_get_here.c
+ascii_get_here_OBJECTS = ascii_get_here.$(OBJEXT)
+ascii_get_here_LDADD = $(LDADD)
+ascii_get_here_DEPENDENCIES = ../src/libgetdata.la
+ascii_get_sub_SOURCES = ascii_get_sub.c
+ascii_get_sub_OBJECTS = ascii_get_sub.$(OBJEXT)
+ascii_get_sub_LDADD = $(LDADD)
+ascii_get_sub_DEPENDENCIES = ../src/libgetdata.la
 ascii_nframes_SOURCES = ascii_nframes.c
 ascii_nframes_OBJECTS = ascii_nframes.$(OBJEXT)
 ascii_nframes_LDADD = $(LDADD)
@@ -1135,10 +1310,34 @@ ascii_put_SOURCES = ascii_put.c
 ascii_put_OBJECTS = ascii_put.$(OBJEXT)
 ascii_put_LDADD = $(LDADD)
 ascii_put_DEPENDENCIES = ../src/libgetdata.la
+ascii_put_here_SOURCES = ascii_put_here.c
+ascii_put_here_OBJECTS = ascii_put_here.$(OBJEXT)
+ascii_put_here_LDADD = $(LDADD)
+ascii_put_here_DEPENDENCIES = ../src/libgetdata.la
+ascii_seek_SOURCES = ascii_seek.c
+ascii_seek_OBJECTS = ascii_seek.$(OBJEXT)
+ascii_seek_LDADD = $(LDADD)
+ascii_seek_DEPENDENCIES = ../src/libgetdata.la
+ascii_seek_far_SOURCES = ascii_seek_far.c
+ascii_seek_far_OBJECTS = ascii_seek_far.$(OBJEXT)
+ascii_seek_far_LDADD = $(LDADD)
+ascii_seek_far_DEPENDENCIES = ../src/libgetdata.la
+ascii_sync_SOURCES = ascii_sync.c
+ascii_sync_OBJECTS = ascii_sync.$(OBJEXT)
+ascii_sync_LDADD = $(LDADD)
+ascii_sync_DEPENDENCIES = ../src/libgetdata.la
 bof_SOURCES = bof.c
 bof_OBJECTS = bof.$(OBJEXT)
 bof_LDADD = $(LDADD)
 bof_DEPENDENCIES = ../src/libgetdata.la
+bof_bit_SOURCES = bof_bit.c
+bof_bit_OBJECTS = bof_bit.$(OBJEXT)
+bof_bit_LDADD = $(LDADD)
+bof_bit_DEPENDENCIES = ../src/libgetdata.la
+bof_index_SOURCES = bof_index.c
+bof_index_OBJECTS = bof_index.$(OBJEXT)
+bof_index_LDADD = $(LDADD)
+bof_index_DEPENDENCIES = ../src/libgetdata.la
 bof_lincom_SOURCES = bof_lincom.c
 bof_lincom_OBJECTS = bof_lincom.$(OBJEXT)
 bof_lincom_LDADD = $(LDADD)
@@ -1147,30 +1346,90 @@ bof_phase_SOURCES = bof_phase.c
 bof_phase_OBJECTS = bof_phase.$(OBJEXT)
 bof_phase_LDADD = $(LDADD)
 bof_phase_DEPENDENCIES = ../src/libgetdata.la
+bof_phase_neg_SOURCES = bof_phase_neg.c
+bof_phase_neg_OBJECTS = bof_phase_neg.$(OBJEXT)
+bof_phase_neg_LDADD = $(LDADD)
+bof_phase_neg_DEPENDENCIES = ../src/libgetdata.la
+bzip_add_SOURCES = bzip_add.c
+bzip_add_OBJECTS = bzip_add.$(OBJEXT)
+bzip_add_LDADD = $(LDADD)
+bzip_add_DEPENDENCIES = ../src/libgetdata.la
 bzip_get_SOURCES = bzip_get.c
 bzip_get_OBJECTS = bzip_get.$(OBJEXT)
 bzip_get_LDADD = $(LDADD)
 bzip_get_DEPENDENCIES = ../src/libgetdata.la
+bzip_get_far_SOURCES = bzip_get_far.c
+bzip_get_far_OBJECTS = bzip_get_far.$(OBJEXT)
+bzip_get_far_LDADD = $(LDADD)
+bzip_get_far_DEPENDENCIES = ../src/libgetdata.la
 bzip_get_get_SOURCES = bzip_get_get.c
 bzip_get_get_OBJECTS = bzip_get_get.$(OBJEXT)
 bzip_get_get_LDADD = $(LDADD)
 bzip_get_get_DEPENDENCIES = ../src/libgetdata.la
+bzip_get_get2_SOURCES = bzip_get_get2.c
+bzip_get_get2_OBJECTS = bzip_get_get2.$(OBJEXT)
+bzip_get_get2_LDADD = $(LDADD)
+bzip_get_get2_DEPENDENCIES = ../src/libgetdata.la
+bzip_get_put_SOURCES = bzip_get_put.c
+bzip_get_put_OBJECTS = bzip_get_put.$(OBJEXT)
+bzip_get_put_LDADD = $(LDADD)
+bzip_get_put_DEPENDENCIES = ../src/libgetdata.la
 bzip_move_from_SOURCES = bzip_move_from.c
 bzip_move_from_OBJECTS = bzip_move_from.$(OBJEXT)
 bzip_move_from_LDADD = $(LDADD)
 bzip_move_from_DEPENDENCIES = ../src/libgetdata.la
+bzip_move_to_SOURCES = bzip_move_to.c
+bzip_move_to_OBJECTS = bzip_move_to.$(OBJEXT)
+bzip_move_to_LDADD = $(LDADD)
+bzip_move_to_DEPENDENCIES = ../src/libgetdata.la
 bzip_nframes_SOURCES = bzip_nframes.c
 bzip_nframes_OBJECTS = bzip_nframes.$(OBJEXT)
 bzip_nframes_LDADD = $(LDADD)
 bzip_nframes_DEPENDENCIES = ../src/libgetdata.la
-close_SOURCES = close.c
-close_OBJECTS = close.$(OBJEXT)
-close_LDADD = $(LDADD)
-close_DEPENDENCIES = ../src/libgetdata.la
+bzip_put_SOURCES = bzip_put.c
+bzip_put_OBJECTS = bzip_put.$(OBJEXT)
+bzip_put_LDADD = $(LDADD)
+bzip_put_DEPENDENCIES = ../src/libgetdata.la
+bzip_put_back_SOURCES = bzip_put_back.c
+bzip_put_back_OBJECTS = bzip_put_back.$(OBJEXT)
+bzip_put_back_LDADD = $(LDADD)
+bzip_put_back_DEPENDENCIES = ../src/libgetdata.la
+bzip_put_endian_SOURCES = bzip_put_endian.c
+bzip_put_endian_OBJECTS = bzip_put_endian.$(OBJEXT)
+bzip_put_endian_LDADD = $(LDADD)
+bzip_put_endian_DEPENDENCIES = ../src/libgetdata.la
+bzip_put_get_SOURCES = bzip_put_get.c
+bzip_put_get_OBJECTS = bzip_put_get.$(OBJEXT)
+bzip_put_get_LDADD = $(LDADD)
+bzip_put_get_DEPENDENCIES = ../src/libgetdata.la
+bzip_put_pad_SOURCES = bzip_put_pad.c
+bzip_put_pad_OBJECTS = bzip_put_pad.$(OBJEXT)
+bzip_put_pad_LDADD = $(LDADD)
+bzip_put_pad_DEPENDENCIES = ../src/libgetdata.la
+bzip_put_sub_SOURCES = bzip_put_sub.c
+bzip_put_sub_OBJECTS = bzip_put_sub.$(OBJEXT)
+bzip_put_sub_LDADD = $(LDADD)
+bzip_put_sub_DEPENDENCIES = ../src/libgetdata.la
+bzip_seek_SOURCES = bzip_seek.c
+bzip_seek_OBJECTS = bzip_seek.$(OBJEXT)
+bzip_seek_LDADD = $(LDADD)
+bzip_seek_DEPENDENCIES = ../src/libgetdata.la
+bzip_seek_far_SOURCES = bzip_seek_far.c
+bzip_seek_far_OBJECTS = bzip_seek_far.$(OBJEXT)
+bzip_seek_far_LDADD = $(LDADD)
+bzip_seek_far_DEPENDENCIES = ../src/libgetdata.la
+bzip_sync_SOURCES = bzip_sync.c
+bzip_sync_OBJECTS = bzip_sync.$(OBJEXT)
+bzip_sync_LDADD = $(LDADD)
+bzip_sync_DEPENDENCIES = ../src/libgetdata.la
 close_bad_SOURCES = close_bad.c
 close_bad_OBJECTS = close_bad.$(OBJEXT)
 close_bad_LDADD = $(LDADD)
 close_bad_DEPENDENCIES = ../src/libgetdata.la
+close_close_SOURCES = close_close.c
+close_close_OBJECTS = close_close.$(OBJEXT)
+close_close_LDADD = $(LDADD)
+close_close_DEPENDENCIES = ../src/libgetdata.la
 close_discard_SOURCES = close_discard.c
 close_discard_OBJECTS = close_discard.$(OBJEXT)
 close_discard_LDADD = $(LDADD)
@@ -1675,6 +1934,10 @@ creat_rdonly_SOURCES = creat_rdonly.c
 creat_rdonly_OBJECTS = creat_rdonly.$(OBJEXT)
 creat_rdonly_LDADD = $(LDADD)
 creat_rdonly_DEPENDENCIES = ../src/libgetdata.la
+creat_rdonly_exists_SOURCES = creat_rdonly_exists.c
+creat_rdonly_exists_OBJECTS = creat_rdonly_exists.$(OBJEXT)
+creat_rdonly_exists_LDADD = $(LDADD)
+creat_rdonly_exists_DEPENDENCIES = ../src/libgetdata.la
 cvlist_SOURCES = cvlist.c
 cvlist_OBJECTS = cvlist.$(OBJEXT)
 cvlist_LDADD = $(LDADD)
@@ -1683,6 +1946,14 @@ cvlist_array_SOURCES = cvlist_array.c
 cvlist_array_OBJECTS = cvlist_array.$(OBJEXT)
 cvlist_array_LDADD = $(LDADD)
 cvlist_array_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array0_SOURCES = cvlist_array0.c
+cvlist_array0_OBJECTS = cvlist_array0.$(OBJEXT)
+cvlist_array0_LDADD = $(LDADD)
+cvlist_array0_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array_free_SOURCES = cvlist_array_free.c
+cvlist_array_free_OBJECTS = cvlist_array_free.$(OBJEXT)
+cvlist_array_free_LDADD = $(LDADD)
+cvlist_array_free_DEPENDENCIES = ../src/libgetdata.la
 cvlist_array_hidden_SOURCES = cvlist_array_hidden.c
 cvlist_array_hidden_OBJECTS = cvlist_array_hidden.$(OBJEXT)
 cvlist_array_hidden_LDADD = $(LDADD)
@@ -1691,6 +1962,14 @@ cvlist_array_meta_SOURCES = cvlist_array_meta.c
 cvlist_array_meta_OBJECTS = cvlist_array_meta.$(OBJEXT)
 cvlist_array_meta_LDADD = $(LDADD)
 cvlist_array_meta_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array_meta0_SOURCES = cvlist_array_meta0.c
+cvlist_array_meta0_OBJECTS = cvlist_array_meta0.$(OBJEXT)
+cvlist_array_meta0_LDADD = $(LDADD)
+cvlist_array_meta0_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array_meta_free_SOURCES = cvlist_array_meta_free.c
+cvlist_array_meta_free_OBJECTS = cvlist_array_meta_free.$(OBJEXT)
+cvlist_array_meta_free_LDADD = $(LDADD)
+cvlist_array_meta_free_DEPENDENCIES = ../src/libgetdata.la
 cvlist_array_meta_hidden_SOURCES = cvlist_array_meta_hidden.c
 cvlist_array_meta_hidden_OBJECTS = cvlist_array_meta_hidden.$(OBJEXT)
 cvlist_array_meta_hidden_LDADD = $(LDADD)
@@ -1707,6 +1986,10 @@ cvlist_meta_SOURCES = cvlist_meta.c
 cvlist_meta_OBJECTS = cvlist_meta.$(OBJEXT)
 cvlist_meta_LDADD = $(LDADD)
 cvlist_meta_DEPENDENCIES = ../src/libgetdata.la
+cvlist_meta0_SOURCES = cvlist_meta0.c
+cvlist_meta0_OBJECTS = cvlist_meta0.$(OBJEXT)
+cvlist_meta0_LDADD = $(LDADD)
+cvlist_meta0_DEPENDENCIES = ../src/libgetdata.la
 cvlist_meta_hidden_SOURCES = cvlist_meta_hidden.c
 cvlist_meta_hidden_OBJECTS = cvlist_meta_hidden.$(OBJEXT)
 cvlist_meta_hidden_LDADD = $(LDADD)
@@ -1715,10 +1998,10 @@ 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_alias_SOURCES = del_alias.c
+del_alias_OBJECTS = del_alias.$(OBJEXT)
+del_alias_LDADD = $(LDADD)
+del_alias_DEPENDENCIES = ../src/libgetdata.la
 del_carray_SOURCES = del_carray.c
 del_carray_OBJECTS = del_carray.$(OBJEXT)
 del_carray_LDADD = $(LDADD)
@@ -1743,6 +2026,18 @@ del_data_SOURCES = del_data.c
 del_data_OBJECTS = del_data.$(OBJEXT)
 del_data_LDADD = $(LDADD)
 del_data_DEPENDENCIES = ../src/libgetdata.la
+del_data_enoent_SOURCES = del_data_enoent.c
+del_data_enoent_OBJECTS = del_data_enoent.$(OBJEXT)
+del_data_enoent_LDADD = $(LDADD)
+del_data_enoent_DEPENDENCIES = ../src/libgetdata.la
+del_data_open_SOURCES = del_data_open.c
+del_data_open_OBJECTS = del_data_open.$(OBJEXT)
+del_data_open_LDADD = $(LDADD)
+del_data_open_DEPENDENCIES = ../src/libgetdata.la
+del_del_SOURCES = del_del.c
+del_del_OBJECTS = del_del.$(OBJEXT)
+del_del_LDADD = $(LDADD)
+del_del_DEPENDENCIES = ../src/libgetdata.la
 del_derived_SOURCES = del_derived.c
 del_derived_OBJECTS = del_derived.$(OBJEXT)
 del_derived_LDADD = $(LDADD)
@@ -1763,6 +2058,10 @@ del_meta_force_SOURCES = del_meta_force.c
 del_meta_force_OBJECTS = del_meta_force.$(OBJEXT)
 del_meta_force_LDADD = $(LDADD)
 del_meta_force_DEPENDENCIES = ../src/libgetdata.la
+del_ref_SOURCES = del_ref.c
+del_ref_OBJECTS = del_ref.$(OBJEXT)
+del_ref_LDADD = $(LDADD)
+del_ref_DEPENDENCIES = ../src/libgetdata.la
 desync_SOURCES = desync.c
 desync_OBJECTS = desync.$(OBJEXT)
 desync_LDADD = $(LDADD)
@@ -1771,6 +2070,10 @@ desync_flush_SOURCES = desync_flush.c
 desync_flush_OBJECTS = desync_flush.$(OBJEXT)
 desync_flush_LDADD = $(LDADD)
 desync_flush_DEPENDENCIES = ../src/libgetdata.la
+desync_path_SOURCES = desync_path.c
+desync_path_OBJECTS = desync_path.$(OBJEXT)
+desync_path_LDADD = $(LDADD)
+desync_path_DEPENDENCIES = ../src/libgetdata.la
 desync_reopen_SOURCES = desync_reopen.c
 desync_reopen_OBJECTS = desync_reopen.$(OBJEXT)
 desync_reopen_LDADD = $(LDADD)
@@ -1839,18 +2142,38 @@ encode_alter_SOURCES = encode_alter.c
 encode_alter_OBJECTS = encode_alter.$(OBJEXT)
 encode_alter_LDADD = $(LDADD)
 encode_alter_DEPENDENCIES = ../src/libgetdata.la
+encode_alter_all_SOURCES = encode_alter_all.c
+encode_alter_all_OBJECTS = encode_alter_all.$(OBJEXT)
+encode_alter_all_LDADD = $(LDADD)
+encode_alter_all_DEPENDENCIES = ../src/libgetdata.la
+encode_alter_open_SOURCES = encode_alter_open.c
+encode_alter_open_OBJECTS = encode_alter_open.$(OBJEXT)
+encode_alter_open_LDADD = $(LDADD)
+encode_alter_open_DEPENDENCIES = ../src/libgetdata.la
 encode_get_SOURCES = encode_get.c
 encode_get_OBJECTS = encode_get.$(OBJEXT)
 encode_get_LDADD = $(LDADD)
 encode_get_DEPENDENCIES = ../src/libgetdata.la
-encode_move_SOURCES = encode_move.c
-encode_move_OBJECTS = encode_move.$(OBJEXT)
-encode_move_LDADD = $(LDADD)
-encode_move_DEPENDENCIES = ../src/libgetdata.la
+encode_recode_SOURCES = encode_recode.c
+encode_recode_OBJECTS = encode_recode.$(OBJEXT)
+encode_recode_LDADD = $(LDADD)
+encode_recode_DEPENDENCIES = ../src/libgetdata.la
+encode_recode_open_SOURCES = encode_recode_open.c
+encode_recode_open_OBJECTS = encode_recode_open.$(OBJEXT)
+encode_recode_open_LDADD = $(LDADD)
+encode_recode_open_DEPENDENCIES = ../src/libgetdata.la
+encode_support_SOURCES = encode_support.c
+encode_support_OBJECTS = encode_support.$(OBJEXT)
+encode_support_LDADD = $(LDADD)
+encode_support_DEPENDENCIES = ../src/libgetdata.la
 endian_alter_SOURCES = endian_alter.c
 endian_alter_OBJECTS = endian_alter.$(OBJEXT)
 endian_alter_LDADD = $(LDADD)
 endian_alter_DEPENDENCIES = ../src/libgetdata.la
+endian_alter_all_SOURCES = endian_alter_all.c
+endian_alter_all_OBJECTS = endian_alter_all.$(OBJEXT)
+endian_alter_all_LDADD = $(LDADD)
+endian_alter_all_DEPENDENCIES = ../src/libgetdata.la
 endian_alter_sie_SOURCES = endian_alter_sie.c
 endian_alter_sie_OBJECTS = endian_alter_sie.$(OBJEXT)
 endian_alter_sie_LDADD = $(LDADD)
@@ -1967,6 +2290,10 @@ eof_SOURCES = eof.c
 eof_OBJECTS = eof.$(OBJEXT)
 eof_LDADD = $(LDADD)
 eof_DEPENDENCIES = ../src/libgetdata.la
+eof_bit_SOURCES = eof_bit.c
+eof_bit_OBJECTS = eof_bit.$(OBJEXT)
+eof_bit_LDADD = $(LDADD)
+eof_bit_DEPENDENCIES = ../src/libgetdata.la
 eof_index_SOURCES = eof_index.c
 eof_index_OBJECTS = eof_index.$(OBJEXT)
 eof_index_LDADD = $(LDADD)
@@ -1979,6 +2306,10 @@ eof_phase_SOURCES = eof_phase.c
 eof_phase_OBJECTS = eof_phase.$(OBJEXT)
 eof_phase_LDADD = $(LDADD)
 eof_phase_DEPENDENCIES = ../src/libgetdata.la
+eof_phase_neg_SOURCES = eof_phase_neg.c
+eof_phase_neg_OBJECTS = eof_phase_neg.$(OBJEXT)
+eof_phase_neg_LDADD = $(LDADD)
+eof_phase_neg_DEPENDENCIES = ../src/libgetdata.la
 error_SOURCES = error.c
 error_OBJECTS = error.$(OBJEXT)
 error_LDADD = $(LDADD)
@@ -2015,10 +2346,78 @@ file_type_SOURCES = file_type.c
 file_type_OBJECTS = file_type.$(OBJEXT)
 file_type_LDADD = $(LDADD)
 file_type_DEPENDENCIES = ../src/libgetdata.la
+flac_add_SOURCES = flac_add.c
+flac_add_OBJECTS = flac_add.$(OBJEXT)
+flac_add_LDADD = $(LDADD)
+flac_add_DEPENDENCIES = ../src/libgetdata.la
+flac_get_big_SOURCES = flac_get_big.c
+flac_get_big_OBJECTS = flac_get_big.$(OBJEXT)
+flac_get_big_LDADD = $(LDADD)
+flac_get_big_DEPENDENCIES = ../src/libgetdata.la
+flac_get_far_SOURCES = flac_get_far.c
+flac_get_far_OBJECTS = flac_get_far.$(OBJEXT)
+flac_get_far_LDADD = $(LDADD)
+flac_get_far_DEPENDENCIES = ../src/libgetdata.la
+flac_get_get_SOURCES = flac_get_get.c
+flac_get_get_OBJECTS = flac_get_get.$(OBJEXT)
+flac_get_get_LDADD = $(LDADD)
+flac_get_get_DEPENDENCIES = ../src/libgetdata.la
+flac_get_get2_SOURCES = flac_get_get2.c
+flac_get_get2_OBJECTS = flac_get_get2.$(OBJEXT)
+flac_get_get2_LDADD = $(LDADD)
+flac_get_get2_DEPENDENCIES = ../src/libgetdata.la
+flac_get_little_SOURCES = flac_get_little.c
+flac_get_little_OBJECTS = flac_get_little.$(OBJEXT)
+flac_get_little_LDADD = $(LDADD)
+flac_get_little_DEPENDENCIES = ../src/libgetdata.la
+flac_nframes_SOURCES = flac_nframes.c
+flac_nframes_OBJECTS = flac_nframes.$(OBJEXT)
+flac_nframes_LDADD = $(LDADD)
+flac_nframes_DEPENDENCIES = ../src/libgetdata.la
+flac_put_big_SOURCES = flac_put_big.c
+flac_put_big_OBJECTS = flac_put_big.$(OBJEXT)
+flac_put_big_LDADD = $(LDADD)
+flac_put_big_DEPENDENCIES = ../src/libgetdata.la
+flac_put_complex128_SOURCES = flac_put_complex128.c
+flac_put_complex128_OBJECTS = flac_put_complex128.$(OBJEXT)
+flac_put_complex128_LDADD = $(LDADD)
+flac_put_complex128_DEPENDENCIES = ../src/libgetdata.la
+flac_put_float64_SOURCES = flac_put_float64.c
+flac_put_float64_OBJECTS = flac_put_float64.$(OBJEXT)
+flac_put_float64_LDADD = $(LDADD)
+flac_put_float64_DEPENDENCIES = ../src/libgetdata.la
+flac_put_int32_SOURCES = flac_put_int32.c
+flac_put_int32_OBJECTS = flac_put_int32.$(OBJEXT)
+flac_put_int32_LDADD = $(LDADD)
+flac_put_int32_DEPENDENCIES = ../src/libgetdata.la
+flac_put_little_SOURCES = flac_put_little.c
+flac_put_little_OBJECTS = flac_put_little.$(OBJEXT)
+flac_put_little_LDADD = $(LDADD)
+flac_put_little_DEPENDENCIES = ../src/libgetdata.la
+flac_seek_SOURCES = flac_seek.c
+flac_seek_OBJECTS = flac_seek.$(OBJEXT)
+flac_seek_LDADD = $(LDADD)
+flac_seek_DEPENDENCIES = ../src/libgetdata.la
+flac_seek_far_SOURCES = flac_seek_far.c
+flac_seek_far_OBJECTS = flac_seek_far.$(OBJEXT)
+flac_seek_far_LDADD = $(LDADD)
+flac_seek_far_DEPENDENCIES = ../src/libgetdata.la
+flac_sync_SOURCES = flac_sync.c
+flac_sync_OBJECTS = flac_sync.$(OBJEXT)
+flac_sync_LDADD = $(LDADD)
+flac_sync_DEPENDENCIES = ../src/libgetdata.la
 flist_SOURCES = flist.c
 flist_OBJECTS = flist.$(OBJEXT)
 flist_LDADD = $(LDADD)
 flist_DEPENDENCIES = ../src/libgetdata.la
+flist0_SOURCES = flist0.c
+flist0_OBJECTS = flist0.$(OBJEXT)
+flist0_LDADD = $(LDADD)
+flist0_DEPENDENCIES = ../src/libgetdata.la
+flist2_SOURCES = flist2.c
+flist2_OBJECTS = flist2.$(OBJEXT)
+flist2_LDADD = $(LDADD)
+flist2_DEPENDENCIES = ../src/libgetdata.la
 flist_hidden_SOURCES = flist_hidden.c
 flist_hidden_OBJECTS = flist_hidden.$(OBJEXT)
 flist_hidden_LDADD = $(LDADD)
@@ -2031,6 +2430,10 @@ flist_meta_SOURCES = flist_meta.c
 flist_meta_OBJECTS = flist_meta.$(OBJEXT)
 flist_meta_LDADD = $(LDADD)
 flist_meta_DEPENDENCIES = ../src/libgetdata.la
+flist_meta2_SOURCES = flist_meta2.c
+flist_meta2_OBJECTS = flist_meta2.$(OBJEXT)
+flist_meta2_LDADD = $(LDADD)
+flist_meta2_DEPENDENCIES = ../src/libgetdata.la
 flist_meta_hidden_SOURCES = flist_meta_hidden.c
 flist_meta_hidden_OBJECTS = flist_meta_hidden.$(OBJEXT)
 flist_meta_hidden_LDADD = $(LDADD)
@@ -2063,18 +2466,22 @@ 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_amb_code_SOURCES = flush_amb_code.c
+flush_amb_code_OBJECTS = flush_amb_code.$(OBJEXT)
+flush_amb_code_LDADD = $(LDADD)
+flush_amb_code_DEPENDENCIES = ../src/libgetdata.la
 flush_bad_code_SOURCES = flush_bad_code.c
 flush_bad_code_OBJECTS = flush_bad_code.$(OBJEXT)
 flush_bad_code_LDADD = $(LDADD)
 flush_bad_code_DEPENDENCIES = ../src/libgetdata.la
+flush_flush_SOURCES = flush_flush.c
+flush_flush_OBJECTS = flush_flush.$(OBJEXT)
+flush_flush_LDADD = $(LDADD)
+flush_flush_DEPENDENCIES = ../src/libgetdata.la
 flush_hex_SOURCES = flush_hex.c
 flush_hex_OBJECTS = flush_hex.$(OBJEXT)
 flush_hex_LDADD = $(LDADD)
@@ -2083,10 +2490,26 @@ flush_invalid_SOURCES = flush_invalid.c
 flush_invalid_OBJECTS = flush_invalid.$(OBJEXT)
 flush_invalid_LDADD = $(LDADD)
 flush_invalid_DEPENDENCIES = ../src/libgetdata.la
+flush_lincom_SOURCES = flush_lincom.c
+flush_lincom_OBJECTS = flush_lincom.$(OBJEXT)
+flush_lincom_LDADD = $(LDADD)
+flush_lincom_DEPENDENCIES = ../src/libgetdata.la
+flush_lincom1_SOURCES = flush_lincom1.c
+flush_lincom1_OBJECTS = flush_lincom1.$(OBJEXT)
+flush_lincom1_LDADD = $(LDADD)
+flush_lincom1_DEPENDENCIES = ../src/libgetdata.la
 flush_meta_SOURCES = flush_meta.c
 flush_meta_OBJECTS = flush_meta.$(OBJEXT)
 flush_meta_LDADD = $(LDADD)
 flush_meta_DEPENDENCIES = ../src/libgetdata.la
+flush_mult_SOURCES = flush_mult.c
+flush_mult_OBJECTS = flush_mult.$(OBJEXT)
+flush_mult_LDADD = $(LDADD)
+flush_mult_DEPENDENCIES = ../src/libgetdata.la
+flush_raw_close_SOURCES = flush_raw_close.c
+flush_raw_close_OBJECTS = flush_raw_close.$(OBJEXT)
+flush_raw_close_LDADD = $(LDADD)
+flush_raw_close_DEPENDENCIES = ../src/libgetdata.la
 flush_ref_SOURCES = flush_ref.c
 flush_ref_OBJECTS = flush_ref.$(OBJEXT)
 flush_ref_LDADD = $(LDADD)
@@ -2095,10 +2518,22 @@ flush_spec_SOURCES = flush_spec.c
 flush_spec_OBJECTS = flush_spec.$(OBJEXT)
 flush_spec_LDADD = $(LDADD)
 flush_spec_DEPENDENCIES = ../src/libgetdata.la
+flush_string_SOURCES = flush_string.c
+flush_string_OBJECTS = flush_string.$(OBJEXT)
+flush_string_LDADD = $(LDADD)
+flush_string_DEPENDENCIES = ../src/libgetdata.la
+flush_sync_SOURCES = flush_sync.c
+flush_sync_OBJECTS = flush_sync.$(OBJEXT)
+flush_sync_LDADD = $(LDADD)
+flush_sync_DEPENDENCIES = ../src/libgetdata.la
 foffs_alter_SOURCES = foffs_alter.c
 foffs_alter_OBJECTS = foffs_alter.$(OBJEXT)
 foffs_alter_LDADD = $(LDADD)
 foffs_alter_DEPENDENCIES = ../src/libgetdata.la
+foffs_alter_all_SOURCES = foffs_alter_all.c
+foffs_alter_all_OBJECTS = foffs_alter_all.$(OBJEXT)
+foffs_alter_all_LDADD = $(LDADD)
+foffs_alter_all_DEPENDENCIES = ../src/libgetdata.la
 foffs_get_SOURCES = foffs_get.c
 foffs_get_OBJECTS = foffs_get.$(OBJEXT)
 foffs_get_LDADD = $(LDADD)
@@ -2119,6 +2554,15 @@ fragment_affix_alter2_SOURCES = fragment_affix_alter2.c
 fragment_affix_alter2_OBJECTS = fragment_affix_alter2.$(OBJEXT)
 fragment_affix_alter2_LDADD = $(LDADD)
 fragment_affix_alter2_DEPENDENCIES = ../src/libgetdata.la
+fragment_affix_alter_code_SOURCES = fragment_affix_alter_code.c
+fragment_affix_alter_code_OBJECTS =  \
+	fragment_affix_alter_code.$(OBJEXT)
+fragment_affix_alter_code_LDADD = $(LDADD)
+fragment_affix_alter_code_DEPENDENCIES = ../src/libgetdata.la
+fragment_affix_alter_nop_SOURCES = fragment_affix_alter_nop.c
+fragment_affix_alter_nop_OBJECTS = fragment_affix_alter_nop.$(OBJEXT)
+fragment_affix_alter_nop_LDADD = $(LDADD)
+fragment_affix_alter_nop_DEPENDENCIES = ../src/libgetdata.la
 fragment_affix_dup_SOURCES = fragment_affix_dup.c
 fragment_affix_dup_OBJECTS = fragment_affix_dup.$(OBJEXT)
 fragment_affix_dup_LDADD = $(LDADD)
@@ -2199,6 +2643,10 @@ get_const_SOURCES = get_const.c
 get_const_OBJECTS = get_const.$(OBJEXT)
 get_const_LDADD = $(LDADD)
 get_const_DEPENDENCIES = ../src/libgetdata.la
+get_const_carray_SOURCES = get_const_carray.c
+get_const_carray_OBJECTS = get_const_carray.$(OBJEXT)
+get_const_carray_LDADD = $(LDADD)
+get_const_carray_DEPENDENCIES = ../src/libgetdata.la
 get_const_complex_SOURCES = get_const_complex.c
 get_const_complex_OBJECTS = get_const_complex.$(OBJEXT)
 get_const_complex_LDADD = $(LDADD)
@@ -2219,6 +2667,10 @@ get_cpolynom_int_SOURCES = get_cpolynom_int.c
 get_cpolynom_int_OBJECTS = get_cpolynom_int.$(OBJEXT)
 get_cpolynom_int_LDADD = $(LDADD)
 get_cpolynom_int_DEPENDENCIES = ../src/libgetdata.la
+get_dim_SOURCES = get_dim.c
+get_dim_OBJECTS = get_dim.$(OBJEXT)
+get_dim_LDADD = $(LDADD)
+get_dim_DEPENDENCIES = ../src/libgetdata.la
 get_divide_SOURCES = get_divide.c
 get_divide_OBJECTS = get_divide.$(OBJEXT)
 get_divide_LDADD = $(LDADD)
@@ -2349,6 +2801,10 @@ get_heres_SOURCES = get_heres.c
 get_heres_OBJECTS = get_heres.$(OBJEXT)
 get_heres_LDADD = $(LDADD)
 get_heres_DEPENDENCIES = ../src/libgetdata.la
+get_index_complex_SOURCES = get_index_complex.c
+get_index_complex_OBJECTS = get_index_complex.$(OBJEXT)
+get_index_complex_LDADD = $(LDADD)
+get_index_complex_DEPENDENCIES = ../src/libgetdata.la
 get_int16_SOURCES = get_int16.c
 get_int16_OBJECTS = get_int16.$(OBJEXT)
 get_int16_LDADD = $(LDADD)
@@ -2377,10 +2833,22 @@ get_lincom2_SOURCES = get_lincom2.c
 get_lincom2_OBJECTS = get_lincom2.$(OBJEXT)
 get_lincom2_LDADD = $(LDADD)
 get_lincom2_DEPENDENCIES = ../src/libgetdata.la
+get_lincom2s_SOURCES = get_lincom2s.c
+get_lincom2s_OBJECTS = get_lincom2s.$(OBJEXT)
+get_lincom2s_LDADD = $(LDADD)
+get_lincom2s_DEPENDENCIES = ../src/libgetdata.la
 get_lincom3_SOURCES = get_lincom3.c
 get_lincom3_OBJECTS = get_lincom3.$(OBJEXT)
 get_lincom3_LDADD = $(LDADD)
 get_lincom3_DEPENDENCIES = ../src/libgetdata.la
+get_lincom3s_SOURCES = get_lincom3s.c
+get_lincom3s_OBJECTS = get_lincom3s.$(OBJEXT)
+get_lincom3s_LDADD = $(LDADD)
+get_lincom3s_DEPENDENCIES = ../src/libgetdata.la
+get_lincom_mdt_SOURCES = get_lincom_mdt.c
+get_lincom_mdt_OBJECTS = get_lincom_mdt.$(OBJEXT)
+get_lincom_mdt_LDADD = $(LDADD)
+get_lincom_mdt_DEPENDENCIES = ../src/libgetdata.la
 get_lincom_noin_SOURCES = get_lincom_noin.c
 get_lincom_noin_OBJECTS = get_lincom_noin.$(OBJEXT)
 get_lincom_noin_LDADD = $(LDADD)
@@ -2401,6 +2869,22 @@ get_linterp_SOURCES = get_linterp.c
 get_linterp_OBJECTS = get_linterp.$(OBJEXT)
 get_linterp_LDADD = $(LDADD)
 get_linterp_DEPENDENCIES = ../src/libgetdata.la
+get_linterp1_SOURCES = get_linterp1.c
+get_linterp1_OBJECTS = get_linterp1.$(OBJEXT)
+get_linterp1_LDADD = $(LDADD)
+get_linterp1_DEPENDENCIES = ../src/libgetdata.la
+get_linterp_abs_SOURCES = get_linterp_abs.c
+get_linterp_abs_OBJECTS = get_linterp_abs.$(OBJEXT)
+get_linterp_abs_LDADD = $(LDADD)
+get_linterp_abs_DEPENDENCIES = ../src/libgetdata.la
+get_linterp_complex_SOURCES = get_linterp_complex.c
+get_linterp_complex_OBJECTS = get_linterp_complex.$(OBJEXT)
+get_linterp_complex_LDADD = $(LDADD)
+get_linterp_complex_DEPENDENCIES = ../src/libgetdata.la
+get_linterp_empty_SOURCES = get_linterp_empty.c
+get_linterp_empty_OBJECTS = get_linterp_empty.$(OBJEXT)
+get_linterp_empty_LDADD = $(LDADD)
+get_linterp_empty_DEPENDENCIES = ../src/libgetdata.la
 get_linterp_noin_SOURCES = get_linterp_noin.c
 get_linterp_noin_OBJECTS = get_linterp_noin.$(OBJEXT)
 get_linterp_noin_LDADD = $(LDADD)
@@ -2421,6 +2905,10 @@ get_mplex_bof_SOURCES = get_mplex_bof.c
 get_mplex_bof_OBJECTS = get_mplex_bof.$(OBJEXT)
 get_mplex_bof_LDADD = $(LDADD)
 get_mplex_bof_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_complex_SOURCES = get_mplex_complex.c
+get_mplex_complex_OBJECTS = get_mplex_complex.$(OBJEXT)
+get_mplex_complex_LDADD = $(LDADD)
+get_mplex_complex_DEPENDENCIES = ../src/libgetdata.la
 get_mplex_lb_SOURCES = get_mplex_lb.c
 get_mplex_lb_OBJECTS = get_mplex_lb.$(OBJEXT)
 get_mplex_lb_LDADD = $(LDADD)
@@ -2433,6 +2921,14 @@ get_mplex_nolb_SOURCES = get_mplex_nolb.c
 get_mplex_nolb_OBJECTS = get_mplex_nolb.$(OBJEXT)
 get_mplex_nolb_LDADD = $(LDADD)
 get_mplex_nolb_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_s_SOURCES = get_mplex_s.c
+get_mplex_s_OBJECTS = get_mplex_s.$(OBJEXT)
+get_mplex_s_LDADD = $(LDADD)
+get_mplex_s_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_saved_SOURCES = get_mplex_saved.c
+get_mplex_saved_OBJECTS = get_mplex_saved.$(OBJEXT)
+get_mplex_saved_LDADD = $(LDADD)
+get_mplex_saved_DEPENDENCIES = ../src/libgetdata.la
 get_multiply_SOURCES = get_multiply.c
 get_multiply_OBJECTS = get_multiply.$(OBJEXT)
 get_multiply_LDADD = $(LDADD)
@@ -2461,6 +2957,14 @@ get_multiply_s_SOURCES = get_multiply_s.c
 get_multiply_s_OBJECTS = get_multiply_s.$(OBJEXT)
 get_multiply_s_LDADD = $(LDADD)
 get_multiply_s_DEPENDENCIES = ../src/libgetdata.la
+get_neg_SOURCES = get_neg.c
+get_neg_OBJECTS = get_neg.$(OBJEXT)
+get_neg_LDADD = $(LDADD)
+get_neg_DEPENDENCIES = ../src/libgetdata.la
+get_none_SOURCES = get_none.c
+get_none_OBJECTS = get_none.$(OBJEXT)
+get_none_LDADD = $(LDADD)
+get_none_DEPENDENCIES = ../src/libgetdata.la
 get_nonexistent_SOURCES = get_nonexistent.c
 get_nonexistent_OBJECTS = get_nonexistent.$(OBJEXT)
 get_nonexistent_LDADD = $(LDADD)
@@ -2521,6 +3025,10 @@ get_ss_SOURCES = get_ss.c
 get_ss_OBJECTS = get_ss.$(OBJEXT)
 get_ss_LDADD = $(LDADD)
 get_ss_DEPENDENCIES = ../src/libgetdata.la
+get_string_SOURCES = get_string.c
+get_string_OBJECTS = get_string.$(OBJEXT)
+get_string_LDADD = $(LDADD)
+get_string_DEPENDENCIES = ../src/libgetdata.la
 get_type_SOURCES = get_type.c
 get_type_OBJECTS = get_type.$(OBJEXT)
 get_type_LDADD = $(LDADD)
@@ -2545,6 +3053,10 @@ get_window_clr_SOURCES = get_window_clr.c
 get_window_clr_OBJECTS = get_window_clr.$(OBJEXT)
 get_window_clr_LDADD = $(LDADD)
 get_window_clr_DEPENDENCIES = ../src/libgetdata.la
+get_window_complex_SOURCES = get_window_complex.c
+get_window_complex_OBJECTS = get_window_complex.$(OBJEXT)
+get_window_complex_LDADD = $(LDADD)
+get_window_complex_DEPENDENCIES = ../src/libgetdata.la
 get_window_ge_SOURCES = get_window_ge.c
 get_window_ge_OBJECTS = get_window_ge.$(OBJEXT)
 get_window_ge_LDADD = $(LDADD)
@@ -2565,6 +3077,10 @@ get_window_ne_SOURCES = get_window_ne.c
 get_window_ne_OBJECTS = get_window_ne.$(OBJEXT)
 get_window_ne_LDADD = $(LDADD)
 get_window_ne_DEPENDENCIES = ../src/libgetdata.la
+get_window_s_SOURCES = get_window_s.c
+get_window_s_OBJECTS = get_window_s.$(OBJEXT)
+get_window_s_LDADD = $(LDADD)
+get_window_s_DEPENDENCIES = ../src/libgetdata.la
 get_window_set_SOURCES = get_window_set.c
 get_window_set_OBJECTS = get_window_set.$(OBJEXT)
 get_window_set_LDADD = $(LDADD)
@@ -2573,6 +3089,14 @@ get_zero_SOURCES = get_zero.c
 get_zero_OBJECTS = get_zero.$(OBJEXT)
 get_zero_LDADD = $(LDADD)
 get_zero_DEPENDENCIES = ../src/libgetdata.la
+get_zero_complex_SOURCES = get_zero_complex.c
+get_zero_complex_OBJECTS = get_zero_complex.$(OBJEXT)
+get_zero_complex_LDADD = $(LDADD)
+get_zero_complex_DEPENDENCIES = ../src/libgetdata.la
+get_zero_float_SOURCES = get_zero_float.c
+get_zero_float_OBJECTS = get_zero_float.$(OBJEXT)
+get_zero_float_LDADD = $(LDADD)
+get_zero_float_DEPENDENCIES = ../src/libgetdata.la
 global_flags_SOURCES = global_flags.c
 global_flags_OBJECTS = global_flags.$(OBJEXT)
 global_flags_LDADD = $(LDADD)
@@ -2597,10 +3121,18 @@ gzip_add_SOURCES = gzip_add.c
 gzip_add_OBJECTS = gzip_add.$(OBJEXT)
 gzip_add_LDADD = $(LDADD)
 gzip_add_DEPENDENCIES = ../src/libgetdata.la
+gzip_del_SOURCES = gzip_del.c
+gzip_del_OBJECTS = gzip_del.$(OBJEXT)
+gzip_del_LDADD = $(LDADD)
+gzip_del_DEPENDENCIES = ../src/libgetdata.la
 gzip_get_SOURCES = gzip_get.c
 gzip_get_OBJECTS = gzip_get.$(OBJEXT)
 gzip_get_LDADD = $(LDADD)
 gzip_get_DEPENDENCIES = ../src/libgetdata.la
+gzip_get_far_SOURCES = gzip_get_far.c
+gzip_get_far_OBJECTS = gzip_get_far.$(OBJEXT)
+gzip_get_far_LDADD = $(LDADD)
+gzip_get_far_DEPENDENCIES = ../src/libgetdata.la
 gzip_get_get_SOURCES = gzip_get_get.c
 gzip_get_get_OBJECTS = gzip_get_get.$(OBJEXT)
 gzip_get_get_LDADD = $(LDADD)
@@ -2629,14 +3161,58 @@ gzip_put_SOURCES = gzip_put.c
 gzip_put_OBJECTS = gzip_put.$(OBJEXT)
 gzip_put_LDADD = $(LDADD)
 gzip_put_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_back_SOURCES = gzip_put_back.c
+gzip_put_back_OBJECTS = gzip_put_back.$(OBJEXT)
+gzip_put_back_LDADD = $(LDADD)
+gzip_put_back_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_endian_SOURCES = gzip_put_endian.c
+gzip_put_endian_OBJECTS = gzip_put_endian.$(OBJEXT)
+gzip_put_endian_LDADD = $(LDADD)
+gzip_put_endian_DEPENDENCIES = ../src/libgetdata.la
 gzip_put_get_SOURCES = gzip_put_get.c
 gzip_put_get_OBJECTS = gzip_put_get.$(OBJEXT)
 gzip_put_get_LDADD = $(LDADD)
 gzip_put_get_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_nframes_SOURCES = gzip_put_nframes.c
+gzip_put_nframes_OBJECTS = gzip_put_nframes.$(OBJEXT)
+gzip_put_nframes_LDADD = $(LDADD)
+gzip_put_nframes_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_off_SOURCES = gzip_put_off.c
+gzip_put_off_OBJECTS = gzip_put_off.$(OBJEXT)
+gzip_put_off_LDADD = $(LDADD)
+gzip_put_off_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_pad_SOURCES = gzip_put_pad.c
+gzip_put_pad_OBJECTS = gzip_put_pad.$(OBJEXT)
+gzip_put_pad_LDADD = $(LDADD)
+gzip_put_pad_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_sub_SOURCES = gzip_put_sub.c
+gzip_put_sub_OBJECTS = gzip_put_sub.$(OBJEXT)
+gzip_put_sub_LDADD = $(LDADD)
+gzip_put_sub_DEPENDENCIES = ../src/libgetdata.la
+gzip_seek_SOURCES = gzip_seek.c
+gzip_seek_OBJECTS = gzip_seek.$(OBJEXT)
+gzip_seek_LDADD = $(LDADD)
+gzip_seek_DEPENDENCIES = ../src/libgetdata.la
+gzip_seek_far_SOURCES = gzip_seek_far.c
+gzip_seek_far_OBJECTS = gzip_seek_far.$(OBJEXT)
+gzip_seek_far_LDADD = $(LDADD)
+gzip_seek_far_DEPENDENCIES = ../src/libgetdata.la
+gzip_seek_put_SOURCES = gzip_seek_put.c
+gzip_seek_put_OBJECTS = gzip_seek_put.$(OBJEXT)
+gzip_seek_put_LDADD = $(LDADD)
+gzip_seek_put_DEPENDENCIES = ../src/libgetdata.la
+gzip_sync_SOURCES = gzip_sync.c
+gzip_sync_OBJECTS = gzip_sync.$(OBJEXT)
+gzip_sync_LDADD = $(LDADD)
+gzip_sync_DEPENDENCIES = ../src/libgetdata.la
 header_complex_SOURCES = header_complex.c
 header_complex_OBJECTS = header_complex.$(OBJEXT)
 header_complex_LDADD = $(LDADD)
 header_complex_DEPENDENCIES = ../src/libgetdata.la
+header_off64t_SOURCES = header_off64t.c
+header_off64t_OBJECTS = header_off64t.$(OBJEXT)
+header_off64t_LDADD = $(LDADD)
+header_off64t_DEPENDENCIES = ../src/libgetdata.la
 hide_SOURCES = hide.c
 hide_OBJECTS = hide.$(OBJEXT)
 hide_LDADD = $(LDADD)
@@ -2649,10 +3225,6 @@ hide_unhide_SOURCES = hide_unhide.c
 hide_unhide_OBJECTS = hide_unhide.$(OBJEXT)
 hide_unhide_LDADD = $(LDADD)
 hide_unhide_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)
@@ -2677,6 +3249,10 @@ include_ignore_SOURCES = include_ignore.c
 include_ignore_OBJECTS = include_ignore.$(OBJEXT)
 include_ignore_LDADD = $(LDADD)
 include_ignore_DEPENDENCIES = ../src/libgetdata.la
+include_include_SOURCES = include_include.c
+include_include_OBJECTS = include_include.$(OBJEXT)
+include_include_LDADD = $(LDADD)
+include_include_DEPENDENCIES = ../src/libgetdata.la
 include_index_SOURCES = include_index.c
 include_index_OBJECTS = include_index.$(OBJEXT)
 include_index_LDADD = $(LDADD)
@@ -2705,18 +3281,38 @@ 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_index_SOURCES = index_index.c
+index_index_OBJECTS = index_index.$(OBJEXT)
+index_index_LDADD = $(LDADD)
+index_index_DEPENDENCIES = ../src/libgetdata.la
 index_range_SOURCES = index_range.c
 index_range_OBJECTS = index_range.$(OBJEXT)
 index_range_LDADD = $(LDADD)
 index_range_DEPENDENCIES = ../src/libgetdata.la
+index_s_SOURCES = index_s.c
+index_s_OBJECTS = index_s.$(OBJEXT)
+index_s_LDADD = $(LDADD)
+index_s_DEPENDENCIES = ../src/libgetdata.la
+index_subset_SOURCES = index_subset.c
+index_subset_OBJECTS = index_subset.$(OBJEXT)
+index_subset_LDADD = $(LDADD)
+index_subset_DEPENDENCIES = ../src/libgetdata.la
+legacy_error_SOURCES = legacy_error.c
+legacy_error_OBJECTS = legacy_error.$(OBJEXT)
+legacy_error_LDADD = $(LDADD)
+legacy_error_DEPENDENCIES = ../src/libgetdata.la
+legacy_estring_SOURCES = legacy_estring.c
+legacy_estring_OBJECTS = legacy_estring.$(OBJEXT)
+legacy_estring_LDADD = $(LDADD)
+legacy_estring_DEPENDENCIES = ../src/libgetdata.la
+legacy_format_SOURCES = legacy_format.c
+legacy_format_OBJECTS = legacy_format.$(OBJEXT)
+legacy_format_LDADD = $(LDADD)
+legacy_format_DEPENDENCIES = ../src/libgetdata.la
 legacy_get_SOURCES = legacy_get.c
 legacy_get_OBJECTS = legacy_get.$(OBJEXT)
 legacy_get_LDADD = $(LDADD)
@@ -2753,6 +3349,74 @@ lzma_nframes_SOURCES = lzma_nframes.c
 lzma_nframes_OBJECTS = lzma_nframes.$(OBJEXT)
 lzma_nframes_LDADD = $(LDADD)
 lzma_nframes_DEPENDENCIES = ../src/libgetdata.la
+lzma_put_SOURCES = lzma_put.c
+lzma_put_OBJECTS = lzma_put.$(OBJEXT)
+lzma_put_LDADD = $(LDADD)
+lzma_put_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_add_SOURCES = lzma_xz_add.c
+lzma_xz_add_OBJECTS = lzma_xz_add.$(OBJEXT)
+lzma_xz_add_LDADD = $(LDADD)
+lzma_xz_add_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_get_SOURCES = lzma_xz_get.c
+lzma_xz_get_OBJECTS = lzma_xz_get.$(OBJEXT)
+lzma_xz_get_LDADD = $(LDADD)
+lzma_xz_get_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_get_far_SOURCES = lzma_xz_get_far.c
+lzma_xz_get_far_OBJECTS = lzma_xz_get_far.$(OBJEXT)
+lzma_xz_get_far_LDADD = $(LDADD)
+lzma_xz_get_far_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_get_get_SOURCES = lzma_xz_get_get.c
+lzma_xz_get_get_OBJECTS = lzma_xz_get_get.$(OBJEXT)
+lzma_xz_get_get_LDADD = $(LDADD)
+lzma_xz_get_get_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_get_get2_SOURCES = lzma_xz_get_get2.c
+lzma_xz_get_get2_OBJECTS = lzma_xz_get_get2.$(OBJEXT)
+lzma_xz_get_get2_LDADD = $(LDADD)
+lzma_xz_get_get2_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_get_put_SOURCES = lzma_xz_get_put.c
+lzma_xz_get_put_OBJECTS = lzma_xz_get_put.$(OBJEXT)
+lzma_xz_get_put_LDADD = $(LDADD)
+lzma_xz_get_put_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_move_to_SOURCES = lzma_xz_move_to.c
+lzma_xz_move_to_OBJECTS = lzma_xz_move_to.$(OBJEXT)
+lzma_xz_move_to_LDADD = $(LDADD)
+lzma_xz_move_to_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_nframes_SOURCES = lzma_xz_nframes.c
+lzma_xz_nframes_OBJECTS = lzma_xz_nframes.$(OBJEXT)
+lzma_xz_nframes_LDADD = $(LDADD)
+lzma_xz_nframes_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_put_SOURCES = lzma_xz_put.c
+lzma_xz_put_OBJECTS = lzma_xz_put.$(OBJEXT)
+lzma_xz_put_LDADD = $(LDADD)
+lzma_xz_put_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_put_back_SOURCES = lzma_xz_put_back.c
+lzma_xz_put_back_OBJECTS = lzma_xz_put_back.$(OBJEXT)
+lzma_xz_put_back_LDADD = $(LDADD)
+lzma_xz_put_back_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_put_endian_SOURCES = lzma_xz_put_endian.c
+lzma_xz_put_endian_OBJECTS = lzma_xz_put_endian.$(OBJEXT)
+lzma_xz_put_endian_LDADD = $(LDADD)
+lzma_xz_put_endian_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_put_get_SOURCES = lzma_xz_put_get.c
+lzma_xz_put_get_OBJECTS = lzma_xz_put_get.$(OBJEXT)
+lzma_xz_put_get_LDADD = $(LDADD)
+lzma_xz_put_get_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_put_pad_SOURCES = lzma_xz_put_pad.c
+lzma_xz_put_pad_OBJECTS = lzma_xz_put_pad.$(OBJEXT)
+lzma_xz_put_pad_LDADD = $(LDADD)
+lzma_xz_put_pad_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_seek_SOURCES = lzma_xz_seek.c
+lzma_xz_seek_OBJECTS = lzma_xz_seek.$(OBJEXT)
+lzma_xz_seek_LDADD = $(LDADD)
+lzma_xz_seek_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_seek_far_SOURCES = lzma_xz_seek_far.c
+lzma_xz_seek_far_OBJECTS = lzma_xz_seek_far.$(OBJEXT)
+lzma_xz_seek_far_LDADD = $(LDADD)
+lzma_xz_seek_far_DEPENDENCIES = ../src/libgetdata.la
+lzma_xz_sync_SOURCES = lzma_xz_sync.c
+lzma_xz_sync_OBJECTS = lzma_xz_sync.$(OBJEXT)
+lzma_xz_sync_LDADD = $(LDADD)
+lzma_xz_sync_DEPENDENCIES = ../src/libgetdata.la
 madd_SOURCES = madd.c
 madd_OBJECTS = madd.$(OBJEXT)
 madd_LDADD = $(LDADD)
@@ -2881,10 +3545,6 @@ madd_window_SOURCES = madd_window.c
 madd_window_OBJECTS = madd_window.$(OBJEXT)
 madd_window_LDADD = $(LDADD)
 madd_window_DEPENDENCIES = ../src/libgetdata.la
-move_SOURCES = move.c
-move_OBJECTS = move.$(OBJEXT)
-move_LDADD = $(LDADD)
-move_DEPENDENCIES = ../src/libgetdata.la
 move_affix_SOURCES = move_affix.c
 move_affix_OBJECTS = move_affix.$(OBJEXT)
 move_affix_LDADD = $(LDADD)
@@ -2893,6 +3553,14 @@ move_affix_dup_SOURCES = move_affix_dup.c
 move_affix_dup_OBJECTS = move_affix_dup.$(OBJEXT)
 move_affix_dup_LDADD = $(LDADD)
 move_affix_dup_DEPENDENCIES = ../src/libgetdata.la
+move_affix_meta_SOURCES = move_affix_meta.c
+move_affix_meta_OBJECTS = move_affix_meta.$(OBJEXT)
+move_affix_meta_LDADD = $(LDADD)
+move_affix_meta_DEPENDENCIES = ../src/libgetdata.la
+move_affix_updb_SOURCES = move_affix_updb.c
+move_affix_updb_OBJECTS = move_affix_updb.$(OBJEXT)
+move_affix_updb_LDADD = $(LDADD)
+move_affix_updb_DEPENDENCIES = ../src/libgetdata.la
 move_alias_SOURCES = move_alias.c
 move_alias_OBJECTS = move_alias.$(OBJEXT)
 move_alias_LDADD = $(LDADD)
@@ -2913,6 +3581,10 @@ move_data_foffs_SOURCES = move_data_foffs.c
 move_data_foffs_OBJECTS = move_data_foffs.$(OBJEXT)
 move_data_foffs_LDADD = $(LDADD)
 move_data_foffs_DEPENDENCIES = ../src/libgetdata.la
+move_data_foffs_neg_SOURCES = move_data_foffs_neg.c
+move_data_foffs_neg_OBJECTS = move_data_foffs_neg.$(OBJEXT)
+move_data_foffs_neg_LDADD = $(LDADD)
+move_data_foffs_neg_DEPENDENCIES = ../src/libgetdata.la
 move_data_nop_SOURCES = move_data_nop.c
 move_data_nop_OBJECTS = move_data_nop.$(OBJEXT)
 move_data_nop_LDADD = $(LDADD)
@@ -2925,6 +3597,10 @@ move_meta_SOURCES = move_meta.c
 move_meta_OBJECTS = move_meta.$(OBJEXT)
 move_meta_LDADD = $(LDADD)
 move_meta_DEPENDENCIES = ../src/libgetdata.la
+move_move_SOURCES = move_move.c
+move_move_OBJECTS = move_move.$(OBJEXT)
+move_move_LDADD = $(LDADD)
+move_move_DEPENDENCIES = ../src/libgetdata.la
 move_protect_SOURCES = move_protect.c
 move_protect_OBJECTS = move_protect.$(OBJEXT)
 move_protect_LDADD = $(LDADD)
@@ -2933,10 +3609,6 @@ 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_affix_SOURCES = name_affix.c
 name_affix_OBJECTS = name_affix.$(OBJEXT)
 name_affix_LDADD = $(LDADD)
@@ -2949,10 +3621,30 @@ name_alias_SOURCES = name_alias.c
 name_alias_OBJECTS = name_alias.$(OBJEXT)
 name_alias_LDADD = $(LDADD)
 name_alias_DEPENDENCIES = ../src/libgetdata.la
+name_dangle_SOURCES = name_dangle.c
+name_dangle_OBJECTS = name_dangle.$(OBJEXT)
+name_dangle_LDADD = $(LDADD)
+name_dangle_DEPENDENCIES = ../src/libgetdata.la
+name_dot5_SOURCES = name_dot5.c
+name_dot5_OBJECTS = name_dot5.$(OBJEXT)
+name_dot5_LDADD = $(LDADD)
+name_dot5_DEPENDENCIES = ../src/libgetdata.la
+name_dot5r_SOURCES = name_dot5r.c
+name_dot5r_OBJECTS = name_dot5r.$(OBJEXT)
+name_dot5r_LDADD = $(LDADD)
+name_dot5r_DEPENDENCIES = ../src/libgetdata.la
+name_dot9_SOURCES = name_dot9.c
+name_dot9_OBJECTS = name_dot9.$(OBJEXT)
+name_dot9_LDADD = $(LDADD)
+name_dot9_DEPENDENCIES = ../src/libgetdata.la
 name_dup_SOURCES = name_dup.c
 name_dup_OBJECTS = name_dup.$(OBJEXT)
 name_dup_LDADD = $(LDADD)
 name_dup_DEPENDENCIES = ../src/libgetdata.la
+name_meta_SOURCES = name_meta.c
+name_meta_OBJECTS = name_meta.$(OBJEXT)
+name_meta_LDADD = $(LDADD)
+name_meta_DEPENDENCIES = ../src/libgetdata.la
 name_move_SOURCES = name_move.c
 name_move_OBJECTS = name_move.$(OBJEXT)
 name_move_LDADD = $(LDADD)
@@ -2961,14 +3653,26 @@ name_move_alias_SOURCES = name_move_alias.c
 name_move_alias_OBJECTS = name_move_alias.$(OBJEXT)
 name_move_alias_LDADD = $(LDADD)
 name_move_alias_DEPENDENCIES = ../src/libgetdata.la
+name_name_SOURCES = name_name.c
+name_name_OBJECTS = name_name.$(OBJEXT)
+name_name_LDADD = $(LDADD)
+name_name_DEPENDENCIES = ../src/libgetdata.la
 name_updb_SOURCES = name_updb.c
 name_updb_OBJECTS = name_updb.$(OBJEXT)
 name_updb_LDADD = $(LDADD)
 name_updb_DEPENDENCIES = ../src/libgetdata.la
+name_updb_affix_SOURCES = name_updb_affix.c
+name_updb_affix_OBJECTS = name_updb_affix.$(OBJEXT)
+name_updb_affix_LDADD = $(LDADD)
+name_updb_affix_DEPENDENCIES = ../src/libgetdata.la
 name_updb_alias_SOURCES = name_updb_alias.c
 name_updb_alias_OBJECTS = name_updb_alias.$(OBJEXT)
 name_updb_alias_LDADD = $(LDADD)
 name_updb_alias_DEPENDENCIES = ../src/libgetdata.la
+name_updb_carray_SOURCES = name_updb_carray.c
+name_updb_carray_OBJECTS = name_updb_carray.$(OBJEXT)
+name_updb_carray_LDADD = $(LDADD)
+name_updb_carray_DEPENDENCIES = ../src/libgetdata.la
 name_updb_const_SOURCES = name_updb_const.c
 name_updb_const_OBJECTS = name_updb_const.$(OBJEXT)
 name_updb_const_LDADD = $(LDADD)
@@ -2977,6 +3681,90 @@ name_updb_const_alias_SOURCES = name_updb_const_alias.c
 name_updb_const_alias_OBJECTS = name_updb_const_alias.$(OBJEXT)
 name_updb_const_alias_LDADD = $(LDADD)
 name_updb_const_alias_DEPENDENCIES = ../src/libgetdata.la
+native_bit_SOURCES = native_bit.c
+native_bit_OBJECTS = native_bit.$(OBJEXT)
+native_bit_LDADD = $(LDADD)
+native_bit_DEPENDENCIES = ../src/libgetdata.la
+native_const_SOURCES = native_const.c
+native_const_OBJECTS = native_const.$(OBJEXT)
+native_const_LDADD = $(LDADD)
+native_const_DEPENDENCIES = ../src/libgetdata.la
+native_index_SOURCES = native_index.c
+native_index_OBJECTS = native_index.$(OBJEXT)
+native_index_LDADD = $(LDADD)
+native_index_DEPENDENCIES = ../src/libgetdata.la
+native_lincom_SOURCES = native_lincom.c
+native_lincom_OBJECTS = native_lincom.$(OBJEXT)
+native_lincom_LDADD = $(LDADD)
+native_lincom_DEPENDENCIES = ../src/libgetdata.la
+native_lincom_cmpin_SOURCES = native_lincom_cmpin.c
+native_lincom_cmpin_OBJECTS = native_lincom_cmpin.$(OBJEXT)
+native_lincom_cmpin_LDADD = $(LDADD)
+native_lincom_cmpin_DEPENDENCIES = ../src/libgetdata.la
+native_lincom_cmpscal_SOURCES = native_lincom_cmpscal.c
+native_lincom_cmpscal_OBJECTS = native_lincom_cmpscal.$(OBJEXT)
+native_lincom_cmpscal_LDADD = $(LDADD)
+native_lincom_cmpscal_DEPENDENCIES = ../src/libgetdata.la
+native_linterp_SOURCES = native_linterp.c
+native_linterp_OBJECTS = native_linterp.$(OBJEXT)
+native_linterp_LDADD = $(LDADD)
+native_linterp_DEPENDENCIES = ../src/libgetdata.la
+native_linterp_cmp_SOURCES = native_linterp_cmp.c
+native_linterp_cmp_OBJECTS = native_linterp_cmp.$(OBJEXT)
+native_linterp_cmp_LDADD = $(LDADD)
+native_linterp_cmp_DEPENDENCIES = ../src/libgetdata.la
+native_mult_SOURCES = native_mult.c
+native_mult_OBJECTS = native_mult.$(OBJEXT)
+native_mult_LDADD = $(LDADD)
+native_mult_DEPENDENCIES = ../src/libgetdata.la
+native_mult1_SOURCES = native_mult1.c
+native_mult1_OBJECTS = native_mult1.$(OBJEXT)
+native_mult1_LDADD = $(LDADD)
+native_mult1_DEPENDENCIES = ../src/libgetdata.la
+native_mult2_SOURCES = native_mult2.c
+native_mult2_OBJECTS = native_mult2.$(OBJEXT)
+native_mult2_LDADD = $(LDADD)
+native_mult2_DEPENDENCIES = ../src/libgetdata.la
+native_phase_SOURCES = native_phase.c
+native_phase_OBJECTS = native_phase.$(OBJEXT)
+native_phase_LDADD = $(LDADD)
+native_phase_DEPENDENCIES = ../src/libgetdata.la
+native_polynom_SOURCES = native_polynom.c
+native_polynom_OBJECTS = native_polynom.$(OBJEXT)
+native_polynom_LDADD = $(LDADD)
+native_polynom_DEPENDENCIES = ../src/libgetdata.la
+native_polynom_cmpin_SOURCES = native_polynom_cmpin.c
+native_polynom_cmpin_OBJECTS = native_polynom_cmpin.$(OBJEXT)
+native_polynom_cmpin_LDADD = $(LDADD)
+native_polynom_cmpin_DEPENDENCIES = ../src/libgetdata.la
+native_polynom_cmpscal_SOURCES = native_polynom_cmpscal.c
+native_polynom_cmpscal_OBJECTS = native_polynom_cmpscal.$(OBJEXT)
+native_polynom_cmpscal_LDADD = $(LDADD)
+native_polynom_cmpscal_DEPENDENCIES = ../src/libgetdata.la
+native_raw_SOURCES = native_raw.c
+native_raw_OBJECTS = native_raw.$(OBJEXT)
+native_raw_LDADD = $(LDADD)
+native_raw_DEPENDENCIES = ../src/libgetdata.la
+native_recip_SOURCES = native_recip.c
+native_recip_OBJECTS = native_recip.$(OBJEXT)
+native_recip_LDADD = $(LDADD)
+native_recip_DEPENDENCIES = ../src/libgetdata.la
+native_recip_cmpin_SOURCES = native_recip_cmpin.c
+native_recip_cmpin_OBJECTS = native_recip_cmpin.$(OBJEXT)
+native_recip_cmpin_LDADD = $(LDADD)
+native_recip_cmpin_DEPENDENCIES = ../src/libgetdata.la
+native_recip_cmpscal_SOURCES = native_recip_cmpscal.c
+native_recip_cmpscal_OBJECTS = native_recip_cmpscal.$(OBJEXT)
+native_recip_cmpscal_LDADD = $(LDADD)
+native_recip_cmpscal_DEPENDENCIES = ../src/libgetdata.la
+native_sbit_SOURCES = native_sbit.c
+native_sbit_OBJECTS = native_sbit.$(OBJEXT)
+native_sbit_LDADD = $(LDADD)
+native_sbit_DEPENDENCIES = ../src/libgetdata.la
+native_string_SOURCES = native_string.c
+native_string_OBJECTS = native_string.$(OBJEXT)
+native_string_LDADD = $(LDADD)
+native_string_DEPENDENCIES = ../src/libgetdata.la
 nentries_alias_SOURCES = nentries_alias.c
 nentries_alias_OBJECTS = nentries_alias.$(OBJEXT)
 nentries_alias_LDADD = $(LDADD)
@@ -2993,10 +3781,6 @@ nentries_scalar_SOURCES = nentries_scalar.c
 nentries_scalar_OBJECTS = nentries_scalar.$(OBJEXT)
 nentries_scalar_LDADD = $(LDADD)
 nentries_scalar_DEPENDENCIES = ../src/libgetdata.la
-nfields_SOURCES = nfields.c
-nfields_OBJECTS = nfields.$(OBJEXT)
-nfields_LDADD = $(LDADD)
-nfields_DEPENDENCIES = ../src/libgetdata.la
 nfields_hidden_SOURCES = nfields_hidden.c
 nfields_hidden_OBJECTS = nfields_hidden.$(OBJEXT)
 nfields_hidden_LDADD = $(LDADD)
@@ -3005,6 +3789,10 @@ nfields_invalid_SOURCES = nfields_invalid.c
 nfields_invalid_OBJECTS = nfields_invalid.$(OBJEXT)
 nfields_invalid_LDADD = $(LDADD)
 nfields_invalid_DEPENDENCIES = ../src/libgetdata.la
+nfields_nfields_SOURCES = nfields_nfields.c
+nfields_nfields_OBJECTS = nfields_nfields.$(OBJEXT)
+nfields_nfields_LDADD = $(LDADD)
+nfields_nfields_DEPENDENCIES = ../src/libgetdata.la
 nfields_type_SOURCES = nfields_type.c
 nfields_type_OBJECTS = nfields_type.$(OBJEXT)
 nfields_type_LDADD = $(LDADD)
@@ -3029,10 +3817,6 @@ nfields_vector_invalid_SOURCES = nfields_vector_invalid.c
 nfields_vector_invalid_OBJECTS = nfields_vector_invalid.$(OBJEXT)
 nfields_vector_invalid_LDADD = $(LDADD)
 nfields_vector_invalid_DEPENDENCIES = ../src/libgetdata.la
-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)
@@ -3045,6 +3829,10 @@ nframes_invalid_SOURCES = nframes_invalid.c
 nframes_invalid_OBJECTS = nframes_invalid.$(OBJEXT)
 nframes_invalid_LDADD = $(LDADD)
 nframes_invalid_DEPENDENCIES = ../src/libgetdata.la
+nframes_nframes_SOURCES = nframes_nframes.c
+nframes_nframes_OBJECTS = nframes_nframes.$(OBJEXT)
+nframes_nframes_LDADD = $(LDADD)
+nframes_nframes_DEPENDENCIES = ../src/libgetdata.la
 nframes_off64_SOURCES = nframes_off64.c
 nframes_off64_OBJECTS = nframes_off64.$(OBJEXT)
 nframes_off64_LDADD = $(LDADD)
@@ -3105,10 +3893,6 @@ nmeta_vectors_parent_SOURCES = nmeta_vectors_parent.c
 nmeta_vectors_parent_OBJECTS = nmeta_vectors_parent.$(OBJEXT)
 nmeta_vectors_parent_LDADD = $(LDADD)
 nmeta_vectors_parent_DEPENDENCIES = ../src/libgetdata.la
-open_SOURCES = open.c
-open_OBJECTS = open.$(OBJEXT)
-open_LDADD = $(LDADD)
-open_DEPENDENCIES = ../src/libgetdata.la
 open_abs_SOURCES = open_abs.c
 open_abs_OBJECTS = open_abs.$(OBJEXT)
 open_abs_LDADD = $(LDADD)
@@ -3133,10 +3917,18 @@ open_cb_rescan_SOURCES = open_cb_rescan.c
 open_cb_rescan_OBJECTS = open_cb_rescan.$(OBJEXT)
 open_cb_rescan_LDADD = $(LDADD)
 open_cb_rescan_DEPENDENCIES = ../src/libgetdata.la
+open_cb_rescan_alloc_SOURCES = open_cb_rescan_alloc.c
+open_cb_rescan_alloc_OBJECTS = open_cb_rescan_alloc.$(OBJEXT)
+open_cb_rescan_alloc_LDADD = $(LDADD)
+open_cb_rescan_alloc_DEPENDENCIES = ../src/libgetdata.la
 open_eaccess_SOURCES = open_eaccess.c
 open_eaccess_OBJECTS = open_eaccess.$(OBJEXT)
 open_eaccess_LDADD = $(LDADD)
 open_eaccess_DEPENDENCIES = ../src/libgetdata.la
+open_invalid_SOURCES = open_invalid.c
+open_invalid_OBJECTS = open_invalid.$(OBJEXT)
+open_invalid_LDADD = $(LDADD)
+open_invalid_DEPENDENCIES = ../src/libgetdata.la
 open_nonexistent_SOURCES = open_nonexistent.c
 open_nonexistent_OBJECTS = open_nonexistent.$(OBJEXT)
 open_nonexistent_LDADD = $(LDADD)
@@ -3145,14 +3937,14 @@ open_notdirfile_SOURCES = open_notdirfile.c
 open_notdirfile_OBJECTS = open_notdirfile.$(OBJEXT)
 open_notdirfile_LDADD = $(LDADD)
 open_notdirfile_DEPENDENCIES = ../src/libgetdata.la
+open_open_SOURCES = open_open.c
+open_open_OBJECTS = open_open.$(OBJEXT)
+open_open_LDADD = $(LDADD)
+open_open_DEPENDENCIES = ../src/libgetdata.la
 open_rofs_SOURCES = open_rofs.c
 open_rofs_OBJECTS = open_rofs.$(OBJEXT)
 open_rofs_LDADD = $(LDADD)
 open_rofs_DEPENDENCIES = ../src/libgetdata.la
-open_sym_a_SOURCES = open_sym_a.c
-open_sym_a_OBJECTS = open_sym_a.$(OBJEXT)
-open_sym_a_LDADD = $(LDADD)
-open_sym_a_DEPENDENCIES = ../src/libgetdata.la
 open_sym_al_SOURCES = open_sym_al.c
 open_sym_al_OBJECTS = open_sym_al.$(OBJEXT)
 open_sym_al_LDADD = $(LDADD)
@@ -3173,6 +3965,14 @@ open_sym_ct_SOURCES = open_sym_ct.c
 open_sym_ct_OBJECTS = open_sym_ct.$(OBJEXT)
 open_sym_ct_LDADD = $(LDADD)
 open_sym_ct_DEPENDENCIES = ../src/libgetdata.la
+open_sym_d_SOURCES = open_sym_d.c
+open_sym_d_OBJECTS = open_sym_d.$(OBJEXT)
+open_sym_d_LDADD = $(LDADD)
+open_sym_d_DEPENDENCIES = ../src/libgetdata.la
+open_sym_l_SOURCES = open_sym_l.c
+open_sym_l_OBJECTS = open_sym_l.$(OBJEXT)
+open_sym_l_LDADD = $(LDADD)
+open_sym_l_DEPENDENCIES = ../src/libgetdata.la
 open_sym_p_SOURCES = open_sym_p.c
 open_sym_p_OBJECTS = open_sym_p.$(OBJEXT)
 open_sym_p_LDADD = $(LDADD)
@@ -3337,6 +4137,10 @@ parse_include_absrel_SOURCES = parse_include_absrel.c
 parse_include_absrel_OBJECTS = parse_include_absrel.$(OBJEXT)
 parse_include_absrel_LDADD = $(LDADD)
 parse_include_absrel_DEPENDENCIES = ../src/libgetdata.la
+parse_include_affix_bad_SOURCES = parse_include_affix_bad.c
+parse_include_affix_bad_OBJECTS = parse_include_affix_bad.$(OBJEXT)
+parse_include_affix_bad_LDADD = $(LDADD)
+parse_include_affix_bad_DEPENDENCIES = ../src/libgetdata.la
 parse_include_affix_ref_SOURCES = parse_include_affix_ref.c
 parse_include_affix_ref_OBJECTS = parse_include_affix_ref.$(OBJEXT)
 parse_include_affix_ref_LDADD = $(LDADD)
@@ -3434,6 +4238,34 @@ parse_linterp_ncols_SOURCES = parse_linterp_ncols.c
 parse_linterp_ncols_OBJECTS = parse_linterp_ncols.$(OBJEXT)
 parse_linterp_ncols_LDADD = $(LDADD)
 parse_linterp_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_literal_cmpbad_SOURCES = parse_literal_cmpbad.c
+parse_literal_cmpbad_OBJECTS = parse_literal_cmpbad.$(OBJEXT)
+parse_literal_cmpbad_LDADD = $(LDADD)
+parse_literal_cmpbad_DEPENDENCIES = ../src/libgetdata.la
+parse_literal_fltcmp_SOURCES = parse_literal_fltcmp.c
+parse_literal_fltcmp_OBJECTS = parse_literal_fltcmp.$(OBJEXT)
+parse_literal_fltcmp_LDADD = $(LDADD)
+parse_literal_fltcmp_DEPENDENCIES = ../src/libgetdata.la
+parse_literal_fltcmp0_SOURCES = parse_literal_fltcmp0.c
+parse_literal_fltcmp0_OBJECTS = parse_literal_fltcmp0.$(OBJEXT)
+parse_literal_fltcmp0_LDADD = $(LDADD)
+parse_literal_fltcmp0_DEPENDENCIES = ../src/libgetdata.la
+parse_literal_intcmp_SOURCES = parse_literal_intcmp.c
+parse_literal_intcmp_OBJECTS = parse_literal_intcmp.$(OBJEXT)
+parse_literal_intcmp_LDADD = $(LDADD)
+parse_literal_intcmp_DEPENDENCIES = ../src/libgetdata.la
+parse_literal_intcmp0_SOURCES = parse_literal_intcmp0.c
+parse_literal_intcmp0_OBJECTS = parse_literal_intcmp0.$(OBJEXT)
+parse_literal_intcmp0_LDADD = $(LDADD)
+parse_literal_intcmp0_DEPENDENCIES = ../src/libgetdata.la
+parse_literal_uintcmp_SOURCES = parse_literal_uintcmp.c
+parse_literal_uintcmp_OBJECTS = parse_literal_uintcmp.$(OBJEXT)
+parse_literal_uintcmp_LDADD = $(LDADD)
+parse_literal_uintcmp_DEPENDENCIES = ../src/libgetdata.la
+parse_literal_uintcmp0_SOURCES = parse_literal_uintcmp0.c
+parse_literal_uintcmp0_OBJECTS = parse_literal_uintcmp0.$(OBJEXT)
+parse_literal_uintcmp0_LDADD = $(LDADD)
+parse_literal_uintcmp0_DEPENDENCIES = ../src/libgetdata.la
 parse_malias_SOURCES = parse_malias.c
 parse_malias_OBJECTS = parse_malias.$(OBJEXT)
 parse_malias_LDADD = $(LDADD)
@@ -3458,6 +4290,10 @@ parse_meta_alias_SOURCES = parse_meta_alias.c
 parse_meta_alias_OBJECTS = parse_meta_alias.$(OBJEXT)
 parse_meta_alias_LDADD = $(LDADD)
 parse_meta_alias_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_frag_SOURCES = parse_meta_frag.c
+parse_meta_frag_OBJECTS = parse_meta_frag.$(OBJEXT)
+parse_meta_frag_LDADD = $(LDADD)
+parse_meta_frag_DEPENDENCIES = ../src/libgetdata.la
 parse_meta_implicit_SOURCES = parse_meta_implicit.c
 parse_meta_implicit_OBJECTS = parse_meta_implicit.$(OBJEXT)
 parse_meta_implicit_LDADD = $(LDADD)
@@ -3543,6 +4379,10 @@ parse_ncols_SOURCES = parse_ncols.c
 parse_ncols_OBJECTS = parse_ncols.$(OBJEXT)
 parse_ncols_LDADD = $(LDADD)
 parse_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_octal_zero_SOURCES = parse_octal_zero.c
+parse_octal_zero_OBJECTS = parse_octal_zero.$(OBJEXT)
+parse_octal_zero_LDADD = $(LDADD)
+parse_octal_zero_DEPENDENCIES = ../src/libgetdata.la
 parse_phase_SOURCES = parse_phase.c
 parse_phase_OBJECTS = parse_phase.$(OBJEXT)
 parse_phase_LDADD = $(LDADD)
@@ -3607,6 +4447,10 @@ parse_raw_char_SOURCES = parse_raw_char.c
 parse_raw_char_OBJECTS = parse_raw_char.$(OBJEXT)
 parse_raw_char_LDADD = $(LDADD)
 parse_raw_char_DEPENDENCIES = ../src/libgetdata.la
+parse_raw_char_bad_SOURCES = parse_raw_char_bad.c
+parse_raw_char_bad_OBJECTS = parse_raw_char_bad.$(OBJEXT)
+parse_raw_char_bad_LDADD = $(LDADD)
+parse_raw_char_bad_DEPENDENCIES = ../src/libgetdata.la
 parse_raw_ncols_SOURCES = parse_raw_ncols.c
 parse_raw_ncols_OBJECTS = parse_raw_ncols.$(OBJEXT)
 parse_raw_ncols_LDADD = $(LDADD)
@@ -3639,6 +4483,18 @@ parse_sbit_SOURCES = parse_sbit.c
 parse_sbit_OBJECTS = parse_sbit.$(OBJEXT)
 parse_sbit_LDADD = $(LDADD)
 parse_sbit_DEPENDENCIES = ../src/libgetdata.la
+parse_scalar1_SOURCES = parse_scalar1.c
+parse_scalar1_OBJECTS = parse_scalar1.$(OBJEXT)
+parse_scalar1_LDADD = $(LDADD)
+parse_scalar1_DEPENDENCIES = ../src/libgetdata.la
+parse_scalar2_SOURCES = parse_scalar2.c
+parse_scalar2_OBJECTS = parse_scalar2.$(OBJEXT)
+parse_scalar2_LDADD = $(LDADD)
+parse_scalar2_DEPENDENCIES = ../src/libgetdata.la
+parse_scalar_repr_SOURCES = parse_scalar_repr.c
+parse_scalar_repr_OBJECTS = parse_scalar_repr.$(OBJEXT)
+parse_scalar_repr_LDADD = $(LDADD)
+parse_scalar_repr_DEPENDENCIES = ../src/libgetdata.la
 parse_sort_SOURCES = parse_sort.c
 parse_sort_OBJECTS = parse_sort.$(OBJEXT)
 parse_sort_LDADD = $(LDADD)
@@ -3723,6 +4579,10 @@ protect_alter_SOURCES = protect_alter.c
 protect_alter_OBJECTS = protect_alter.$(OBJEXT)
 protect_alter_LDADD = $(LDADD)
 protect_alter_DEPENDENCIES = ../src/libgetdata.la
+protect_alter_all_SOURCES = protect_alter_all.c
+protect_alter_all_OBJECTS = protect_alter_all.$(OBJEXT)
+protect_alter_all_LDADD = $(LDADD)
+protect_alter_all_DEPENDENCIES = ../src/libgetdata.la
 protect_get_SOURCES = protect_get.c
 protect_get_OBJECTS = protect_get.$(OBJEXT)
 protect_get_LDADD = $(LDADD)
@@ -3747,6 +4607,10 @@ put_carray_SOURCES = put_carray.c
 put_carray_OBJECTS = put_carray.$(OBJEXT)
 put_carray_LDADD = $(LDADD)
 put_carray_DEPENDENCIES = ../src/libgetdata.la
+put_carray_client_SOURCES = put_carray_client.c
+put_carray_client_OBJECTS = put_carray_client.$(OBJEXT)
+put_carray_client_LDADD = $(LDADD)
+put_carray_client_DEPENDENCIES = ../src/libgetdata.la
 put_carray_slice_SOURCES = put_carray_slice.c
 put_carray_slice_OBJECTS = put_carray_slice.$(OBJEXT)
 put_carray_slice_LDADD = $(LDADD)
@@ -3755,6 +4619,10 @@ put_char_SOURCES = put_char.c
 put_char_OBJECTS = put_char.$(OBJEXT)
 put_char_LDADD = $(LDADD)
 put_char_DEPENDENCIES = ../src/libgetdata.la
+put_clincom1_SOURCES = put_clincom1.c
+put_clincom1_OBJECTS = put_clincom1.$(OBJEXT)
+put_clincom1_LDADD = $(LDADD)
+put_clincom1_DEPENDENCIES = ../src/libgetdata.la
 put_complex128_SOURCES = put_complex128.c
 put_complex128_OBJECTS = put_complex128.$(OBJEXT)
 put_complex128_LDADD = $(LDADD)
@@ -3771,6 +4639,14 @@ put_const_protect_SOURCES = put_const_protect.c
 put_const_protect_OBJECTS = put_const_protect.$(OBJEXT)
 put_const_protect_LDADD = $(LDADD)
 put_const_protect_DEPENDENCIES = ../src/libgetdata.la
+put_cpolynom_SOURCES = put_cpolynom.c
+put_cpolynom_OBJECTS = put_cpolynom.$(OBJEXT)
+put_cpolynom_LDADD = $(LDADD)
+put_cpolynom_DEPENDENCIES = ../src/libgetdata.la
+put_crecip_SOURCES = put_crecip.c
+put_crecip_OBJECTS = put_crecip.$(OBJEXT)
+put_crecip_LDADD = $(LDADD)
+put_crecip_DEPENDENCIES = ../src/libgetdata.la
 put_divide_SOURCES = put_divide.c
 put_divide_OBJECTS = put_divide.$(OBJEXT)
 put_divide_LDADD = $(LDADD)
@@ -3929,10 +4805,18 @@ put_mplex_SOURCES = put_mplex.c
 put_mplex_OBJECTS = put_mplex.$(OBJEXT)
 put_mplex_LDADD = $(LDADD)
 put_mplex_DEPENDENCIES = ../src/libgetdata.la
+put_mplex_complex_SOURCES = put_mplex_complex.c
+put_mplex_complex_OBJECTS = put_mplex_complex.$(OBJEXT)
+put_mplex_complex_LDADD = $(LDADD)
+put_mplex_complex_DEPENDENCIES = ../src/libgetdata.la
 put_multiply_SOURCES = put_multiply.c
 put_multiply_OBJECTS = put_multiply.$(OBJEXT)
 put_multiply_LDADD = $(LDADD)
 put_multiply_DEPENDENCIES = ../src/libgetdata.la
+put_nofile_SOURCES = put_nofile.c
+put_nofile_OBJECTS = put_nofile.$(OBJEXT)
+put_nofile_LDADD = $(LDADD)
+put_nofile_DEPENDENCIES = ../src/libgetdata.la
 put_null_SOURCES = put_null.c
 put_null_OBJECTS = put_null.$(OBJEXT)
 put_null_LDADD = $(LDADD)
@@ -4005,6 +4889,10 @@ put_string_protect_SOURCES = put_string_protect.c
 put_string_protect_OBJECTS = put_string_protect.$(OBJEXT)
 put_string_protect_LDADD = $(LDADD)
 put_string_protect_DEPENDENCIES = ../src/libgetdata.la
+put_sub_SOURCES = put_sub.c
+put_sub_OBJECTS = put_sub.$(OBJEXT)
+put_sub_LDADD = $(LDADD)
+put_sub_DEPENDENCIES = ../src/libgetdata.la
 put_type_SOURCES = put_type.c
 put_type_OBJECTS = put_type.$(OBJEXT)
 put_type_LDADD = $(LDADD)
@@ -4045,6 +4933,10 @@ repr_a_SOURCES = repr_a.c
 repr_a_OBJECTS = repr_a.$(OBJEXT)
 repr_a_LDADD = $(LDADD)
 repr_a_DEPENDENCIES = ../src/libgetdata.la
+repr_bad_SOURCES = repr_bad.c
+repr_bad_OBJECTS = repr_bad.$(OBJEXT)
+repr_bad_LDADD = $(LDADD)
+repr_bad_DEPENDENCIES = ../src/libgetdata.la
 repr_float32_SOURCES = repr_float32.c
 repr_float32_OBJECTS = repr_float32.$(OBJEXT)
 repr_float32_LDADD = $(LDADD)
@@ -4125,6 +5017,10 @@ seek_end_SOURCES = seek_end.c
 seek_end_OBJECTS = seek_end.$(OBJEXT)
 seek_end_LDADD = $(LDADD)
 seek_end_DEPENDENCIES = ../src/libgetdata.la
+seek_far_SOURCES = seek_far.c
+seek_far_OBJECTS = seek_far.$(OBJEXT)
+seek_far_LDADD = $(LDADD)
+seek_far_DEPENDENCIES = ../src/libgetdata.la
 seek_foffs_SOURCES = seek_foffs.c
 seek_foffs_OBJECTS = seek_foffs.$(OBJEXT)
 seek_foffs_LDADD = $(LDADD)
@@ -4133,14 +5029,34 @@ seek_foffs2_SOURCES = seek_foffs2.c
 seek_foffs2_OBJECTS = seek_foffs2.$(OBJEXT)
 seek_foffs2_LDADD = $(LDADD)
 seek_foffs2_DEPENDENCIES = ../src/libgetdata.la
+seek_index_SOURCES = seek_index.c
+seek_index_OBJECTS = seek_index.$(OBJEXT)
+seek_index_LDADD = $(LDADD)
+seek_index_DEPENDENCIES = ../src/libgetdata.la
+seek_lincom_SOURCES = seek_lincom.c
+seek_lincom_OBJECTS = seek_lincom.$(OBJEXT)
+seek_lincom_LDADD = $(LDADD)
+seek_lincom_DEPENDENCIES = ../src/libgetdata.la
+seek_mult_SOURCES = seek_mult.c
+seek_mult_OBJECTS = seek_mult.$(OBJEXT)
+seek_mult_LDADD = $(LDADD)
+seek_mult_DEPENDENCIES = ../src/libgetdata.la
 seek_neg_SOURCES = seek_neg.c
 seek_neg_OBJECTS = seek_neg.$(OBJEXT)
 seek_neg_LDADD = $(LDADD)
 seek_neg_DEPENDENCIES = ../src/libgetdata.la
+seek_phase_SOURCES = seek_phase.c
+seek_phase_OBJECTS = seek_phase.$(OBJEXT)
+seek_phase_LDADD = $(LDADD)
+seek_phase_DEPENDENCIES = ../src/libgetdata.la
 seek_set_SOURCES = seek_set.c
 seek_set_OBJECTS = seek_set.$(OBJEXT)
 seek_set_LDADD = $(LDADD)
 seek_set_DEPENDENCIES = ../src/libgetdata.la
+seek_sub_SOURCES = seek_sub.c
+seek_sub_OBJECTS = seek_sub.$(OBJEXT)
+seek_sub_LDADD = $(LDADD)
+seek_sub_DEPENDENCIES = ../src/libgetdata.la
 sie_get_big_SOURCES = sie_get_big.c
 sie_get_big_OBJECTS = sie_get_big.$(OBJEXT)
 sie_get_big_LDADD = $(LDADD)
@@ -4217,6 +5133,14 @@ sie_put_trunc_nf_SOURCES = sie_put_trunc_nf.c
 sie_put_trunc_nf_OBJECTS = sie_put_trunc_nf.$(OBJEXT)
 sie_put_trunc_nf_LDADD = $(LDADD)
 sie_put_trunc_nf_DEPENDENCIES = ../src/libgetdata.la
+sie_seek_SOURCES = sie_seek.c
+sie_seek_OBJECTS = sie_seek.$(OBJEXT)
+sie_seek_LDADD = $(LDADD)
+sie_seek_DEPENDENCIES = ../src/libgetdata.la
+sie_seek_far_SOURCES = sie_seek_far.c
+sie_seek_far_OBJECTS = sie_seek_far.$(OBJEXT)
+sie_seek_far_LDADD = $(LDADD)
+sie_seek_far_DEPENDENCIES = ../src/libgetdata.la
 sie_sync_SOURCES = sie_sync.c
 sie_sync_OBJECTS = sie_sync.$(OBJEXT)
 sie_sync_LDADD = $(LDADD)
@@ -4229,10 +5153,14 @@ 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
+slim_seek_SOURCES = slim_seek.c
+slim_seek_OBJECTS = slim_seek.$(OBJEXT)
+slim_seek_LDADD = $(LDADD)
+slim_seek_DEPENDENCIES = ../src/libgetdata.la
+slim_seek_far_SOURCES = slim_seek_far.c
+slim_seek_far_OBJECTS = slim_seek_far.$(OBJEXT)
+slim_seek_far_LDADD = $(LDADD)
+slim_seek_far_DEPENDENCIES = ../src/libgetdata.la
 spf_alias_SOURCES = spf_alias.c
 spf_alias_OBJECTS = spf_alias.$(OBJEXT)
 spf_alias_LDADD = $(LDADD)
@@ -4261,6 +5189,10 @@ spf_polynom_SOURCES = spf_polynom.c
 spf_polynom_OBJECTS = spf_polynom.$(OBJEXT)
 spf_polynom_LDADD = $(LDADD)
 spf_polynom_DEPENDENCIES = ../src/libgetdata.la
+spf_raw_SOURCES = spf_raw.c
+spf_raw_OBJECTS = spf_raw.$(OBJEXT)
+spf_raw_LDADD = $(LDADD)
+spf_raw_DEPENDENCIES = ../src/libgetdata.la
 spf_recip_SOURCES = spf_recip.c
 spf_recip_OBJECTS = spf_recip.$(OBJEXT)
 spf_recip_LDADD = $(LDADD)
@@ -4273,6 +5205,14 @@ svlist_SOURCES = svlist.c
 svlist_OBJECTS = svlist.$(OBJEXT)
 svlist_LDADD = $(LDADD)
 svlist_DEPENDENCIES = ../src/libgetdata.la
+svlist0_SOURCES = svlist0.c
+svlist0_OBJECTS = svlist0.$(OBJEXT)
+svlist0_LDADD = $(LDADD)
+svlist0_DEPENDENCIES = ../src/libgetdata.la
+svlist2_SOURCES = svlist2.c
+svlist2_OBJECTS = svlist2.$(OBJEXT)
+svlist2_LDADD = $(LDADD)
+svlist2_DEPENDENCIES = ../src/libgetdata.la
 svlist_hidden_SOURCES = svlist_hidden.c
 svlist_hidden_OBJECTS = svlist_hidden.$(OBJEXT)
 svlist_hidden_LDADD = $(LDADD)
@@ -4285,6 +5225,10 @@ svlist_meta_SOURCES = svlist_meta.c
 svlist_meta_OBJECTS = svlist_meta.$(OBJEXT)
 svlist_meta_LDADD = $(LDADD)
 svlist_meta_DEPENDENCIES = ../src/libgetdata.la
+svlist_meta0_SOURCES = svlist_meta0.c
+svlist_meta0_OBJECTS = svlist_meta0.$(OBJEXT)
+svlist_meta0_LDADD = $(LDADD)
+svlist_meta0_DEPENDENCIES = ../src/libgetdata.la
 svlist_meta_hidden_SOURCES = svlist_meta_hidden.c
 svlist_meta_hidden_OBJECTS = svlist_meta_hidden.$(OBJEXT)
 svlist_meta_hidden_LDADD = $(LDADD)
@@ -4317,6 +5261,10 @@ tell_multidiv_SOURCES = tell_multidiv.c
 tell_multidiv_OBJECTS = tell_multidiv.$(OBJEXT)
 tell_multidiv_LDADD = $(LDADD)
 tell_multidiv_DEPENDENCIES = ../src/libgetdata.la
+tell_sub_SOURCES = tell_sub.c
+tell_sub_OBJECTS = tell_sub.$(OBJEXT)
+tell_sub_LDADD = $(LDADD)
+tell_sub_DEPENDENCIES = ../src/libgetdata.la
 tok_arg_SOURCES = tok_arg.c
 tok_arg_OBJECTS = tok_arg.$(OBJEXT)
 tok_arg_LDADD = $(LDADD)
@@ -4361,6 +5309,10 @@ unclude_move_SOURCES = unclude_move.c
 unclude_move_OBJECTS = unclude_move.$(OBJEXT)
 unclude_move_LDADD = $(LDADD)
 unclude_move_DEPENDENCIES = ../src/libgetdata.la
+unclude_open_SOURCES = unclude_open.c
+unclude_open_OBJECTS = unclude_open.$(OBJEXT)
+unclude_open_LDADD = $(LDADD)
+unclude_open_DEPENDENCIES = ../src/libgetdata.la
 version_0_SOURCES = version_0.c
 version_0_OBJECTS = version_0.$(OBJEXT)
 version_0_LDADD = $(LDADD)
@@ -4489,14 +5441,6 @@ 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
 zzip_data_SOURCES = zzip_data.c
 zzip_data_OBJECTS = zzip_data.$(OBJEXT)
 zzip_data_LDADD = $(LDADD)
@@ -4513,6 +5457,14 @@ zzip_nframes_SOURCES = zzip_nframes.c
 zzip_nframes_OBJECTS = zzip_nframes.$(OBJEXT)
 zzip_nframes_LDADD = $(LDADD)
 zzip_nframes_DEPENDENCIES = ../src/libgetdata.la
+zzip_seek_SOURCES = zzip_seek.c
+zzip_seek_OBJECTS = zzip_seek.$(OBJEXT)
+zzip_seek_LDADD = $(LDADD)
+zzip_seek_DEPENDENCIES = ../src/libgetdata.la
+zzip_seek_far_SOURCES = zzip_seek_far.c
+zzip_seek_far_OBJECTS = zzip_seek_far.$(OBJEXT)
+zzip_seek_far_LDADD = $(LDADD)
+zzip_seek_far_DEPENDENCIES = ../src/libgetdata.la
 zzslim_get_SOURCES = zzslim_get.c
 zzslim_get_OBJECTS = zzslim_get.$(OBJEXT)
 zzslim_get_LDADD = $(LDADD)
@@ -4521,6 +5473,14 @@ zzslim_nframes_SOURCES = zzslim_nframes.c
 zzslim_nframes_OBJECTS = zzslim_nframes.$(OBJEXT)
 zzslim_nframes_LDADD = $(LDADD)
 zzslim_nframes_DEPENDENCIES = ../src/libgetdata.la
+zzslim_seek_SOURCES = zzslim_seek.c
+zzslim_seek_OBJECTS = zzslim_seek.$(OBJEXT)
+zzslim_seek_LDADD = $(LDADD)
+zzslim_seek_DEPENDENCIES = ../src/libgetdata.la
+zzslim_seek_far_SOURCES = zzslim_seek_far.c
+zzslim_seek_far_OBJECTS = zzslim_seek_far.$(OBJEXT)
+zzslim_seek_far_LDADD = $(LDADD)
+zzslim_seek_far_DEPENDENCIES = ../src/libgetdata.la
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -4555,19 +5515,20 @@ AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
-	add_alias_meta.c add_bit.c add_bit_bitnum.c add_bit_bitsize.c \
-	add_bit_invalid.c add_bit_numbits.c add_bit_scalars.c \
-	add_carray.c add_clincom.c add_code.c add_const.c \
-	add_cpolynom.c add_crecip.c add_crecip89.c add_dangle_dup.c \
-	add_divide.c add_divide_invalid.c add_duplicate.c add_format.c \
-	add_invalid.c add_lincom.c add_lincom_affix.c \
-	add_lincom_invalid.c add_lincom_nfields.c add_linterp.c \
-	add_linterp_invalid.c add_meta.c add_meta_alias.c add_mplex.c \
-	add_mplex_scalars.c add_multiply.c add_multiply_invalid.c \
-	add_phase.c add_phase_invalid.c add_polynom.c \
-	add_polynom_scalar.c add_protect.c add_raw.c add_raw_include.c \
-	add_raw_invalid.c add_raw_spf.c add_raw_spf_scalar.c \
+SOURCES = add_add.c add_affix.c add_alias.c add_alias_affix.c \
+	add_alias_meta.c add_amb_code7.c add_bit.c add_bit_bitnum.c \
+	add_bit_bitsize.c add_bit_invalid.c add_bit_numbits.c \
+	add_bit_scalars.c add_carray.c add_clincom.c add_code.c \
+	add_const.c add_cpolynom.c add_crecip.c add_crecip89.c \
+	add_dangle_dup.c add_divide.c add_divide_invalid.c add_dot5.c \
+	add_dot6.c add_duplicate.c add_format.c add_invalid.c \
+	add_lincom.c add_lincom_affix.c add_lincom_invalid.c \
+	add_lincom_nfields.c add_linterp.c add_linterp_invalid.c \
+	add_meta.c add_meta_alias.c add_mplex.c add_mplex_scalars.c \
+	add_multiply.c add_multiply_invalid.c add_phase.c \
+	add_phase_invalid.c add_polynom.c add_polynom_scalar.c \
+	add_protect.c add_raw.c add_raw_include.c add_raw_invalid.c \
+	add_raw_spf.c add_raw_spf_scalar.c add_raw_sub.c \
 	add_raw_type.c add_rdonly.c add_recip.c add_resolv.c \
 	add_sbit.c add_scalar.c add_scalar_carray.c \
 	add_scalar_carray_bad.c add_sort.c add_spec.c \
@@ -4577,14 +5538,18 @@ SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	alias_list_missing.c alias_num.c alias_num_alias.c \
 	alias_num_missing.c alias_target.c alias_target_alias.c \
 	alias_target_missing.c alter_bit_bitnum.c alter_bit_numbits.c \
-	alter_carray_len.c alter_carray_type.c alter_const.c \
-	alter_const_c2r.c alter_cpolynom.c alter_crecip.c \
-	alter_crecip89.c alter_crecip_zero.c alter_divide.c \
-	alter_entry.c alter_entry_affix.c alter_entry_hidden.c \
-	alter_entry_recode.c alter_entry_scalar2a.c \
+	alter_carray_len.c alter_carray_type.c alter_clincom.c \
+	alter_const.c alter_const_c2r.c alter_const_r2c.c \
+	alter_const_r2r.c alter_cpolynom.c alter_cpolynom_null.c \
+	alter_crecip.c alter_crecip89.c alter_crecip89_null.c \
+	alter_crecip_zero.c alter_divide.c alter_entry.c \
+	alter_entry_affix.c alter_entry_hidden.c alter_entry_lincom.c \
+	alter_entry_recode.c alter_entry_recode_recalc.c \
+	alter_entry_scalar1.c alter_entry_scalar2a.c \
 	alter_entry_scalar2n.c alter_entry_scalar3.c \
-	alter_entry_scalar4.c alter_lincom_23.c alter_lincom_32.c \
-	alter_lincom_affix.c alter_lincom_input.c \
+	alter_entry_scalar3c.c alter_entry_scalar4.c \
+	alter_entry_scalar_amb.c alter_index.c alter_lincom_23.c \
+	alter_lincom_32.c alter_lincom_affix.c alter_lincom_input.c \
 	alter_lincom_offset.c alter_lincom_slope.c alter_linterp.c \
 	alter_linterp_move.c alter_mplex.c alter_mspec.c \
 	alter_mspec_affix.c alter_multiply.c alter_phase.c \
@@ -4592,45 +5557,51 @@ SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	alter_polynom_ord.c alter_raw_spf.c alter_raw_type.c \
 	alter_recip.c alter_recip_zero.c alter_scalar_affix.c \
 	alter_spec.c alter_spec_affix.c alter_spec_meta.c \
-	alter_window.c ascii_add.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 \
+	alter_spec_polynom.c alter_window.c ascii_add.c ascii_get.c \
+	ascii_get_complex.c ascii_get_get.c ascii_get_here.c \
+	ascii_get_sub.c ascii_nframes.c ascii_put.c ascii_put_here.c \
+	ascii_seek.c ascii_seek_far.c ascii_sync.c bof.c bof_bit.c \
+	bof_index.c bof_lincom.c bof_phase.c bof_phase_neg.c \
+	bzip_add.c bzip_get.c bzip_get_far.c bzip_get_get.c \
+	bzip_get_get2.c bzip_get_put.c bzip_move_from.c bzip_move_to.c \
+	bzip_nframes.c bzip_put.c bzip_put_back.c bzip_put_endian.c \
+	bzip_put_get.c bzip_put_pad.c bzip_put_sub.c bzip_seek.c \
+	bzip_seek_far.c bzip_sync.c close_bad.c close_close.c \
+	close_discard.c close_null.c convert_complex128_complex64.c \
+	convert_complex128_float64.c convert_complex128_int64.c \
+	convert_complex128_uint64.c convert_complex64_complex128.c \
+	convert_complex64_float64.c convert_complex64_int64.c \
+	convert_complex64_uint64.c convert_float32_complex128.c \
+	convert_float32_complex64.c convert_float32_float64.c \
+	convert_float32_int16.c convert_float32_int32.c \
+	convert_float32_int64.c convert_float32_int8.c \
+	convert_float32_uint16.c convert_float32_uint32.c \
+	convert_float32_uint64.c convert_float32_uint8.c \
+	convert_float64_complex128.c convert_float64_complex64.c \
+	convert_float64_float32.c convert_float64_int16.c \
+	convert_float64_int32.c convert_float64_int64.c \
+	convert_float64_int8.c convert_float64_uint16.c \
+	convert_float64_uint32.c convert_float64_uint64.c \
+	convert_float64_uint8.c convert_int16_complex128.c \
+	convert_int16_complex64.c convert_int16_float32.c \
+	convert_int16_float64.c convert_int16_int32.c \
+	convert_int16_int64.c convert_int16_int8.c \
+	convert_int16_uint16.c convert_int16_uint32.c \
+	convert_int16_uint64.c convert_int16_uint8.c \
+	convert_int32_complex128.c convert_int32_complex64.c \
+	convert_int32_float32.c convert_int32_float64.c \
+	convert_int32_int16.c convert_int32_int64.c \
+	convert_int32_int8.c convert_int32_uint16.c \
+	convert_int32_uint32.c convert_int32_uint64.c \
+	convert_int32_uint8.c convert_int64_complex128.c \
+	convert_int64_complex64.c convert_int64_float32.c \
+	convert_int64_float64.c convert_int64_int16.c \
+	convert_int64_int32.c convert_int64_int8.c \
+	convert_int64_uint16.c convert_int64_uint32.c \
+	convert_int64_uint64.c convert_int64_uint8.c \
+	convert_int8_complex128.c convert_int8_complex64.c \
+	convert_int8_float32.c convert_int8_float64.c \
+	convert_int8_int16.c convert_int8_int32.c convert_int8_int64.c \
 	convert_int8_uint16.c convert_int8_uint32.c \
 	convert_int8_uint64.c convert_int8_uint8.c \
 	convert_uint16_complex128.c convert_uint16_complex64.c \
@@ -4655,45 +5626,60 @@ SOURCES = add.c add_affix.c add_alias.c add_alias_affix.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_hidden.c cvlist_array_meta.c \
-	cvlist_array_meta_hidden.c cvlist_hidden.c cvlist_invalid.c \
-	cvlist_meta.c cvlist_meta_hidden.c cvlist_meta_invalid.c del.c \
+	creat_excl.c creat_rdonly.c creat_rdonly_exists.c cvlist.c \
+	cvlist_array.c cvlist_array0.c cvlist_array_free.c \
+	cvlist_array_hidden.c cvlist_array_meta.c cvlist_array_meta0.c \
+	cvlist_array_meta_free.c cvlist_array_meta_hidden.c \
+	cvlist_hidden.c cvlist_invalid.c cvlist_meta.c cvlist_meta0.c \
+	cvlist_meta_hidden.c cvlist_meta_invalid.c del_alias.c \
 	del_carray.c del_carray_deref.c del_const.c del_const_deref.c \
-	del_const_force.c del_data.c del_derived.c del_derived_after.c \
-	del_derived_force.c del_meta.c del_meta_force.c desync.c \
-	desync_flush.c desync_reopen.c desync_reopen_inv.c dfes_bit.c \
-	dfes_divide.c dfes_lincom.c dfes_linterp.c dfes_multiply.c \
-	dfes_null.c dfes_phase.c dfes_raw.c dfes_recip.c dfes_zero.c \
-	elist_alias.c elist_hidden.c elist_noalias.c elist_scalar.c \
-	encode_alter.c encode_get.c encode_move.c endian_alter.c \
-	endian_alter_sie.c endian_get.c endian_move.c entry_bad_code.c \
-	entry_bit.c entry_bit_scalar.c entry_divide.c entry_invalid.c \
+	del_const_force.c del_data.c del_data_enoent.c del_data_open.c \
+	del_del.c del_derived.c del_derived_after.c \
+	del_derived_force.c del_meta.c del_meta_force.c del_ref.c \
+	desync.c desync_flush.c desync_path.c desync_reopen.c \
+	desync_reopen_inv.c dfes_bit.c dfes_divide.c dfes_lincom.c \
+	dfes_linterp.c dfes_multiply.c dfes_null.c dfes_phase.c \
+	dfes_raw.c dfes_recip.c dfes_zero.c elist_alias.c \
+	elist_hidden.c elist_noalias.c elist_scalar.c encode_alter.c \
+	encode_alter_all.c encode_alter_open.c encode_get.c \
+	encode_recode.c encode_recode_open.c encode_support.c \
+	endian_alter.c endian_alter_all.c endian_alter_sie.c \
+	endian_get.c endian_move.c entry_bad_code.c entry_bit.c \
+	entry_bit_scalar.c entry_divide.c entry_invalid.c \
 	entry_lincom.c entry_lincom_scalar.c entry_linterp.c \
 	entry_mplex.c entry_mplex_scalar.c entry_multiply.c \
 	entry_phase.c entry_phase_scalar.c entry_polynom.c \
 	entry_polynom_scalar.c entry_raw.c entry_raw_scalar.c \
 	entry_raw_scalar_code.c entry_raw_scalar_type.c entry_recip.c \
 	entry_scalar_repr.c entry_type.c entry_type_alias.c \
-	entry_window.c entry_window_scalar.c eof.c eof_index.c \
-	eof_lincom.c eof_phase.c error.c error_error.c error_num.c \
-	error_short.c error_verbose.c error_verbose_prefix.c file.c \
-	file_code.c file_type.c flist.c flist_hidden.c flist_invalid.c \
-	flist_meta.c flist_meta_hidden.c flist_meta_invalid.c \
-	flist_type.c flist_type_hidden.c flist_type_invalid.c \
-	flist_type_meta.c flist_type_meta_hidden.c \
-	flist_type_meta_invalid.c flush.c flush_all.c flush_bad_code.c \
-	flush_hex.c flush_invalid.c flush_meta.c flush_ref.c \
-	flush_spec.c foffs_alter.c foffs_get.c foffs_move.c \
-	fragment_affix.c fragment_affix_alter.c \
-	fragment_affix_alter2.c fragment_affix_dup.c fragment_index.c \
-	fragment_index_alias.c fragment_name.c fragment_name_oor.c \
-	fragment_num.c fragment_parent.c get64.c get_affix.c \
-	get_bad_code.c get_bit.c get_carray.c get_carray_c2r.c \
-	get_carray_len.c get_carray_slice.c get_char.c get_clincom.c \
-	get_complex128.c get_complex64.c get_const.c \
+	entry_window.c entry_window_scalar.c eof.c eof_bit.c \
+	eof_index.c eof_lincom.c eof_phase.c eof_phase_neg.c error.c \
+	error_error.c error_num.c error_short.c error_verbose.c \
+	error_verbose_prefix.c file.c file_code.c file_type.c \
+	flac_add.c flac_get_big.c flac_get_far.c flac_get_get.c \
+	flac_get_get2.c flac_get_little.c flac_nframes.c \
+	flac_put_big.c flac_put_complex128.c flac_put_float64.c \
+	flac_put_int32.c flac_put_little.c flac_seek.c flac_seek_far.c \
+	flac_sync.c flist.c flist0.c flist2.c flist_hidden.c \
+	flist_invalid.c flist_meta.c flist_meta2.c flist_meta_hidden.c \
+	flist_meta_invalid.c flist_type.c flist_type_hidden.c \
+	flist_type_invalid.c flist_type_meta.c \
+	flist_type_meta_hidden.c flist_type_meta_invalid.c flush_all.c \
+	flush_amb_code.c flush_bad_code.c flush_flush.c flush_hex.c \
+	flush_invalid.c flush_lincom.c flush_lincom1.c flush_meta.c \
+	flush_mult.c flush_raw_close.c flush_ref.c flush_spec.c \
+	flush_string.c flush_sync.c foffs_alter.c foffs_alter_all.c \
+	foffs_get.c foffs_move.c fragment_affix.c \
+	fragment_affix_alter.c fragment_affix_alter2.c \
+	fragment_affix_alter_code.c fragment_affix_alter_nop.c \
+	fragment_affix_dup.c fragment_index.c fragment_index_alias.c \
+	fragment_name.c fragment_name_oor.c fragment_num.c \
+	fragment_parent.c get64.c get_affix.c get_bad_code.c get_bit.c \
+	get_carray.c get_carray_c2r.c get_carray_len.c \
+	get_carray_slice.c get_char.c get_clincom.c get_complex128.c \
+	get_complex64.c get_const.c get_const_carray.c \
 	get_const_complex.c get_const_repr.c get_cpolynom.c \
-	get_cpolynom1.c get_cpolynom_int.c get_divide.c \
+	get_cpolynom1.c get_cpolynom_int.c get_dim.c get_divide.c \
 	get_divide_ccin.c get_divide_crin.c get_divide_crinr.c \
 	get_divide_rcin.c get_divide_s.c get_endian16.c get_endian32.c \
 	get_endian64.c get_endian8.c get_endian_complex128_arm.c \
@@ -4704,34 +5690,50 @@ SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	get_endian_float64_arm.c get_endian_float64_big.c \
 	get_endian_float64_little.c get_ff.c get_float32.c \
 	get_float64.c get_foffs.c get_foffs2.c get_fs.c get_here.c \
-	get_here_foffs.c get_heres.c get_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_here_foffs.c get_heres.c get_index_complex.c get_int16.c \
+	get_int32.c get_int64.c get_int8.c get_invalid.c get_lincom1.c \
+	get_lincom2.c get_lincom2s.c get_lincom3.c get_lincom3s.c \
+	get_lincom_mdt.c get_lincom_noin.c get_lincom_non.c \
 	get_lincom_null.c get_lincom_spf.c get_linterp.c \
-	get_linterp_noin.c get_linterp_notab.c get_linterp_sort.c \
-	get_mplex.c get_mplex_bof.c get_mplex_lb.c get_mplex_lball.c \
-	get_mplex_nolb.c get_multiply.c get_multiply_ccin.c \
-	get_multiply_crin.c get_multiply_crinr.c get_multiply_noin.c \
-	get_multiply_rcin.c get_multiply_s.c get_nonexistent.c \
+	get_linterp1.c get_linterp_abs.c get_linterp_complex.c \
+	get_linterp_empty.c get_linterp_noin.c get_linterp_notab.c \
+	get_linterp_sort.c get_mplex.c get_mplex_bof.c \
+	get_mplex_complex.c get_mplex_lb.c get_mplex_lball.c \
+	get_mplex_nolb.c get_mplex_s.c get_mplex_saved.c \
+	get_multiply.c get_multiply_ccin.c get_multiply_crin.c \
+	get_multiply_crinr.c get_multiply_noin.c get_multiply_rcin.c \
+	get_multiply_s.c get_neg.c get_none.c get_nonexistent.c \
 	get_null.c get_off64.c get_phase.c get_phase_affix.c \
 	get_polynom.c get_polynom_cmpin.c get_polynom_noin.c \
 	get_recip.c get_recip_const.c get_recurse.c get_rofs.c \
-	get_sbit.c get_sf.c get_ss.c get_type.c get_uint16.c \
-	get_uint32.c get_uint64.c get_window.c get_window_clr.c \
-	get_window_ge.c get_window_gt.c get_window_le.c \
-	get_window_lt.c get_window_ne.c get_window_set.c get_zero.c \
-	global_flags.c global_name.c global_ref.c global_ref_empty.c \
-	global_ref_set.c gzip_add.c gzip_get.c gzip_get_get.c \
+	get_sbit.c get_sf.c get_ss.c get_string.c get_type.c \
+	get_uint16.c get_uint32.c get_uint64.c get_window.c \
+	get_window_clr.c get_window_complex.c get_window_ge.c \
+	get_window_gt.c get_window_le.c get_window_lt.c \
+	get_window_ne.c get_window_s.c get_window_set.c get_zero.c \
+	get_zero_complex.c get_zero_float.c global_flags.c \
+	global_name.c global_ref.c global_ref_empty.c global_ref_set.c \
+	gzip_add.c gzip_del.c gzip_get.c gzip_get_far.c gzip_get_get.c \
 	gzip_get_get2.c gzip_get_put.c gzip_move_from.c gzip_move_to.c \
-	gzip_nframes.c gzip_put.c gzip_put_get.c header_complex.c \
-	hide.c hide_hidden.c hide_unhide.c include.c include_accmode.c \
+	gzip_nframes.c gzip_put.c gzip_put_back.c gzip_put_endian.c \
+	gzip_put_get.c gzip_put_nframes.c gzip_put_off.c \
+	gzip_put_pad.c gzip_put_sub.c gzip_seek.c gzip_seek_far.c \
+	gzip_seek_put.c gzip_sync.c header_complex.c header_off64t.c \
+	hide.c hide_hidden.c hide_unhide.c include_accmode.c \
 	include_affix.c include_auto.c include_cb.c include_creat.c \
-	include_ignore.c include_index.c include_invalid.c \
-	include_nonexistent.c include_pc.c include_ref.c include_sub.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_affix.c \
+	include_ignore.c include_include.c include_index.c \
+	include_invalid.c include_nonexistent.c include_pc.c \
+	include_ref.c include_sub.c include_syntax.c index_domain.c \
+	index_index.c index_range.c index_s.c index_subset.c \
+	legacy_error.c legacy_estring.c legacy_format.c legacy_get.c \
+	legacy_get_put.c legacy_get_rofs.c legacy_nframes.c \
+	legacy_nonexistent.c legacy_put.c legacy_spf.c lzma_get.c \
+	lzma_nframes.c lzma_put.c lzma_xz_add.c lzma_xz_get.c \
+	lzma_xz_get_far.c lzma_xz_get_get.c lzma_xz_get_get2.c \
+	lzma_xz_get_put.c lzma_xz_move_to.c lzma_xz_nframes.c \
+	lzma_xz_put.c lzma_xz_put_back.c lzma_xz_put_endian.c \
+	lzma_xz_put_get.c lzma_xz_put_pad.c lzma_xz_seek.c \
+	lzma_xz_seek_far.c lzma_xz_sync.c madd.c madd_affix.c \
 	madd_alias.c madd_alias_affix.c madd_bit.c madd_bit_invalid.c \
 	madd_carray.c madd_clincom.c madd_const.c madd_cpolynom.c \
 	madd_crecip.c madd_crecip89.c madd_divide.c madd_index.c \
@@ -4740,32 +5742,43 @@ SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	madd_multiply_invalid.c madd_phase.c madd_phase_invalid.c \
 	madd_polynom.c madd_recip.c madd_sbit.c madd_spec.c \
 	madd_spec_directive.c madd_spec_invalid.c madd_spec_resolv.c \
-	madd_string.c madd_window.c move.c move_affix.c \
-	move_affix_dup.c move_alias.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_affix.c name_affix_bad.c \
-	name_alias.c name_dup.c name_move.c name_move_alias.c \
-	name_updb.c name_updb_alias.c name_updb_const.c \
-	name_updb_const_alias.c nentries_alias.c nentries_hidden.c \
-	nentries_noalias.c nentries_scalar.c nfields.c \
-	nfields_hidden.c nfields_invalid.c nfields_type.c \
-	nfields_type_hidden.c nfields_type_invalid.c nfields_vector.c \
-	nfields_vector_hidden.c nfields_vector_invalid.c nframes.c \
-	nframes64.c nframes_empty.c nframes_invalid.c nframes_off64.c \
+	madd_string.c madd_window.c move_affix.c move_affix_dup.c \
+	move_affix_meta.c move_affix_updb.c move_alias.c \
+	move_data_enc_ar.c move_data_enc_ra.c move_data_endian.c \
+	move_data_foffs.c move_data_foffs_neg.c move_data_nop.c \
+	move_index.c move_meta.c move_move.c move_protect.c \
+	move_subdir.c name_affix.c name_affix_bad.c name_alias.c \
+	name_dangle.c name_dot5.c name_dot5r.c name_dot9.c name_dup.c \
+	name_meta.c name_move.c name_move_alias.c name_name.c \
+	name_updb.c name_updb_affix.c name_updb_alias.c \
+	name_updb_carray.c name_updb_const.c name_updb_const_alias.c \
+	native_bit.c native_const.c native_index.c native_lincom.c \
+	native_lincom_cmpin.c native_lincom_cmpscal.c native_linterp.c \
+	native_linterp_cmp.c native_mult.c native_mult1.c \
+	native_mult2.c native_phase.c native_polynom.c \
+	native_polynom_cmpin.c native_polynom_cmpscal.c native_raw.c \
+	native_recip.c native_recip_cmpin.c native_recip_cmpscal.c \
+	native_sbit.c native_string.c nentries_alias.c \
+	nentries_hidden.c nentries_noalias.c nentries_scalar.c \
+	nfields_hidden.c nfields_invalid.c nfields_nfields.c \
+	nfields_type.c nfields_type_hidden.c nfields_type_invalid.c \
+	nfields_vector.c nfields_vector_hidden.c \
+	nfields_vector_invalid.c nframes64.c nframes_empty.c \
+	nframes_invalid.c nframes_nframes.c nframes_off64.c \
 	nframes_spf.c nmeta.c nmeta_hidden.c nmeta_invalid.c \
 	nmeta_parent.c nmeta_type.c nmeta_type_hidden.c \
 	nmeta_type_invalid.c nmeta_type_parent.c nmeta_vectors.c \
 	nmeta_vectors_del.c nmeta_vectors_hidden.c \
-	nmeta_vectors_invalid.c nmeta_vectors_parent.c open.c \
-	open_abs.c open_cb_abort.c open_cb_cont.c open_cb_ignore.c \
-	open_cb_invalid.c open_cb_rescan.c open_eaccess.c \
-	open_nonexistent.c open_notdirfile.c open_rofs.c open_sym_a.c \
-	open_sym_al.c open_sym_at.c open_sym_c.c open_sym_cl.c \
-	open_sym_ct.c open_sym_p.c open_sym_pl.c open_sym_pt.c \
-	parse_alias.c parse_alias_code.c parse_alias_dup.c \
-	parse_alias_meta.c parse_alias_missing.c parse_badline.c \
-	parse_bit.c parse_bit4.c parse_bit_bitnum.c \
+	nmeta_vectors_invalid.c nmeta_vectors_parent.c open_abs.c \
+	open_cb_abort.c open_cb_cont.c open_cb_ignore.c \
+	open_cb_invalid.c open_cb_rescan.c open_cb_rescan_alloc.c \
+	open_eaccess.c open_invalid.c open_nonexistent.c \
+	open_notdirfile.c open_open.c open_rofs.c open_sym_al.c \
+	open_sym_at.c open_sym_c.c open_sym_cl.c open_sym_ct.c \
+	open_sym_d.c open_sym_l.c open_sym_p.c open_sym_pl.c \
+	open_sym_pt.c parse_alias.c parse_alias_code.c \
+	parse_alias_dup.c parse_alias_meta.c parse_alias_missing.c \
+	parse_badline.c parse_bit.c parse_bit4.c parse_bit_bitnum.c \
 	parse_bit_bitsize.c parse_bit_ncols.c parse_bit_numbits.c \
 	parse_bit_scalar.c parse_carray.c parse_carray_long.c \
 	parse_const.c parse_const_complex.c parse_const_ncols.c \
@@ -4776,46 +5789,53 @@ SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	parse_foffs_include.c parse_foffs_slash.c parse_hex.c \
 	parse_hidden.c parse_hidden_field.c parse_hidden_meta.c \
 	parse_include.c parse_include_absolute.c \
-	parse_include_absrel.c parse_include_affix_ref.c \
-	parse_include_dir.c parse_include_loop.c \
-	parse_include_nonexistent.c parse_include_prefix.c \
-	parse_include_prefix_dup.c parse_include_preprefix.c \
-	parse_include_ref.c parse_include_relabs.c \
-	parse_include_relrel.c parse_include_slash.c \
-	parse_include_suffix.c parse_include_sufsuffix.c parse_index.c \
-	parse_lincom.c parse_lincom_ncols1.c parse_lincom_ncols2.c \
+	parse_include_absrel.c parse_include_affix_bad.c \
+	parse_include_affix_ref.c parse_include_dir.c \
+	parse_include_loop.c parse_include_nonexistent.c \
+	parse_include_prefix.c parse_include_prefix_dup.c \
+	parse_include_preprefix.c parse_include_ref.c \
+	parse_include_relabs.c parse_include_relrel.c \
+	parse_include_slash.c parse_include_suffix.c \
+	parse_include_sufsuffix.c parse_index.c parse_lincom.c \
+	parse_lincom_ncols1.c parse_lincom_ncols2.c \
 	parse_lincom_nfields.c parse_lincom_nofields.c \
 	parse_lincom_non.c parse_lincom_non_ncols.c \
 	parse_lincom_scalar.c parse_linterp.c parse_linterp_ncols.c \
-	parse_malias.c parse_malias_dup.c parse_malias_meta.c \
-	parse_meta.c parse_meta_affix.c parse_meta_alias.c \
-	parse_meta_implicit.c parse_meta_implicit2.c \
-	parse_meta_implicit_affix.c parse_meta_index.c \
-	parse_meta_index2.c parse_meta_jump.c parse_meta_malias.c \
-	parse_meta_meta.c parse_meta_parent.c parse_meta_raw.c \
-	parse_mplex.c parse_mplex_ncols.c parse_mplex_nomax.c \
-	parse_mplex_scalar.c parse_multiply.c parse_multiply_ncols.c \
-	parse_name.c parse_name_dot.c parse_name_ext.c \
-	parse_name_pedantic.c parse_ncols.c parse_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_utf8.c parse_utf8_invalid.c \
-	parse_utf8_zero.c parse_version.c parse_version_89.c \
-	parse_version_98.c parse_version_include.c parse_version_p8.c \
-	parse_version_p9.c parse_version_permissive.c \
-	parse_version_slash.c parse_whitespace.c parse_window.c \
-	parse_window_ncols.c parse_window_op.c parse_window_scalar.c \
-	protect_alter.c protect_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 \
+	parse_literal_cmpbad.c parse_literal_fltcmp.c \
+	parse_literal_fltcmp0.c parse_literal_intcmp.c \
+	parse_literal_intcmp0.c parse_literal_uintcmp.c \
+	parse_literal_uintcmp0.c parse_malias.c parse_malias_dup.c \
+	parse_malias_meta.c parse_meta.c parse_meta_affix.c \
+	parse_meta_alias.c parse_meta_frag.c parse_meta_implicit.c \
+	parse_meta_implicit2.c parse_meta_implicit_affix.c \
+	parse_meta_index.c parse_meta_index2.c parse_meta_jump.c \
+	parse_meta_malias.c parse_meta_meta.c parse_meta_parent.c \
+	parse_meta_raw.c parse_mplex.c parse_mplex_ncols.c \
+	parse_mplex_nomax.c parse_mplex_scalar.c parse_multiply.c \
+	parse_multiply_ncols.c parse_name.c parse_name_dot.c \
+	parse_name_ext.c parse_name_pedantic.c parse_ncols.c \
+	parse_octal_zero.c parse_phase.c parse_phase_ncols.c \
+	parse_phase_scalar.c parse_polynom.c parse_polynom_ncols1.c \
+	parse_polynom_ncols2.c parse_polynom_scalar.c \
+	parse_protect_all.c parse_protect_bad.c parse_protect_data.c \
+	parse_protect_format.c parse_protect_none.c parse_quote.c \
+	parse_quote_mismatch.c parse_raw.c parse_raw_char.c \
+	parse_raw_char_bad.c parse_raw_ncols.c parse_raw_scalar.c \
+	parse_raw_spf.c parse_raw_type.c parse_recip.c parse_ref.c \
+	parse_ref_nonexistent.c parse_sbit.c parse_scalar1.c \
+	parse_scalar2.c parse_scalar_repr.c parse_sort.c \
+	parse_string.c parse_string_ncols.c parse_string_null.c \
+	parse_utf8.c parse_utf8_invalid.c parse_utf8_zero.c \
+	parse_version.c parse_version_89.c parse_version_98.c \
+	parse_version_include.c parse_version_p8.c parse_version_p9.c \
+	parse_version_permissive.c parse_version_slash.c \
+	parse_whitespace.c parse_window.c parse_window_ncols.c \
+	parse_window_op.c parse_window_scalar.c protect_alter.c \
+	protect_alter_all.c protect_get.c put64.c put_bad_code.c \
+	put_bit.c put_bof.c put_carray.c put_carray_client.c \
+	put_carray_slice.c put_char.c put_clincom1.c put_complex128.c \
+	put_complex64.c put_const.c put_const_protect.c put_cpolynom.c \
+	put_crecip.c put_divide.c put_endian16.c put_endian32.c \
 	put_endian64.c put_endian8.c put_endian_complex128_arm.c \
 	put_endian_complex128_big.c put_endian_complex128_little.c \
 	put_endian_complex64_arm.c put_endian_complex64_big.c \
@@ -4827,57 +5847,63 @@ SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	put_int16.c put_int32.c put_int64.c put_int8.c put_invalid.c \
 	put_lincom1.c put_lincom2.c put_lincom_noin.c put_linterp.c \
 	put_linterp_noin.c put_linterp_nomono.c put_linterp_notab.c \
-	put_linterp_reverse.c put_mplex.c put_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 put_window.c put_zero.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 seek64.c seek_cur.c seek_end.c \
-	seek_foffs.c seek_foffs2.c seek_neg.c seek_set.c sie_get_big.c \
+	put_linterp_reverse.c put_mplex.c put_mplex_complex.c \
+	put_multiply.c put_nofile.c put_null.c put_off64.c put_phase.c \
+	put_phase_noin.c put_polynom1.c put_polynom2.c \
+	put_polynom_noin.c put_protect.c put_rdonly.c put_recip.c \
+	put_recurse.c put_repr.c put_rofs.c put_sbit.c put_sf.c \
+	put_ss.c put_string.c put_string_protect.c put_sub.c \
+	put_type.c put_uint16.c put_uint32.c put_uint64.c put_window.c \
+	put_zero.c ref.c ref_none.c ref_two.c repr_a.c repr_bad.c \
+	repr_float32.c repr_float64.c repr_i.c repr_int16.c \
+	repr_int32.c repr_int64.c repr_int8.c repr_m.c repr_r.c \
+	repr_real_a.c repr_real_i.c repr_real_m.c repr_real_r.c \
+	repr_uint16.c repr_uint32.c repr_uint64.c repr_uint8.c \
+	seek64.c seek_cur.c seek_end.c seek_far.c seek_foffs.c \
+	seek_foffs2.c seek_index.c seek_lincom.c seek_mult.c \
+	seek_neg.c seek_phase.c seek_set.c seek_sub.c sie_get_big.c \
 	sie_get_little.c sie_move_from.c sie_move_to.c \
 	sie_nframes_big.c sie_nframes_little.c sie_put_append.c \
 	sie_put_append2.c sie_put_back.c sie_put_big.c \
 	sie_put_little.c sie_put_many.c sie_put_newo.c sie_put_newo0.c \
 	sie_put_pad.c sie_put_pad0.c sie_put_trunc.c sie_put_trunc2.c \
-	sie_put_trunc_nf.c sie_sync.c slim_get.c slim_nframes.c spf.c \
+	sie_put_trunc_nf.c sie_seek.c sie_seek_far.c sie_sync.c \
+	slim_get.c slim_nframes.c slim_seek.c slim_seek_far.c \
 	spf_alias.c spf_alias_meta.c spf_alias_missing.c spf_divide.c \
-	spf_lincom.c spf_multiply.c spf_polynom.c spf_recip.c \
-	spf_recurse.c svlist.c svlist_hidden.c svlist_invalid.c \
-	svlist_meta.c svlist_meta_hidden.c svlist_meta_invalid.c \
-	table.c table_code.c table_type.c tell.c tell64.c \
-	tell_multidiv.c tok_arg.c tok_escape.c tok_quote.c trunc.c \
+	spf_lincom.c spf_multiply.c spf_polynom.c spf_raw.c \
+	spf_recip.c spf_recurse.c svlist.c svlist0.c svlist2.c \
+	svlist_hidden.c svlist_invalid.c svlist_meta.c svlist_meta0.c \
+	svlist_meta_hidden.c svlist_meta_invalid.c table.c \
+	table_code.c table_type.c tell.c tell64.c tell_multidiv.c \
+	tell_sub.c tok_arg.c tok_escape.c tok_quote.c trunc.c \
 	trunc_dir.c trunc_rdonly.c trunc_rofs.c trunc_truncsub.c \
-	unclude.c unclude_del.c unclude_move.c 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 \
+	unclude.c unclude_del.c unclude_move.c unclude_open.c \
+	version_0.c version_0_write.c version_1.c version_1_write.c \
+	version_2.c version_2_write.c version_3.c version_3_write.c \
+	version_4.c version_4_write.c version_5.c version_5_strict.c \
 	version_5_write.c version_6.c version_6_strict.c \
 	version_6_write.c version_7.c version_7_strict.c \
 	version_7_write.c version_8.c version_8_strict.c \
 	version_8_write.c version_9.c version_9_strict.c \
 	version_9_write.c vlist.c vlist_alias.c vlist_hidden.c \
 	vlist_invalid.c vlist_meta.c vlist_meta_hidden.c \
-	vlist_meta_invalid.c xz_get.c xz_nframes.c zzip_data.c \
-	zzip_get.c zzip_get_get.c zzip_nframes.c zzslim_get.c \
-	zzslim_nframes.c
-DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
-	add_alias_meta.c add_bit.c add_bit_bitnum.c add_bit_bitsize.c \
-	add_bit_invalid.c add_bit_numbits.c add_bit_scalars.c \
-	add_carray.c add_clincom.c add_code.c add_const.c \
-	add_cpolynom.c add_crecip.c add_crecip89.c add_dangle_dup.c \
-	add_divide.c add_divide_invalid.c add_duplicate.c add_format.c \
-	add_invalid.c add_lincom.c add_lincom_affix.c \
-	add_lincom_invalid.c add_lincom_nfields.c add_linterp.c \
-	add_linterp_invalid.c add_meta.c add_meta_alias.c add_mplex.c \
-	add_mplex_scalars.c add_multiply.c add_multiply_invalid.c \
-	add_phase.c add_phase_invalid.c add_polynom.c \
-	add_polynom_scalar.c add_protect.c add_raw.c add_raw_include.c \
-	add_raw_invalid.c add_raw_spf.c add_raw_spf_scalar.c \
+	vlist_meta_invalid.c zzip_data.c zzip_get.c zzip_get_get.c \
+	zzip_nframes.c zzip_seek.c zzip_seek_far.c zzslim_get.c \
+	zzslim_nframes.c zzslim_seek.c zzslim_seek_far.c
+DIST_SOURCES = add_add.c add_affix.c add_alias.c add_alias_affix.c \
+	add_alias_meta.c add_amb_code7.c add_bit.c add_bit_bitnum.c \
+	add_bit_bitsize.c add_bit_invalid.c add_bit_numbits.c \
+	add_bit_scalars.c add_carray.c add_clincom.c add_code.c \
+	add_const.c add_cpolynom.c add_crecip.c add_crecip89.c \
+	add_dangle_dup.c add_divide.c add_divide_invalid.c add_dot5.c \
+	add_dot6.c add_duplicate.c add_format.c add_invalid.c \
+	add_lincom.c add_lincom_affix.c add_lincom_invalid.c \
+	add_lincom_nfields.c add_linterp.c add_linterp_invalid.c \
+	add_meta.c add_meta_alias.c add_mplex.c add_mplex_scalars.c \
+	add_multiply.c add_multiply_invalid.c add_phase.c \
+	add_phase_invalid.c add_polynom.c add_polynom_scalar.c \
+	add_protect.c add_raw.c add_raw_include.c add_raw_invalid.c \
+	add_raw_spf.c add_raw_spf_scalar.c add_raw_sub.c \
 	add_raw_type.c add_rdonly.c add_recip.c add_resolv.c \
 	add_sbit.c add_scalar.c add_scalar_carray.c \
 	add_scalar_carray_bad.c add_sort.c add_spec.c \
@@ -4887,14 +5913,18 @@ DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	alias_list_missing.c alias_num.c alias_num_alias.c \
 	alias_num_missing.c alias_target.c alias_target_alias.c \
 	alias_target_missing.c alter_bit_bitnum.c alter_bit_numbits.c \
-	alter_carray_len.c alter_carray_type.c alter_const.c \
-	alter_const_c2r.c alter_cpolynom.c alter_crecip.c \
-	alter_crecip89.c alter_crecip_zero.c alter_divide.c \
-	alter_entry.c alter_entry_affix.c alter_entry_hidden.c \
-	alter_entry_recode.c alter_entry_scalar2a.c \
+	alter_carray_len.c alter_carray_type.c alter_clincom.c \
+	alter_const.c alter_const_c2r.c alter_const_r2c.c \
+	alter_const_r2r.c alter_cpolynom.c alter_cpolynom_null.c \
+	alter_crecip.c alter_crecip89.c alter_crecip89_null.c \
+	alter_crecip_zero.c alter_divide.c alter_entry.c \
+	alter_entry_affix.c alter_entry_hidden.c alter_entry_lincom.c \
+	alter_entry_recode.c alter_entry_recode_recalc.c \
+	alter_entry_scalar1.c alter_entry_scalar2a.c \
 	alter_entry_scalar2n.c alter_entry_scalar3.c \
-	alter_entry_scalar4.c alter_lincom_23.c alter_lincom_32.c \
-	alter_lincom_affix.c alter_lincom_input.c \
+	alter_entry_scalar3c.c alter_entry_scalar4.c \
+	alter_entry_scalar_amb.c alter_index.c alter_lincom_23.c \
+	alter_lincom_32.c alter_lincom_affix.c alter_lincom_input.c \
 	alter_lincom_offset.c alter_lincom_slope.c alter_linterp.c \
 	alter_linterp_move.c alter_mplex.c alter_mspec.c \
 	alter_mspec_affix.c alter_multiply.c alter_phase.c \
@@ -4902,45 +5932,51 @@ DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	alter_polynom_ord.c alter_raw_spf.c alter_raw_type.c \
 	alter_recip.c alter_recip_zero.c alter_scalar_affix.c \
 	alter_spec.c alter_spec_affix.c alter_spec_meta.c \
-	alter_window.c ascii_add.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 \
+	alter_spec_polynom.c alter_window.c ascii_add.c ascii_get.c \
+	ascii_get_complex.c ascii_get_get.c ascii_get_here.c \
+	ascii_get_sub.c ascii_nframes.c ascii_put.c ascii_put_here.c \
+	ascii_seek.c ascii_seek_far.c ascii_sync.c bof.c bof_bit.c \
+	bof_index.c bof_lincom.c bof_phase.c bof_phase_neg.c \
+	bzip_add.c bzip_get.c bzip_get_far.c bzip_get_get.c \
+	bzip_get_get2.c bzip_get_put.c bzip_move_from.c bzip_move_to.c \
+	bzip_nframes.c bzip_put.c bzip_put_back.c bzip_put_endian.c \
+	bzip_put_get.c bzip_put_pad.c bzip_put_sub.c bzip_seek.c \
+	bzip_seek_far.c bzip_sync.c close_bad.c close_close.c \
+	close_discard.c close_null.c convert_complex128_complex64.c \
+	convert_complex128_float64.c convert_complex128_int64.c \
+	convert_complex128_uint64.c convert_complex64_complex128.c \
+	convert_complex64_float64.c convert_complex64_int64.c \
+	convert_complex64_uint64.c convert_float32_complex128.c \
+	convert_float32_complex64.c convert_float32_float64.c \
+	convert_float32_int16.c convert_float32_int32.c \
+	convert_float32_int64.c convert_float32_int8.c \
+	convert_float32_uint16.c convert_float32_uint32.c \
+	convert_float32_uint64.c convert_float32_uint8.c \
+	convert_float64_complex128.c convert_float64_complex64.c \
+	convert_float64_float32.c convert_float64_int16.c \
+	convert_float64_int32.c convert_float64_int64.c \
+	convert_float64_int8.c convert_float64_uint16.c \
+	convert_float64_uint32.c convert_float64_uint64.c \
+	convert_float64_uint8.c convert_int16_complex128.c \
+	convert_int16_complex64.c convert_int16_float32.c \
+	convert_int16_float64.c convert_int16_int32.c \
+	convert_int16_int64.c convert_int16_int8.c \
+	convert_int16_uint16.c convert_int16_uint32.c \
+	convert_int16_uint64.c convert_int16_uint8.c \
+	convert_int32_complex128.c convert_int32_complex64.c \
+	convert_int32_float32.c convert_int32_float64.c \
+	convert_int32_int16.c convert_int32_int64.c \
+	convert_int32_int8.c convert_int32_uint16.c \
+	convert_int32_uint32.c convert_int32_uint64.c \
+	convert_int32_uint8.c convert_int64_complex128.c \
+	convert_int64_complex64.c convert_int64_float32.c \
+	convert_int64_float64.c convert_int64_int16.c \
+	convert_int64_int32.c convert_int64_int8.c \
+	convert_int64_uint16.c convert_int64_uint32.c \
+	convert_int64_uint64.c convert_int64_uint8.c \
+	convert_int8_complex128.c convert_int8_complex64.c \
+	convert_int8_float32.c convert_int8_float64.c \
+	convert_int8_int16.c convert_int8_int32.c convert_int8_int64.c \
 	convert_int8_uint16.c convert_int8_uint32.c \
 	convert_int8_uint64.c convert_int8_uint8.c \
 	convert_uint16_complex128.c convert_uint16_complex64.c \
@@ -4965,45 +6001,60 @@ DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.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_hidden.c cvlist_array_meta.c \
-	cvlist_array_meta_hidden.c cvlist_hidden.c cvlist_invalid.c \
-	cvlist_meta.c cvlist_meta_hidden.c cvlist_meta_invalid.c del.c \
+	creat_excl.c creat_rdonly.c creat_rdonly_exists.c cvlist.c \
+	cvlist_array.c cvlist_array0.c cvlist_array_free.c \
+	cvlist_array_hidden.c cvlist_array_meta.c cvlist_array_meta0.c \
+	cvlist_array_meta_free.c cvlist_array_meta_hidden.c \
+	cvlist_hidden.c cvlist_invalid.c cvlist_meta.c cvlist_meta0.c \
+	cvlist_meta_hidden.c cvlist_meta_invalid.c del_alias.c \
 	del_carray.c del_carray_deref.c del_const.c del_const_deref.c \
-	del_const_force.c del_data.c del_derived.c del_derived_after.c \
-	del_derived_force.c del_meta.c del_meta_force.c desync.c \
-	desync_flush.c desync_reopen.c desync_reopen_inv.c dfes_bit.c \
-	dfes_divide.c dfes_lincom.c dfes_linterp.c dfes_multiply.c \
-	dfes_null.c dfes_phase.c dfes_raw.c dfes_recip.c dfes_zero.c \
-	elist_alias.c elist_hidden.c elist_noalias.c elist_scalar.c \
-	encode_alter.c encode_get.c encode_move.c endian_alter.c \
-	endian_alter_sie.c endian_get.c endian_move.c entry_bad_code.c \
-	entry_bit.c entry_bit_scalar.c entry_divide.c entry_invalid.c \
+	del_const_force.c del_data.c del_data_enoent.c del_data_open.c \
+	del_del.c del_derived.c del_derived_after.c \
+	del_derived_force.c del_meta.c del_meta_force.c del_ref.c \
+	desync.c desync_flush.c desync_path.c desync_reopen.c \
+	desync_reopen_inv.c dfes_bit.c dfes_divide.c dfes_lincom.c \
+	dfes_linterp.c dfes_multiply.c dfes_null.c dfes_phase.c \
+	dfes_raw.c dfes_recip.c dfes_zero.c elist_alias.c \
+	elist_hidden.c elist_noalias.c elist_scalar.c encode_alter.c \
+	encode_alter_all.c encode_alter_open.c encode_get.c \
+	encode_recode.c encode_recode_open.c encode_support.c \
+	endian_alter.c endian_alter_all.c endian_alter_sie.c \
+	endian_get.c endian_move.c entry_bad_code.c entry_bit.c \
+	entry_bit_scalar.c entry_divide.c entry_invalid.c \
 	entry_lincom.c entry_lincom_scalar.c entry_linterp.c \
 	entry_mplex.c entry_mplex_scalar.c entry_multiply.c \
 	entry_phase.c entry_phase_scalar.c entry_polynom.c \
 	entry_polynom_scalar.c entry_raw.c entry_raw_scalar.c \
 	entry_raw_scalar_code.c entry_raw_scalar_type.c entry_recip.c \
 	entry_scalar_repr.c entry_type.c entry_type_alias.c \
-	entry_window.c entry_window_scalar.c eof.c eof_index.c \
-	eof_lincom.c eof_phase.c error.c error_error.c error_num.c \
-	error_short.c error_verbose.c error_verbose_prefix.c file.c \
-	file_code.c file_type.c flist.c flist_hidden.c flist_invalid.c \
-	flist_meta.c flist_meta_hidden.c flist_meta_invalid.c \
-	flist_type.c flist_type_hidden.c flist_type_invalid.c \
-	flist_type_meta.c flist_type_meta_hidden.c \
-	flist_type_meta_invalid.c flush.c flush_all.c flush_bad_code.c \
-	flush_hex.c flush_invalid.c flush_meta.c flush_ref.c \
-	flush_spec.c foffs_alter.c foffs_get.c foffs_move.c \
-	fragment_affix.c fragment_affix_alter.c \
-	fragment_affix_alter2.c fragment_affix_dup.c fragment_index.c \
-	fragment_index_alias.c fragment_name.c fragment_name_oor.c \
-	fragment_num.c fragment_parent.c get64.c get_affix.c \
-	get_bad_code.c get_bit.c get_carray.c get_carray_c2r.c \
-	get_carray_len.c get_carray_slice.c get_char.c get_clincom.c \
-	get_complex128.c get_complex64.c get_const.c \
+	entry_window.c entry_window_scalar.c eof.c eof_bit.c \
+	eof_index.c eof_lincom.c eof_phase.c eof_phase_neg.c error.c \
+	error_error.c error_num.c error_short.c error_verbose.c \
+	error_verbose_prefix.c file.c file_code.c file_type.c \
+	flac_add.c flac_get_big.c flac_get_far.c flac_get_get.c \
+	flac_get_get2.c flac_get_little.c flac_nframes.c \
+	flac_put_big.c flac_put_complex128.c flac_put_float64.c \
+	flac_put_int32.c flac_put_little.c flac_seek.c flac_seek_far.c \
+	flac_sync.c flist.c flist0.c flist2.c flist_hidden.c \
+	flist_invalid.c flist_meta.c flist_meta2.c flist_meta_hidden.c \
+	flist_meta_invalid.c flist_type.c flist_type_hidden.c \
+	flist_type_invalid.c flist_type_meta.c \
+	flist_type_meta_hidden.c flist_type_meta_invalid.c flush_all.c \
+	flush_amb_code.c flush_bad_code.c flush_flush.c flush_hex.c \
+	flush_invalid.c flush_lincom.c flush_lincom1.c flush_meta.c \
+	flush_mult.c flush_raw_close.c flush_ref.c flush_spec.c \
+	flush_string.c flush_sync.c foffs_alter.c foffs_alter_all.c \
+	foffs_get.c foffs_move.c fragment_affix.c \
+	fragment_affix_alter.c fragment_affix_alter2.c \
+	fragment_affix_alter_code.c fragment_affix_alter_nop.c \
+	fragment_affix_dup.c fragment_index.c fragment_index_alias.c \
+	fragment_name.c fragment_name_oor.c fragment_num.c \
+	fragment_parent.c get64.c get_affix.c get_bad_code.c get_bit.c \
+	get_carray.c get_carray_c2r.c get_carray_len.c \
+	get_carray_slice.c get_char.c get_clincom.c get_complex128.c \
+	get_complex64.c get_const.c get_const_carray.c \
 	get_const_complex.c get_const_repr.c get_cpolynom.c \
-	get_cpolynom1.c get_cpolynom_int.c get_divide.c \
+	get_cpolynom1.c get_cpolynom_int.c get_dim.c get_divide.c \
 	get_divide_ccin.c get_divide_crin.c get_divide_crinr.c \
 	get_divide_rcin.c get_divide_s.c get_endian16.c get_endian32.c \
 	get_endian64.c get_endian8.c get_endian_complex128_arm.c \
@@ -5014,34 +6065,50 @@ DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	get_endian_float64_arm.c get_endian_float64_big.c \
 	get_endian_float64_little.c get_ff.c get_float32.c \
 	get_float64.c get_foffs.c get_foffs2.c get_fs.c get_here.c \
-	get_here_foffs.c get_heres.c get_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_here_foffs.c get_heres.c get_index_complex.c get_int16.c \
+	get_int32.c get_int64.c get_int8.c get_invalid.c get_lincom1.c \
+	get_lincom2.c get_lincom2s.c get_lincom3.c get_lincom3s.c \
+	get_lincom_mdt.c get_lincom_noin.c get_lincom_non.c \
 	get_lincom_null.c get_lincom_spf.c get_linterp.c \
-	get_linterp_noin.c get_linterp_notab.c get_linterp_sort.c \
-	get_mplex.c get_mplex_bof.c get_mplex_lb.c get_mplex_lball.c \
-	get_mplex_nolb.c get_multiply.c get_multiply_ccin.c \
-	get_multiply_crin.c get_multiply_crinr.c get_multiply_noin.c \
-	get_multiply_rcin.c get_multiply_s.c get_nonexistent.c \
+	get_linterp1.c get_linterp_abs.c get_linterp_complex.c \
+	get_linterp_empty.c get_linterp_noin.c get_linterp_notab.c \
+	get_linterp_sort.c get_mplex.c get_mplex_bof.c \
+	get_mplex_complex.c get_mplex_lb.c get_mplex_lball.c \
+	get_mplex_nolb.c get_mplex_s.c get_mplex_saved.c \
+	get_multiply.c get_multiply_ccin.c get_multiply_crin.c \
+	get_multiply_crinr.c get_multiply_noin.c get_multiply_rcin.c \
+	get_multiply_s.c get_neg.c get_none.c get_nonexistent.c \
 	get_null.c get_off64.c get_phase.c get_phase_affix.c \
 	get_polynom.c get_polynom_cmpin.c get_polynom_noin.c \
 	get_recip.c get_recip_const.c get_recurse.c get_rofs.c \
-	get_sbit.c get_sf.c get_ss.c get_type.c get_uint16.c \
-	get_uint32.c get_uint64.c get_window.c get_window_clr.c \
-	get_window_ge.c get_window_gt.c get_window_le.c \
-	get_window_lt.c get_window_ne.c get_window_set.c get_zero.c \
-	global_flags.c global_name.c global_ref.c global_ref_empty.c \
-	global_ref_set.c gzip_add.c gzip_get.c gzip_get_get.c \
+	get_sbit.c get_sf.c get_ss.c get_string.c get_type.c \
+	get_uint16.c get_uint32.c get_uint64.c get_window.c \
+	get_window_clr.c get_window_complex.c get_window_ge.c \
+	get_window_gt.c get_window_le.c get_window_lt.c \
+	get_window_ne.c get_window_s.c get_window_set.c get_zero.c \
+	get_zero_complex.c get_zero_float.c global_flags.c \
+	global_name.c global_ref.c global_ref_empty.c global_ref_set.c \
+	gzip_add.c gzip_del.c gzip_get.c gzip_get_far.c gzip_get_get.c \
 	gzip_get_get2.c gzip_get_put.c gzip_move_from.c gzip_move_to.c \
-	gzip_nframes.c gzip_put.c gzip_put_get.c header_complex.c \
-	hide.c hide_hidden.c hide_unhide.c include.c include_accmode.c \
+	gzip_nframes.c gzip_put.c gzip_put_back.c gzip_put_endian.c \
+	gzip_put_get.c gzip_put_nframes.c gzip_put_off.c \
+	gzip_put_pad.c gzip_put_sub.c gzip_seek.c gzip_seek_far.c \
+	gzip_seek_put.c gzip_sync.c header_complex.c header_off64t.c \
+	hide.c hide_hidden.c hide_unhide.c include_accmode.c \
 	include_affix.c include_auto.c include_cb.c include_creat.c \
-	include_ignore.c include_index.c include_invalid.c \
-	include_nonexistent.c include_pc.c include_ref.c include_sub.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_affix.c \
+	include_ignore.c include_include.c include_index.c \
+	include_invalid.c include_nonexistent.c include_pc.c \
+	include_ref.c include_sub.c include_syntax.c index_domain.c \
+	index_index.c index_range.c index_s.c index_subset.c \
+	legacy_error.c legacy_estring.c legacy_format.c legacy_get.c \
+	legacy_get_put.c legacy_get_rofs.c legacy_nframes.c \
+	legacy_nonexistent.c legacy_put.c legacy_spf.c lzma_get.c \
+	lzma_nframes.c lzma_put.c lzma_xz_add.c lzma_xz_get.c \
+	lzma_xz_get_far.c lzma_xz_get_get.c lzma_xz_get_get2.c \
+	lzma_xz_get_put.c lzma_xz_move_to.c lzma_xz_nframes.c \
+	lzma_xz_put.c lzma_xz_put_back.c lzma_xz_put_endian.c \
+	lzma_xz_put_get.c lzma_xz_put_pad.c lzma_xz_seek.c \
+	lzma_xz_seek_far.c lzma_xz_sync.c madd.c madd_affix.c \
 	madd_alias.c madd_alias_affix.c madd_bit.c madd_bit_invalid.c \
 	madd_carray.c madd_clincom.c madd_const.c madd_cpolynom.c \
 	madd_crecip.c madd_crecip89.c madd_divide.c madd_index.c \
@@ -5050,32 +6117,43 @@ DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	madd_multiply_invalid.c madd_phase.c madd_phase_invalid.c \
 	madd_polynom.c madd_recip.c madd_sbit.c madd_spec.c \
 	madd_spec_directive.c madd_spec_invalid.c madd_spec_resolv.c \
-	madd_string.c madd_window.c move.c move_affix.c \
-	move_affix_dup.c move_alias.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_affix.c name_affix_bad.c \
-	name_alias.c name_dup.c name_move.c name_move_alias.c \
-	name_updb.c name_updb_alias.c name_updb_const.c \
-	name_updb_const_alias.c nentries_alias.c nentries_hidden.c \
-	nentries_noalias.c nentries_scalar.c nfields.c \
-	nfields_hidden.c nfields_invalid.c nfields_type.c \
-	nfields_type_hidden.c nfields_type_invalid.c nfields_vector.c \
-	nfields_vector_hidden.c nfields_vector_invalid.c nframes.c \
-	nframes64.c nframes_empty.c nframes_invalid.c nframes_off64.c \
+	madd_string.c madd_window.c move_affix.c move_affix_dup.c \
+	move_affix_meta.c move_affix_updb.c move_alias.c \
+	move_data_enc_ar.c move_data_enc_ra.c move_data_endian.c \
+	move_data_foffs.c move_data_foffs_neg.c move_data_nop.c \
+	move_index.c move_meta.c move_move.c move_protect.c \
+	move_subdir.c name_affix.c name_affix_bad.c name_alias.c \
+	name_dangle.c name_dot5.c name_dot5r.c name_dot9.c name_dup.c \
+	name_meta.c name_move.c name_move_alias.c name_name.c \
+	name_updb.c name_updb_affix.c name_updb_alias.c \
+	name_updb_carray.c name_updb_const.c name_updb_const_alias.c \
+	native_bit.c native_const.c native_index.c native_lincom.c \
+	native_lincom_cmpin.c native_lincom_cmpscal.c native_linterp.c \
+	native_linterp_cmp.c native_mult.c native_mult1.c \
+	native_mult2.c native_phase.c native_polynom.c \
+	native_polynom_cmpin.c native_polynom_cmpscal.c native_raw.c \
+	native_recip.c native_recip_cmpin.c native_recip_cmpscal.c \
+	native_sbit.c native_string.c nentries_alias.c \
+	nentries_hidden.c nentries_noalias.c nentries_scalar.c \
+	nfields_hidden.c nfields_invalid.c nfields_nfields.c \
+	nfields_type.c nfields_type_hidden.c nfields_type_invalid.c \
+	nfields_vector.c nfields_vector_hidden.c \
+	nfields_vector_invalid.c nframes64.c nframes_empty.c \
+	nframes_invalid.c nframes_nframes.c nframes_off64.c \
 	nframes_spf.c nmeta.c nmeta_hidden.c nmeta_invalid.c \
 	nmeta_parent.c nmeta_type.c nmeta_type_hidden.c \
 	nmeta_type_invalid.c nmeta_type_parent.c nmeta_vectors.c \
 	nmeta_vectors_del.c nmeta_vectors_hidden.c \
-	nmeta_vectors_invalid.c nmeta_vectors_parent.c open.c \
-	open_abs.c open_cb_abort.c open_cb_cont.c open_cb_ignore.c \
-	open_cb_invalid.c open_cb_rescan.c open_eaccess.c \
-	open_nonexistent.c open_notdirfile.c open_rofs.c open_sym_a.c \
-	open_sym_al.c open_sym_at.c open_sym_c.c open_sym_cl.c \
-	open_sym_ct.c open_sym_p.c open_sym_pl.c open_sym_pt.c \
-	parse_alias.c parse_alias_code.c parse_alias_dup.c \
-	parse_alias_meta.c parse_alias_missing.c parse_badline.c \
-	parse_bit.c parse_bit4.c parse_bit_bitnum.c \
+	nmeta_vectors_invalid.c nmeta_vectors_parent.c open_abs.c \
+	open_cb_abort.c open_cb_cont.c open_cb_ignore.c \
+	open_cb_invalid.c open_cb_rescan.c open_cb_rescan_alloc.c \
+	open_eaccess.c open_invalid.c open_nonexistent.c \
+	open_notdirfile.c open_open.c open_rofs.c open_sym_al.c \
+	open_sym_at.c open_sym_c.c open_sym_cl.c open_sym_ct.c \
+	open_sym_d.c open_sym_l.c open_sym_p.c open_sym_pl.c \
+	open_sym_pt.c parse_alias.c parse_alias_code.c \
+	parse_alias_dup.c parse_alias_meta.c parse_alias_missing.c \
+	parse_badline.c parse_bit.c parse_bit4.c parse_bit_bitnum.c \
 	parse_bit_bitsize.c parse_bit_ncols.c parse_bit_numbits.c \
 	parse_bit_scalar.c parse_carray.c parse_carray_long.c \
 	parse_const.c parse_const_complex.c parse_const_ncols.c \
@@ -5086,46 +6164,53 @@ DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	parse_foffs_include.c parse_foffs_slash.c parse_hex.c \
 	parse_hidden.c parse_hidden_field.c parse_hidden_meta.c \
 	parse_include.c parse_include_absolute.c \
-	parse_include_absrel.c parse_include_affix_ref.c \
-	parse_include_dir.c parse_include_loop.c \
-	parse_include_nonexistent.c parse_include_prefix.c \
-	parse_include_prefix_dup.c parse_include_preprefix.c \
-	parse_include_ref.c parse_include_relabs.c \
-	parse_include_relrel.c parse_include_slash.c \
-	parse_include_suffix.c parse_include_sufsuffix.c parse_index.c \
-	parse_lincom.c parse_lincom_ncols1.c parse_lincom_ncols2.c \
+	parse_include_absrel.c parse_include_affix_bad.c \
+	parse_include_affix_ref.c parse_include_dir.c \
+	parse_include_loop.c parse_include_nonexistent.c \
+	parse_include_prefix.c parse_include_prefix_dup.c \
+	parse_include_preprefix.c parse_include_ref.c \
+	parse_include_relabs.c parse_include_relrel.c \
+	parse_include_slash.c parse_include_suffix.c \
+	parse_include_sufsuffix.c parse_index.c parse_lincom.c \
+	parse_lincom_ncols1.c parse_lincom_ncols2.c \
 	parse_lincom_nfields.c parse_lincom_nofields.c \
 	parse_lincom_non.c parse_lincom_non_ncols.c \
 	parse_lincom_scalar.c parse_linterp.c parse_linterp_ncols.c \
-	parse_malias.c parse_malias_dup.c parse_malias_meta.c \
-	parse_meta.c parse_meta_affix.c parse_meta_alias.c \
-	parse_meta_implicit.c parse_meta_implicit2.c \
-	parse_meta_implicit_affix.c parse_meta_index.c \
-	parse_meta_index2.c parse_meta_jump.c parse_meta_malias.c \
-	parse_meta_meta.c parse_meta_parent.c parse_meta_raw.c \
-	parse_mplex.c parse_mplex_ncols.c parse_mplex_nomax.c \
-	parse_mplex_scalar.c parse_multiply.c parse_multiply_ncols.c \
-	parse_name.c parse_name_dot.c parse_name_ext.c \
-	parse_name_pedantic.c parse_ncols.c parse_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_utf8.c parse_utf8_invalid.c \
-	parse_utf8_zero.c parse_version.c parse_version_89.c \
-	parse_version_98.c parse_version_include.c parse_version_p8.c \
-	parse_version_p9.c parse_version_permissive.c \
-	parse_version_slash.c parse_whitespace.c parse_window.c \
-	parse_window_ncols.c parse_window_op.c parse_window_scalar.c \
-	protect_alter.c protect_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 \
+	parse_literal_cmpbad.c parse_literal_fltcmp.c \
+	parse_literal_fltcmp0.c parse_literal_intcmp.c \
+	parse_literal_intcmp0.c parse_literal_uintcmp.c \
+	parse_literal_uintcmp0.c parse_malias.c parse_malias_dup.c \
+	parse_malias_meta.c parse_meta.c parse_meta_affix.c \
+	parse_meta_alias.c parse_meta_frag.c parse_meta_implicit.c \
+	parse_meta_implicit2.c parse_meta_implicit_affix.c \
+	parse_meta_index.c parse_meta_index2.c parse_meta_jump.c \
+	parse_meta_malias.c parse_meta_meta.c parse_meta_parent.c \
+	parse_meta_raw.c parse_mplex.c parse_mplex_ncols.c \
+	parse_mplex_nomax.c parse_mplex_scalar.c parse_multiply.c \
+	parse_multiply_ncols.c parse_name.c parse_name_dot.c \
+	parse_name_ext.c parse_name_pedantic.c parse_ncols.c \
+	parse_octal_zero.c parse_phase.c parse_phase_ncols.c \
+	parse_phase_scalar.c parse_polynom.c parse_polynom_ncols1.c \
+	parse_polynom_ncols2.c parse_polynom_scalar.c \
+	parse_protect_all.c parse_protect_bad.c parse_protect_data.c \
+	parse_protect_format.c parse_protect_none.c parse_quote.c \
+	parse_quote_mismatch.c parse_raw.c parse_raw_char.c \
+	parse_raw_char_bad.c parse_raw_ncols.c parse_raw_scalar.c \
+	parse_raw_spf.c parse_raw_type.c parse_recip.c parse_ref.c \
+	parse_ref_nonexistent.c parse_sbit.c parse_scalar1.c \
+	parse_scalar2.c parse_scalar_repr.c parse_sort.c \
+	parse_string.c parse_string_ncols.c parse_string_null.c \
+	parse_utf8.c parse_utf8_invalid.c parse_utf8_zero.c \
+	parse_version.c parse_version_89.c parse_version_98.c \
+	parse_version_include.c parse_version_p8.c parse_version_p9.c \
+	parse_version_permissive.c parse_version_slash.c \
+	parse_whitespace.c parse_window.c parse_window_ncols.c \
+	parse_window_op.c parse_window_scalar.c protect_alter.c \
+	protect_alter_all.c protect_get.c put64.c put_bad_code.c \
+	put_bit.c put_bof.c put_carray.c put_carray_client.c \
+	put_carray_slice.c put_char.c put_clincom1.c put_complex128.c \
+	put_complex64.c put_const.c put_const_protect.c put_cpolynom.c \
+	put_crecip.c put_divide.c put_endian16.c put_endian32.c \
 	put_endian64.c put_endian8.c put_endian_complex128_arm.c \
 	put_endian_complex128_big.c put_endian_complex128_little.c \
 	put_endian_complex64_arm.c put_endian_complex64_big.c \
@@ -5137,44 +6222,49 @@ DIST_SOURCES = add.c add_affix.c add_alias.c add_alias_affix.c \
 	put_int16.c put_int32.c put_int64.c put_int8.c put_invalid.c \
 	put_lincom1.c put_lincom2.c put_lincom_noin.c put_linterp.c \
 	put_linterp_noin.c put_linterp_nomono.c put_linterp_notab.c \
-	put_linterp_reverse.c put_mplex.c put_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 put_window.c put_zero.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 seek64.c seek_cur.c seek_end.c \
-	seek_foffs.c seek_foffs2.c seek_neg.c seek_set.c sie_get_big.c \
+	put_linterp_reverse.c put_mplex.c put_mplex_complex.c \
+	put_multiply.c put_nofile.c put_null.c put_off64.c put_phase.c \
+	put_phase_noin.c put_polynom1.c put_polynom2.c \
+	put_polynom_noin.c put_protect.c put_rdonly.c put_recip.c \
+	put_recurse.c put_repr.c put_rofs.c put_sbit.c put_sf.c \
+	put_ss.c put_string.c put_string_protect.c put_sub.c \
+	put_type.c put_uint16.c put_uint32.c put_uint64.c put_window.c \
+	put_zero.c ref.c ref_none.c ref_two.c repr_a.c repr_bad.c \
+	repr_float32.c repr_float64.c repr_i.c repr_int16.c \
+	repr_int32.c repr_int64.c repr_int8.c repr_m.c repr_r.c \
+	repr_real_a.c repr_real_i.c repr_real_m.c repr_real_r.c \
+	repr_uint16.c repr_uint32.c repr_uint64.c repr_uint8.c \
+	seek64.c seek_cur.c seek_end.c seek_far.c seek_foffs.c \
+	seek_foffs2.c seek_index.c seek_lincom.c seek_mult.c \
+	seek_neg.c seek_phase.c seek_set.c seek_sub.c sie_get_big.c \
 	sie_get_little.c sie_move_from.c sie_move_to.c \
 	sie_nframes_big.c sie_nframes_little.c sie_put_append.c \
 	sie_put_append2.c sie_put_back.c sie_put_big.c \
 	sie_put_little.c sie_put_many.c sie_put_newo.c sie_put_newo0.c \
 	sie_put_pad.c sie_put_pad0.c sie_put_trunc.c sie_put_trunc2.c \
-	sie_put_trunc_nf.c sie_sync.c slim_get.c slim_nframes.c spf.c \
+	sie_put_trunc_nf.c sie_seek.c sie_seek_far.c sie_sync.c \
+	slim_get.c slim_nframes.c slim_seek.c slim_seek_far.c \
 	spf_alias.c spf_alias_meta.c spf_alias_missing.c spf_divide.c \
-	spf_lincom.c spf_multiply.c spf_polynom.c spf_recip.c \
-	spf_recurse.c svlist.c svlist_hidden.c svlist_invalid.c \
-	svlist_meta.c svlist_meta_hidden.c svlist_meta_invalid.c \
-	table.c table_code.c table_type.c tell.c tell64.c \
-	tell_multidiv.c tok_arg.c tok_escape.c tok_quote.c trunc.c \
+	spf_lincom.c spf_multiply.c spf_polynom.c spf_raw.c \
+	spf_recip.c spf_recurse.c svlist.c svlist0.c svlist2.c \
+	svlist_hidden.c svlist_invalid.c svlist_meta.c svlist_meta0.c \
+	svlist_meta_hidden.c svlist_meta_invalid.c table.c \
+	table_code.c table_type.c tell.c tell64.c tell_multidiv.c \
+	tell_sub.c tok_arg.c tok_escape.c tok_quote.c trunc.c \
 	trunc_dir.c trunc_rdonly.c trunc_rofs.c trunc_truncsub.c \
-	unclude.c unclude_del.c unclude_move.c 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 \
+	unclude.c unclude_del.c unclude_move.c unclude_open.c \
+	version_0.c version_0_write.c version_1.c version_1_write.c \
+	version_2.c version_2_write.c version_3.c version_3_write.c \
+	version_4.c version_4_write.c version_5.c version_5_strict.c \
 	version_5_write.c version_6.c version_6_strict.c \
 	version_6_write.c version_7.c version_7_strict.c \
 	version_7_write.c version_8.c version_8_strict.c \
 	version_8_write.c version_9.c version_9_strict.c \
 	version_9_write.c vlist.c vlist_alias.c vlist_hidden.c \
 	vlist_invalid.c vlist_meta.c vlist_meta_hidden.c \
-	vlist_meta_invalid.c xz_get.c xz_nframes.c zzip_data.c \
-	zzip_get.c zzip_get_get.c zzip_nframes.c zzslim_get.c \
-	zzslim_nframes.c
+	vlist_meta_invalid.c zzip_data.c zzip_get.c zzip_get_get.c \
+	zzip_nframes.c zzip_seek.c zzip_seek_far.c zzslim_get.c \
+	zzslim_nframes.c zzslim_seek.c zzslim_seek_far.c
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -5248,6 +6338,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -5273,8 +6365,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -5322,7 +6425,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -5337,12 +6439,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -5406,9 +6512,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -5416,6 +6523,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -5429,7 +6537,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# (C) 2008-2012 D. V. Wiebe
+# Copyright (C) 2008-2015 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -5450,23 +6558,22 @@ top_srcdir = @top_srcdir@
 # 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 AUTOMAKE_OPTIONS = foreign serial-tests
- at CC_WALL_TRUE@WALL = -Wall
- at CC_WEXTRA_TRUE@WEXTRA = -Wextra
 LDADD = ../src/libgetdata.la
-AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(top_srcdir)/src
+AM_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src
 EXTRA_DIST = test.h
-ADD_TESTS = add add_affix add_alias add_alias_affix add_alias_meta add_bit \
-					add_bit_bitnum add_bit_bitsize add_bit_invalid add_bit_numbits \
-					add_bit_scalars add_carray add_clincom add_code add_const \
-					add_cpolynom add_crecip add_crecip89 add_dangle_dup add_divide \
-					add_divide_invalid add_duplicate add_format add_invalid add_lincom \
-					add_lincom_affix add_lincom_invalid add_lincom_nfields add_linterp \
+ADD_TESTS = add_add add_affix add_alias add_alias_affix add_alias_meta \
+					add_amb_code7 add_bit add_bit_bitnum add_bit_bitsize add_bit_invalid \
+					add_bit_numbits add_bit_scalars add_carray add_clincom add_code \
+					add_const add_cpolynom add_crecip add_crecip89 add_dangle_dup \
+					add_divide add_divide_invalid add_dot5 add_dot6 add_duplicate \
+					add_format add_invalid add_lincom add_lincom_affix \
+					add_lincom_invalid add_lincom_nfields add_linterp \
 					add_linterp_invalid add_meta add_meta_alias add_mplex \
 					add_mplex_scalars add_multiply add_multiply_invalid add_phase \
 					add_phase_invalid add_polynom add_polynom_scalar add_protect add_raw \
 					add_raw_include add_raw_invalid add_raw_spf add_raw_spf_scalar \
-					add_raw_type add_rdonly add_recip add_resolv add_sbit add_scalar \
-					add_scalar_carray add_scalar_carray_bad add_sort add_spec \
+					add_raw_sub add_raw_type add_rdonly add_recip add_resolv add_sbit \
+					add_scalar add_scalar_carray add_scalar_carray_bad add_sort add_spec \
 					add_spec_directive add_spec_invalid add_spec_meta add_spec_resolv \
 					add_string add_string_affix add_type add_window add_window_op
 
@@ -5475,28 +6582,33 @@ ALIAS_TESTS = alias_list alias_list_alias alias_list_missing alias_num \
 						alias_target_missing
 
 ALTER_TESTS = alter_bit_bitnum alter_bit_numbits alter_carray_len \
-						alter_carray_type alter_const alter_const_c2r alter_cpolynom \
-						alter_crecip \
-						alter_crecip89 alter_crecip_zero alter_divide alter_entry \
-						alter_entry_affix alter_entry_hidden alter_entry_recode \
-						alter_entry_scalar2a alter_entry_scalar2n alter_entry_scalar3 \
-						alter_entry_scalar4 alter_lincom_23 alter_lincom_32 \
+						alter_carray_type alter_clincom alter_const alter_const_c2r \
+						alter_const_r2c alter_const_r2r alter_cpolynom alter_cpolynom_null \
+						alter_crecip alter_crecip89 alter_crecip89_null alter_crecip_zero \
+						alter_divide alter_entry alter_entry_affix alter_entry_hidden \
+						alter_entry_lincom alter_entry_recode alter_entry_recode_recalc \
+						alter_entry_scalar1 alter_entry_scalar2a alter_entry_scalar2n \
+						alter_entry_scalar3 alter_entry_scalar3c alter_entry_scalar4 \
+						alter_entry_scalar_amb alter_index alter_lincom_23 alter_lincom_32 \
 						alter_lincom_affix alter_lincom_input alter_lincom_offset \
 						alter_lincom_slope alter_linterp alter_linterp_move alter_mplex \
 						alter_mspec alter_mspec_affix alter_multiply alter_phase \
 						alter_polynom_coeff alter_polynom_input alter_polynom_ord \
 						alter_raw_spf alter_raw_type alter_recip alter_recip_zero \
 						alter_scalar_affix alter_spec alter_spec_affix alter_spec_meta \
-						alter_window
+						alter_spec_polynom alter_window
 
-ASCII_TESTS = ascii_add 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_hidden cvlist_array_meta \
-						 cvlist_array_meta_hidden cvlist_hidden cvlist_invalid cvlist_meta \
-						 cvlist_meta_hidden cvlist_meta_invalid
+ASCII_TESTS = ascii_add ascii_get ascii_get_complex ascii_get_get ascii_get_here \
+						ascii_get_sub ascii_nframes ascii_put ascii_put_here ascii_seek \
+						ascii_seek_far ascii_sync
 
-CLOSE_TESTS = close close_bad close_discard close_null
+BOF_TESTS = bof bof_bit bof_index bof_lincom bof_phase bof_phase_neg
+BZIP_TESTS = bzip_add bzip_get bzip_get_far bzip_get_get bzip_get_get2 \
+					 bzip_get_put bzip_move_from bzip_move_to bzip_nframes bzip_put \
+					 bzip_put_back bzip_put_endian bzip_put_get bzip_put_pad \
+					 bzip_put_sub bzip_seek bzip_seek_far bzip_sync
+
+CLOSE_TESTS = close_bad close_close close_discard close_null
 CONVERT_TESTS = convert_complex128_complex64 convert_complex128_float64 \
 							convert_complex128_int64 convert_complex128_uint64 \
 							convert_complex64_complex128 convert_complex64_float64 \
@@ -5546,18 +6658,29 @@ CONVERT_TESTS = convert_complex128_complex64 convert_complex128_float64 \
 							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_after \
-					del_derived_force del_meta del_meta_force
+CREAT_TESTS = creat creat_excl creat_rdonly creat_rdonly_exists
+CVLIST_TESTS = cvlist cvlist_array cvlist_array0 cvlist_array_free \
+						 cvlist_array_hidden cvlist_array_meta cvlist_array_meta0 \
+						 cvlist_array_meta_free cvlist_array_meta_hidden cvlist_hidden \
+						 cvlist_invalid cvlist_meta cvlist_meta0 cvlist_meta_hidden \
+						 cvlist_meta_invalid
+
+DEL_TESTS = del_alias del_carray del_carray_deref del_const del_const_deref \
+					del_const_force del_data del_data_enoent del_data_open del_derived \
+					del_derived_after del_derived_force del_del del_meta del_meta_force \
+					del_ref
 
+DESYNC_TESTS = desync desync_flush desync_path desync_reopen desync_reopen_inv
 DFES_TESTS = dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \
 					 dfes_null dfes_phase dfes_raw dfes_recip dfes_zero
 
-DESYNC_TESTS = desync desync_flush desync_reopen desync_reopen_inv
 ELIST_TESTS = elist_alias elist_hidden elist_noalias elist_scalar
-ENCODE_TESTS = encode_alter encode_get encode_move
-ENDIAN_TESTS = endian_alter endian_alter_sie endian_get endian_move
+ENCODE_TESTS = encode_alter encode_alter_all encode_alter_open encode_get \
+						 encode_recode encode_recode_open encode_support
+
+ENDIAN_TESTS = endian_alter endian_alter_all endian_alter_sie endian_get \
+						 endian_move
+
 ENTRY_TESTS = entry_bad_code entry_bit entry_bit_scalar entry_divide \
 						entry_invalid entry_lincom entry_lincom_scalar entry_linterp \
 						entry_mplex entry_mplex_scalar entry_multiply entry_phase \
@@ -5566,30 +6689,37 @@ ENTRY_TESTS = entry_bad_code entry_bit entry_bit_scalar entry_divide \
 						entry_scalar_repr entry_recip entry_type entry_type_alias \
 						entry_window entry_window_scalar
 
-EOF_TESTS = eof eof_index eof_lincom eof_phase
+EOF_TESTS = eof eof_bit eof_index eof_lincom eof_phase eof_phase_neg
 ERROR_TESTS = error error_error error_num error_short error_verbose \
 						error_verbose_prefix
 
 FILE_TESTS = file file_code file_type
-FLIST_TESTS = flist flist_hidden flist_invalid flist_meta flist_meta_hidden \
-						flist_meta_invalid flist_type flist_type_hidden flist_type_invalid \
-						flist_type_meta flist_type_meta_hidden flist_type_meta_invalid
+FLAC_TESTS = flac_add flac_get_big flac_get_far flac_get_get flac_get_get2 \
+					 flac_get_little flac_nframes flac_put_big flac_put_complex128 \
+					 flac_put_float64 flac_put_int32 flac_put_little flac_seek \
+					 flac_seek_far flac_sync
 
-FLUSH_TESTS = flush flush_all flush_bad_code flush_hex flush_invalid flush_meta \
-						flush_ref flush_spec
+FLIST_TESTS = flist flist0 flist2 flist_hidden flist_invalid flist_meta \
+						flist_meta2 flist_meta_hidden flist_meta_invalid flist_type \
+						flist_type_hidden flist_type_invalid flist_type_meta \
+						flist_type_meta_hidden flist_type_meta_invalid
 
-FOFFS_TESTS = foffs_alter foffs_get foffs_move
+FLUSH_TESTS = flush_all flush_amb_code flush_bad_code flush_flush flush_hex \
+						flush_invalid flush_lincom flush_lincom1 flush_meta flush_mult \
+						flush_raw_close flush_ref flush_spec flush_string flush_sync
+
+FOFFS_TESTS = foffs_alter foffs_alter_all foffs_get foffs_move
 FRAGMENT_TESTS = fragment_affix fragment_affix_alter fragment_affix_alter2 \
+							 fragment_affix_alter_code fragment_affix_alter_nop \
 							 fragment_affix_dup fragment_index fragment_index_alias \
 							 fragment_name fragment_name_oor fragment_num fragment_parent
 
 GET_TESTS = get64 get_affix get_bad_code get_bit get_carray get_carray_len \
 					get_carray_c2r get_carray_slice get_char get_clincom get_complex128 \
-					get_complex64 get_const get_const_complex get_const_repr \
-					get_cpolynom get_cpolynom1 get_cpolynom_int get_divide \
-					get_divide_ccin get_divide_crin \
-					get_divide_crinr get_divide_rcin get_divide_s get_endian8 \
-					get_endian16 get_endian32 \
+					get_complex64 get_const get_const_carray get_const_complex \
+					get_const_repr get_cpolynom get_cpolynom1 get_cpolynom_int get_dim \
+					get_divide get_divide_ccin get_divide_crin get_divide_crinr \
+					get_divide_rcin get_divide_s get_endian8 get_endian16 get_endian32 \
 					get_endian64 get_endian_complex128_arm get_endian_complex128_big \
 					get_endian_complex128_little get_endian_complex64_arm \
 					get_endian_complex64_big get_endian_complex64_little \
@@ -5597,60 +6727,81 @@ GET_TESTS = get64 get_affix get_bad_code get_bit get_carray get_carray_len \
 					get_endian_float32_little get_endian_float64_arm \
 					get_endian_float64_big get_endian_float64_little get_ff get_float32 \
 					get_float64 get_foffs get_foffs2 get_fs get_here get_here_foffs \
-					get_heres \
-					get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 \
-					get_lincom2 get_lincom3 get_lincom_noin get_lincom_non \
-					get_lincom_null get_lincom_spf get_linterp get_linterp_noin \
-					get_linterp_notab get_linterp_sort get_mplex get_mplex_bof \
-					get_mplex_lb get_mplex_lball get_mplex_nolb get_multiply \
+					get_heres get_index_complex get_int8 get_int16 get_int32 \
+					get_int64 get_invalid get_lincom1 get_lincom2 get_lincom2s \
+					get_lincom3 get_lincom3s get_lincom_mdt get_lincom_noin \
+					get_lincom_non get_lincom_null get_lincom_spf get_linterp \
+					get_linterp1 get_linterp_abs get_linterp_complex get_linterp_empty \
+					get_linterp_noin get_linterp_notab get_linterp_sort get_mplex \
+					get_mplex_bof get_mplex_complex get_mplex_lb get_mplex_lball \
+					get_mplex_nolb get_mplex_s get_mplex_saved get_multiply \
 					get_multiply_ccin get_multiply_crin get_multiply_crinr \
-					get_multiply_noin get_multiply_rcin get_multiply_s get_nonexistent \
-					get_null get_off64 get_phase \
-					get_phase_affix get_polynom get_polynom_cmpin \
-					get_polynom_noin get_recip \
-					get_recip_const get_recurse get_rofs get_sbit get_sf get_ss get_type \
-					get_uint16 get_uint32 get_uint64 get_window get_window_clr \
-					get_window_ge get_window_gt get_window_le get_window_lt \
-					get_window_ne get_window_set get_zero
+					get_multiply_noin get_multiply_rcin get_multiply_s get_neg get_none \
+					get_nonexistent get_null get_off64 get_phase get_phase_affix \
+					get_polynom get_polynom_cmpin get_polynom_noin get_recip \
+					get_recip_const get_recurse get_rofs get_sbit get_sf get_ss \
+					get_string get_type get_uint16 get_uint32 get_uint64 get_window \
+					get_window_clr get_window_complex get_window_ge get_window_gt \
+					get_window_le get_window_lt get_window_ne get_window_s \
+					get_window_set get_zero get_zero_complex get_zero_float
 
 GLOBAL_TESTS = global_flags global_name global_ref global_ref_empty global_ref_set
-GZIP_TESTS = gzip_add gzip_get gzip_get_get gzip_get_get2 gzip_get_put \
-					 gzip_move_from gzip_move_to gzip_nframes gzip_put gzip_put_get
+GZIP_TESTS = gzip_add gzip_del gzip_get gzip_get_far gzip_get_get gzip_get_get2 \
+					 gzip_get_put gzip_move_from gzip_move_to gzip_nframes gzip_put \
+					 gzip_put_back gzip_put_endian gzip_put_get gzip_put_nframes \
+					 gzip_put_off gzip_put_pad gzip_put_sub gzip_seek gzip_seek_far \
+					 gzip_seek_put gzip_sync
 
-HEADER_TESTS = header_complex
+HEADER_TESTS = header_complex header_off64t
 HIDE_TESTS = hide hide_hidden hide_unhide
-INCLUDE_TESTS = include include_accmode include_affix include_auto include_cb \
-							include_creat include_ignore include_index include_invalid \
-							include_nonexistent include_pc include_ref include_sub \
-							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
+INCLUDE_TESTS = include_accmode include_affix include_auto include_cb \
+							include_creat include_ignore include_include include_index \
+							include_invalid include_nonexistent include_pc \
+							include_ref include_sub include_syntax
+
+INDEX_TESTS = index_domain index_index index_range index_s index_subset
+ at INCLUDE_LEGACY_API_TRUE@LEGACY_TESTS = legacy_error legacy_estring legacy_format legacy_get \
+ at INCLUDE_LEGACY_API_TRUE@						 legacy_get_put legacy_get_rofs legacy_nframes legacy_nonexistent \
+ at INCLUDE_LEGACY_API_TRUE@						 legacy_put legacy_spf
+
+LZMA_TESTS = lzma_get lzma_nframes lzma_put lzma_xz_add lzma_xz_get \
+					 lzma_xz_get_far lzma_xz_get_get lzma_xz_get_get2 lzma_xz_get_put \
+					 lzma_xz_move_to lzma_xz_nframes lzma_xz_put lzma_xz_put_back \
+					 lzma_xz_put_endian lzma_xz_put_get lzma_xz_put_pad lzma_xz_seek \
+					 lzma_xz_seek_far lzma_xz_sync
 
-LZMA_TESTS = lzma_get lzma_nframes
 MADD_TESTS = madd madd_affix madd_alias madd_alias_affix madd_bit \
 					 madd_bit_invalid madd_carray madd_clincom madd_const madd_cpolynom \
-					 madd_crecip madd_crecip89 madd_divide madd_index madd_lincom \
-					 madd_lincom_invalid madd_linterp madd_linterp_invalid madd_mplex \
-					 madd_multiply madd_multiply_invalid madd_phase madd_phase_invalid \
-					 madd_polynom madd_recip madd_sbit madd_spec madd_spec_directive \
-					 madd_spec_invalid madd_spec_resolv madd_string madd_window
-
-MOVE_TESTS = move move_affix move_affix_dup move_alias 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_affix name_affix_bad name_alias name_dup name_move \
-					 name_move_alias name_updb name_updb_alias name_updb_const \
-					 name_updb_const_alias
+					 madd_crecip madd_crecip89 madd_divide madd_index \
+					 madd_lincom madd_lincom_invalid madd_linterp madd_linterp_invalid \
+					 madd_mplex madd_multiply madd_multiply_invalid madd_phase \
+					 madd_phase_invalid madd_polynom madd_recip madd_sbit \
+					 madd_spec madd_spec_directive madd_spec_invalid \
+					 madd_spec_resolv madd_string madd_window
+
+MOVE_TESTS = move_affix move_affix_dup move_affix_meta move_affix_updb \
+					 move_alias move_data_enc_ar move_data_enc_ra move_data_endian \
+					 move_data_foffs move_data_foffs_neg move_data_nop move_index \
+					 move_meta move_move move_protect move_subdir
+
+NAME_TESTS = name_affix name_affix_bad name_alias name_dangle name_dot5 \
+					 name_dot5r name_dot9 name_dup name_meta name_move name_move_alias \
+					 name_name name_updb name_updb_affix name_updb_alias \
+					 name_updb_carray name_updb_const name_updb_const_alias
+
+NATIVE_TESTS = native_bit native_const native_index native_lincom \
+						 native_lincom_cmpin native_lincom_cmpscal native_linterp \
+						 native_linterp_cmp native_mult native_mult1 native_mult2 \
+						 native_polynom native_polynom_cmpin native_polynom_cmpscal \
+						 native_raw native_phase native_recip native_recip_cmpin \
+						 native_recip_cmpscal native_sbit native_string
 
 NENTRIES_TESTS = nentries_alias nentries_hidden nentries_noalias nentries_scalar
-NFIELDS_TESTS = nfields nfields_hidden nfields_invalid nfields_type \
+NFIELDS_TESTS = nfields_hidden nfields_invalid nfields_nfields nfields_type \
 							nfields_type_hidden nfields_type_invalid nfields_vector \
 							nfields_vector_hidden nfields_vector_invalid
 
-NFRAMES_TESTS = nframes nframes64 nframes_empty nframes_invalid \
+NFRAMES_TESTS = nframes64 nframes_empty nframes_invalid nframes_nframes \
 							nframes_off64 nframes_spf
 
 NMETA_TESTS = nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \
@@ -5658,10 +6809,11 @@ NMETA_TESTS = nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \
 						nmeta_vectors nmeta_vectors_del nmeta_vectors_hidden \
 						nmeta_vectors_invalid nmeta_vectors_parent
 
-OPEN_TESTS = open open_abs open_cb_abort open_cb_cont open_cb_ignore \
-					 open_cb_invalid open_cb_rescan open_eaccess open_nonexistent \
-					 open_notdirfile open_rofs open_sym_a open_sym_al open_sym_at \
-					 open_sym_c open_sym_cl open_sym_ct open_sym_p open_sym_pl open_sym_pt
+OPEN_TESTS = open_abs open_cb_abort open_cb_cont open_cb_ignore open_cb_invalid \
+					 open_cb_rescan open_cb_rescan_alloc open_eaccess open_invalid \
+					 open_nonexistent open_notdirfile open_open open_rofs open_sym_al \
+					 open_sym_at open_sym_c open_sym_cl open_sym_ct open_sym_d \
+					 open_sym_l open_sym_p open_sym_pl open_sym_pt
 
 PARSE_TESTS = parse_alias parse_alias_code parse_alias_dup parse_alias_meta \
 						parse_alias_missing parse_badline parse_bit parse_bit4 \
@@ -5674,40 +6826,45 @@ PARSE_TESTS = parse_alias parse_alias_code parse_alias_dup parse_alias_meta \
 						parse_foffs_include parse_foffs_slash parse_hex parse_hidden \
 						parse_hidden_field parse_hidden_meta parse_include \
 						parse_include_absolute parse_include_absrel \
-						parse_include_affix_ref parse_include_dir parse_include_loop \
-						parse_include_nonexistent parse_include_prefix \
-						parse_include_prefix_dup parse_include_preprefix \
-						parse_include_ref parse_include_relabs parse_include_relrel \
-						parse_include_slash parse_include_suffix parse_include_sufsuffix \
-						parse_index parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 \
+						parse_include_affix_bad parse_include_affix_ref parse_include_dir \
+						parse_include_loop parse_include_nonexistent parse_include_prefix \
+						parse_include_prefix_dup parse_include_preprefix parse_include_ref \
+						parse_include_relabs parse_include_relrel parse_include_slash \
+						parse_include_suffix parse_include_sufsuffix parse_index \
+						parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 \
 						parse_lincom_nfields parse_lincom_nofields parse_lincom_non \
 						parse_lincom_non_ncols parse_lincom_scalar parse_linterp \
-						parse_linterp_ncols parse_malias parse_malias_dup \
-						parse_malias_meta parse_meta parse_meta_affix parse_meta_alias \
-						parse_meta_implicit parse_meta_implicit2 parse_meta_implicit_affix \
-						parse_meta_index parse_meta_index2 parse_meta_jump \
-						parse_meta_malias parse_meta_meta parse_meta_parent parse_meta_raw \
-						parse_mplex parse_mplex_ncols parse_mplex_nomax parse_mplex_scalar \
+						parse_linterp_ncols parse_literal_cmpbad parse_literal_fltcmp \
+						parse_literal_fltcmp0 parse_literal_intcmp parse_literal_intcmp0 \
+						parse_literal_uintcmp parse_literal_uintcmp0 parse_malias \
+						parse_malias_dup parse_malias_meta parse_meta parse_meta_affix \
+						parse_meta_alias parse_meta_frag parse_meta_implicit \
+						parse_meta_implicit2 parse_meta_implicit_affix parse_meta_index \
+						parse_meta_index2 parse_meta_jump parse_meta_malias \
+						parse_meta_meta parse_meta_parent parse_meta_raw parse_mplex \
+						parse_mplex_ncols parse_mplex_nomax parse_mplex_scalar \
 						parse_multiply parse_multiply_ncols parse_name parse_name_dot \
-						parse_name_ext parse_name_pedantic parse_ncols parse_phase \
-						parse_phase_ncols parse_phase_scalar parse_polynom \
+						parse_name_ext parse_name_pedantic parse_ncols parse_octal_zero \
+						parse_phase parse_phase_ncols parse_phase_scalar parse_polynom \
 						parse_polynom_ncols1 parse_polynom_ncols2 parse_polynom_scalar \
 						parse_protect_all parse_protect_bad parse_protect_data \
 						parse_protect_format parse_protect_none parse_quote \
-						parse_quote_mismatch parse_raw parse_raw_char parse_raw_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_utf8 parse_utf8_invalid \
-						parse_utf8_zero parse_version \
-						parse_version_89 parse_version_98 parse_version_include \
-						parse_version_permissive parse_version_p8 parse_version_p9 \
-						parse_version_slash parse_whitespace parse_window \
-						parse_window_ncols parse_window_op parse_window_scalar
-
-PROTECT_TESTS = protect_alter protect_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 \
+						parse_quote_mismatch parse_raw parse_raw_char parse_raw_char_bad \
+						parse_raw_ncols parse_raw_scalar parse_raw_spf parse_raw_type \
+						parse_recip parse_ref parse_ref_nonexistent parse_sbit \
+						parse_scalar1 parse_scalar2 parse_scalar_repr parse_sort \
+						parse_string parse_string_ncols parse_string_null parse_utf8 \
+						parse_utf8_invalid parse_utf8_zero parse_version parse_version_89 \
+						parse_version_98 parse_version_include parse_version_permissive \
+						parse_version_p8 parse_version_p9 parse_version_slash \
+						parse_whitespace parse_window parse_window_ncols parse_window_op \
+						parse_window_scalar
+
+PROTECT_TESTS = protect_alter protect_alter_all protect_get
+PUT_TESTS = put64 put_bad_code put_bit put_bof put_carray put_carray_client \
+					put_carray_slice put_char put_clincom1 put_complex128 put_complex64 \
+					put_const put_const_protect put_cpolynom put_crecip put_divide \
+					put_endian8 put_endian16 put_endian32 put_endian64 \
 					put_endian_complex128_arm put_endian_complex128_big \
 					put_endian_complex128_little put_endian_complex64_arm \
 					put_endian_complex64_big put_endian_complex64_little \
@@ -5717,39 +6874,40 @@ PUT_TESTS = put64 put_bad_code put_bit put_bof put_carray put_carray_slice \
 					put_float64 put_foffs put_fs put_here put_heres put_int8 put_int16 \
 					put_int32 put_int64 put_invalid put_lincom1 put_lincom2 \
 					put_lincom_noin put_linterp put_linterp_noin put_linterp_nomono \
-					put_linterp_notab put_linterp_reverse put_mplex put_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 \
-					put_window put_zero
+					put_linterp_notab put_linterp_reverse put_mplex put_mplex_complex \
+					put_multiply put_nofile put_null put_off64 put_phase put_phase_noin \
+					put_polynom1 put_polynom2 put_polynom_noin put_protect put_rdonly \
+					put_recip put_recurse put_repr put_rofs put_sbit put_sf put_ss \
+					put_string put_string_protect put_sub put_type put_uint16 put_uint32 \
+					put_uint64 put_window put_zero
 
 REF_TESTS = ref ref_none ref_two
-REPR_TESTS = repr_a repr_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
+REPR_TESTS = repr_a repr_bad repr_float32 repr_float64 repr_i repr_int16 \
+					 repr_int32 repr_int64 repr_int8 repr_m repr_r repr_real_a \
+					 repr_real_i repr_real_m repr_real_r repr_uint16 repr_uint32 \
+					 repr_uint64 repr_uint8
+
+SEEK_TESTS = seek64 seek_cur seek_end seek_far seek_foffs seek_foffs2 seek_index \
+					 seek_lincom seek_mult seek_neg seek_phase seek_set seek_sub
 
-SEEK_TESTS = seek64 seek_cur seek_end seek_foffs seek_foffs2 seek_neg seek_set
 SIE_TESTS = sie_get_big sie_get_little sie_move_from sie_move_to sie_nframes_big \
-					sie_nframes_little sie_put_big sie_put_append sie_put_append2 \
-					sie_put_back sie_put_little sie_put_many sie_put_newo sie_put_newo0 \
+					sie_nframes_little sie_put_append sie_put_append2 sie_put_back \
+					sie_put_big sie_put_little sie_put_many sie_put_newo sie_put_newo0 \
 					sie_put_pad sie_put_pad0 sie_put_trunc sie_put_trunc2 \
-					sie_put_trunc_nf sie_sync
+					sie_put_trunc_nf sie_seek sie_seek_far sie_sync
 
-SLIM_TESTS = slim_get slim_nframes
-SVLIST_TESTS = svlist svlist_hidden svlist_invalid svlist_meta \
-						 svlist_meta_hidden svlist_meta_invalid
+SLIM_TESTS = slim_get slim_nframes slim_seek slim_seek_far
+SVLIST_TESTS = svlist svlist0 svlist2 svlist_hidden svlist_invalid svlist_meta \
+						 svlist_meta0 svlist_meta_hidden svlist_meta_invalid
 
-SPF_TESTS = spf spf_alias spf_alias_missing spf_alias_meta \
-					spf_divide spf_lincom spf_multiply \
-					spf_polynom spf_recip spf_recurse
+SPF_TESTS = spf_alias spf_alias_missing spf_alias_meta spf_divide spf_lincom \
+					spf_multiply spf_polynom spf_raw spf_recip spf_recurse
 
 TABLE_TESTS = table table_code table_type
-TELL_TESTS = tell tell64 tell_multidiv
+TELL_TESTS = tell tell64 tell_multidiv tell_sub
 TOK_TESTS = tok_arg tok_escape tok_quote
 TRUNC_TESTS = trunc trunc_dir trunc_rdonly trunc_rofs trunc_truncsub
-UNCLUDE_TESTS = unclude unclude_del unclude_move
+UNCLUDE_TESTS = unclude unclude_del unclude_move unclude_open
 VERSION_TESTS = version_0 version_0_write version_1 version_1_write version_2 \
 							version_2_write version_3 version_3_write version_4 \
 							version_4_write version_5 version_5_strict version_5_write \
@@ -5760,9 +6918,8 @@ VERSION_TESTS = version_0 version_0_write version_1 version_1_write version_2 \
 VLIST_TESTS = vlist vlist_alias vlist_hidden vlist_invalid vlist_meta \
 						vlist_meta_hidden vlist_meta_invalid
 
-XZ_TESTS = xz_get xz_nframes
-ZZIP_TESTS = zzip_data zzip_get zzip_get_get zzip_nframes
-ZZSLIM_TESTS = zzslim_get zzslim_nframes
+ZZIP_TESTS = zzip_data zzip_get zzip_get_get zzip_nframes zzip_seek zzip_seek_far
+ZZSLIM_TESTS = zzslim_get zzslim_nframes zzslim_seek zzslim_seek_far
 all: all-am
 
 .SUFFIXES:
@@ -5807,9 +6964,9 @@ clean-checkPROGRAMS:
 	echo " rm -f" $$list; \
 	rm -f $$list
 
-add$(EXEEXT): $(add_OBJECTS) $(add_DEPENDENCIES) $(EXTRA_add_DEPENDENCIES) 
-	@rm -f add$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(add_OBJECTS) $(add_LDADD) $(LIBS)
+add_add$(EXEEXT): $(add_add_OBJECTS) $(add_add_DEPENDENCIES) $(EXTRA_add_add_DEPENDENCIES) 
+	@rm -f add_add$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_add_OBJECTS) $(add_add_LDADD) $(LIBS)
 
 add_affix$(EXEEXT): $(add_affix_OBJECTS) $(add_affix_DEPENDENCIES) $(EXTRA_add_affix_DEPENDENCIES) 
 	@rm -f add_affix$(EXEEXT)
@@ -5827,6 +6984,10 @@ add_alias_meta$(EXEEXT): $(add_alias_meta_OBJECTS) $(add_alias_meta_DEPENDENCIES
 	@rm -f add_alias_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(add_alias_meta_OBJECTS) $(add_alias_meta_LDADD) $(LIBS)
 
+add_amb_code7$(EXEEXT): $(add_amb_code7_OBJECTS) $(add_amb_code7_DEPENDENCIES) $(EXTRA_add_amb_code7_DEPENDENCIES) 
+	@rm -f add_amb_code7$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_amb_code7_OBJECTS) $(add_amb_code7_LDADD) $(LIBS)
+
 add_bit$(EXEEXT): $(add_bit_OBJECTS) $(add_bit_DEPENDENCIES) $(EXTRA_add_bit_DEPENDENCIES) 
 	@rm -f add_bit$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(add_bit_OBJECTS) $(add_bit_LDADD) $(LIBS)
@@ -5891,6 +7052,14 @@ add_divide_invalid$(EXEEXT): $(add_divide_invalid_OBJECTS) $(add_divide_invalid_
 	@rm -f add_divide_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(add_divide_invalid_OBJECTS) $(add_divide_invalid_LDADD) $(LIBS)
 
+add_dot5$(EXEEXT): $(add_dot5_OBJECTS) $(add_dot5_DEPENDENCIES) $(EXTRA_add_dot5_DEPENDENCIES) 
+	@rm -f add_dot5$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_dot5_OBJECTS) $(add_dot5_LDADD) $(LIBS)
+
+add_dot6$(EXEEXT): $(add_dot6_OBJECTS) $(add_dot6_DEPENDENCIES) $(EXTRA_add_dot6_DEPENDENCIES) 
+	@rm -f add_dot6$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_dot6_OBJECTS) $(add_dot6_LDADD) $(LIBS)
+
 add_duplicate$(EXEEXT): $(add_duplicate_OBJECTS) $(add_duplicate_DEPENDENCIES) $(EXTRA_add_duplicate_DEPENDENCIES) 
 	@rm -f add_duplicate$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(add_duplicate_OBJECTS) $(add_duplicate_LDADD) $(LIBS)
@@ -5991,6 +7160,10 @@ add_raw_spf_scalar$(EXEEXT): $(add_raw_spf_scalar_OBJECTS) $(add_raw_spf_scalar_
 	@rm -f add_raw_spf_scalar$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(add_raw_spf_scalar_OBJECTS) $(add_raw_spf_scalar_LDADD) $(LIBS)
 
+add_raw_sub$(EXEEXT): $(add_raw_sub_OBJECTS) $(add_raw_sub_DEPENDENCIES) $(EXTRA_add_raw_sub_DEPENDENCIES) 
+	@rm -f add_raw_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_raw_sub_OBJECTS) $(add_raw_sub_LDADD) $(LIBS)
+
 add_raw_type$(EXEEXT): $(add_raw_type_OBJECTS) $(add_raw_type_DEPENDENCIES) $(EXTRA_add_raw_type_DEPENDENCIES) 
 	@rm -f add_raw_type$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(add_raw_type_OBJECTS) $(add_raw_type_LDADD) $(LIBS)
@@ -6119,6 +7292,10 @@ alter_carray_type$(EXEEXT): $(alter_carray_type_OBJECTS) $(alter_carray_type_DEP
 	@rm -f alter_carray_type$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_carray_type_OBJECTS) $(alter_carray_type_LDADD) $(LIBS)
 
+alter_clincom$(EXEEXT): $(alter_clincom_OBJECTS) $(alter_clincom_DEPENDENCIES) $(EXTRA_alter_clincom_DEPENDENCIES) 
+	@rm -f alter_clincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_clincom_OBJECTS) $(alter_clincom_LDADD) $(LIBS)
+
 alter_const$(EXEEXT): $(alter_const_OBJECTS) $(alter_const_DEPENDENCIES) $(EXTRA_alter_const_DEPENDENCIES) 
 	@rm -f alter_const$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_const_OBJECTS) $(alter_const_LDADD) $(LIBS)
@@ -6127,10 +7304,22 @@ alter_const_c2r$(EXEEXT): $(alter_const_c2r_OBJECTS) $(alter_const_c2r_DEPENDENC
 	@rm -f alter_const_c2r$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_const_c2r_OBJECTS) $(alter_const_c2r_LDADD) $(LIBS)
 
+alter_const_r2c$(EXEEXT): $(alter_const_r2c_OBJECTS) $(alter_const_r2c_DEPENDENCIES) $(EXTRA_alter_const_r2c_DEPENDENCIES) 
+	@rm -f alter_const_r2c$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_const_r2c_OBJECTS) $(alter_const_r2c_LDADD) $(LIBS)
+
+alter_const_r2r$(EXEEXT): $(alter_const_r2r_OBJECTS) $(alter_const_r2r_DEPENDENCIES) $(EXTRA_alter_const_r2r_DEPENDENCIES) 
+	@rm -f alter_const_r2r$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_const_r2r_OBJECTS) $(alter_const_r2r_LDADD) $(LIBS)
+
 alter_cpolynom$(EXEEXT): $(alter_cpolynom_OBJECTS) $(alter_cpolynom_DEPENDENCIES) $(EXTRA_alter_cpolynom_DEPENDENCIES) 
 	@rm -f alter_cpolynom$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_cpolynom_OBJECTS) $(alter_cpolynom_LDADD) $(LIBS)
 
+alter_cpolynom_null$(EXEEXT): $(alter_cpolynom_null_OBJECTS) $(alter_cpolynom_null_DEPENDENCIES) $(EXTRA_alter_cpolynom_null_DEPENDENCIES) 
+	@rm -f alter_cpolynom_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_cpolynom_null_OBJECTS) $(alter_cpolynom_null_LDADD) $(LIBS)
+
 alter_crecip$(EXEEXT): $(alter_crecip_OBJECTS) $(alter_crecip_DEPENDENCIES) $(EXTRA_alter_crecip_DEPENDENCIES) 
 	@rm -f alter_crecip$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_crecip_OBJECTS) $(alter_crecip_LDADD) $(LIBS)
@@ -6139,6 +7328,10 @@ alter_crecip89$(EXEEXT): $(alter_crecip89_OBJECTS) $(alter_crecip89_DEPENDENCIES
 	@rm -f alter_crecip89$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_crecip89_OBJECTS) $(alter_crecip89_LDADD) $(LIBS)
 
+alter_crecip89_null$(EXEEXT): $(alter_crecip89_null_OBJECTS) $(alter_crecip89_null_DEPENDENCIES) $(EXTRA_alter_crecip89_null_DEPENDENCIES) 
+	@rm -f alter_crecip89_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_crecip89_null_OBJECTS) $(alter_crecip89_null_LDADD) $(LIBS)
+
 alter_crecip_zero$(EXEEXT): $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_DEPENDENCIES) $(EXTRA_alter_crecip_zero_DEPENDENCIES) 
 	@rm -f alter_crecip_zero$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_LDADD) $(LIBS)
@@ -6159,10 +7352,22 @@ alter_entry_hidden$(EXEEXT): $(alter_entry_hidden_OBJECTS) $(alter_entry_hidden_
 	@rm -f alter_entry_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_entry_hidden_OBJECTS) $(alter_entry_hidden_LDADD) $(LIBS)
 
+alter_entry_lincom$(EXEEXT): $(alter_entry_lincom_OBJECTS) $(alter_entry_lincom_DEPENDENCIES) $(EXTRA_alter_entry_lincom_DEPENDENCIES) 
+	@rm -f alter_entry_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_lincom_OBJECTS) $(alter_entry_lincom_LDADD) $(LIBS)
+
 alter_entry_recode$(EXEEXT): $(alter_entry_recode_OBJECTS) $(alter_entry_recode_DEPENDENCIES) $(EXTRA_alter_entry_recode_DEPENDENCIES) 
 	@rm -f alter_entry_recode$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_entry_recode_OBJECTS) $(alter_entry_recode_LDADD) $(LIBS)
 
+alter_entry_recode_recalc$(EXEEXT): $(alter_entry_recode_recalc_OBJECTS) $(alter_entry_recode_recalc_DEPENDENCIES) $(EXTRA_alter_entry_recode_recalc_DEPENDENCIES) 
+	@rm -f alter_entry_recode_recalc$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_recode_recalc_OBJECTS) $(alter_entry_recode_recalc_LDADD) $(LIBS)
+
+alter_entry_scalar1$(EXEEXT): $(alter_entry_scalar1_OBJECTS) $(alter_entry_scalar1_DEPENDENCIES) $(EXTRA_alter_entry_scalar1_DEPENDENCIES) 
+	@rm -f alter_entry_scalar1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar1_OBJECTS) $(alter_entry_scalar1_LDADD) $(LIBS)
+
 alter_entry_scalar2a$(EXEEXT): $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_DEPENDENCIES) $(EXTRA_alter_entry_scalar2a_DEPENDENCIES) 
 	@rm -f alter_entry_scalar2a$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_LDADD) $(LIBS)
@@ -6175,10 +7380,22 @@ alter_entry_scalar3$(EXEEXT): $(alter_entry_scalar3_OBJECTS) $(alter_entry_scala
 	@rm -f alter_entry_scalar3$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar3_OBJECTS) $(alter_entry_scalar3_LDADD) $(LIBS)
 
+alter_entry_scalar3c$(EXEEXT): $(alter_entry_scalar3c_OBJECTS) $(alter_entry_scalar3c_DEPENDENCIES) $(EXTRA_alter_entry_scalar3c_DEPENDENCIES) 
+	@rm -f alter_entry_scalar3c$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar3c_OBJECTS) $(alter_entry_scalar3c_LDADD) $(LIBS)
+
 alter_entry_scalar4$(EXEEXT): $(alter_entry_scalar4_OBJECTS) $(alter_entry_scalar4_DEPENDENCIES) $(EXTRA_alter_entry_scalar4_DEPENDENCIES) 
 	@rm -f alter_entry_scalar4$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar4_OBJECTS) $(alter_entry_scalar4_LDADD) $(LIBS)
 
+alter_entry_scalar_amb$(EXEEXT): $(alter_entry_scalar_amb_OBJECTS) $(alter_entry_scalar_amb_DEPENDENCIES) $(EXTRA_alter_entry_scalar_amb_DEPENDENCIES) 
+	@rm -f alter_entry_scalar_amb$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar_amb_OBJECTS) $(alter_entry_scalar_amb_LDADD) $(LIBS)
+
+alter_index$(EXEEXT): $(alter_index_OBJECTS) $(alter_index_DEPENDENCIES) $(EXTRA_alter_index_DEPENDENCIES) 
+	@rm -f alter_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_index_OBJECTS) $(alter_index_LDADD) $(LIBS)
+
 alter_lincom_23$(EXEEXT): $(alter_lincom_23_OBJECTS) $(alter_lincom_23_DEPENDENCIES) $(EXTRA_alter_lincom_23_DEPENDENCIES) 
 	@rm -f alter_lincom_23$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_lincom_23_OBJECTS) $(alter_lincom_23_LDADD) $(LIBS)
@@ -6275,6 +7492,10 @@ alter_spec_meta$(EXEEXT): $(alter_spec_meta_OBJECTS) $(alter_spec_meta_DEPENDENC
 	@rm -f alter_spec_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_spec_meta_OBJECTS) $(alter_spec_meta_LDADD) $(LIBS)
 
+alter_spec_polynom$(EXEEXT): $(alter_spec_polynom_OBJECTS) $(alter_spec_polynom_DEPENDENCIES) $(EXTRA_alter_spec_polynom_DEPENDENCIES) 
+	@rm -f alter_spec_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_spec_polynom_OBJECTS) $(alter_spec_polynom_LDADD) $(LIBS)
+
 alter_window$(EXEEXT): $(alter_window_OBJECTS) $(alter_window_DEPENDENCIES) $(EXTRA_alter_window_DEPENDENCIES) 
 	@rm -f alter_window$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(alter_window_OBJECTS) $(alter_window_LDADD) $(LIBS)
@@ -6287,10 +7508,22 @@ ascii_get$(EXEEXT): $(ascii_get_OBJECTS) $(ascii_get_DEPENDENCIES) $(EXTRA_ascii
 	@rm -f ascii_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(ascii_get_OBJECTS) $(ascii_get_LDADD) $(LIBS)
 
+ascii_get_complex$(EXEEXT): $(ascii_get_complex_OBJECTS) $(ascii_get_complex_DEPENDENCIES) $(EXTRA_ascii_get_complex_DEPENDENCIES) 
+	@rm -f ascii_get_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_get_complex_OBJECTS) $(ascii_get_complex_LDADD) $(LIBS)
+
 ascii_get_get$(EXEEXT): $(ascii_get_get_OBJECTS) $(ascii_get_get_DEPENDENCIES) $(EXTRA_ascii_get_get_DEPENDENCIES) 
 	@rm -f ascii_get_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(ascii_get_get_OBJECTS) $(ascii_get_get_LDADD) $(LIBS)
 
+ascii_get_here$(EXEEXT): $(ascii_get_here_OBJECTS) $(ascii_get_here_DEPENDENCIES) $(EXTRA_ascii_get_here_DEPENDENCIES) 
+	@rm -f ascii_get_here$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_get_here_OBJECTS) $(ascii_get_here_LDADD) $(LIBS)
+
+ascii_get_sub$(EXEEXT): $(ascii_get_sub_OBJECTS) $(ascii_get_sub_DEPENDENCIES) $(EXTRA_ascii_get_sub_DEPENDENCIES) 
+	@rm -f ascii_get_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_get_sub_OBJECTS) $(ascii_get_sub_LDADD) $(LIBS)
+
 ascii_nframes$(EXEEXT): $(ascii_nframes_OBJECTS) $(ascii_nframes_DEPENDENCIES) $(EXTRA_ascii_nframes_DEPENDENCIES) 
 	@rm -f ascii_nframes$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(ascii_nframes_OBJECTS) $(ascii_nframes_LDADD) $(LIBS)
@@ -6299,10 +7532,34 @@ ascii_put$(EXEEXT): $(ascii_put_OBJECTS) $(ascii_put_DEPENDENCIES) $(EXTRA_ascii
 	@rm -f ascii_put$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(ascii_put_OBJECTS) $(ascii_put_LDADD) $(LIBS)
 
+ascii_put_here$(EXEEXT): $(ascii_put_here_OBJECTS) $(ascii_put_here_DEPENDENCIES) $(EXTRA_ascii_put_here_DEPENDENCIES) 
+	@rm -f ascii_put_here$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_put_here_OBJECTS) $(ascii_put_here_LDADD) $(LIBS)
+
+ascii_seek$(EXEEXT): $(ascii_seek_OBJECTS) $(ascii_seek_DEPENDENCIES) $(EXTRA_ascii_seek_DEPENDENCIES) 
+	@rm -f ascii_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_seek_OBJECTS) $(ascii_seek_LDADD) $(LIBS)
+
+ascii_seek_far$(EXEEXT): $(ascii_seek_far_OBJECTS) $(ascii_seek_far_DEPENDENCIES) $(EXTRA_ascii_seek_far_DEPENDENCIES) 
+	@rm -f ascii_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_seek_far_OBJECTS) $(ascii_seek_far_LDADD) $(LIBS)
+
+ascii_sync$(EXEEXT): $(ascii_sync_OBJECTS) $(ascii_sync_DEPENDENCIES) $(EXTRA_ascii_sync_DEPENDENCIES) 
+	@rm -f ascii_sync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_sync_OBJECTS) $(ascii_sync_LDADD) $(LIBS)
+
 bof$(EXEEXT): $(bof_OBJECTS) $(bof_DEPENDENCIES) $(EXTRA_bof_DEPENDENCIES) 
 	@rm -f bof$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(bof_OBJECTS) $(bof_LDADD) $(LIBS)
 
+bof_bit$(EXEEXT): $(bof_bit_OBJECTS) $(bof_bit_DEPENDENCIES) $(EXTRA_bof_bit_DEPENDENCIES) 
+	@rm -f bof_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bof_bit_OBJECTS) $(bof_bit_LDADD) $(LIBS)
+
+bof_index$(EXEEXT): $(bof_index_OBJECTS) $(bof_index_DEPENDENCIES) $(EXTRA_bof_index_DEPENDENCIES) 
+	@rm -f bof_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bof_index_OBJECTS) $(bof_index_LDADD) $(LIBS)
+
 bof_lincom$(EXEEXT): $(bof_lincom_OBJECTS) $(bof_lincom_DEPENDENCIES) $(EXTRA_bof_lincom_DEPENDENCIES) 
 	@rm -f bof_lincom$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(bof_lincom_OBJECTS) $(bof_lincom_LDADD) $(LIBS)
@@ -6311,30 +7568,90 @@ bof_phase$(EXEEXT): $(bof_phase_OBJECTS) $(bof_phase_DEPENDENCIES) $(EXTRA_bof_p
 	@rm -f bof_phase$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(bof_phase_OBJECTS) $(bof_phase_LDADD) $(LIBS)
 
+bof_phase_neg$(EXEEXT): $(bof_phase_neg_OBJECTS) $(bof_phase_neg_DEPENDENCIES) $(EXTRA_bof_phase_neg_DEPENDENCIES) 
+	@rm -f bof_phase_neg$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bof_phase_neg_OBJECTS) $(bof_phase_neg_LDADD) $(LIBS)
+
+bzip_add$(EXEEXT): $(bzip_add_OBJECTS) $(bzip_add_DEPENDENCIES) $(EXTRA_bzip_add_DEPENDENCIES) 
+	@rm -f bzip_add$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_add_OBJECTS) $(bzip_add_LDADD) $(LIBS)
+
 bzip_get$(EXEEXT): $(bzip_get_OBJECTS) $(bzip_get_DEPENDENCIES) $(EXTRA_bzip_get_DEPENDENCIES) 
 	@rm -f bzip_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(bzip_get_OBJECTS) $(bzip_get_LDADD) $(LIBS)
 
+bzip_get_far$(EXEEXT): $(bzip_get_far_OBJECTS) $(bzip_get_far_DEPENDENCIES) $(EXTRA_bzip_get_far_DEPENDENCIES) 
+	@rm -f bzip_get_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_get_far_OBJECTS) $(bzip_get_far_LDADD) $(LIBS)
+
 bzip_get_get$(EXEEXT): $(bzip_get_get_OBJECTS) $(bzip_get_get_DEPENDENCIES) $(EXTRA_bzip_get_get_DEPENDENCIES) 
 	@rm -f bzip_get_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(bzip_get_get_OBJECTS) $(bzip_get_get_LDADD) $(LIBS)
 
+bzip_get_get2$(EXEEXT): $(bzip_get_get2_OBJECTS) $(bzip_get_get2_DEPENDENCIES) $(EXTRA_bzip_get_get2_DEPENDENCIES) 
+	@rm -f bzip_get_get2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_get_get2_OBJECTS) $(bzip_get_get2_LDADD) $(LIBS)
+
+bzip_get_put$(EXEEXT): $(bzip_get_put_OBJECTS) $(bzip_get_put_DEPENDENCIES) $(EXTRA_bzip_get_put_DEPENDENCIES) 
+	@rm -f bzip_get_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_get_put_OBJECTS) $(bzip_get_put_LDADD) $(LIBS)
+
 bzip_move_from$(EXEEXT): $(bzip_move_from_OBJECTS) $(bzip_move_from_DEPENDENCIES) $(EXTRA_bzip_move_from_DEPENDENCIES) 
 	@rm -f bzip_move_from$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(bzip_move_from_OBJECTS) $(bzip_move_from_LDADD) $(LIBS)
 
+bzip_move_to$(EXEEXT): $(bzip_move_to_OBJECTS) $(bzip_move_to_DEPENDENCIES) $(EXTRA_bzip_move_to_DEPENDENCIES) 
+	@rm -f bzip_move_to$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_move_to_OBJECTS) $(bzip_move_to_LDADD) $(LIBS)
+
 bzip_nframes$(EXEEXT): $(bzip_nframes_OBJECTS) $(bzip_nframes_DEPENDENCIES) $(EXTRA_bzip_nframes_DEPENDENCIES) 
 	@rm -f bzip_nframes$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(bzip_nframes_OBJECTS) $(bzip_nframes_LDADD) $(LIBS)
 
-close$(EXEEXT): $(close_OBJECTS) $(close_DEPENDENCIES) $(EXTRA_close_DEPENDENCIES) 
-	@rm -f close$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(close_OBJECTS) $(close_LDADD) $(LIBS)
+bzip_put$(EXEEXT): $(bzip_put_OBJECTS) $(bzip_put_DEPENDENCIES) $(EXTRA_bzip_put_DEPENDENCIES) 
+	@rm -f bzip_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_put_OBJECTS) $(bzip_put_LDADD) $(LIBS)
+
+bzip_put_back$(EXEEXT): $(bzip_put_back_OBJECTS) $(bzip_put_back_DEPENDENCIES) $(EXTRA_bzip_put_back_DEPENDENCIES) 
+	@rm -f bzip_put_back$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_put_back_OBJECTS) $(bzip_put_back_LDADD) $(LIBS)
+
+bzip_put_endian$(EXEEXT): $(bzip_put_endian_OBJECTS) $(bzip_put_endian_DEPENDENCIES) $(EXTRA_bzip_put_endian_DEPENDENCIES) 
+	@rm -f bzip_put_endian$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_put_endian_OBJECTS) $(bzip_put_endian_LDADD) $(LIBS)
+
+bzip_put_get$(EXEEXT): $(bzip_put_get_OBJECTS) $(bzip_put_get_DEPENDENCIES) $(EXTRA_bzip_put_get_DEPENDENCIES) 
+	@rm -f bzip_put_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_put_get_OBJECTS) $(bzip_put_get_LDADD) $(LIBS)
+
+bzip_put_pad$(EXEEXT): $(bzip_put_pad_OBJECTS) $(bzip_put_pad_DEPENDENCIES) $(EXTRA_bzip_put_pad_DEPENDENCIES) 
+	@rm -f bzip_put_pad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_put_pad_OBJECTS) $(bzip_put_pad_LDADD) $(LIBS)
+
+bzip_put_sub$(EXEEXT): $(bzip_put_sub_OBJECTS) $(bzip_put_sub_DEPENDENCIES) $(EXTRA_bzip_put_sub_DEPENDENCIES) 
+	@rm -f bzip_put_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_put_sub_OBJECTS) $(bzip_put_sub_LDADD) $(LIBS)
+
+bzip_seek$(EXEEXT): $(bzip_seek_OBJECTS) $(bzip_seek_DEPENDENCIES) $(EXTRA_bzip_seek_DEPENDENCIES) 
+	@rm -f bzip_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_seek_OBJECTS) $(bzip_seek_LDADD) $(LIBS)
+
+bzip_seek_far$(EXEEXT): $(bzip_seek_far_OBJECTS) $(bzip_seek_far_DEPENDENCIES) $(EXTRA_bzip_seek_far_DEPENDENCIES) 
+	@rm -f bzip_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_seek_far_OBJECTS) $(bzip_seek_far_LDADD) $(LIBS)
+
+bzip_sync$(EXEEXT): $(bzip_sync_OBJECTS) $(bzip_sync_DEPENDENCIES) $(EXTRA_bzip_sync_DEPENDENCIES) 
+	@rm -f bzip_sync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bzip_sync_OBJECTS) $(bzip_sync_LDADD) $(LIBS)
 
 close_bad$(EXEEXT): $(close_bad_OBJECTS) $(close_bad_DEPENDENCIES) $(EXTRA_close_bad_DEPENDENCIES) 
 	@rm -f close_bad$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(close_bad_OBJECTS) $(close_bad_LDADD) $(LIBS)
 
+close_close$(EXEEXT): $(close_close_OBJECTS) $(close_close_DEPENDENCIES) $(EXTRA_close_close_DEPENDENCIES) 
+	@rm -f close_close$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(close_close_OBJECTS) $(close_close_LDADD) $(LIBS)
+
 close_discard$(EXEEXT): $(close_discard_OBJECTS) $(close_discard_DEPENDENCIES) $(EXTRA_close_discard_DEPENDENCIES) 
 	@rm -f close_discard$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(close_discard_OBJECTS) $(close_discard_LDADD) $(LIBS)
@@ -6827,6 +8144,10 @@ creat_rdonly$(EXEEXT): $(creat_rdonly_OBJECTS) $(creat_rdonly_DEPENDENCIES) $(EX
 	@rm -f creat_rdonly$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(creat_rdonly_OBJECTS) $(creat_rdonly_LDADD) $(LIBS)
 
+creat_rdonly_exists$(EXEEXT): $(creat_rdonly_exists_OBJECTS) $(creat_rdonly_exists_DEPENDENCIES) $(EXTRA_creat_rdonly_exists_DEPENDENCIES) 
+	@rm -f creat_rdonly_exists$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(creat_rdonly_exists_OBJECTS) $(creat_rdonly_exists_LDADD) $(LIBS)
+
 cvlist$(EXEEXT): $(cvlist_OBJECTS) $(cvlist_DEPENDENCIES) $(EXTRA_cvlist_DEPENDENCIES) 
 	@rm -f cvlist$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_OBJECTS) $(cvlist_LDADD) $(LIBS)
@@ -6835,6 +8156,14 @@ cvlist_array$(EXEEXT): $(cvlist_array_OBJECTS) $(cvlist_array_DEPENDENCIES) $(EX
 	@rm -f cvlist_array$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_array_OBJECTS) $(cvlist_array_LDADD) $(LIBS)
 
+cvlist_array0$(EXEEXT): $(cvlist_array0_OBJECTS) $(cvlist_array0_DEPENDENCIES) $(EXTRA_cvlist_array0_DEPENDENCIES) 
+	@rm -f cvlist_array0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array0_OBJECTS) $(cvlist_array0_LDADD) $(LIBS)
+
+cvlist_array_free$(EXEEXT): $(cvlist_array_free_OBJECTS) $(cvlist_array_free_DEPENDENCIES) $(EXTRA_cvlist_array_free_DEPENDENCIES) 
+	@rm -f cvlist_array_free$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array_free_OBJECTS) $(cvlist_array_free_LDADD) $(LIBS)
+
 cvlist_array_hidden$(EXEEXT): $(cvlist_array_hidden_OBJECTS) $(cvlist_array_hidden_DEPENDENCIES) $(EXTRA_cvlist_array_hidden_DEPENDENCIES) 
 	@rm -f cvlist_array_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_array_hidden_OBJECTS) $(cvlist_array_hidden_LDADD) $(LIBS)
@@ -6843,6 +8172,14 @@ cvlist_array_meta$(EXEEXT): $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_DEP
 	@rm -f cvlist_array_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_LDADD) $(LIBS)
 
+cvlist_array_meta0$(EXEEXT): $(cvlist_array_meta0_OBJECTS) $(cvlist_array_meta0_DEPENDENCIES) $(EXTRA_cvlist_array_meta0_DEPENDENCIES) 
+	@rm -f cvlist_array_meta0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array_meta0_OBJECTS) $(cvlist_array_meta0_LDADD) $(LIBS)
+
+cvlist_array_meta_free$(EXEEXT): $(cvlist_array_meta_free_OBJECTS) $(cvlist_array_meta_free_DEPENDENCIES) $(EXTRA_cvlist_array_meta_free_DEPENDENCIES) 
+	@rm -f cvlist_array_meta_free$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array_meta_free_OBJECTS) $(cvlist_array_meta_free_LDADD) $(LIBS)
+
 cvlist_array_meta_hidden$(EXEEXT): $(cvlist_array_meta_hidden_OBJECTS) $(cvlist_array_meta_hidden_DEPENDENCIES) $(EXTRA_cvlist_array_meta_hidden_DEPENDENCIES) 
 	@rm -f cvlist_array_meta_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_array_meta_hidden_OBJECTS) $(cvlist_array_meta_hidden_LDADD) $(LIBS)
@@ -6859,6 +8196,10 @@ cvlist_meta$(EXEEXT): $(cvlist_meta_OBJECTS) $(cvlist_meta_DEPENDENCIES) $(EXTRA
 	@rm -f cvlist_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_meta_OBJECTS) $(cvlist_meta_LDADD) $(LIBS)
 
+cvlist_meta0$(EXEEXT): $(cvlist_meta0_OBJECTS) $(cvlist_meta0_DEPENDENCIES) $(EXTRA_cvlist_meta0_DEPENDENCIES) 
+	@rm -f cvlist_meta0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_meta0_OBJECTS) $(cvlist_meta0_LDADD) $(LIBS)
+
 cvlist_meta_hidden$(EXEEXT): $(cvlist_meta_hidden_OBJECTS) $(cvlist_meta_hidden_DEPENDENCIES) $(EXTRA_cvlist_meta_hidden_DEPENDENCIES) 
 	@rm -f cvlist_meta_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_meta_hidden_OBJECTS) $(cvlist_meta_hidden_LDADD) $(LIBS)
@@ -6867,9 +8208,9 @@ cvlist_meta_invalid$(EXEEXT): $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_inval
 	@rm -f cvlist_meta_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_invalid_LDADD) $(LIBS)
 
-del$(EXEEXT): $(del_OBJECTS) $(del_DEPENDENCIES) $(EXTRA_del_DEPENDENCIES) 
-	@rm -f del$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(del_OBJECTS) $(del_LDADD) $(LIBS)
+del_alias$(EXEEXT): $(del_alias_OBJECTS) $(del_alias_DEPENDENCIES) $(EXTRA_del_alias_DEPENDENCIES) 
+	@rm -f del_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_alias_OBJECTS) $(del_alias_LDADD) $(LIBS)
 
 del_carray$(EXEEXT): $(del_carray_OBJECTS) $(del_carray_DEPENDENCIES) $(EXTRA_del_carray_DEPENDENCIES) 
 	@rm -f del_carray$(EXEEXT)
@@ -6895,6 +8236,18 @@ del_data$(EXEEXT): $(del_data_OBJECTS) $(del_data_DEPENDENCIES) $(EXTRA_del_data
 	@rm -f del_data$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(del_data_OBJECTS) $(del_data_LDADD) $(LIBS)
 
+del_data_enoent$(EXEEXT): $(del_data_enoent_OBJECTS) $(del_data_enoent_DEPENDENCIES) $(EXTRA_del_data_enoent_DEPENDENCIES) 
+	@rm -f del_data_enoent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_data_enoent_OBJECTS) $(del_data_enoent_LDADD) $(LIBS)
+
+del_data_open$(EXEEXT): $(del_data_open_OBJECTS) $(del_data_open_DEPENDENCIES) $(EXTRA_del_data_open_DEPENDENCIES) 
+	@rm -f del_data_open$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_data_open_OBJECTS) $(del_data_open_LDADD) $(LIBS)
+
+del_del$(EXEEXT): $(del_del_OBJECTS) $(del_del_DEPENDENCIES) $(EXTRA_del_del_DEPENDENCIES) 
+	@rm -f del_del$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_del_OBJECTS) $(del_del_LDADD) $(LIBS)
+
 del_derived$(EXEEXT): $(del_derived_OBJECTS) $(del_derived_DEPENDENCIES) $(EXTRA_del_derived_DEPENDENCIES) 
 	@rm -f del_derived$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(del_derived_OBJECTS) $(del_derived_LDADD) $(LIBS)
@@ -6915,6 +8268,10 @@ del_meta_force$(EXEEXT): $(del_meta_force_OBJECTS) $(del_meta_force_DEPENDENCIES
 	@rm -f del_meta_force$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(del_meta_force_OBJECTS) $(del_meta_force_LDADD) $(LIBS)
 
+del_ref$(EXEEXT): $(del_ref_OBJECTS) $(del_ref_DEPENDENCIES) $(EXTRA_del_ref_DEPENDENCIES) 
+	@rm -f del_ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_ref_OBJECTS) $(del_ref_LDADD) $(LIBS)
+
 desync$(EXEEXT): $(desync_OBJECTS) $(desync_DEPENDENCIES) $(EXTRA_desync_DEPENDENCIES) 
 	@rm -f desync$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(desync_OBJECTS) $(desync_LDADD) $(LIBS)
@@ -6923,6 +8280,10 @@ desync_flush$(EXEEXT): $(desync_flush_OBJECTS) $(desync_flush_DEPENDENCIES) $(EX
 	@rm -f desync_flush$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(desync_flush_OBJECTS) $(desync_flush_LDADD) $(LIBS)
 
+desync_path$(EXEEXT): $(desync_path_OBJECTS) $(desync_path_DEPENDENCIES) $(EXTRA_desync_path_DEPENDENCIES) 
+	@rm -f desync_path$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(desync_path_OBJECTS) $(desync_path_LDADD) $(LIBS)
+
 desync_reopen$(EXEEXT): $(desync_reopen_OBJECTS) $(desync_reopen_DEPENDENCIES) $(EXTRA_desync_reopen_DEPENDENCIES) 
 	@rm -f desync_reopen$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(desync_reopen_OBJECTS) $(desync_reopen_LDADD) $(LIBS)
@@ -6991,18 +8352,38 @@ encode_alter$(EXEEXT): $(encode_alter_OBJECTS) $(encode_alter_DEPENDENCIES) $(EX
 	@rm -f encode_alter$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(encode_alter_OBJECTS) $(encode_alter_LDADD) $(LIBS)
 
+encode_alter_all$(EXEEXT): $(encode_alter_all_OBJECTS) $(encode_alter_all_DEPENDENCIES) $(EXTRA_encode_alter_all_DEPENDENCIES) 
+	@rm -f encode_alter_all$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(encode_alter_all_OBJECTS) $(encode_alter_all_LDADD) $(LIBS)
+
+encode_alter_open$(EXEEXT): $(encode_alter_open_OBJECTS) $(encode_alter_open_DEPENDENCIES) $(EXTRA_encode_alter_open_DEPENDENCIES) 
+	@rm -f encode_alter_open$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(encode_alter_open_OBJECTS) $(encode_alter_open_LDADD) $(LIBS)
+
 encode_get$(EXEEXT): $(encode_get_OBJECTS) $(encode_get_DEPENDENCIES) $(EXTRA_encode_get_DEPENDENCIES) 
 	@rm -f encode_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(encode_get_OBJECTS) $(encode_get_LDADD) $(LIBS)
 
-encode_move$(EXEEXT): $(encode_move_OBJECTS) $(encode_move_DEPENDENCIES) $(EXTRA_encode_move_DEPENDENCIES) 
-	@rm -f encode_move$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(encode_move_OBJECTS) $(encode_move_LDADD) $(LIBS)
+encode_recode$(EXEEXT): $(encode_recode_OBJECTS) $(encode_recode_DEPENDENCIES) $(EXTRA_encode_recode_DEPENDENCIES) 
+	@rm -f encode_recode$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(encode_recode_OBJECTS) $(encode_recode_LDADD) $(LIBS)
+
+encode_recode_open$(EXEEXT): $(encode_recode_open_OBJECTS) $(encode_recode_open_DEPENDENCIES) $(EXTRA_encode_recode_open_DEPENDENCIES) 
+	@rm -f encode_recode_open$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(encode_recode_open_OBJECTS) $(encode_recode_open_LDADD) $(LIBS)
+
+encode_support$(EXEEXT): $(encode_support_OBJECTS) $(encode_support_DEPENDENCIES) $(EXTRA_encode_support_DEPENDENCIES) 
+	@rm -f encode_support$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(encode_support_OBJECTS) $(encode_support_LDADD) $(LIBS)
 
 endian_alter$(EXEEXT): $(endian_alter_OBJECTS) $(endian_alter_DEPENDENCIES) $(EXTRA_endian_alter_DEPENDENCIES) 
 	@rm -f endian_alter$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(endian_alter_OBJECTS) $(endian_alter_LDADD) $(LIBS)
 
+endian_alter_all$(EXEEXT): $(endian_alter_all_OBJECTS) $(endian_alter_all_DEPENDENCIES) $(EXTRA_endian_alter_all_DEPENDENCIES) 
+	@rm -f endian_alter_all$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(endian_alter_all_OBJECTS) $(endian_alter_all_LDADD) $(LIBS)
+
 endian_alter_sie$(EXEEXT): $(endian_alter_sie_OBJECTS) $(endian_alter_sie_DEPENDENCIES) $(EXTRA_endian_alter_sie_DEPENDENCIES) 
 	@rm -f endian_alter_sie$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(endian_alter_sie_OBJECTS) $(endian_alter_sie_LDADD) $(LIBS)
@@ -7119,6 +8500,10 @@ eof$(EXEEXT): $(eof_OBJECTS) $(eof_DEPENDENCIES) $(EXTRA_eof_DEPENDENCIES)
 	@rm -f eof$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(eof_OBJECTS) $(eof_LDADD) $(LIBS)
 
+eof_bit$(EXEEXT): $(eof_bit_OBJECTS) $(eof_bit_DEPENDENCIES) $(EXTRA_eof_bit_DEPENDENCIES) 
+	@rm -f eof_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(eof_bit_OBJECTS) $(eof_bit_LDADD) $(LIBS)
+
 eof_index$(EXEEXT): $(eof_index_OBJECTS) $(eof_index_DEPENDENCIES) $(EXTRA_eof_index_DEPENDENCIES) 
 	@rm -f eof_index$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(eof_index_OBJECTS) $(eof_index_LDADD) $(LIBS)
@@ -7131,6 +8516,10 @@ eof_phase$(EXEEXT): $(eof_phase_OBJECTS) $(eof_phase_DEPENDENCIES) $(EXTRA_eof_p
 	@rm -f eof_phase$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(eof_phase_OBJECTS) $(eof_phase_LDADD) $(LIBS)
 
+eof_phase_neg$(EXEEXT): $(eof_phase_neg_OBJECTS) $(eof_phase_neg_DEPENDENCIES) $(EXTRA_eof_phase_neg_DEPENDENCIES) 
+	@rm -f eof_phase_neg$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(eof_phase_neg_OBJECTS) $(eof_phase_neg_LDADD) $(LIBS)
+
 error$(EXEEXT): $(error_OBJECTS) $(error_DEPENDENCIES) $(EXTRA_error_DEPENDENCIES) 
 	@rm -f error$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(error_OBJECTS) $(error_LDADD) $(LIBS)
@@ -7167,10 +8556,78 @@ file_type$(EXEEXT): $(file_type_OBJECTS) $(file_type_DEPENDENCIES) $(EXTRA_file_
 	@rm -f file_type$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(file_type_OBJECTS) $(file_type_LDADD) $(LIBS)
 
+flac_add$(EXEEXT): $(flac_add_OBJECTS) $(flac_add_DEPENDENCIES) $(EXTRA_flac_add_DEPENDENCIES) 
+	@rm -f flac_add$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_add_OBJECTS) $(flac_add_LDADD) $(LIBS)
+
+flac_get_big$(EXEEXT): $(flac_get_big_OBJECTS) $(flac_get_big_DEPENDENCIES) $(EXTRA_flac_get_big_DEPENDENCIES) 
+	@rm -f flac_get_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_get_big_OBJECTS) $(flac_get_big_LDADD) $(LIBS)
+
+flac_get_far$(EXEEXT): $(flac_get_far_OBJECTS) $(flac_get_far_DEPENDENCIES) $(EXTRA_flac_get_far_DEPENDENCIES) 
+	@rm -f flac_get_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_get_far_OBJECTS) $(flac_get_far_LDADD) $(LIBS)
+
+flac_get_get$(EXEEXT): $(flac_get_get_OBJECTS) $(flac_get_get_DEPENDENCIES) $(EXTRA_flac_get_get_DEPENDENCIES) 
+	@rm -f flac_get_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_get_get_OBJECTS) $(flac_get_get_LDADD) $(LIBS)
+
+flac_get_get2$(EXEEXT): $(flac_get_get2_OBJECTS) $(flac_get_get2_DEPENDENCIES) $(EXTRA_flac_get_get2_DEPENDENCIES) 
+	@rm -f flac_get_get2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_get_get2_OBJECTS) $(flac_get_get2_LDADD) $(LIBS)
+
+flac_get_little$(EXEEXT): $(flac_get_little_OBJECTS) $(flac_get_little_DEPENDENCIES) $(EXTRA_flac_get_little_DEPENDENCIES) 
+	@rm -f flac_get_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_get_little_OBJECTS) $(flac_get_little_LDADD) $(LIBS)
+
+flac_nframes$(EXEEXT): $(flac_nframes_OBJECTS) $(flac_nframes_DEPENDENCIES) $(EXTRA_flac_nframes_DEPENDENCIES) 
+	@rm -f flac_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_nframes_OBJECTS) $(flac_nframes_LDADD) $(LIBS)
+
+flac_put_big$(EXEEXT): $(flac_put_big_OBJECTS) $(flac_put_big_DEPENDENCIES) $(EXTRA_flac_put_big_DEPENDENCIES) 
+	@rm -f flac_put_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_put_big_OBJECTS) $(flac_put_big_LDADD) $(LIBS)
+
+flac_put_complex128$(EXEEXT): $(flac_put_complex128_OBJECTS) $(flac_put_complex128_DEPENDENCIES) $(EXTRA_flac_put_complex128_DEPENDENCIES) 
+	@rm -f flac_put_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_put_complex128_OBJECTS) $(flac_put_complex128_LDADD) $(LIBS)
+
+flac_put_float64$(EXEEXT): $(flac_put_float64_OBJECTS) $(flac_put_float64_DEPENDENCIES) $(EXTRA_flac_put_float64_DEPENDENCIES) 
+	@rm -f flac_put_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_put_float64_OBJECTS) $(flac_put_float64_LDADD) $(LIBS)
+
+flac_put_int32$(EXEEXT): $(flac_put_int32_OBJECTS) $(flac_put_int32_DEPENDENCIES) $(EXTRA_flac_put_int32_DEPENDENCIES) 
+	@rm -f flac_put_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_put_int32_OBJECTS) $(flac_put_int32_LDADD) $(LIBS)
+
+flac_put_little$(EXEEXT): $(flac_put_little_OBJECTS) $(flac_put_little_DEPENDENCIES) $(EXTRA_flac_put_little_DEPENDENCIES) 
+	@rm -f flac_put_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_put_little_OBJECTS) $(flac_put_little_LDADD) $(LIBS)
+
+flac_seek$(EXEEXT): $(flac_seek_OBJECTS) $(flac_seek_DEPENDENCIES) $(EXTRA_flac_seek_DEPENDENCIES) 
+	@rm -f flac_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_seek_OBJECTS) $(flac_seek_LDADD) $(LIBS)
+
+flac_seek_far$(EXEEXT): $(flac_seek_far_OBJECTS) $(flac_seek_far_DEPENDENCIES) $(EXTRA_flac_seek_far_DEPENDENCIES) 
+	@rm -f flac_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_seek_far_OBJECTS) $(flac_seek_far_LDADD) $(LIBS)
+
+flac_sync$(EXEEXT): $(flac_sync_OBJECTS) $(flac_sync_DEPENDENCIES) $(EXTRA_flac_sync_DEPENDENCIES) 
+	@rm -f flac_sync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flac_sync_OBJECTS) $(flac_sync_LDADD) $(LIBS)
+
 flist$(EXEEXT): $(flist_OBJECTS) $(flist_DEPENDENCIES) $(EXTRA_flist_DEPENDENCIES) 
 	@rm -f flist$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flist_OBJECTS) $(flist_LDADD) $(LIBS)
 
+flist0$(EXEEXT): $(flist0_OBJECTS) $(flist0_DEPENDENCIES) $(EXTRA_flist0_DEPENDENCIES) 
+	@rm -f flist0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist0_OBJECTS) $(flist0_LDADD) $(LIBS)
+
+flist2$(EXEEXT): $(flist2_OBJECTS) $(flist2_DEPENDENCIES) $(EXTRA_flist2_DEPENDENCIES) 
+	@rm -f flist2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist2_OBJECTS) $(flist2_LDADD) $(LIBS)
+
 flist_hidden$(EXEEXT): $(flist_hidden_OBJECTS) $(flist_hidden_DEPENDENCIES) $(EXTRA_flist_hidden_DEPENDENCIES) 
 	@rm -f flist_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flist_hidden_OBJECTS) $(flist_hidden_LDADD) $(LIBS)
@@ -7183,6 +8640,10 @@ flist_meta$(EXEEXT): $(flist_meta_OBJECTS) $(flist_meta_DEPENDENCIES) $(EXTRA_fl
 	@rm -f flist_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flist_meta_OBJECTS) $(flist_meta_LDADD) $(LIBS)
 
+flist_meta2$(EXEEXT): $(flist_meta2_OBJECTS) $(flist_meta2_DEPENDENCIES) $(EXTRA_flist_meta2_DEPENDENCIES) 
+	@rm -f flist_meta2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_meta2_OBJECTS) $(flist_meta2_LDADD) $(LIBS)
+
 flist_meta_hidden$(EXEEXT): $(flist_meta_hidden_OBJECTS) $(flist_meta_hidden_DEPENDENCIES) $(EXTRA_flist_meta_hidden_DEPENDENCIES) 
 	@rm -f flist_meta_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flist_meta_hidden_OBJECTS) $(flist_meta_hidden_LDADD) $(LIBS)
@@ -7215,18 +8676,22 @@ flist_type_meta_invalid$(EXEEXT): $(flist_type_meta_invalid_OBJECTS) $(flist_typ
 	@rm -f flist_type_meta_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flist_type_meta_invalid_OBJECTS) $(flist_type_meta_invalid_LDADD) $(LIBS)
 
-flush$(EXEEXT): $(flush_OBJECTS) $(flush_DEPENDENCIES) $(EXTRA_flush_DEPENDENCIES) 
-	@rm -f flush$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(flush_OBJECTS) $(flush_LDADD) $(LIBS)
-
 flush_all$(EXEEXT): $(flush_all_OBJECTS) $(flush_all_DEPENDENCIES) $(EXTRA_flush_all_DEPENDENCIES) 
 	@rm -f flush_all$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flush_all_OBJECTS) $(flush_all_LDADD) $(LIBS)
 
+flush_amb_code$(EXEEXT): $(flush_amb_code_OBJECTS) $(flush_amb_code_DEPENDENCIES) $(EXTRA_flush_amb_code_DEPENDENCIES) 
+	@rm -f flush_amb_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_amb_code_OBJECTS) $(flush_amb_code_LDADD) $(LIBS)
+
 flush_bad_code$(EXEEXT): $(flush_bad_code_OBJECTS) $(flush_bad_code_DEPENDENCIES) $(EXTRA_flush_bad_code_DEPENDENCIES) 
 	@rm -f flush_bad_code$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flush_bad_code_OBJECTS) $(flush_bad_code_LDADD) $(LIBS)
 
+flush_flush$(EXEEXT): $(flush_flush_OBJECTS) $(flush_flush_DEPENDENCIES) $(EXTRA_flush_flush_DEPENDENCIES) 
+	@rm -f flush_flush$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_flush_OBJECTS) $(flush_flush_LDADD) $(LIBS)
+
 flush_hex$(EXEEXT): $(flush_hex_OBJECTS) $(flush_hex_DEPENDENCIES) $(EXTRA_flush_hex_DEPENDENCIES) 
 	@rm -f flush_hex$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flush_hex_OBJECTS) $(flush_hex_LDADD) $(LIBS)
@@ -7235,10 +8700,26 @@ flush_invalid$(EXEEXT): $(flush_invalid_OBJECTS) $(flush_invalid_DEPENDENCIES) $
 	@rm -f flush_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flush_invalid_OBJECTS) $(flush_invalid_LDADD) $(LIBS)
 
+flush_lincom$(EXEEXT): $(flush_lincom_OBJECTS) $(flush_lincom_DEPENDENCIES) $(EXTRA_flush_lincom_DEPENDENCIES) 
+	@rm -f flush_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_lincom_OBJECTS) $(flush_lincom_LDADD) $(LIBS)
+
+flush_lincom1$(EXEEXT): $(flush_lincom1_OBJECTS) $(flush_lincom1_DEPENDENCIES) $(EXTRA_flush_lincom1_DEPENDENCIES) 
+	@rm -f flush_lincom1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_lincom1_OBJECTS) $(flush_lincom1_LDADD) $(LIBS)
+
 flush_meta$(EXEEXT): $(flush_meta_OBJECTS) $(flush_meta_DEPENDENCIES) $(EXTRA_flush_meta_DEPENDENCIES) 
 	@rm -f flush_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flush_meta_OBJECTS) $(flush_meta_LDADD) $(LIBS)
 
+flush_mult$(EXEEXT): $(flush_mult_OBJECTS) $(flush_mult_DEPENDENCIES) $(EXTRA_flush_mult_DEPENDENCIES) 
+	@rm -f flush_mult$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_mult_OBJECTS) $(flush_mult_LDADD) $(LIBS)
+
+flush_raw_close$(EXEEXT): $(flush_raw_close_OBJECTS) $(flush_raw_close_DEPENDENCIES) $(EXTRA_flush_raw_close_DEPENDENCIES) 
+	@rm -f flush_raw_close$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_raw_close_OBJECTS) $(flush_raw_close_LDADD) $(LIBS)
+
 flush_ref$(EXEEXT): $(flush_ref_OBJECTS) $(flush_ref_DEPENDENCIES) $(EXTRA_flush_ref_DEPENDENCIES) 
 	@rm -f flush_ref$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flush_ref_OBJECTS) $(flush_ref_LDADD) $(LIBS)
@@ -7247,10 +8728,22 @@ flush_spec$(EXEEXT): $(flush_spec_OBJECTS) $(flush_spec_DEPENDENCIES) $(EXTRA_fl
 	@rm -f flush_spec$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(flush_spec_OBJECTS) $(flush_spec_LDADD) $(LIBS)
 
+flush_string$(EXEEXT): $(flush_string_OBJECTS) $(flush_string_DEPENDENCIES) $(EXTRA_flush_string_DEPENDENCIES) 
+	@rm -f flush_string$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_string_OBJECTS) $(flush_string_LDADD) $(LIBS)
+
+flush_sync$(EXEEXT): $(flush_sync_OBJECTS) $(flush_sync_DEPENDENCIES) $(EXTRA_flush_sync_DEPENDENCIES) 
+	@rm -f flush_sync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_sync_OBJECTS) $(flush_sync_LDADD) $(LIBS)
+
 foffs_alter$(EXEEXT): $(foffs_alter_OBJECTS) $(foffs_alter_DEPENDENCIES) $(EXTRA_foffs_alter_DEPENDENCIES) 
 	@rm -f foffs_alter$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(foffs_alter_OBJECTS) $(foffs_alter_LDADD) $(LIBS)
 
+foffs_alter_all$(EXEEXT): $(foffs_alter_all_OBJECTS) $(foffs_alter_all_DEPENDENCIES) $(EXTRA_foffs_alter_all_DEPENDENCIES) 
+	@rm -f foffs_alter_all$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(foffs_alter_all_OBJECTS) $(foffs_alter_all_LDADD) $(LIBS)
+
 foffs_get$(EXEEXT): $(foffs_get_OBJECTS) $(foffs_get_DEPENDENCIES) $(EXTRA_foffs_get_DEPENDENCIES) 
 	@rm -f foffs_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(foffs_get_OBJECTS) $(foffs_get_LDADD) $(LIBS)
@@ -7271,6 +8764,14 @@ fragment_affix_alter2$(EXEEXT): $(fragment_affix_alter2_OBJECTS) $(fragment_affi
 	@rm -f fragment_affix_alter2$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(fragment_affix_alter2_OBJECTS) $(fragment_affix_alter2_LDADD) $(LIBS)
 
+fragment_affix_alter_code$(EXEEXT): $(fragment_affix_alter_code_OBJECTS) $(fragment_affix_alter_code_DEPENDENCIES) $(EXTRA_fragment_affix_alter_code_DEPENDENCIES) 
+	@rm -f fragment_affix_alter_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_affix_alter_code_OBJECTS) $(fragment_affix_alter_code_LDADD) $(LIBS)
+
+fragment_affix_alter_nop$(EXEEXT): $(fragment_affix_alter_nop_OBJECTS) $(fragment_affix_alter_nop_DEPENDENCIES) $(EXTRA_fragment_affix_alter_nop_DEPENDENCIES) 
+	@rm -f fragment_affix_alter_nop$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_affix_alter_nop_OBJECTS) $(fragment_affix_alter_nop_LDADD) $(LIBS)
+
 fragment_affix_dup$(EXEEXT): $(fragment_affix_dup_OBJECTS) $(fragment_affix_dup_DEPENDENCIES) $(EXTRA_fragment_affix_dup_DEPENDENCIES) 
 	@rm -f fragment_affix_dup$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(fragment_affix_dup_OBJECTS) $(fragment_affix_dup_LDADD) $(LIBS)
@@ -7351,6 +8852,10 @@ get_const$(EXEEXT): $(get_const_OBJECTS) $(get_const_DEPENDENCIES) $(EXTRA_get_c
 	@rm -f get_const$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_const_OBJECTS) $(get_const_LDADD) $(LIBS)
 
+get_const_carray$(EXEEXT): $(get_const_carray_OBJECTS) $(get_const_carray_DEPENDENCIES) $(EXTRA_get_const_carray_DEPENDENCIES) 
+	@rm -f get_const_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_const_carray_OBJECTS) $(get_const_carray_LDADD) $(LIBS)
+
 get_const_complex$(EXEEXT): $(get_const_complex_OBJECTS) $(get_const_complex_DEPENDENCIES) $(EXTRA_get_const_complex_DEPENDENCIES) 
 	@rm -f get_const_complex$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_const_complex_OBJECTS) $(get_const_complex_LDADD) $(LIBS)
@@ -7371,6 +8876,10 @@ get_cpolynom_int$(EXEEXT): $(get_cpolynom_int_OBJECTS) $(get_cpolynom_int_DEPEND
 	@rm -f get_cpolynom_int$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_cpolynom_int_OBJECTS) $(get_cpolynom_int_LDADD) $(LIBS)
 
+get_dim$(EXEEXT): $(get_dim_OBJECTS) $(get_dim_DEPENDENCIES) $(EXTRA_get_dim_DEPENDENCIES) 
+	@rm -f get_dim$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_dim_OBJECTS) $(get_dim_LDADD) $(LIBS)
+
 get_divide$(EXEEXT): $(get_divide_OBJECTS) $(get_divide_DEPENDENCIES) $(EXTRA_get_divide_DEPENDENCIES) 
 	@rm -f get_divide$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_divide_OBJECTS) $(get_divide_LDADD) $(LIBS)
@@ -7495,6 +9004,10 @@ get_heres$(EXEEXT): $(get_heres_OBJECTS) $(get_heres_DEPENDENCIES) $(EXTRA_get_h
 	@rm -f get_heres$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_heres_OBJECTS) $(get_heres_LDADD) $(LIBS)
 
+get_index_complex$(EXEEXT): $(get_index_complex_OBJECTS) $(get_index_complex_DEPENDENCIES) $(EXTRA_get_index_complex_DEPENDENCIES) 
+	@rm -f get_index_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_index_complex_OBJECTS) $(get_index_complex_LDADD) $(LIBS)
+
 get_int16$(EXEEXT): $(get_int16_OBJECTS) $(get_int16_DEPENDENCIES) $(EXTRA_get_int16_DEPENDENCIES) 
 	@rm -f get_int16$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_int16_OBJECTS) $(get_int16_LDADD) $(LIBS)
@@ -7523,10 +9036,22 @@ get_lincom2$(EXEEXT): $(get_lincom2_OBJECTS) $(get_lincom2_DEPENDENCIES) $(EXTRA
 	@rm -f get_lincom2$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_lincom2_OBJECTS) $(get_lincom2_LDADD) $(LIBS)
 
+get_lincom2s$(EXEEXT): $(get_lincom2s_OBJECTS) $(get_lincom2s_DEPENDENCIES) $(EXTRA_get_lincom2s_DEPENDENCIES) 
+	@rm -f get_lincom2s$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom2s_OBJECTS) $(get_lincom2s_LDADD) $(LIBS)
+
 get_lincom3$(EXEEXT): $(get_lincom3_OBJECTS) $(get_lincom3_DEPENDENCIES) $(EXTRA_get_lincom3_DEPENDENCIES) 
 	@rm -f get_lincom3$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_lincom3_OBJECTS) $(get_lincom3_LDADD) $(LIBS)
 
+get_lincom3s$(EXEEXT): $(get_lincom3s_OBJECTS) $(get_lincom3s_DEPENDENCIES) $(EXTRA_get_lincom3s_DEPENDENCIES) 
+	@rm -f get_lincom3s$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom3s_OBJECTS) $(get_lincom3s_LDADD) $(LIBS)
+
+get_lincom_mdt$(EXEEXT): $(get_lincom_mdt_OBJECTS) $(get_lincom_mdt_DEPENDENCIES) $(EXTRA_get_lincom_mdt_DEPENDENCIES) 
+	@rm -f get_lincom_mdt$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom_mdt_OBJECTS) $(get_lincom_mdt_LDADD) $(LIBS)
+
 get_lincom_noin$(EXEEXT): $(get_lincom_noin_OBJECTS) $(get_lincom_noin_DEPENDENCIES) $(EXTRA_get_lincom_noin_DEPENDENCIES) 
 	@rm -f get_lincom_noin$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_lincom_noin_OBJECTS) $(get_lincom_noin_LDADD) $(LIBS)
@@ -7547,6 +9072,22 @@ get_linterp$(EXEEXT): $(get_linterp_OBJECTS) $(get_linterp_DEPENDENCIES) $(EXTRA
 	@rm -f get_linterp$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_linterp_OBJECTS) $(get_linterp_LDADD) $(LIBS)
 
+get_linterp1$(EXEEXT): $(get_linterp1_OBJECTS) $(get_linterp1_DEPENDENCIES) $(EXTRA_get_linterp1_DEPENDENCIES) 
+	@rm -f get_linterp1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp1_OBJECTS) $(get_linterp1_LDADD) $(LIBS)
+
+get_linterp_abs$(EXEEXT): $(get_linterp_abs_OBJECTS) $(get_linterp_abs_DEPENDENCIES) $(EXTRA_get_linterp_abs_DEPENDENCIES) 
+	@rm -f get_linterp_abs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp_abs_OBJECTS) $(get_linterp_abs_LDADD) $(LIBS)
+
+get_linterp_complex$(EXEEXT): $(get_linterp_complex_OBJECTS) $(get_linterp_complex_DEPENDENCIES) $(EXTRA_get_linterp_complex_DEPENDENCIES) 
+	@rm -f get_linterp_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp_complex_OBJECTS) $(get_linterp_complex_LDADD) $(LIBS)
+
+get_linterp_empty$(EXEEXT): $(get_linterp_empty_OBJECTS) $(get_linterp_empty_DEPENDENCIES) $(EXTRA_get_linterp_empty_DEPENDENCIES) 
+	@rm -f get_linterp_empty$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp_empty_OBJECTS) $(get_linterp_empty_LDADD) $(LIBS)
+
 get_linterp_noin$(EXEEXT): $(get_linterp_noin_OBJECTS) $(get_linterp_noin_DEPENDENCIES) $(EXTRA_get_linterp_noin_DEPENDENCIES) 
 	@rm -f get_linterp_noin$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_linterp_noin_OBJECTS) $(get_linterp_noin_LDADD) $(LIBS)
@@ -7567,6 +9108,10 @@ get_mplex_bof$(EXEEXT): $(get_mplex_bof_OBJECTS) $(get_mplex_bof_DEPENDENCIES) $
 	@rm -f get_mplex_bof$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_mplex_bof_OBJECTS) $(get_mplex_bof_LDADD) $(LIBS)
 
+get_mplex_complex$(EXEEXT): $(get_mplex_complex_OBJECTS) $(get_mplex_complex_DEPENDENCIES) $(EXTRA_get_mplex_complex_DEPENDENCIES) 
+	@rm -f get_mplex_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_complex_OBJECTS) $(get_mplex_complex_LDADD) $(LIBS)
+
 get_mplex_lb$(EXEEXT): $(get_mplex_lb_OBJECTS) $(get_mplex_lb_DEPENDENCIES) $(EXTRA_get_mplex_lb_DEPENDENCIES) 
 	@rm -f get_mplex_lb$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_mplex_lb_OBJECTS) $(get_mplex_lb_LDADD) $(LIBS)
@@ -7579,6 +9124,14 @@ get_mplex_nolb$(EXEEXT): $(get_mplex_nolb_OBJECTS) $(get_mplex_nolb_DEPENDENCIES
 	@rm -f get_mplex_nolb$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_mplex_nolb_OBJECTS) $(get_mplex_nolb_LDADD) $(LIBS)
 
+get_mplex_s$(EXEEXT): $(get_mplex_s_OBJECTS) $(get_mplex_s_DEPENDENCIES) $(EXTRA_get_mplex_s_DEPENDENCIES) 
+	@rm -f get_mplex_s$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_s_OBJECTS) $(get_mplex_s_LDADD) $(LIBS)
+
+get_mplex_saved$(EXEEXT): $(get_mplex_saved_OBJECTS) $(get_mplex_saved_DEPENDENCIES) $(EXTRA_get_mplex_saved_DEPENDENCIES) 
+	@rm -f get_mplex_saved$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_saved_OBJECTS) $(get_mplex_saved_LDADD) $(LIBS)
+
 get_multiply$(EXEEXT): $(get_multiply_OBJECTS) $(get_multiply_DEPENDENCIES) $(EXTRA_get_multiply_DEPENDENCIES) 
 	@rm -f get_multiply$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_multiply_OBJECTS) $(get_multiply_LDADD) $(LIBS)
@@ -7607,6 +9160,14 @@ get_multiply_s$(EXEEXT): $(get_multiply_s_OBJECTS) $(get_multiply_s_DEPENDENCIES
 	@rm -f get_multiply_s$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_multiply_s_OBJECTS) $(get_multiply_s_LDADD) $(LIBS)
 
+get_neg$(EXEEXT): $(get_neg_OBJECTS) $(get_neg_DEPENDENCIES) $(EXTRA_get_neg_DEPENDENCIES) 
+	@rm -f get_neg$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_neg_OBJECTS) $(get_neg_LDADD) $(LIBS)
+
+get_none$(EXEEXT): $(get_none_OBJECTS) $(get_none_DEPENDENCIES) $(EXTRA_get_none_DEPENDENCIES) 
+	@rm -f get_none$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_none_OBJECTS) $(get_none_LDADD) $(LIBS)
+
 get_nonexistent$(EXEEXT): $(get_nonexistent_OBJECTS) $(get_nonexistent_DEPENDENCIES) $(EXTRA_get_nonexistent_DEPENDENCIES) 
 	@rm -f get_nonexistent$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_nonexistent_OBJECTS) $(get_nonexistent_LDADD) $(LIBS)
@@ -7667,6 +9228,10 @@ get_ss$(EXEEXT): $(get_ss_OBJECTS) $(get_ss_DEPENDENCIES) $(EXTRA_get_ss_DEPENDE
 	@rm -f get_ss$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_ss_OBJECTS) $(get_ss_LDADD) $(LIBS)
 
+get_string$(EXEEXT): $(get_string_OBJECTS) $(get_string_DEPENDENCIES) $(EXTRA_get_string_DEPENDENCIES) 
+	@rm -f get_string$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_string_OBJECTS) $(get_string_LDADD) $(LIBS)
+
 get_type$(EXEEXT): $(get_type_OBJECTS) $(get_type_DEPENDENCIES) $(EXTRA_get_type_DEPENDENCIES) 
 	@rm -f get_type$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_type_OBJECTS) $(get_type_LDADD) $(LIBS)
@@ -7691,6 +9256,10 @@ get_window_clr$(EXEEXT): $(get_window_clr_OBJECTS) $(get_window_clr_DEPENDENCIES
 	@rm -f get_window_clr$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_window_clr_OBJECTS) $(get_window_clr_LDADD) $(LIBS)
 
+get_window_complex$(EXEEXT): $(get_window_complex_OBJECTS) $(get_window_complex_DEPENDENCIES) $(EXTRA_get_window_complex_DEPENDENCIES) 
+	@rm -f get_window_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_complex_OBJECTS) $(get_window_complex_LDADD) $(LIBS)
+
 get_window_ge$(EXEEXT): $(get_window_ge_OBJECTS) $(get_window_ge_DEPENDENCIES) $(EXTRA_get_window_ge_DEPENDENCIES) 
 	@rm -f get_window_ge$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_window_ge_OBJECTS) $(get_window_ge_LDADD) $(LIBS)
@@ -7711,6 +9280,10 @@ get_window_ne$(EXEEXT): $(get_window_ne_OBJECTS) $(get_window_ne_DEPENDENCIES) $
 	@rm -f get_window_ne$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_window_ne_OBJECTS) $(get_window_ne_LDADD) $(LIBS)
 
+get_window_s$(EXEEXT): $(get_window_s_OBJECTS) $(get_window_s_DEPENDENCIES) $(EXTRA_get_window_s_DEPENDENCIES) 
+	@rm -f get_window_s$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_s_OBJECTS) $(get_window_s_LDADD) $(LIBS)
+
 get_window_set$(EXEEXT): $(get_window_set_OBJECTS) $(get_window_set_DEPENDENCIES) $(EXTRA_get_window_set_DEPENDENCIES) 
 	@rm -f get_window_set$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_window_set_OBJECTS) $(get_window_set_LDADD) $(LIBS)
@@ -7719,6 +9292,14 @@ get_zero$(EXEEXT): $(get_zero_OBJECTS) $(get_zero_DEPENDENCIES) $(EXTRA_get_zero
 	@rm -f get_zero$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(get_zero_OBJECTS) $(get_zero_LDADD) $(LIBS)
 
+get_zero_complex$(EXEEXT): $(get_zero_complex_OBJECTS) $(get_zero_complex_DEPENDENCIES) $(EXTRA_get_zero_complex_DEPENDENCIES) 
+	@rm -f get_zero_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_zero_complex_OBJECTS) $(get_zero_complex_LDADD) $(LIBS)
+
+get_zero_float$(EXEEXT): $(get_zero_float_OBJECTS) $(get_zero_float_DEPENDENCIES) $(EXTRA_get_zero_float_DEPENDENCIES) 
+	@rm -f get_zero_float$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_zero_float_OBJECTS) $(get_zero_float_LDADD) $(LIBS)
+
 global_flags$(EXEEXT): $(global_flags_OBJECTS) $(global_flags_DEPENDENCIES) $(EXTRA_global_flags_DEPENDENCIES) 
 	@rm -f global_flags$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(global_flags_OBJECTS) $(global_flags_LDADD) $(LIBS)
@@ -7743,10 +9324,18 @@ gzip_add$(EXEEXT): $(gzip_add_OBJECTS) $(gzip_add_DEPENDENCIES) $(EXTRA_gzip_add
 	@rm -f gzip_add$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(gzip_add_OBJECTS) $(gzip_add_LDADD) $(LIBS)
 
+gzip_del$(EXEEXT): $(gzip_del_OBJECTS) $(gzip_del_DEPENDENCIES) $(EXTRA_gzip_del_DEPENDENCIES) 
+	@rm -f gzip_del$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_del_OBJECTS) $(gzip_del_LDADD) $(LIBS)
+
 gzip_get$(EXEEXT): $(gzip_get_OBJECTS) $(gzip_get_DEPENDENCIES) $(EXTRA_gzip_get_DEPENDENCIES) 
 	@rm -f gzip_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(gzip_get_OBJECTS) $(gzip_get_LDADD) $(LIBS)
 
+gzip_get_far$(EXEEXT): $(gzip_get_far_OBJECTS) $(gzip_get_far_DEPENDENCIES) $(EXTRA_gzip_get_far_DEPENDENCIES) 
+	@rm -f gzip_get_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_get_far_OBJECTS) $(gzip_get_far_LDADD) $(LIBS)
+
 gzip_get_get$(EXEEXT): $(gzip_get_get_OBJECTS) $(gzip_get_get_DEPENDENCIES) $(EXTRA_gzip_get_get_DEPENDENCIES) 
 	@rm -f gzip_get_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(gzip_get_get_OBJECTS) $(gzip_get_get_LDADD) $(LIBS)
@@ -7775,14 +9364,58 @@ gzip_put$(EXEEXT): $(gzip_put_OBJECTS) $(gzip_put_DEPENDENCIES) $(EXTRA_gzip_put
 	@rm -f gzip_put$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(gzip_put_OBJECTS) $(gzip_put_LDADD) $(LIBS)
 
+gzip_put_back$(EXEEXT): $(gzip_put_back_OBJECTS) $(gzip_put_back_DEPENDENCIES) $(EXTRA_gzip_put_back_DEPENDENCIES) 
+	@rm -f gzip_put_back$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_put_back_OBJECTS) $(gzip_put_back_LDADD) $(LIBS)
+
+gzip_put_endian$(EXEEXT): $(gzip_put_endian_OBJECTS) $(gzip_put_endian_DEPENDENCIES) $(EXTRA_gzip_put_endian_DEPENDENCIES) 
+	@rm -f gzip_put_endian$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_put_endian_OBJECTS) $(gzip_put_endian_LDADD) $(LIBS)
+
 gzip_put_get$(EXEEXT): $(gzip_put_get_OBJECTS) $(gzip_put_get_DEPENDENCIES) $(EXTRA_gzip_put_get_DEPENDENCIES) 
 	@rm -f gzip_put_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(gzip_put_get_OBJECTS) $(gzip_put_get_LDADD) $(LIBS)
 
+gzip_put_nframes$(EXEEXT): $(gzip_put_nframes_OBJECTS) $(gzip_put_nframes_DEPENDENCIES) $(EXTRA_gzip_put_nframes_DEPENDENCIES) 
+	@rm -f gzip_put_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_put_nframes_OBJECTS) $(gzip_put_nframes_LDADD) $(LIBS)
+
+gzip_put_off$(EXEEXT): $(gzip_put_off_OBJECTS) $(gzip_put_off_DEPENDENCIES) $(EXTRA_gzip_put_off_DEPENDENCIES) 
+	@rm -f gzip_put_off$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_put_off_OBJECTS) $(gzip_put_off_LDADD) $(LIBS)
+
+gzip_put_pad$(EXEEXT): $(gzip_put_pad_OBJECTS) $(gzip_put_pad_DEPENDENCIES) $(EXTRA_gzip_put_pad_DEPENDENCIES) 
+	@rm -f gzip_put_pad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_put_pad_OBJECTS) $(gzip_put_pad_LDADD) $(LIBS)
+
+gzip_put_sub$(EXEEXT): $(gzip_put_sub_OBJECTS) $(gzip_put_sub_DEPENDENCIES) $(EXTRA_gzip_put_sub_DEPENDENCIES) 
+	@rm -f gzip_put_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_put_sub_OBJECTS) $(gzip_put_sub_LDADD) $(LIBS)
+
+gzip_seek$(EXEEXT): $(gzip_seek_OBJECTS) $(gzip_seek_DEPENDENCIES) $(EXTRA_gzip_seek_DEPENDENCIES) 
+	@rm -f gzip_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_seek_OBJECTS) $(gzip_seek_LDADD) $(LIBS)
+
+gzip_seek_far$(EXEEXT): $(gzip_seek_far_OBJECTS) $(gzip_seek_far_DEPENDENCIES) $(EXTRA_gzip_seek_far_DEPENDENCIES) 
+	@rm -f gzip_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_seek_far_OBJECTS) $(gzip_seek_far_LDADD) $(LIBS)
+
+gzip_seek_put$(EXEEXT): $(gzip_seek_put_OBJECTS) $(gzip_seek_put_DEPENDENCIES) $(EXTRA_gzip_seek_put_DEPENDENCIES) 
+	@rm -f gzip_seek_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_seek_put_OBJECTS) $(gzip_seek_put_LDADD) $(LIBS)
+
+gzip_sync$(EXEEXT): $(gzip_sync_OBJECTS) $(gzip_sync_DEPENDENCIES) $(EXTRA_gzip_sync_DEPENDENCIES) 
+	@rm -f gzip_sync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_sync_OBJECTS) $(gzip_sync_LDADD) $(LIBS)
+
 header_complex$(EXEEXT): $(header_complex_OBJECTS) $(header_complex_DEPENDENCIES) $(EXTRA_header_complex_DEPENDENCIES) 
 	@rm -f header_complex$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(header_complex_OBJECTS) $(header_complex_LDADD) $(LIBS)
 
+header_off64t$(EXEEXT): $(header_off64t_OBJECTS) $(header_off64t_DEPENDENCIES) $(EXTRA_header_off64t_DEPENDENCIES) 
+	@rm -f header_off64t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(header_off64t_OBJECTS) $(header_off64t_LDADD) $(LIBS)
+
 hide$(EXEEXT): $(hide_OBJECTS) $(hide_DEPENDENCIES) $(EXTRA_hide_DEPENDENCIES) 
 	@rm -f hide$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(hide_OBJECTS) $(hide_LDADD) $(LIBS)
@@ -7795,10 +9428,6 @@ hide_unhide$(EXEEXT): $(hide_unhide_OBJECTS) $(hide_unhide_DEPENDENCIES) $(EXTRA
 	@rm -f hide_unhide$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(hide_unhide_OBJECTS) $(hide_unhide_LDADD) $(LIBS)
 
-include$(EXEEXT): $(include_OBJECTS) $(include_DEPENDENCIES) $(EXTRA_include_DEPENDENCIES) 
-	@rm -f include$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(include_OBJECTS) $(include_LDADD) $(LIBS)
-
 include_accmode$(EXEEXT): $(include_accmode_OBJECTS) $(include_accmode_DEPENDENCIES) $(EXTRA_include_accmode_DEPENDENCIES) 
 	@rm -f include_accmode$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(include_accmode_OBJECTS) $(include_accmode_LDADD) $(LIBS)
@@ -7823,6 +9452,10 @@ include_ignore$(EXEEXT): $(include_ignore_OBJECTS) $(include_ignore_DEPENDENCIES
 	@rm -f include_ignore$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(include_ignore_OBJECTS) $(include_ignore_LDADD) $(LIBS)
 
+include_include$(EXEEXT): $(include_include_OBJECTS) $(include_include_DEPENDENCIES) $(EXTRA_include_include_DEPENDENCIES) 
+	@rm -f include_include$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_include_OBJECTS) $(include_include_LDADD) $(LIBS)
+
 include_index$(EXEEXT): $(include_index_OBJECTS) $(include_index_DEPENDENCIES) $(EXTRA_include_index_DEPENDENCIES) 
 	@rm -f include_index$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(include_index_OBJECTS) $(include_index_LDADD) $(LIBS)
@@ -7851,18 +9484,38 @@ include_syntax$(EXEEXT): $(include_syntax_OBJECTS) $(include_syntax_DEPENDENCIES
 	@rm -f include_syntax$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(include_syntax_OBJECTS) $(include_syntax_LDADD) $(LIBS)
 
-index$(EXEEXT): $(index_OBJECTS) $(index_DEPENDENCIES) $(EXTRA_index_DEPENDENCIES) 
-	@rm -f index$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(index_OBJECTS) $(index_LDADD) $(LIBS)
-
 index_domain$(EXEEXT): $(index_domain_OBJECTS) $(index_domain_DEPENDENCIES) $(EXTRA_index_domain_DEPENDENCIES) 
 	@rm -f index_domain$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(index_domain_OBJECTS) $(index_domain_LDADD) $(LIBS)
 
+index_index$(EXEEXT): $(index_index_OBJECTS) $(index_index_DEPENDENCIES) $(EXTRA_index_index_DEPENDENCIES) 
+	@rm -f index_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(index_index_OBJECTS) $(index_index_LDADD) $(LIBS)
+
 index_range$(EXEEXT): $(index_range_OBJECTS) $(index_range_DEPENDENCIES) $(EXTRA_index_range_DEPENDENCIES) 
 	@rm -f index_range$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(index_range_OBJECTS) $(index_range_LDADD) $(LIBS)
 
+index_s$(EXEEXT): $(index_s_OBJECTS) $(index_s_DEPENDENCIES) $(EXTRA_index_s_DEPENDENCIES) 
+	@rm -f index_s$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(index_s_OBJECTS) $(index_s_LDADD) $(LIBS)
+
+index_subset$(EXEEXT): $(index_subset_OBJECTS) $(index_subset_DEPENDENCIES) $(EXTRA_index_subset_DEPENDENCIES) 
+	@rm -f index_subset$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(index_subset_OBJECTS) $(index_subset_LDADD) $(LIBS)
+
+legacy_error$(EXEEXT): $(legacy_error_OBJECTS) $(legacy_error_DEPENDENCIES) $(EXTRA_legacy_error_DEPENDENCIES) 
+	@rm -f legacy_error$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_error_OBJECTS) $(legacy_error_LDADD) $(LIBS)
+
+legacy_estring$(EXEEXT): $(legacy_estring_OBJECTS) $(legacy_estring_DEPENDENCIES) $(EXTRA_legacy_estring_DEPENDENCIES) 
+	@rm -f legacy_estring$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_estring_OBJECTS) $(legacy_estring_LDADD) $(LIBS)
+
+legacy_format$(EXEEXT): $(legacy_format_OBJECTS) $(legacy_format_DEPENDENCIES) $(EXTRA_legacy_format_DEPENDENCIES) 
+	@rm -f legacy_format$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_format_OBJECTS) $(legacy_format_LDADD) $(LIBS)
+
 legacy_get$(EXEEXT): $(legacy_get_OBJECTS) $(legacy_get_DEPENDENCIES) $(EXTRA_legacy_get_DEPENDENCIES) 
 	@rm -f legacy_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(legacy_get_OBJECTS) $(legacy_get_LDADD) $(LIBS)
@@ -7899,6 +9552,74 @@ lzma_nframes$(EXEEXT): $(lzma_nframes_OBJECTS) $(lzma_nframes_DEPENDENCIES) $(EX
 	@rm -f lzma_nframes$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(lzma_nframes_OBJECTS) $(lzma_nframes_LDADD) $(LIBS)
 
+lzma_put$(EXEEXT): $(lzma_put_OBJECTS) $(lzma_put_DEPENDENCIES) $(EXTRA_lzma_put_DEPENDENCIES) 
+	@rm -f lzma_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_put_OBJECTS) $(lzma_put_LDADD) $(LIBS)
+
+lzma_xz_add$(EXEEXT): $(lzma_xz_add_OBJECTS) $(lzma_xz_add_DEPENDENCIES) $(EXTRA_lzma_xz_add_DEPENDENCIES) 
+	@rm -f lzma_xz_add$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_add_OBJECTS) $(lzma_xz_add_LDADD) $(LIBS)
+
+lzma_xz_get$(EXEEXT): $(lzma_xz_get_OBJECTS) $(lzma_xz_get_DEPENDENCIES) $(EXTRA_lzma_xz_get_DEPENDENCIES) 
+	@rm -f lzma_xz_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_get_OBJECTS) $(lzma_xz_get_LDADD) $(LIBS)
+
+lzma_xz_get_far$(EXEEXT): $(lzma_xz_get_far_OBJECTS) $(lzma_xz_get_far_DEPENDENCIES) $(EXTRA_lzma_xz_get_far_DEPENDENCIES) 
+	@rm -f lzma_xz_get_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_get_far_OBJECTS) $(lzma_xz_get_far_LDADD) $(LIBS)
+
+lzma_xz_get_get$(EXEEXT): $(lzma_xz_get_get_OBJECTS) $(lzma_xz_get_get_DEPENDENCIES) $(EXTRA_lzma_xz_get_get_DEPENDENCIES) 
+	@rm -f lzma_xz_get_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_get_get_OBJECTS) $(lzma_xz_get_get_LDADD) $(LIBS)
+
+lzma_xz_get_get2$(EXEEXT): $(lzma_xz_get_get2_OBJECTS) $(lzma_xz_get_get2_DEPENDENCIES) $(EXTRA_lzma_xz_get_get2_DEPENDENCIES) 
+	@rm -f lzma_xz_get_get2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_get_get2_OBJECTS) $(lzma_xz_get_get2_LDADD) $(LIBS)
+
+lzma_xz_get_put$(EXEEXT): $(lzma_xz_get_put_OBJECTS) $(lzma_xz_get_put_DEPENDENCIES) $(EXTRA_lzma_xz_get_put_DEPENDENCIES) 
+	@rm -f lzma_xz_get_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_get_put_OBJECTS) $(lzma_xz_get_put_LDADD) $(LIBS)
+
+lzma_xz_move_to$(EXEEXT): $(lzma_xz_move_to_OBJECTS) $(lzma_xz_move_to_DEPENDENCIES) $(EXTRA_lzma_xz_move_to_DEPENDENCIES) 
+	@rm -f lzma_xz_move_to$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_move_to_OBJECTS) $(lzma_xz_move_to_LDADD) $(LIBS)
+
+lzma_xz_nframes$(EXEEXT): $(lzma_xz_nframes_OBJECTS) $(lzma_xz_nframes_DEPENDENCIES) $(EXTRA_lzma_xz_nframes_DEPENDENCIES) 
+	@rm -f lzma_xz_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_nframes_OBJECTS) $(lzma_xz_nframes_LDADD) $(LIBS)
+
+lzma_xz_put$(EXEEXT): $(lzma_xz_put_OBJECTS) $(lzma_xz_put_DEPENDENCIES) $(EXTRA_lzma_xz_put_DEPENDENCIES) 
+	@rm -f lzma_xz_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_put_OBJECTS) $(lzma_xz_put_LDADD) $(LIBS)
+
+lzma_xz_put_back$(EXEEXT): $(lzma_xz_put_back_OBJECTS) $(lzma_xz_put_back_DEPENDENCIES) $(EXTRA_lzma_xz_put_back_DEPENDENCIES) 
+	@rm -f lzma_xz_put_back$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_put_back_OBJECTS) $(lzma_xz_put_back_LDADD) $(LIBS)
+
+lzma_xz_put_endian$(EXEEXT): $(lzma_xz_put_endian_OBJECTS) $(lzma_xz_put_endian_DEPENDENCIES) $(EXTRA_lzma_xz_put_endian_DEPENDENCIES) 
+	@rm -f lzma_xz_put_endian$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_put_endian_OBJECTS) $(lzma_xz_put_endian_LDADD) $(LIBS)
+
+lzma_xz_put_get$(EXEEXT): $(lzma_xz_put_get_OBJECTS) $(lzma_xz_put_get_DEPENDENCIES) $(EXTRA_lzma_xz_put_get_DEPENDENCIES) 
+	@rm -f lzma_xz_put_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_put_get_OBJECTS) $(lzma_xz_put_get_LDADD) $(LIBS)
+
+lzma_xz_put_pad$(EXEEXT): $(lzma_xz_put_pad_OBJECTS) $(lzma_xz_put_pad_DEPENDENCIES) $(EXTRA_lzma_xz_put_pad_DEPENDENCIES) 
+	@rm -f lzma_xz_put_pad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_put_pad_OBJECTS) $(lzma_xz_put_pad_LDADD) $(LIBS)
+
+lzma_xz_seek$(EXEEXT): $(lzma_xz_seek_OBJECTS) $(lzma_xz_seek_DEPENDENCIES) $(EXTRA_lzma_xz_seek_DEPENDENCIES) 
+	@rm -f lzma_xz_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_seek_OBJECTS) $(lzma_xz_seek_LDADD) $(LIBS)
+
+lzma_xz_seek_far$(EXEEXT): $(lzma_xz_seek_far_OBJECTS) $(lzma_xz_seek_far_DEPENDENCIES) $(EXTRA_lzma_xz_seek_far_DEPENDENCIES) 
+	@rm -f lzma_xz_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_seek_far_OBJECTS) $(lzma_xz_seek_far_LDADD) $(LIBS)
+
+lzma_xz_sync$(EXEEXT): $(lzma_xz_sync_OBJECTS) $(lzma_xz_sync_DEPENDENCIES) $(EXTRA_lzma_xz_sync_DEPENDENCIES) 
+	@rm -f lzma_xz_sync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_xz_sync_OBJECTS) $(lzma_xz_sync_LDADD) $(LIBS)
+
 madd$(EXEEXT): $(madd_OBJECTS) $(madd_DEPENDENCIES) $(EXTRA_madd_DEPENDENCIES) 
 	@rm -f madd$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(madd_OBJECTS) $(madd_LDADD) $(LIBS)
@@ -8027,10 +9748,6 @@ madd_window$(EXEEXT): $(madd_window_OBJECTS) $(madd_window_DEPENDENCIES) $(EXTRA
 	@rm -f madd_window$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(madd_window_OBJECTS) $(madd_window_LDADD) $(LIBS)
 
-move$(EXEEXT): $(move_OBJECTS) $(move_DEPENDENCIES) $(EXTRA_move_DEPENDENCIES) 
-	@rm -f move$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(move_OBJECTS) $(move_LDADD) $(LIBS)
-
 move_affix$(EXEEXT): $(move_affix_OBJECTS) $(move_affix_DEPENDENCIES) $(EXTRA_move_affix_DEPENDENCIES) 
 	@rm -f move_affix$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_affix_OBJECTS) $(move_affix_LDADD) $(LIBS)
@@ -8039,6 +9756,14 @@ move_affix_dup$(EXEEXT): $(move_affix_dup_OBJECTS) $(move_affix_dup_DEPENDENCIES
 	@rm -f move_affix_dup$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_affix_dup_OBJECTS) $(move_affix_dup_LDADD) $(LIBS)
 
+move_affix_meta$(EXEEXT): $(move_affix_meta_OBJECTS) $(move_affix_meta_DEPENDENCIES) $(EXTRA_move_affix_meta_DEPENDENCIES) 
+	@rm -f move_affix_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_affix_meta_OBJECTS) $(move_affix_meta_LDADD) $(LIBS)
+
+move_affix_updb$(EXEEXT): $(move_affix_updb_OBJECTS) $(move_affix_updb_DEPENDENCIES) $(EXTRA_move_affix_updb_DEPENDENCIES) 
+	@rm -f move_affix_updb$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_affix_updb_OBJECTS) $(move_affix_updb_LDADD) $(LIBS)
+
 move_alias$(EXEEXT): $(move_alias_OBJECTS) $(move_alias_DEPENDENCIES) $(EXTRA_move_alias_DEPENDENCIES) 
 	@rm -f move_alias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_alias_OBJECTS) $(move_alias_LDADD) $(LIBS)
@@ -8059,6 +9784,10 @@ move_data_foffs$(EXEEXT): $(move_data_foffs_OBJECTS) $(move_data_foffs_DEPENDENC
 	@rm -f move_data_foffs$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_data_foffs_OBJECTS) $(move_data_foffs_LDADD) $(LIBS)
 
+move_data_foffs_neg$(EXEEXT): $(move_data_foffs_neg_OBJECTS) $(move_data_foffs_neg_DEPENDENCIES) $(EXTRA_move_data_foffs_neg_DEPENDENCIES) 
+	@rm -f move_data_foffs_neg$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_data_foffs_neg_OBJECTS) $(move_data_foffs_neg_LDADD) $(LIBS)
+
 move_data_nop$(EXEEXT): $(move_data_nop_OBJECTS) $(move_data_nop_DEPENDENCIES) $(EXTRA_move_data_nop_DEPENDENCIES) 
 	@rm -f move_data_nop$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_data_nop_OBJECTS) $(move_data_nop_LDADD) $(LIBS)
@@ -8071,6 +9800,10 @@ move_meta$(EXEEXT): $(move_meta_OBJECTS) $(move_meta_DEPENDENCIES) $(EXTRA_move_
 	@rm -f move_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_meta_OBJECTS) $(move_meta_LDADD) $(LIBS)
 
+move_move$(EXEEXT): $(move_move_OBJECTS) $(move_move_DEPENDENCIES) $(EXTRA_move_move_DEPENDENCIES) 
+	@rm -f move_move$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_move_OBJECTS) $(move_move_LDADD) $(LIBS)
+
 move_protect$(EXEEXT): $(move_protect_OBJECTS) $(move_protect_DEPENDENCIES) $(EXTRA_move_protect_DEPENDENCIES) 
 	@rm -f move_protect$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_protect_OBJECTS) $(move_protect_LDADD) $(LIBS)
@@ -8079,10 +9812,6 @@ move_subdir$(EXEEXT): $(move_subdir_OBJECTS) $(move_subdir_DEPENDENCIES) $(EXTRA
 	@rm -f move_subdir$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(move_subdir_OBJECTS) $(move_subdir_LDADD) $(LIBS)
 
-name$(EXEEXT): $(name_OBJECTS) $(name_DEPENDENCIES) $(EXTRA_name_DEPENDENCIES) 
-	@rm -f name$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(name_OBJECTS) $(name_LDADD) $(LIBS)
-
 name_affix$(EXEEXT): $(name_affix_OBJECTS) $(name_affix_DEPENDENCIES) $(EXTRA_name_affix_DEPENDENCIES) 
 	@rm -f name_affix$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_affix_OBJECTS) $(name_affix_LDADD) $(LIBS)
@@ -8095,10 +9824,30 @@ name_alias$(EXEEXT): $(name_alias_OBJECTS) $(name_alias_DEPENDENCIES) $(EXTRA_na
 	@rm -f name_alias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_alias_OBJECTS) $(name_alias_LDADD) $(LIBS)
 
+name_dangle$(EXEEXT): $(name_dangle_OBJECTS) $(name_dangle_DEPENDENCIES) $(EXTRA_name_dangle_DEPENDENCIES) 
+	@rm -f name_dangle$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_dangle_OBJECTS) $(name_dangle_LDADD) $(LIBS)
+
+name_dot5$(EXEEXT): $(name_dot5_OBJECTS) $(name_dot5_DEPENDENCIES) $(EXTRA_name_dot5_DEPENDENCIES) 
+	@rm -f name_dot5$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_dot5_OBJECTS) $(name_dot5_LDADD) $(LIBS)
+
+name_dot5r$(EXEEXT): $(name_dot5r_OBJECTS) $(name_dot5r_DEPENDENCIES) $(EXTRA_name_dot5r_DEPENDENCIES) 
+	@rm -f name_dot5r$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_dot5r_OBJECTS) $(name_dot5r_LDADD) $(LIBS)
+
+name_dot9$(EXEEXT): $(name_dot9_OBJECTS) $(name_dot9_DEPENDENCIES) $(EXTRA_name_dot9_DEPENDENCIES) 
+	@rm -f name_dot9$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_dot9_OBJECTS) $(name_dot9_LDADD) $(LIBS)
+
 name_dup$(EXEEXT): $(name_dup_OBJECTS) $(name_dup_DEPENDENCIES) $(EXTRA_name_dup_DEPENDENCIES) 
 	@rm -f name_dup$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_dup_OBJECTS) $(name_dup_LDADD) $(LIBS)
 
+name_meta$(EXEEXT): $(name_meta_OBJECTS) $(name_meta_DEPENDENCIES) $(EXTRA_name_meta_DEPENDENCIES) 
+	@rm -f name_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_meta_OBJECTS) $(name_meta_LDADD) $(LIBS)
+
 name_move$(EXEEXT): $(name_move_OBJECTS) $(name_move_DEPENDENCIES) $(EXTRA_name_move_DEPENDENCIES) 
 	@rm -f name_move$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_move_OBJECTS) $(name_move_LDADD) $(LIBS)
@@ -8107,14 +9856,26 @@ name_move_alias$(EXEEXT): $(name_move_alias_OBJECTS) $(name_move_alias_DEPENDENC
 	@rm -f name_move_alias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_move_alias_OBJECTS) $(name_move_alias_LDADD) $(LIBS)
 
+name_name$(EXEEXT): $(name_name_OBJECTS) $(name_name_DEPENDENCIES) $(EXTRA_name_name_DEPENDENCIES) 
+	@rm -f name_name$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_name_OBJECTS) $(name_name_LDADD) $(LIBS)
+
 name_updb$(EXEEXT): $(name_updb_OBJECTS) $(name_updb_DEPENDENCIES) $(EXTRA_name_updb_DEPENDENCIES) 
 	@rm -f name_updb$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_updb_OBJECTS) $(name_updb_LDADD) $(LIBS)
 
+name_updb_affix$(EXEEXT): $(name_updb_affix_OBJECTS) $(name_updb_affix_DEPENDENCIES) $(EXTRA_name_updb_affix_DEPENDENCIES) 
+	@rm -f name_updb_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_updb_affix_OBJECTS) $(name_updb_affix_LDADD) $(LIBS)
+
 name_updb_alias$(EXEEXT): $(name_updb_alias_OBJECTS) $(name_updb_alias_DEPENDENCIES) $(EXTRA_name_updb_alias_DEPENDENCIES) 
 	@rm -f name_updb_alias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_updb_alias_OBJECTS) $(name_updb_alias_LDADD) $(LIBS)
 
+name_updb_carray$(EXEEXT): $(name_updb_carray_OBJECTS) $(name_updb_carray_DEPENDENCIES) $(EXTRA_name_updb_carray_DEPENDENCIES) 
+	@rm -f name_updb_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_updb_carray_OBJECTS) $(name_updb_carray_LDADD) $(LIBS)
+
 name_updb_const$(EXEEXT): $(name_updb_const_OBJECTS) $(name_updb_const_DEPENDENCIES) $(EXTRA_name_updb_const_DEPENDENCIES) 
 	@rm -f name_updb_const$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_updb_const_OBJECTS) $(name_updb_const_LDADD) $(LIBS)
@@ -8123,6 +9884,90 @@ name_updb_const_alias$(EXEEXT): $(name_updb_const_alias_OBJECTS) $(name_updb_con
 	@rm -f name_updb_const_alias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(name_updb_const_alias_OBJECTS) $(name_updb_const_alias_LDADD) $(LIBS)
 
+native_bit$(EXEEXT): $(native_bit_OBJECTS) $(native_bit_DEPENDENCIES) $(EXTRA_native_bit_DEPENDENCIES) 
+	@rm -f native_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_bit_OBJECTS) $(native_bit_LDADD) $(LIBS)
+
+native_const$(EXEEXT): $(native_const_OBJECTS) $(native_const_DEPENDENCIES) $(EXTRA_native_const_DEPENDENCIES) 
+	@rm -f native_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_const_OBJECTS) $(native_const_LDADD) $(LIBS)
+
+native_index$(EXEEXT): $(native_index_OBJECTS) $(native_index_DEPENDENCIES) $(EXTRA_native_index_DEPENDENCIES) 
+	@rm -f native_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_index_OBJECTS) $(native_index_LDADD) $(LIBS)
+
+native_lincom$(EXEEXT): $(native_lincom_OBJECTS) $(native_lincom_DEPENDENCIES) $(EXTRA_native_lincom_DEPENDENCIES) 
+	@rm -f native_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_lincom_OBJECTS) $(native_lincom_LDADD) $(LIBS)
+
+native_lincom_cmpin$(EXEEXT): $(native_lincom_cmpin_OBJECTS) $(native_lincom_cmpin_DEPENDENCIES) $(EXTRA_native_lincom_cmpin_DEPENDENCIES) 
+	@rm -f native_lincom_cmpin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_lincom_cmpin_OBJECTS) $(native_lincom_cmpin_LDADD) $(LIBS)
+
+native_lincom_cmpscal$(EXEEXT): $(native_lincom_cmpscal_OBJECTS) $(native_lincom_cmpscal_DEPENDENCIES) $(EXTRA_native_lincom_cmpscal_DEPENDENCIES) 
+	@rm -f native_lincom_cmpscal$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_lincom_cmpscal_OBJECTS) $(native_lincom_cmpscal_LDADD) $(LIBS)
+
+native_linterp$(EXEEXT): $(native_linterp_OBJECTS) $(native_linterp_DEPENDENCIES) $(EXTRA_native_linterp_DEPENDENCIES) 
+	@rm -f native_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_linterp_OBJECTS) $(native_linterp_LDADD) $(LIBS)
+
+native_linterp_cmp$(EXEEXT): $(native_linterp_cmp_OBJECTS) $(native_linterp_cmp_DEPENDENCIES) $(EXTRA_native_linterp_cmp_DEPENDENCIES) 
+	@rm -f native_linterp_cmp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_linterp_cmp_OBJECTS) $(native_linterp_cmp_LDADD) $(LIBS)
+
+native_mult$(EXEEXT): $(native_mult_OBJECTS) $(native_mult_DEPENDENCIES) $(EXTRA_native_mult_DEPENDENCIES) 
+	@rm -f native_mult$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_mult_OBJECTS) $(native_mult_LDADD) $(LIBS)
+
+native_mult1$(EXEEXT): $(native_mult1_OBJECTS) $(native_mult1_DEPENDENCIES) $(EXTRA_native_mult1_DEPENDENCIES) 
+	@rm -f native_mult1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_mult1_OBJECTS) $(native_mult1_LDADD) $(LIBS)
+
+native_mult2$(EXEEXT): $(native_mult2_OBJECTS) $(native_mult2_DEPENDENCIES) $(EXTRA_native_mult2_DEPENDENCIES) 
+	@rm -f native_mult2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_mult2_OBJECTS) $(native_mult2_LDADD) $(LIBS)
+
+native_phase$(EXEEXT): $(native_phase_OBJECTS) $(native_phase_DEPENDENCIES) $(EXTRA_native_phase_DEPENDENCIES) 
+	@rm -f native_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_phase_OBJECTS) $(native_phase_LDADD) $(LIBS)
+
+native_polynom$(EXEEXT): $(native_polynom_OBJECTS) $(native_polynom_DEPENDENCIES) $(EXTRA_native_polynom_DEPENDENCIES) 
+	@rm -f native_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_polynom_OBJECTS) $(native_polynom_LDADD) $(LIBS)
+
+native_polynom_cmpin$(EXEEXT): $(native_polynom_cmpin_OBJECTS) $(native_polynom_cmpin_DEPENDENCIES) $(EXTRA_native_polynom_cmpin_DEPENDENCIES) 
+	@rm -f native_polynom_cmpin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_polynom_cmpin_OBJECTS) $(native_polynom_cmpin_LDADD) $(LIBS)
+
+native_polynom_cmpscal$(EXEEXT): $(native_polynom_cmpscal_OBJECTS) $(native_polynom_cmpscal_DEPENDENCIES) $(EXTRA_native_polynom_cmpscal_DEPENDENCIES) 
+	@rm -f native_polynom_cmpscal$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_polynom_cmpscal_OBJECTS) $(native_polynom_cmpscal_LDADD) $(LIBS)
+
+native_raw$(EXEEXT): $(native_raw_OBJECTS) $(native_raw_DEPENDENCIES) $(EXTRA_native_raw_DEPENDENCIES) 
+	@rm -f native_raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_raw_OBJECTS) $(native_raw_LDADD) $(LIBS)
+
+native_recip$(EXEEXT): $(native_recip_OBJECTS) $(native_recip_DEPENDENCIES) $(EXTRA_native_recip_DEPENDENCIES) 
+	@rm -f native_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_recip_OBJECTS) $(native_recip_LDADD) $(LIBS)
+
+native_recip_cmpin$(EXEEXT): $(native_recip_cmpin_OBJECTS) $(native_recip_cmpin_DEPENDENCIES) $(EXTRA_native_recip_cmpin_DEPENDENCIES) 
+	@rm -f native_recip_cmpin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_recip_cmpin_OBJECTS) $(native_recip_cmpin_LDADD) $(LIBS)
+
+native_recip_cmpscal$(EXEEXT): $(native_recip_cmpscal_OBJECTS) $(native_recip_cmpscal_DEPENDENCIES) $(EXTRA_native_recip_cmpscal_DEPENDENCIES) 
+	@rm -f native_recip_cmpscal$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_recip_cmpscal_OBJECTS) $(native_recip_cmpscal_LDADD) $(LIBS)
+
+native_sbit$(EXEEXT): $(native_sbit_OBJECTS) $(native_sbit_DEPENDENCIES) $(EXTRA_native_sbit_DEPENDENCIES) 
+	@rm -f native_sbit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_sbit_OBJECTS) $(native_sbit_LDADD) $(LIBS)
+
+native_string$(EXEEXT): $(native_string_OBJECTS) $(native_string_DEPENDENCIES) $(EXTRA_native_string_DEPENDENCIES) 
+	@rm -f native_string$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(native_string_OBJECTS) $(native_string_LDADD) $(LIBS)
+
 nentries_alias$(EXEEXT): $(nentries_alias_OBJECTS) $(nentries_alias_DEPENDENCIES) $(EXTRA_nentries_alias_DEPENDENCIES) 
 	@rm -f nentries_alias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nentries_alias_OBJECTS) $(nentries_alias_LDADD) $(LIBS)
@@ -8139,10 +9984,6 @@ nentries_scalar$(EXEEXT): $(nentries_scalar_OBJECTS) $(nentries_scalar_DEPENDENC
 	@rm -f nentries_scalar$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nentries_scalar_OBJECTS) $(nentries_scalar_LDADD) $(LIBS)
 
-nfields$(EXEEXT): $(nfields_OBJECTS) $(nfields_DEPENDENCIES) $(EXTRA_nfields_DEPENDENCIES) 
-	@rm -f nfields$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(nfields_OBJECTS) $(nfields_LDADD) $(LIBS)
-
 nfields_hidden$(EXEEXT): $(nfields_hidden_OBJECTS) $(nfields_hidden_DEPENDENCIES) $(EXTRA_nfields_hidden_DEPENDENCIES) 
 	@rm -f nfields_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nfields_hidden_OBJECTS) $(nfields_hidden_LDADD) $(LIBS)
@@ -8151,6 +9992,10 @@ nfields_invalid$(EXEEXT): $(nfields_invalid_OBJECTS) $(nfields_invalid_DEPENDENC
 	@rm -f nfields_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nfields_invalid_OBJECTS) $(nfields_invalid_LDADD) $(LIBS)
 
+nfields_nfields$(EXEEXT): $(nfields_nfields_OBJECTS) $(nfields_nfields_DEPENDENCIES) $(EXTRA_nfields_nfields_DEPENDENCIES) 
+	@rm -f nfields_nfields$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_nfields_OBJECTS) $(nfields_nfields_LDADD) $(LIBS)
+
 nfields_type$(EXEEXT): $(nfields_type_OBJECTS) $(nfields_type_DEPENDENCIES) $(EXTRA_nfields_type_DEPENDENCIES) 
 	@rm -f nfields_type$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nfields_type_OBJECTS) $(nfields_type_LDADD) $(LIBS)
@@ -8175,10 +10020,6 @@ nfields_vector_invalid$(EXEEXT): $(nfields_vector_invalid_OBJECTS) $(nfields_vec
 	@rm -f nfields_vector_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nfields_vector_invalid_OBJECTS) $(nfields_vector_invalid_LDADD) $(LIBS)
 
-nframes$(EXEEXT): $(nframes_OBJECTS) $(nframes_DEPENDENCIES) $(EXTRA_nframes_DEPENDENCIES) 
-	@rm -f nframes$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(nframes_OBJECTS) $(nframes_LDADD) $(LIBS)
-
 nframes64$(EXEEXT): $(nframes64_OBJECTS) $(nframes64_DEPENDENCIES) $(EXTRA_nframes64_DEPENDENCIES) 
 	@rm -f nframes64$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nframes64_OBJECTS) $(nframes64_LDADD) $(LIBS)
@@ -8191,6 +10032,10 @@ nframes_invalid$(EXEEXT): $(nframes_invalid_OBJECTS) $(nframes_invalid_DEPENDENC
 	@rm -f nframes_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nframes_invalid_OBJECTS) $(nframes_invalid_LDADD) $(LIBS)
 
+nframes_nframes$(EXEEXT): $(nframes_nframes_OBJECTS) $(nframes_nframes_DEPENDENCIES) $(EXTRA_nframes_nframes_DEPENDENCIES) 
+	@rm -f nframes_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nframes_nframes_OBJECTS) $(nframes_nframes_LDADD) $(LIBS)
+
 nframes_off64$(EXEEXT): $(nframes_off64_OBJECTS) $(nframes_off64_DEPENDENCIES) $(EXTRA_nframes_off64_DEPENDENCIES) 
 	@rm -f nframes_off64$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nframes_off64_OBJECTS) $(nframes_off64_LDADD) $(LIBS)
@@ -8251,10 +10096,6 @@ nmeta_vectors_parent$(EXEEXT): $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_p
 	@rm -f nmeta_vectors_parent$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_parent_LDADD) $(LIBS)
 
-open$(EXEEXT): $(open_OBJECTS) $(open_DEPENDENCIES) $(EXTRA_open_DEPENDENCIES) 
-	@rm -f open$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(open_OBJECTS) $(open_LDADD) $(LIBS)
-
 open_abs$(EXEEXT): $(open_abs_OBJECTS) $(open_abs_DEPENDENCIES) $(EXTRA_open_abs_DEPENDENCIES) 
 	@rm -f open_abs$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_abs_OBJECTS) $(open_abs_LDADD) $(LIBS)
@@ -8279,10 +10120,18 @@ open_cb_rescan$(EXEEXT): $(open_cb_rescan_OBJECTS) $(open_cb_rescan_DEPENDENCIES
 	@rm -f open_cb_rescan$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_cb_rescan_OBJECTS) $(open_cb_rescan_LDADD) $(LIBS)
 
+open_cb_rescan_alloc$(EXEEXT): $(open_cb_rescan_alloc_OBJECTS) $(open_cb_rescan_alloc_DEPENDENCIES) $(EXTRA_open_cb_rescan_alloc_DEPENDENCIES) 
+	@rm -f open_cb_rescan_alloc$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_cb_rescan_alloc_OBJECTS) $(open_cb_rescan_alloc_LDADD) $(LIBS)
+
 open_eaccess$(EXEEXT): $(open_eaccess_OBJECTS) $(open_eaccess_DEPENDENCIES) $(EXTRA_open_eaccess_DEPENDENCIES) 
 	@rm -f open_eaccess$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_eaccess_OBJECTS) $(open_eaccess_LDADD) $(LIBS)
 
+open_invalid$(EXEEXT): $(open_invalid_OBJECTS) $(open_invalid_DEPENDENCIES) $(EXTRA_open_invalid_DEPENDENCIES) 
+	@rm -f open_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_invalid_OBJECTS) $(open_invalid_LDADD) $(LIBS)
+
 open_nonexistent$(EXEEXT): $(open_nonexistent_OBJECTS) $(open_nonexistent_DEPENDENCIES) $(EXTRA_open_nonexistent_DEPENDENCIES) 
 	@rm -f open_nonexistent$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_nonexistent_OBJECTS) $(open_nonexistent_LDADD) $(LIBS)
@@ -8291,14 +10140,14 @@ open_notdirfile$(EXEEXT): $(open_notdirfile_OBJECTS) $(open_notdirfile_DEPENDENC
 	@rm -f open_notdirfile$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_notdirfile_OBJECTS) $(open_notdirfile_LDADD) $(LIBS)
 
+open_open$(EXEEXT): $(open_open_OBJECTS) $(open_open_DEPENDENCIES) $(EXTRA_open_open_DEPENDENCIES) 
+	@rm -f open_open$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_open_OBJECTS) $(open_open_LDADD) $(LIBS)
+
 open_rofs$(EXEEXT): $(open_rofs_OBJECTS) $(open_rofs_DEPENDENCIES) $(EXTRA_open_rofs_DEPENDENCIES) 
 	@rm -f open_rofs$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_rofs_OBJECTS) $(open_rofs_LDADD) $(LIBS)
 
-open_sym_a$(EXEEXT): $(open_sym_a_OBJECTS) $(open_sym_a_DEPENDENCIES) $(EXTRA_open_sym_a_DEPENDENCIES) 
-	@rm -f open_sym_a$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(open_sym_a_OBJECTS) $(open_sym_a_LDADD) $(LIBS)
-
 open_sym_al$(EXEEXT): $(open_sym_al_OBJECTS) $(open_sym_al_DEPENDENCIES) $(EXTRA_open_sym_al_DEPENDENCIES) 
 	@rm -f open_sym_al$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_sym_al_OBJECTS) $(open_sym_al_LDADD) $(LIBS)
@@ -8319,6 +10168,14 @@ open_sym_ct$(EXEEXT): $(open_sym_ct_OBJECTS) $(open_sym_ct_DEPENDENCIES) $(EXTRA
 	@rm -f open_sym_ct$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_sym_ct_OBJECTS) $(open_sym_ct_LDADD) $(LIBS)
 
+open_sym_d$(EXEEXT): $(open_sym_d_OBJECTS) $(open_sym_d_DEPENDENCIES) $(EXTRA_open_sym_d_DEPENDENCIES) 
+	@rm -f open_sym_d$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_d_OBJECTS) $(open_sym_d_LDADD) $(LIBS)
+
+open_sym_l$(EXEEXT): $(open_sym_l_OBJECTS) $(open_sym_l_DEPENDENCIES) $(EXTRA_open_sym_l_DEPENDENCIES) 
+	@rm -f open_sym_l$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_l_OBJECTS) $(open_sym_l_LDADD) $(LIBS)
+
 open_sym_p$(EXEEXT): $(open_sym_p_OBJECTS) $(open_sym_p_DEPENDENCIES) $(EXTRA_open_sym_p_DEPENDENCIES) 
 	@rm -f open_sym_p$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(open_sym_p_OBJECTS) $(open_sym_p_LDADD) $(LIBS)
@@ -8483,6 +10340,10 @@ parse_include_absrel$(EXEEXT): $(parse_include_absrel_OBJECTS) $(parse_include_a
 	@rm -f parse_include_absrel$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_include_absrel_OBJECTS) $(parse_include_absrel_LDADD) $(LIBS)
 
+parse_include_affix_bad$(EXEEXT): $(parse_include_affix_bad_OBJECTS) $(parse_include_affix_bad_DEPENDENCIES) $(EXTRA_parse_include_affix_bad_DEPENDENCIES) 
+	@rm -f parse_include_affix_bad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_affix_bad_OBJECTS) $(parse_include_affix_bad_LDADD) $(LIBS)
+
 parse_include_affix_ref$(EXEEXT): $(parse_include_affix_ref_OBJECTS) $(parse_include_affix_ref_DEPENDENCIES) $(EXTRA_parse_include_affix_ref_DEPENDENCIES) 
 	@rm -f parse_include_affix_ref$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_include_affix_ref_OBJECTS) $(parse_include_affix_ref_LDADD) $(LIBS)
@@ -8579,6 +10440,34 @@ parse_linterp_ncols$(EXEEXT): $(parse_linterp_ncols_OBJECTS) $(parse_linterp_nco
 	@rm -f parse_linterp_ncols$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_linterp_ncols_OBJECTS) $(parse_linterp_ncols_LDADD) $(LIBS)
 
+parse_literal_cmpbad$(EXEEXT): $(parse_literal_cmpbad_OBJECTS) $(parse_literal_cmpbad_DEPENDENCIES) $(EXTRA_parse_literal_cmpbad_DEPENDENCIES) 
+	@rm -f parse_literal_cmpbad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_literal_cmpbad_OBJECTS) $(parse_literal_cmpbad_LDADD) $(LIBS)
+
+parse_literal_fltcmp$(EXEEXT): $(parse_literal_fltcmp_OBJECTS) $(parse_literal_fltcmp_DEPENDENCIES) $(EXTRA_parse_literal_fltcmp_DEPENDENCIES) 
+	@rm -f parse_literal_fltcmp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_literal_fltcmp_OBJECTS) $(parse_literal_fltcmp_LDADD) $(LIBS)
+
+parse_literal_fltcmp0$(EXEEXT): $(parse_literal_fltcmp0_OBJECTS) $(parse_literal_fltcmp0_DEPENDENCIES) $(EXTRA_parse_literal_fltcmp0_DEPENDENCIES) 
+	@rm -f parse_literal_fltcmp0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_literal_fltcmp0_OBJECTS) $(parse_literal_fltcmp0_LDADD) $(LIBS)
+
+parse_literal_intcmp$(EXEEXT): $(parse_literal_intcmp_OBJECTS) $(parse_literal_intcmp_DEPENDENCIES) $(EXTRA_parse_literal_intcmp_DEPENDENCIES) 
+	@rm -f parse_literal_intcmp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_literal_intcmp_OBJECTS) $(parse_literal_intcmp_LDADD) $(LIBS)
+
+parse_literal_intcmp0$(EXEEXT): $(parse_literal_intcmp0_OBJECTS) $(parse_literal_intcmp0_DEPENDENCIES) $(EXTRA_parse_literal_intcmp0_DEPENDENCIES) 
+	@rm -f parse_literal_intcmp0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_literal_intcmp0_OBJECTS) $(parse_literal_intcmp0_LDADD) $(LIBS)
+
+parse_literal_uintcmp$(EXEEXT): $(parse_literal_uintcmp_OBJECTS) $(parse_literal_uintcmp_DEPENDENCIES) $(EXTRA_parse_literal_uintcmp_DEPENDENCIES) 
+	@rm -f parse_literal_uintcmp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_literal_uintcmp_OBJECTS) $(parse_literal_uintcmp_LDADD) $(LIBS)
+
+parse_literal_uintcmp0$(EXEEXT): $(parse_literal_uintcmp0_OBJECTS) $(parse_literal_uintcmp0_DEPENDENCIES) $(EXTRA_parse_literal_uintcmp0_DEPENDENCIES) 
+	@rm -f parse_literal_uintcmp0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_literal_uintcmp0_OBJECTS) $(parse_literal_uintcmp0_LDADD) $(LIBS)
+
 parse_malias$(EXEEXT): $(parse_malias_OBJECTS) $(parse_malias_DEPENDENCIES) $(EXTRA_parse_malias_DEPENDENCIES) 
 	@rm -f parse_malias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_malias_OBJECTS) $(parse_malias_LDADD) $(LIBS)
@@ -8603,6 +10492,10 @@ parse_meta_alias$(EXEEXT): $(parse_meta_alias_OBJECTS) $(parse_meta_alias_DEPEND
 	@rm -f parse_meta_alias$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_meta_alias_OBJECTS) $(parse_meta_alias_LDADD) $(LIBS)
 
+parse_meta_frag$(EXEEXT): $(parse_meta_frag_OBJECTS) $(parse_meta_frag_DEPENDENCIES) $(EXTRA_parse_meta_frag_DEPENDENCIES) 
+	@rm -f parse_meta_frag$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_frag_OBJECTS) $(parse_meta_frag_LDADD) $(LIBS)
+
 parse_meta_implicit$(EXEEXT): $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_DEPENDENCIES) $(EXTRA_parse_meta_implicit_DEPENDENCIES) 
 	@rm -f parse_meta_implicit$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_LDADD) $(LIBS)
@@ -8687,6 +10580,10 @@ parse_ncols$(EXEEXT): $(parse_ncols_OBJECTS) $(parse_ncols_DEPENDENCIES) $(EXTRA
 	@rm -f parse_ncols$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_ncols_OBJECTS) $(parse_ncols_LDADD) $(LIBS)
 
+parse_octal_zero$(EXEEXT): $(parse_octal_zero_OBJECTS) $(parse_octal_zero_DEPENDENCIES) $(EXTRA_parse_octal_zero_DEPENDENCIES) 
+	@rm -f parse_octal_zero$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_octal_zero_OBJECTS) $(parse_octal_zero_LDADD) $(LIBS)
+
 parse_phase$(EXEEXT): $(parse_phase_OBJECTS) $(parse_phase_DEPENDENCIES) $(EXTRA_parse_phase_DEPENDENCIES) 
 	@rm -f parse_phase$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_phase_OBJECTS) $(parse_phase_LDADD) $(LIBS)
@@ -8751,6 +10648,10 @@ parse_raw_char$(EXEEXT): $(parse_raw_char_OBJECTS) $(parse_raw_char_DEPENDENCIES
 	@rm -f parse_raw_char$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_raw_char_OBJECTS) $(parse_raw_char_LDADD) $(LIBS)
 
+parse_raw_char_bad$(EXEEXT): $(parse_raw_char_bad_OBJECTS) $(parse_raw_char_bad_DEPENDENCIES) $(EXTRA_parse_raw_char_bad_DEPENDENCIES) 
+	@rm -f parse_raw_char_bad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_raw_char_bad_OBJECTS) $(parse_raw_char_bad_LDADD) $(LIBS)
+
 parse_raw_ncols$(EXEEXT): $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_DEPENDENCIES) $(EXTRA_parse_raw_ncols_DEPENDENCIES) 
 	@rm -f parse_raw_ncols$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_LDADD) $(LIBS)
@@ -8783,6 +10684,18 @@ parse_sbit$(EXEEXT): $(parse_sbit_OBJECTS) $(parse_sbit_DEPENDENCIES) $(EXTRA_pa
 	@rm -f parse_sbit$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_sbit_OBJECTS) $(parse_sbit_LDADD) $(LIBS)
 
+parse_scalar1$(EXEEXT): $(parse_scalar1_OBJECTS) $(parse_scalar1_DEPENDENCIES) $(EXTRA_parse_scalar1_DEPENDENCIES) 
+	@rm -f parse_scalar1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_scalar1_OBJECTS) $(parse_scalar1_LDADD) $(LIBS)
+
+parse_scalar2$(EXEEXT): $(parse_scalar2_OBJECTS) $(parse_scalar2_DEPENDENCIES) $(EXTRA_parse_scalar2_DEPENDENCIES) 
+	@rm -f parse_scalar2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_scalar2_OBJECTS) $(parse_scalar2_LDADD) $(LIBS)
+
+parse_scalar_repr$(EXEEXT): $(parse_scalar_repr_OBJECTS) $(parse_scalar_repr_DEPENDENCIES) $(EXTRA_parse_scalar_repr_DEPENDENCIES) 
+	@rm -f parse_scalar_repr$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_scalar_repr_OBJECTS) $(parse_scalar_repr_LDADD) $(LIBS)
+
 parse_sort$(EXEEXT): $(parse_sort_OBJECTS) $(parse_sort_DEPENDENCIES) $(EXTRA_parse_sort_DEPENDENCIES) 
 	@rm -f parse_sort$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(parse_sort_OBJECTS) $(parse_sort_LDADD) $(LIBS)
@@ -8867,6 +10780,10 @@ protect_alter$(EXEEXT): $(protect_alter_OBJECTS) $(protect_alter_DEPENDENCIES) $
 	@rm -f protect_alter$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(protect_alter_OBJECTS) $(protect_alter_LDADD) $(LIBS)
 
+protect_alter_all$(EXEEXT): $(protect_alter_all_OBJECTS) $(protect_alter_all_DEPENDENCIES) $(EXTRA_protect_alter_all_DEPENDENCIES) 
+	@rm -f protect_alter_all$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(protect_alter_all_OBJECTS) $(protect_alter_all_LDADD) $(LIBS)
+
 protect_get$(EXEEXT): $(protect_get_OBJECTS) $(protect_get_DEPENDENCIES) $(EXTRA_protect_get_DEPENDENCIES) 
 	@rm -f protect_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(protect_get_OBJECTS) $(protect_get_LDADD) $(LIBS)
@@ -8891,6 +10808,10 @@ put_carray$(EXEEXT): $(put_carray_OBJECTS) $(put_carray_DEPENDENCIES) $(EXTRA_pu
 	@rm -f put_carray$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_carray_OBJECTS) $(put_carray_LDADD) $(LIBS)
 
+put_carray_client$(EXEEXT): $(put_carray_client_OBJECTS) $(put_carray_client_DEPENDENCIES) $(EXTRA_put_carray_client_DEPENDENCIES) 
+	@rm -f put_carray_client$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_carray_client_OBJECTS) $(put_carray_client_LDADD) $(LIBS)
+
 put_carray_slice$(EXEEXT): $(put_carray_slice_OBJECTS) $(put_carray_slice_DEPENDENCIES) $(EXTRA_put_carray_slice_DEPENDENCIES) 
 	@rm -f put_carray_slice$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_carray_slice_OBJECTS) $(put_carray_slice_LDADD) $(LIBS)
@@ -8899,6 +10820,10 @@ put_char$(EXEEXT): $(put_char_OBJECTS) $(put_char_DEPENDENCIES) $(EXTRA_put_char
 	@rm -f put_char$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_char_OBJECTS) $(put_char_LDADD) $(LIBS)
 
+put_clincom1$(EXEEXT): $(put_clincom1_OBJECTS) $(put_clincom1_DEPENDENCIES) $(EXTRA_put_clincom1_DEPENDENCIES) 
+	@rm -f put_clincom1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_clincom1_OBJECTS) $(put_clincom1_LDADD) $(LIBS)
+
 put_complex128$(EXEEXT): $(put_complex128_OBJECTS) $(put_complex128_DEPENDENCIES) $(EXTRA_put_complex128_DEPENDENCIES) 
 	@rm -f put_complex128$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_complex128_OBJECTS) $(put_complex128_LDADD) $(LIBS)
@@ -8915,6 +10840,14 @@ put_const_protect$(EXEEXT): $(put_const_protect_OBJECTS) $(put_const_protect_DEP
 	@rm -f put_const_protect$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_const_protect_OBJECTS) $(put_const_protect_LDADD) $(LIBS)
 
+put_cpolynom$(EXEEXT): $(put_cpolynom_OBJECTS) $(put_cpolynom_DEPENDENCIES) $(EXTRA_put_cpolynom_DEPENDENCIES) 
+	@rm -f put_cpolynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_cpolynom_OBJECTS) $(put_cpolynom_LDADD) $(LIBS)
+
+put_crecip$(EXEEXT): $(put_crecip_OBJECTS) $(put_crecip_DEPENDENCIES) $(EXTRA_put_crecip_DEPENDENCIES) 
+	@rm -f put_crecip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_crecip_OBJECTS) $(put_crecip_LDADD) $(LIBS)
+
 put_divide$(EXEEXT): $(put_divide_OBJECTS) $(put_divide_DEPENDENCIES) $(EXTRA_put_divide_DEPENDENCIES) 
 	@rm -f put_divide$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_divide_OBJECTS) $(put_divide_LDADD) $(LIBS)
@@ -9067,10 +11000,18 @@ put_mplex$(EXEEXT): $(put_mplex_OBJECTS) $(put_mplex_DEPENDENCIES) $(EXTRA_put_m
 	@rm -f put_mplex$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_mplex_OBJECTS) $(put_mplex_LDADD) $(LIBS)
 
+put_mplex_complex$(EXEEXT): $(put_mplex_complex_OBJECTS) $(put_mplex_complex_DEPENDENCIES) $(EXTRA_put_mplex_complex_DEPENDENCIES) 
+	@rm -f put_mplex_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_mplex_complex_OBJECTS) $(put_mplex_complex_LDADD) $(LIBS)
+
 put_multiply$(EXEEXT): $(put_multiply_OBJECTS) $(put_multiply_DEPENDENCIES) $(EXTRA_put_multiply_DEPENDENCIES) 
 	@rm -f put_multiply$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_multiply_OBJECTS) $(put_multiply_LDADD) $(LIBS)
 
+put_nofile$(EXEEXT): $(put_nofile_OBJECTS) $(put_nofile_DEPENDENCIES) $(EXTRA_put_nofile_DEPENDENCIES) 
+	@rm -f put_nofile$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_nofile_OBJECTS) $(put_nofile_LDADD) $(LIBS)
+
 put_null$(EXEEXT): $(put_null_OBJECTS) $(put_null_DEPENDENCIES) $(EXTRA_put_null_DEPENDENCIES) 
 	@rm -f put_null$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_null_OBJECTS) $(put_null_LDADD) $(LIBS)
@@ -9143,6 +11084,10 @@ put_string_protect$(EXEEXT): $(put_string_protect_OBJECTS) $(put_string_protect_
 	@rm -f put_string_protect$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_string_protect_OBJECTS) $(put_string_protect_LDADD) $(LIBS)
 
+put_sub$(EXEEXT): $(put_sub_OBJECTS) $(put_sub_DEPENDENCIES) $(EXTRA_put_sub_DEPENDENCIES) 
+	@rm -f put_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_sub_OBJECTS) $(put_sub_LDADD) $(LIBS)
+
 put_type$(EXEEXT): $(put_type_OBJECTS) $(put_type_DEPENDENCIES) $(EXTRA_put_type_DEPENDENCIES) 
 	@rm -f put_type$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(put_type_OBJECTS) $(put_type_LDADD) $(LIBS)
@@ -9183,6 +11128,10 @@ repr_a$(EXEEXT): $(repr_a_OBJECTS) $(repr_a_DEPENDENCIES) $(EXTRA_repr_a_DEPENDE
 	@rm -f repr_a$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(repr_a_OBJECTS) $(repr_a_LDADD) $(LIBS)
 
+repr_bad$(EXEEXT): $(repr_bad_OBJECTS) $(repr_bad_DEPENDENCIES) $(EXTRA_repr_bad_DEPENDENCIES) 
+	@rm -f repr_bad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_bad_OBJECTS) $(repr_bad_LDADD) $(LIBS)
+
 repr_float32$(EXEEXT): $(repr_float32_OBJECTS) $(repr_float32_DEPENDENCIES) $(EXTRA_repr_float32_DEPENDENCIES) 
 	@rm -f repr_float32$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(repr_float32_OBJECTS) $(repr_float32_LDADD) $(LIBS)
@@ -9263,6 +11212,10 @@ seek_end$(EXEEXT): $(seek_end_OBJECTS) $(seek_end_DEPENDENCIES) $(EXTRA_seek_end
 	@rm -f seek_end$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(seek_end_OBJECTS) $(seek_end_LDADD) $(LIBS)
 
+seek_far$(EXEEXT): $(seek_far_OBJECTS) $(seek_far_DEPENDENCIES) $(EXTRA_seek_far_DEPENDENCIES) 
+	@rm -f seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_far_OBJECTS) $(seek_far_LDADD) $(LIBS)
+
 seek_foffs$(EXEEXT): $(seek_foffs_OBJECTS) $(seek_foffs_DEPENDENCIES) $(EXTRA_seek_foffs_DEPENDENCIES) 
 	@rm -f seek_foffs$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(seek_foffs_OBJECTS) $(seek_foffs_LDADD) $(LIBS)
@@ -9271,14 +11224,34 @@ seek_foffs2$(EXEEXT): $(seek_foffs2_OBJECTS) $(seek_foffs2_DEPENDENCIES) $(EXTRA
 	@rm -f seek_foffs2$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(seek_foffs2_OBJECTS) $(seek_foffs2_LDADD) $(LIBS)
 
+seek_index$(EXEEXT): $(seek_index_OBJECTS) $(seek_index_DEPENDENCIES) $(EXTRA_seek_index_DEPENDENCIES) 
+	@rm -f seek_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_index_OBJECTS) $(seek_index_LDADD) $(LIBS)
+
+seek_lincom$(EXEEXT): $(seek_lincom_OBJECTS) $(seek_lincom_DEPENDENCIES) $(EXTRA_seek_lincom_DEPENDENCIES) 
+	@rm -f seek_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_lincom_OBJECTS) $(seek_lincom_LDADD) $(LIBS)
+
+seek_mult$(EXEEXT): $(seek_mult_OBJECTS) $(seek_mult_DEPENDENCIES) $(EXTRA_seek_mult_DEPENDENCIES) 
+	@rm -f seek_mult$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_mult_OBJECTS) $(seek_mult_LDADD) $(LIBS)
+
 seek_neg$(EXEEXT): $(seek_neg_OBJECTS) $(seek_neg_DEPENDENCIES) $(EXTRA_seek_neg_DEPENDENCIES) 
 	@rm -f seek_neg$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(seek_neg_OBJECTS) $(seek_neg_LDADD) $(LIBS)
 
+seek_phase$(EXEEXT): $(seek_phase_OBJECTS) $(seek_phase_DEPENDENCIES) $(EXTRA_seek_phase_DEPENDENCIES) 
+	@rm -f seek_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_phase_OBJECTS) $(seek_phase_LDADD) $(LIBS)
+
 seek_set$(EXEEXT): $(seek_set_OBJECTS) $(seek_set_DEPENDENCIES) $(EXTRA_seek_set_DEPENDENCIES) 
 	@rm -f seek_set$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(seek_set_OBJECTS) $(seek_set_LDADD) $(LIBS)
 
+seek_sub$(EXEEXT): $(seek_sub_OBJECTS) $(seek_sub_DEPENDENCIES) $(EXTRA_seek_sub_DEPENDENCIES) 
+	@rm -f seek_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_sub_OBJECTS) $(seek_sub_LDADD) $(LIBS)
+
 sie_get_big$(EXEEXT): $(sie_get_big_OBJECTS) $(sie_get_big_DEPENDENCIES) $(EXTRA_sie_get_big_DEPENDENCIES) 
 	@rm -f sie_get_big$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(sie_get_big_OBJECTS) $(sie_get_big_LDADD) $(LIBS)
@@ -9355,6 +11328,14 @@ sie_put_trunc_nf$(EXEEXT): $(sie_put_trunc_nf_OBJECTS) $(sie_put_trunc_nf_DEPEND
 	@rm -f sie_put_trunc_nf$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(sie_put_trunc_nf_OBJECTS) $(sie_put_trunc_nf_LDADD) $(LIBS)
 
+sie_seek$(EXEEXT): $(sie_seek_OBJECTS) $(sie_seek_DEPENDENCIES) $(EXTRA_sie_seek_DEPENDENCIES) 
+	@rm -f sie_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_seek_OBJECTS) $(sie_seek_LDADD) $(LIBS)
+
+sie_seek_far$(EXEEXT): $(sie_seek_far_OBJECTS) $(sie_seek_far_DEPENDENCIES) $(EXTRA_sie_seek_far_DEPENDENCIES) 
+	@rm -f sie_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_seek_far_OBJECTS) $(sie_seek_far_LDADD) $(LIBS)
+
 sie_sync$(EXEEXT): $(sie_sync_OBJECTS) $(sie_sync_DEPENDENCIES) $(EXTRA_sie_sync_DEPENDENCIES) 
 	@rm -f sie_sync$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(sie_sync_OBJECTS) $(sie_sync_LDADD) $(LIBS)
@@ -9367,9 +11348,13 @@ slim_nframes$(EXEEXT): $(slim_nframes_OBJECTS) $(slim_nframes_DEPENDENCIES) $(EX
 	@rm -f slim_nframes$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(slim_nframes_OBJECTS) $(slim_nframes_LDADD) $(LIBS)
 
-spf$(EXEEXT): $(spf_OBJECTS) $(spf_DEPENDENCIES) $(EXTRA_spf_DEPENDENCIES) 
-	@rm -f spf$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(spf_OBJECTS) $(spf_LDADD) $(LIBS)
+slim_seek$(EXEEXT): $(slim_seek_OBJECTS) $(slim_seek_DEPENDENCIES) $(EXTRA_slim_seek_DEPENDENCIES) 
+	@rm -f slim_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(slim_seek_OBJECTS) $(slim_seek_LDADD) $(LIBS)
+
+slim_seek_far$(EXEEXT): $(slim_seek_far_OBJECTS) $(slim_seek_far_DEPENDENCIES) $(EXTRA_slim_seek_far_DEPENDENCIES) 
+	@rm -f slim_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(slim_seek_far_OBJECTS) $(slim_seek_far_LDADD) $(LIBS)
 
 spf_alias$(EXEEXT): $(spf_alias_OBJECTS) $(spf_alias_DEPENDENCIES) $(EXTRA_spf_alias_DEPENDENCIES) 
 	@rm -f spf_alias$(EXEEXT)
@@ -9399,6 +11384,10 @@ spf_polynom$(EXEEXT): $(spf_polynom_OBJECTS) $(spf_polynom_DEPENDENCIES) $(EXTRA
 	@rm -f spf_polynom$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(spf_polynom_OBJECTS) $(spf_polynom_LDADD) $(LIBS)
 
+spf_raw$(EXEEXT): $(spf_raw_OBJECTS) $(spf_raw_DEPENDENCIES) $(EXTRA_spf_raw_DEPENDENCIES) 
+	@rm -f spf_raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_raw_OBJECTS) $(spf_raw_LDADD) $(LIBS)
+
 spf_recip$(EXEEXT): $(spf_recip_OBJECTS) $(spf_recip_DEPENDENCIES) $(EXTRA_spf_recip_DEPENDENCIES) 
 	@rm -f spf_recip$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(spf_recip_OBJECTS) $(spf_recip_LDADD) $(LIBS)
@@ -9411,6 +11400,14 @@ svlist$(EXEEXT): $(svlist_OBJECTS) $(svlist_DEPENDENCIES) $(EXTRA_svlist_DEPENDE
 	@rm -f svlist$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(svlist_OBJECTS) $(svlist_LDADD) $(LIBS)
 
+svlist0$(EXEEXT): $(svlist0_OBJECTS) $(svlist0_DEPENDENCIES) $(EXTRA_svlist0_DEPENDENCIES) 
+	@rm -f svlist0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist0_OBJECTS) $(svlist0_LDADD) $(LIBS)
+
+svlist2$(EXEEXT): $(svlist2_OBJECTS) $(svlist2_DEPENDENCIES) $(EXTRA_svlist2_DEPENDENCIES) 
+	@rm -f svlist2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist2_OBJECTS) $(svlist2_LDADD) $(LIBS)
+
 svlist_hidden$(EXEEXT): $(svlist_hidden_OBJECTS) $(svlist_hidden_DEPENDENCIES) $(EXTRA_svlist_hidden_DEPENDENCIES) 
 	@rm -f svlist_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(svlist_hidden_OBJECTS) $(svlist_hidden_LDADD) $(LIBS)
@@ -9423,6 +11420,10 @@ svlist_meta$(EXEEXT): $(svlist_meta_OBJECTS) $(svlist_meta_DEPENDENCIES) $(EXTRA
 	@rm -f svlist_meta$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(svlist_meta_OBJECTS) $(svlist_meta_LDADD) $(LIBS)
 
+svlist_meta0$(EXEEXT): $(svlist_meta0_OBJECTS) $(svlist_meta0_DEPENDENCIES) $(EXTRA_svlist_meta0_DEPENDENCIES) 
+	@rm -f svlist_meta0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist_meta0_OBJECTS) $(svlist_meta0_LDADD) $(LIBS)
+
 svlist_meta_hidden$(EXEEXT): $(svlist_meta_hidden_OBJECTS) $(svlist_meta_hidden_DEPENDENCIES) $(EXTRA_svlist_meta_hidden_DEPENDENCIES) 
 	@rm -f svlist_meta_hidden$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(svlist_meta_hidden_OBJECTS) $(svlist_meta_hidden_LDADD) $(LIBS)
@@ -9455,6 +11456,10 @@ tell_multidiv$(EXEEXT): $(tell_multidiv_OBJECTS) $(tell_multidiv_DEPENDENCIES) $
 	@rm -f tell_multidiv$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(tell_multidiv_OBJECTS) $(tell_multidiv_LDADD) $(LIBS)
 
+tell_sub$(EXEEXT): $(tell_sub_OBJECTS) $(tell_sub_DEPENDENCIES) $(EXTRA_tell_sub_DEPENDENCIES) 
+	@rm -f tell_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tell_sub_OBJECTS) $(tell_sub_LDADD) $(LIBS)
+
 tok_arg$(EXEEXT): $(tok_arg_OBJECTS) $(tok_arg_DEPENDENCIES) $(EXTRA_tok_arg_DEPENDENCIES) 
 	@rm -f tok_arg$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(tok_arg_OBJECTS) $(tok_arg_LDADD) $(LIBS)
@@ -9499,6 +11504,10 @@ unclude_move$(EXEEXT): $(unclude_move_OBJECTS) $(unclude_move_DEPENDENCIES) $(EX
 	@rm -f unclude_move$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(unclude_move_OBJECTS) $(unclude_move_LDADD) $(LIBS)
 
+unclude_open$(EXEEXT): $(unclude_open_OBJECTS) $(unclude_open_DEPENDENCIES) $(EXTRA_unclude_open_DEPENDENCIES) 
+	@rm -f unclude_open$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(unclude_open_OBJECTS) $(unclude_open_LDADD) $(LIBS)
+
 version_0$(EXEEXT): $(version_0_OBJECTS) $(version_0_DEPENDENCIES) $(EXTRA_version_0_DEPENDENCIES) 
 	@rm -f version_0$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(version_0_OBJECTS) $(version_0_LDADD) $(LIBS)
@@ -9627,14 +11636,6 @@ vlist_meta_invalid$(EXEEXT): $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_
 	@rm -f vlist_meta_invalid$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_LDADD) $(LIBS)
 
-xz_get$(EXEEXT): $(xz_get_OBJECTS) $(xz_get_DEPENDENCIES) $(EXTRA_xz_get_DEPENDENCIES) 
-	@rm -f xz_get$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(xz_get_OBJECTS) $(xz_get_LDADD) $(LIBS)
-
-xz_nframes$(EXEEXT): $(xz_nframes_OBJECTS) $(xz_nframes_DEPENDENCIES) $(EXTRA_xz_nframes_DEPENDENCIES) 
-	@rm -f xz_nframes$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(xz_nframes_OBJECTS) $(xz_nframes_LDADD) $(LIBS)
-
 zzip_data$(EXEEXT): $(zzip_data_OBJECTS) $(zzip_data_DEPENDENCIES) $(EXTRA_zzip_data_DEPENDENCIES) 
 	@rm -f zzip_data$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(zzip_data_OBJECTS) $(zzip_data_LDADD) $(LIBS)
@@ -9651,6 +11652,14 @@ zzip_nframes$(EXEEXT): $(zzip_nframes_OBJECTS) $(zzip_nframes_DEPENDENCIES) $(EX
 	@rm -f zzip_nframes$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(zzip_nframes_OBJECTS) $(zzip_nframes_LDADD) $(LIBS)
 
+zzip_seek$(EXEEXT): $(zzip_seek_OBJECTS) $(zzip_seek_DEPENDENCIES) $(EXTRA_zzip_seek_DEPENDENCIES) 
+	@rm -f zzip_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzip_seek_OBJECTS) $(zzip_seek_LDADD) $(LIBS)
+
+zzip_seek_far$(EXEEXT): $(zzip_seek_far_OBJECTS) $(zzip_seek_far_DEPENDENCIES) $(EXTRA_zzip_seek_far_DEPENDENCIES) 
+	@rm -f zzip_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzip_seek_far_OBJECTS) $(zzip_seek_far_LDADD) $(LIBS)
+
 zzslim_get$(EXEEXT): $(zzslim_get_OBJECTS) $(zzslim_get_DEPENDENCIES) $(EXTRA_zzslim_get_DEPENDENCIES) 
 	@rm -f zzslim_get$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(zzslim_get_OBJECTS) $(zzslim_get_LDADD) $(LIBS)
@@ -9659,17 +11668,26 @@ zzslim_nframes$(EXEEXT): $(zzslim_nframes_OBJECTS) $(zzslim_nframes_DEPENDENCIES
 	@rm -f zzslim_nframes$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(zzslim_nframes_OBJECTS) $(zzslim_nframes_LDADD) $(LIBS)
 
+zzslim_seek$(EXEEXT): $(zzslim_seek_OBJECTS) $(zzslim_seek_DEPENDENCIES) $(EXTRA_zzslim_seek_DEPENDENCIES) 
+	@rm -f zzslim_seek$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzslim_seek_OBJECTS) $(zzslim_seek_LDADD) $(LIBS)
+
+zzslim_seek_far$(EXEEXT): $(zzslim_seek_far_OBJECTS) $(zzslim_seek_far_DEPENDENCIES) $(EXTRA_zzslim_seek_far_DEPENDENCIES) 
+	@rm -f zzslim_seek_far$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzslim_seek_far_OBJECTS) $(zzslim_seek_far_LDADD) $(LIBS)
+
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
 
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_add.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_alias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_alias_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_alias_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_amb_code7.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_bitnum.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_bitsize.Po at am__quote@
@@ -9686,6 +11704,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_dangle_dup.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_divide.Po at am__quote@
 @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_dot5.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_dot6.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_duplicate.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_format.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_invalid.Po at am__quote@
@@ -9711,6 +11731,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_spf.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_spf_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_sub.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_type.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_rdonly.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_recip.Po at am__quote@
@@ -9743,21 +11764,32 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_bit_numbits.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_carray_len.Po at am__quote@
 @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_clincom.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_const.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_const_c2r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_const_r2c.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_const_r2r.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_cpolynom_null.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip89_null.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip_zero.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_divide.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_lincom.Po at am__quote@
 @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_recode_recalc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar1.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar2a.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar2n.Po at am__quote@
 @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_scalar3c.Po at am__quote@
 @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_entry_scalar_amb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_index.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_23.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_32.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_affix.Po at am__quote@
@@ -9782,21 +11814,46 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec_polynom.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_window.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_add.Po at am__quote@
 @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_complex.Po at am__quote@
 @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_get_here.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_get_sub.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_nframes.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_put_here.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_seek_far.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_sync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_index.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_lincom.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_phase_neg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_add.Po at am__quote@
 @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_far.Po at am__quote@
 @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_get_get2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_get_put.Po at am__quote@
 @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_move_to.Po at am__quote@
 @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)/bzip_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_put_back.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_put_endian.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_put_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_put_pad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_put_sub.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_seek_far.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_sync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_close.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_discard.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_null.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_complex64.Po at am__quote@
@@ -9920,30 +11977,41 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat_excl.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat_rdonly_exists.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_free.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_hidden.Po at am__quote@
 @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_array_meta0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_meta_free.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_meta_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta0.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta_hidden.Po at am__quote@
 @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_alias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_carray.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_carray_deref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const_deref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const_force.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_data.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_data_enoent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_data_open.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_del.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived_after.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived_force.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_meta.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_meta_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_ref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync_flush.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync_path.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync_reopen.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync_reopen_inv.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_bit.Po at am__quote@
@@ -9961,9 +12029,14 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/elist_noalias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/elist_scalar.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_alter_all.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_alter_open.Po at am__quote@
 @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)/encode_recode.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_recode_open.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_support.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_alter_all.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_alter_sie.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_move.Po at am__quote@
@@ -9993,9 +12066,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_window.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_window_scalar.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_bit.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_index.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_lincom.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_phase_neg.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_error.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_num.Po at am__quote@
@@ -10005,10 +12080,28 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file_code.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_add.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_far.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_get2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_put_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_put_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_put_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_put_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_put_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_seek_far.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_sync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type.Po at am__quote@
@@ -10017,20 +12110,30 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_meta.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_meta_hidden.Po at am__quote@
 @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@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_all.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_amb_code.Po at am__quote@
 @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_flush.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_hex.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_lincom1.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_mult.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_raw_close.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_ref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_sync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_alter_all.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_move.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix_alter.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix_alter2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix_alter_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix_alter_nop.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix_dup.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_index.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_index_alias.Po at am__quote@
@@ -10051,11 +12154,13 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_complex128.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_complex64.Po at am__quote@
 @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_carray.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const_complex.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const_repr.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_cpolynom.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_cpolynom1.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_cpolynom_int.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_dim.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide_ccin.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide_crin.Po at am__quote@
@@ -10087,6 +12192,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_here.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_here_foffs.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_heres.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_index_complex.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int16.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int32.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int64.Po at am__quote@
@@ -10094,20 +12200,30 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom1.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom2s.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom3s.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_mdt.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_noin.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_non.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_null.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_spf.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_abs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_empty.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_noin.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_notab.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_sort.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_bof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_complex.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_lb.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_lball.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_nolb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_s.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_saved.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_ccin.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_crin.Po at am__quote@
@@ -10115,6 +12231,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_noin.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_rcin.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_s.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_neg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_none.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_nonexistent.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_null.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_off64.Po at am__quote@
@@ -10130,26 +12248,33 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_sbit.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_sf.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_ss.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_string.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_type.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint16.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint32.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_clr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_complex.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_ge.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_gt.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_le.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_lt.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_ne.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_s.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_set.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_zero_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_zero_float.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_flags.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_name.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref_empty.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref_set.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_add.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_del.Po at am__quote@
 @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_far.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get_get2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get_put.Po at am__quote@
@@ -10157,18 +12282,29 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_move_to.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_nframes.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_back.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_endian.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_off.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_pad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_sub.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_seek_far.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_seek_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_sync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/header_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/header_off64t.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hide.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hide_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hide_unhide.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_accmode.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_auto.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_cb.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_creat.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_ignore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_include.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_index.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_nonexistent.Po at am__quote@
@@ -10176,9 +12312,14 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_ref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_sub.Po at am__quote@
 @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@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_domain.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_index.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_range.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_s.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_subset.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_error.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_estring.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_format.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get_put.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get_rofs.Po at am__quote@
@@ -10188,6 +12329,23 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_spf.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_add.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_get_far.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_get_get2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_get_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_move_to.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_put_back.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_put_endian.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_put_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_put_pad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_seek_far.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_xz_sync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_alias.Po at am__quote@
@@ -10220,47 +12378,78 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec_resolv.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_string.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_window.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_affix_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_affix_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_affix_updb.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_alias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_enc_ar.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_enc_ra.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_endian.Po at am__quote@
 @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_foffs_neg.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_nop.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_index.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_move.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_protect.Po at am__quote@
 @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@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_affix_bad.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_dangle.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_dot5.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_dot5r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_dot9.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_meta.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_move.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_move_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_name.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_updb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_updb_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_updb_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_updb_carray.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_updb_const.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_updb_const_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_lincom_cmpin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_lincom_cmpscal.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_linterp_cmp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_mult.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_mult1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_mult2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_polynom_cmpin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_polynom_cmpscal.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_recip_cmpin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_recip_cmpscal.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native_string.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nentries_alias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nentries_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nentries_noalias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nentries_scalar.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_nfields.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_vector.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_vector_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_vector_invalid.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_empty.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_nframes.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_off64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_spf.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta.Po at am__quote@
@@ -10276,23 +12465,26 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_parent.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_abs.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_abort.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_cont.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_ignore.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_invalid.Po at am__quote@
 @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_cb_rescan_alloc.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_eaccess.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_nonexistent.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_notdirfile.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_open.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_rofs.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_a.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_al.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_at.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_c.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_cl.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_ct.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_d.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_l.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_p.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_pl.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_pt.Po at am__quote@
@@ -10334,6 +12526,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_absolute.Po at am__quote@
 @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_affix_bad.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_affix_ref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_dir.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_loop.Po at am__quote@
@@ -10358,12 +12551,20 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_scalar.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_linterp.Po at am__quote@
 @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_literal_cmpbad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_literal_fltcmp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_literal_fltcmp0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_literal_intcmp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_literal_intcmp0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_literal_uintcmp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_literal_uintcmp0.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_malias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_malias_dup.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_malias_meta.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_affix.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_frag.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_implicit.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_implicit2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_implicit_affix.Po at am__quote@
@@ -10385,6 +12586,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_ext.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_pedantic.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_octal_zero.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase_ncols.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase_scalar.Po at am__quote@
@@ -10401,6 +12603,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_quote_mismatch.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw.Po at am__quote@
 @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_char_bad.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_ncols.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_scalar.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_spf.Po at am__quote@
@@ -10409,6 +12612,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ref.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ref_nonexistent.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_scalar1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_scalar2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_scalar_repr.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_sort.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string_ncols.Po at am__quote@
@@ -10430,18 +12636,23 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_window_op.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_window_scalar.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect_alter_all.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bad_code.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bit.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bof.Po at am__quote@
 @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_client.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_carray_slice.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_char.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_clincom1.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_complex128.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_complex64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_const.Po at am__quote@
 @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_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_crecip.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_divide.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian16.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian32.Po at am__quote@
@@ -10480,7 +12691,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_notab.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_reverse.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_mplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_mplex_complex.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_nofile.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_null.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_off64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_phase.Po at am__quote@
@@ -10499,6 +12712,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_ss.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_string.Po at am__quote@
 @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_sub.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_type.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint16.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint32.Po at am__quote@
@@ -10509,6 +12723,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref_none.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref_two.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_bad.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_float32.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_float64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_i.Po at am__quote@
@@ -10529,10 +12744,16 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_cur.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_end.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_far.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_foffs.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_foffs2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_mult.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_neg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_phase.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_set.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_sub.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_get_big.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_get_little.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_move_from.Po at am__quote@
@@ -10552,10 +12773,13 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_trunc.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_trunc2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_trunc_nf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_seek_far.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_sync.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim_get.Po at am__quote@
 @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)/slim_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim_seek_far.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_alias.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_alias_meta.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_alias_missing.Po at am__quote@
@@ -10563,12 +12787,16 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_lincom.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_multiply.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_raw.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_recip.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_recurse.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist2.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta0.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta_hidden.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta_invalid.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table.Po at am__quote@
@@ -10577,6 +12805,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tell.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tell64.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tell_multidiv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tell_sub.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tok_arg.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tok_escape.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tok_quote.Po at am__quote@
@@ -10588,6 +12817,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude_del.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude_open.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_0.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_0_write.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_1.Po at am__quote@
@@ -10620,14 +12850,16 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_meta.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_meta_hidden.Po at am__quote@
 @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@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_data.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_get_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_seek_far.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzslim_get.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzslim_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzslim_seek.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzslim_seek_far.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/test/add.c b/test/add.c
deleted file mode 100644
index c90b82b..0000000
--- a/test/add.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 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
- */
-/* 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  int error, r = 0;
-  DIRFILE *D;
-  gd_entry_t E, e;
-
-  rmdirfile();
-  memset(&E, 0, sizeof(E));
-  E.field = "data";
-  E.field_type = GD_RAW_ENTRY;
-  E.EN(raw,spf) = 2;
-  E.EN(raw,data_type) = GD_UINT8;
-  E.scalar[0] = NULL;
-
-  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
-  gd_add(D, &E);
-  error = gd_error(D);
-
-  /* check */
-  gd_entry(D, "data", &e);
-  if (gd_error(D))
-    r = 1;
-  else {
-    CHECKI(e.field_type, GD_RAW_ENTRY);
-    CHECKI(e.fragment_index, 0);
-    CHECKI(e.EN(raw,spf), 2);
-    CHECKI(e.EN(raw,data_type), GD_UINT8);
-    CHECKP(e.scalar[0]);
-    gd_free_entry_strings(&e);
-  }
-
-  gd_close(D);
-
-  unlink(data);
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error, GD_E_OK);
-
-  return r;
-}
diff --git a/test/add_add.c b/test/add_add.c
new file mode 100644
index 0000000..a43e1b5
--- /dev/null
+++ b/test/add_add.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Add a dirfile field */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E, e;
+
+  rmdirfile();
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_RAW_ENTRY;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+  E.scalar[0] = NULL;
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    CHECKP(e.scalar[0]);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_alias.c b/test/add_alias.c
index 43a3599..8321eea 100644
--- a/test/add_alias.c
+++ b/test/add_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -26,7 +26,8 @@ int main(void)
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
   const char *target;
-  int error, i, n, r = 0;
+  int error, i, r = 0;
+  unsigned int n;
   DIRFILE *D;
 
   rmdirfile();
@@ -51,7 +52,7 @@ int main(void)
 
   CHECKI(error, GD_E_OK);
   CHECKI(i, 0);
-  CHECKI(n, 2);
+  CHECKU(n, 2);
 
   return r;
 }
diff --git a/test/add_alias_affix.c b/test/add_alias_affix.c
index e412207..043d3a6 100644
--- a/test/add_alias_affix.c
+++ b/test/add_alias_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -27,7 +27,8 @@ int main(void)
   const char *format1 = "dirfile/format";
   const char *data = "dirfile/data";
   const char *target;
-  int e1, e2, e3, i, n, r = 0;
+  int e1, e2, e3, i, r = 0;
+  unsigned int n;
   DIRFILE *D;
 
   rmdirfile();
@@ -60,7 +61,7 @@ int main(void)
   CHECKI(e2, GD_E_BAD_CODE);
   CHECKI(e3, GD_E_OK);
   CHECKI(i, 1);
-  CHECKI(n, 2);
+  CHECKU(n, 2);
 
   return r;
 }
diff --git a/test/add_alias_meta.c b/test/add_alias_meta.c
index 86af86d..2fed181 100644
--- a/test/add_alias_meta.c
+++ b/test/add_alias_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -26,8 +26,9 @@ int main(void)
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
   const char *target;
-  int error, i, n, r = 0;
+  int error, i, r = 0;
   DIRFILE *D;
+  unsigned int n;
 
   rmdirfile();
 
@@ -51,7 +52,7 @@ int main(void)
 
   CHECKI(error, GD_E_OK);
   CHECKI(i, 0);
-  CHECKI(n, 2);
+  CHECKU(n, 2);
 
   return r;
 }
diff --git a/test/add_amb_code7.c b/test/add_amb_code7.c
new file mode 100644
index 0000000..06270d6
--- /dev/null
+++ b/test/add_amb_code7.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  memset(&E, 0, sizeof(E));
+  E.field = "pathological";
+  E.field_type = GD_PHASE_ENTRY;
+  E.in_fields[0] = "INDEX";
+
+  /* this is a valid field code, sadly */
+  E.scalar[0] = "1";
+  E.scalar_ind[0] = -1;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC);
+  gd_dirfile_standards(D, 7);
+
+  gd_add(D, &E);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_BAD_CODE);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/add_bit.c b/test/add_bit.c
index 5b32c2a..4e9fcbb 100644
--- a/test/add_bit.c
+++ b/test/add_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_bit_bitnum.c b/test/add_bit_bitnum.c
index fc47c8c..625954b 100644
--- a/test/add_bit_bitnum.c
+++ b/test/add_bit_bitnum.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_bit_bitsize.c b/test/add_bit_bitsize.c
index c861d30..a35a85a 100644
--- a/test/add_bit_bitsize.c
+++ b/test/add_bit_bitsize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_bit_invalid.c b/test/add_bit_invalid.c
index c62fa04..9a58593 100644
--- a/test/add_bit_invalid.c
+++ b/test/add_bit_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
 
   gd_add_bit(D, "new", "input", 1, 1, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error,GD_E_BAD_DIRFILE);
 
diff --git a/test/add_bit_numbits.c b/test/add_bit_numbits.c
index 533a047..f7e58bd 100644
--- a/test/add_bit_numbits.c
+++ b/test/add_bit_numbits.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_carray.c b/test/add_carray.c
index 27d5a3b..e72a50a 100644
--- a/test/add_carray.c
+++ b/test/add_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,13 +56,13 @@ int main(void)
     CHECKI(e.EN(scalar,const_type), GD_UINT8);
     gd_free_entry_strings(&e);
   }
-  n = (int)gd_carray_len(D, "data");
+  n = (int)gd_array_len(D, "data");
   CHECKI(n, 5);
   gd_get_carray(D, "data", GD_UINT8, &data);
   for (n = 0; n < 5; ++n)
     CHECKIi(n, data[n], 3 + n);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_clincom.c b/test/add_clincom.c
index 76258a0..a7eae39 100644
--- a/test/add_clincom.c
+++ b/test/add_clincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,11 +73,11 @@ int main(void)
     CHECKC(e.EN(lincom,cb)[0], b[0]);
     CHECKC(e.EN(lincom,cb)[1], b[1]);
 #endif
-    CHECKI(e.comp_scal,1);
+    CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_code.c b/test/add_code.c
index 49042d1..db73450 100644
--- a/test/add_code.c
+++ b/test/add_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_const.c b/test/add_const.c
index dac48c8..52ca3fa 100644
--- a/test/add_const.c
+++ b/test/add_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_cpolynom.c b/test/add_cpolynom.c
index 4a99f53..95cc15f 100644
--- a/test/add_cpolynom.c
+++ b/test/add_cpolynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
     CHECKS(e.in_fields[0], "in");
     CHECKI(e.fragment_index, 0);
     CHECKI(e.EN(polynom,poly_ord), 3);
-    CHECKI(e.comp_scal, 1);
+    CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC);
     for (j = 0; j < 4; ++j) {
 #ifdef GD_NO_C99_API
       CHECKCi(j,e.EN(polynom,ca)[j], a + 2 * j);
@@ -70,7 +70,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_crecip.c b/test/add_crecip.c
index c66d7fb..1f0aa8c 100644
--- a/test/add_crecip.c
+++ b/test/add_crecip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,14 +54,14 @@ int main(void)
   else {
     CHECKI(e.field_type, GD_RECIP_ENTRY);
     CHECKS(e.in_fields[0], "in");
-    CHECKI(e.comp_scal, 1);
+    CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC);
     CHECKC(e.EN(recip,cdividend), cdividend);
     CHECKI(e.fragment_index, 0);
 
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_crecip89.c b/test/add_crecip89.c
index 909b086..d81e694 100644
--- a/test/add_crecip89.c
+++ b/test/add_crecip89.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   else {
     CHECKI(e.field_type, GD_RECIP_ENTRY);
     CHECKS(e.in_fields[0], "in");
-    CHECKI(e.comp_scal, 1);
+    CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC);
     CHECKF(e.EN(recip,cdividend)[0], dividend[0]);
     CHECKF(e.EN(recip,cdividend)[1], dividend[1]);
     CHECKI(e.fragment_index, 0);
@@ -58,7 +58,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_divide.c b/test/add_divide.c
index 43e6941..54c07b7 100644
--- a/test/add_divide.c
+++ b/test/add_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_divide_invalid.c b/test/add_divide_invalid.c
index c53bd8d..30116c6 100644
--- a/test/add_divide_invalid.c
+++ b/test/add_divide_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add_multiply(D, "new", "in1", "in2", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/add_dot5.c b/test/add_dot5.c
new file mode 100644
index 0000000..9a8896b
--- /dev/null
+++ b/test/add_dot5.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E, e;
+
+  rmdirfile();
+  memset(&E, 0, sizeof(E));
+  E.field = "dat.a";
+  E.field_type = GD_PHASE_ENTRY;
+  E.in_fields[0] = "INDEX";
+  E.EN(phase,shift) = 0;
+  E.scalar[0] = NULL;
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_dirfile_standards(D, 5);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  CHECKI(error, GD_E_OK);
+
+  /* check */
+  gd_entry(D, "dat.a", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_PHASE_ENTRY);
+    CHECKS(e.in_fields[0], "INDEX");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(phase,shift), 0);
+    CHECKP(e.scalar[0]);
+    CHECKI(e.flags & GD_EN_DOTTED, GD_EN_DOTTED);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/add_dot6.c b/test/add_dot6.c
new file mode 100644
index 0000000..533f3a9
--- /dev/null
+++ b/test/add_dot6.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  memset(&E, 0, sizeof(E));
+  E.field = "dat.a";
+  E.field_type = GD_PHASE_ENTRY;
+  E.in_fields[0] = "INDEX";
+  E.EN(phase,shift) = 0;
+  E.scalar[0] = NULL;
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_dirfile_standards(D, 6);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  CHECKI(error, GD_E_BAD_CODE);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/add_duplicate.c b/test/add_duplicate.c
index 4d378ce..9856b7d 100644
--- a/test/add_duplicate.c
+++ b/test/add_duplicate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_format.c b/test/add_format.c
index 6a99e90..6d6887d 100644
--- a/test/add_format.c
+++ b/test/add_format.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_invalid.c b/test/add_invalid.c
index 59e70f8..7dd1228 100644
--- a/test/add_invalid.c
+++ b/test/add_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add(D, &E);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
 
diff --git a/test/add_lincom.c b/test/add_lincom.c
index 11f960f..a232651 100644
--- a/test/add_lincom.c
+++ b/test/add_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,11 +61,11 @@ int main(void)
     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);
+    CHECKX(e.flags, GD_EN_CALC);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_lincom_affix.c b/test/add_lincom_affix.c
index a87bd97..a0ed458 100644
--- a/test/add_lincom_affix.c
+++ b/test/add_lincom_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -68,11 +68,11 @@ int main(void)
     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);
+    CHECKX(e.flags, GD_EN_CALC);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/add_lincom_invalid.c b/test/add_lincom_invalid.c
index 8980ffd..672a7e0 100644
--- a/test/add_lincom_invalid.c
+++ b/test/add_lincom_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -40,7 +40,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add_lincom(D, "new", 2, in_fields, m, b, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
 
diff --git a/test/add_lincom_nfields.c b/test/add_lincom_nfields.c
index cfe60ce..025e423 100644
--- a/test/add_lincom_nfields.c
+++ b/test/add_lincom_nfields.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_linterp.c b/test/add_linterp.c
index 514fcd3..0e37420 100644
--- a/test/add_linterp.c
+++ b/test/add_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_linterp_invalid.c b/test/add_linterp_invalid.c
index 11d1250..cdaf829 100644
--- a/test/add_linterp_invalid.c
+++ b/test/add_linterp_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add_linterp(D, "new", "in", "table", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/add_meta.c b/test/add_meta.c
index 07c4c41..cbd0246 100644
--- a/test/add_meta.c
+++ b/test/add_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/add_meta_alias.c b/test/add_meta_alias.c
index 96ab508..77a0b22 100644
--- a/test/add_meta_alias.c
+++ b/test/add_meta_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/add_mplex.c b/test/add_mplex.c
index 68b116d..b375795 100644
--- a/test/add_mplex.c
+++ b/test/add_mplex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,11 +43,11 @@ int main(void)
     CHECKS(e.in_fields[1], "count");
     CHECKI(e.fragment_index, 0);
     CHECKI(e.EN(mplex,count_val), 3);
-    CHECKF(e.EN(mplex,period), 4);
+    CHECKI(e.EN(mplex,period), 4);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_multiply.c b/test/add_multiply.c
index cc65a99..1d2dfb6 100644
--- a/test/add_multiply.c
+++ b/test/add_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_multiply_invalid.c b/test/add_multiply_invalid.c
index 55a43ca..dd0188a 100644
--- a/test/add_multiply_invalid.c
+++ b/test/add_multiply_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add_multiply(D, "new", "in1", "in2", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/add_phase.c b/test/add_phase.c
index c801031..7a6a4ff 100644
--- a/test/add_phase.c
+++ b/test/add_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_phase_invalid.c b/test/add_phase_invalid.c
index 269e6ad..b29161e 100644
--- a/test/add_phase_invalid.c
+++ b/test/add_phase_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add_phase(D, "new", "in", 3, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/add_polynom.c b/test/add_polynom.c
index 9bb7437..a489346 100644
--- a/test/add_polynom.c
+++ b/test/add_polynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,13 +54,13 @@ int main(void)
     CHECKS(e.in_fields[0], "in");
     CHECKI(e.fragment_index, 0);
     CHECKI(e.EN(polynom,poly_ord), 3);
-    CHECKI(e.comp_scal, 0);
+    CHECKX(e.flags, GD_EN_CALC);
     for (j = 0; j < 4; ++j)
       CHECKFi(j,e.EN(polynom,a)[j], a[j]);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_polynom_scalar.c b/test/add_polynom_scalar.c
index 8d446cf..47da2a5 100644
--- a/test/add_polynom_scalar.c
+++ b/test/add_polynom_scalar.c
@@ -33,7 +33,6 @@ int main(void)
   E.field_type = GD_POLYNOM_ENTRY;
   E.fragment_index = 0;
   E.EN(polynom,poly_ord) = 3;
-  E.comp_scal = 0;
   E.in_fields[0] = "INDEX";
   E.scalar[0] = "A";
   E.scalar[1] = "B";
@@ -68,7 +67,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_protect.c b/test/add_protect.c
index 2fcd142..051136f 100644
--- a/test/add_protect.c
+++ b/test/add_protect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_raw.c b/test/add_raw.c
index f2efa8c..1c8be00 100644
--- a/test/add_raw.c
+++ b/test/add_raw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   if (unlink(data)) {
     perror("unlink");
diff --git a/test/add_raw_include.c b/test/add_raw_include.c
index d7fc411..0648a12 100644
--- a/test/add_raw_include.c
+++ b/test/add_raw_include.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   if (unlink(data))
     r = 1;
diff --git a/test/add_raw_invalid.c b/test/add_raw_invalid.c
index cfb66d6..191050b 100644
--- a/test/add_raw_invalid.c
+++ b/test/add_raw_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add_raw(D, "data", GD_UINT8, 2, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/add_raw_spf.c b/test/add_raw_spf.c
index 420c64b..daa5d9b 100644
--- a/test/add_raw_spf.c
+++ b/test/add_raw_spf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_raw_spf_scalar.c b/test/add_raw_spf_scalar.c
index 2b990b3..dd7eab2 100644
--- a/test/add_raw_spf_scalar.c
+++ b/test/add_raw_spf_scalar.c
@@ -65,7 +65,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/add_raw_sub.c b/test/add_raw_sub.c
new file mode 100644
index 0000000..8a040d6
--- /dev/null
+++ b/test/add_raw_sub.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *data = "dirfile/sub/data";
+  const char *format_data = "/INCLUDE sub/format1\n";
+  const char *format1_data = "#\n";
+  gd_entry_t e;
+  int error, fd, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE | GD_UNENCODED);
+  gd_add_raw(D, "data", GD_UINT8, 2, 1);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 1);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_discard(D);
+
+  if (unlink(data)) {
+    perror("unlink");
+    r = 1;
+  }
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_raw_type.c b/test/add_raw_type.c
index d28b5c5..646e3c6 100644
--- a/test/add_raw_type.c
+++ b/test/add_raw_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_rdonly.c b/test/add_rdonly.c
index 09232db..fc647c1 100644
--- a/test/add_rdonly.c
+++ b/test/add_rdonly.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_recip.c b/test/add_recip.c
index e73b3b1..91f76be 100644
--- a/test/add_recip.c
+++ b/test/add_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,14 +48,14 @@ int main(void)
   else {
     CHECKI(e.field_type, GD_RECIP_ENTRY);
     CHECKS(e.in_fields[0], "in");
-    CHECKI(e.comp_scal, 0);
+    CHECKX(e.flags, GD_EN_CALC);
     CHECKF(e.EN(recip,dividend), 33.3);
     CHECKI(e.fragment_index, 0);
 
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_resolv.c b/test/add_resolv.c
index 8bd2fa4..9e663f1 100644
--- a/test/add_resolv.c
+++ b/test/add_resolv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -25,7 +25,8 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int error, i, n, r = 0;
+  int error, i, r = 0;
+  unsigned int n;
   DIRFILE *D;
   const char *target;
 
@@ -51,7 +52,7 @@ int main(void)
 
   CHECKI(error, GD_E_OK);
   CHECKI(i, 0);
-  CHECKI(n, 2);
+  CHECKU(n, 2);
 
   return r;
 }
diff --git a/test/add_sbit.c b/test/add_sbit.c
index da51dad..98b845e 100644
--- a/test/add_sbit.c
+++ b/test/add_sbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_scalar.c b/test/add_scalar.c
index bd79f6e..62c912c 100644
--- a/test/add_scalar.c
+++ b/test/add_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -33,7 +33,6 @@ int main(void)
   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;
@@ -60,7 +59,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_scalar_carray.c b/test/add_scalar_carray.c
index 7bd34ee..1320b6e 100644
--- a/test/add_scalar_carray.c
+++ b/test/add_scalar_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -33,7 +33,6 @@ int main(void)
   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;
@@ -62,7 +61,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_scalar_carray_bad.c b/test/add_scalar_carray_bad.c
index c410e42..48976ed 100644
--- a/test/add_scalar_carray_bad.c
+++ b/test/add_scalar_carray_bad.c
@@ -33,7 +33,6 @@ int main(void)
   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;
@@ -62,7 +61,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_sort.c b/test/add_sort.c
index cb8c1d8..42e367e 100644
--- a/test/add_sort.c
+++ b/test/add_sort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -82,7 +82,7 @@ int main (void)
   CheckSPF(D, "i", 10);
   CheckSPF(D, "j", 11);
   CheckSPF(D, "k", 7);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(k);
   unlink(j);
diff --git a/test/add_spec.c b/test/add_spec.c
index 30cef8d..8d25c07 100644
--- a/test/add_spec.c
+++ b/test/add_spec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   if (unlink(data))
     r = 1;
diff --git a/test/add_spec_directive.c b/test/add_spec_directive.c
index c775c13..4a22061 100644
--- a/test/add_spec_directive.c
+++ b/test/add_spec_directive.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   if (!unlink(data))
     r = 1;
diff --git a/test/add_spec_invalid.c b/test/add_spec_invalid.c
index 755c948..729f0ae 100644
--- a/test/add_spec_invalid.c
+++ b/test/add_spec_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_add_spec(D, "data RAW UINT8 2", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
 
diff --git a/test/add_spec_meta.c b/test/add_spec_meta.c
index 24e8340..218c49b 100644
--- a/test/add_spec_meta.c
+++ b/test/add_spec_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_spec_resolv.c b/test/add_spec_resolv.c
index c028be9..6acc17d 100644
--- a/test/add_spec_resolv.c
+++ b/test/add_spec_resolv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -25,7 +25,8 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int error, i, n, r = 0;
+  int error, i, r = 0;
+  unsigned int n;
   DIRFILE *D;
   const char *target;
 
@@ -51,7 +52,7 @@ int main(void)
 
   CHECKI(error, GD_E_OK);
   CHECKI(i, 0);
-  CHECKI(n, 2);
+  CHECKU(n, 2);
 
   return r;
 }
diff --git a/test/add_string.c b/test/add_string.c
index b372406..39e2285 100644
--- a/test/add_string.c
+++ b/test/add_string.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_string_affix.c b/test/add_string_affix.c
index 02ead8e..1d8af49 100644
--- a/test/add_string_affix.c
+++ b/test/add_string_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   /* check */
   gd_get_string(D, "AdataZ", 1000, val);
   e2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/add_type.c b/test/add_type.c
index 05135d7..d834c7b 100644
--- a/test/add_type.c
+++ b/test/add_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   /* check */
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_window.c b/test/add_window.c
index 8f0c871..d694399 100644
--- a/test/add_window.c
+++ b/test/add_window.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/add_window_op.c b/test/add_window_op.c
index 515c244..3685c0f 100644
--- a/test/add_window_op.c
+++ b/test/add_window_op.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
   gd_add_window(D, "new", "in", "check", (gd_windop_t)-1, threshold, 0);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alias_list.c b/test/alias_list.c
index c7c3d62..70ad1a4 100644
--- a/test/alias_list.c
+++ b/test/alias_list.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   for (i = 0; i < 256; ++i)
     CHECKIi(i, x[i], (i >= 'a' && i <= 'f') ? 1 : 0);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_list_alias.c b/test/alias_list_alias.c
index 55991e7..dbfda79 100644
--- a/test/alias_list_alias.c
+++ b/test/alias_list_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   for (i = 0; i < 256; ++i)
     CHECKIi(i, x[i], (i >= 'a' && i <= 'f') ? 1 : 0);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_list_missing.c b/test/alias_list_missing.c
index 4473365..b291066 100644
--- a/test/alias_list_missing.c
+++ b/test/alias_list_missing.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   CHECKI(e, GD_E_BAD_CODE);
   CHECKP(al);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_num.c b/test/alias_num.c
index 24a9d01..def78b8 100644
--- a/test/alias_num.c
+++ b/test/alias_num.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -31,7 +31,8 @@ int main(void)
     "/ALIAS c d\n"
     "/ALIAS d f\n"
     "f CONST UINT8 1\n";
-  int fd, e, n, r = 0;
+  int fd, e, r = 0;
+  unsigned int n;
   DIRFILE *D;
 
   rmdirfile();
@@ -47,9 +48,9 @@ int main(void)
   e = gd_error(D);
 
   CHECKI(e, GD_E_OK);
-  CHECKI(n, 6);
+  CHECKU(n, 6);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_num_alias.c b/test/alias_num_alias.c
index 6bc4d55..3c85a7a 100644
--- a/test/alias_num_alias.c
+++ b/test/alias_num_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -31,7 +31,8 @@ int main(void)
     "/ALIAS c d\n"
     "/ALIAS d f\n"
     "f CONST UINT8 1\n";
-  int fd, e, n, r = 0;
+  int fd, e, r = 0;
+  unsigned int n;
   DIRFILE *D;
 
   rmdirfile();
@@ -47,9 +48,9 @@ int main(void)
   e = gd_error(D);
 
   CHECKI(e, GD_E_OK);
-  CHECKI(n, 6);
+  CHECKU(n, 6);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_num_missing.c b/test/alias_num_missing.c
index a81f00e..4630275 100644
--- a/test/alias_num_missing.c
+++ b/test/alias_num_missing.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -30,7 +30,8 @@ int main(void)
     "/ALIAS b d\n"
     "/ALIAS c d\n"
     "/ALIAS d f\n";
-  int fd, e, n, r = 0;
+  int fd, e, r = 0;
+  unsigned n;
   DIRFILE *D;
 
   rmdirfile();
@@ -46,9 +47,9 @@ int main(void)
   e = gd_error(D);
 
   CHECKI(e, GD_E_BAD_CODE);
-  CHECKI(n, -1);
+  CHECKU(n, 0);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_target.c b/test/alias_target.c
index cb9ca02..e82ec9e 100644
--- a/test/alias_target.c
+++ b/test/alias_target.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
 
   CHECKI(e, GD_E_OK);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_target_alias.c b/test/alias_target_alias.c
index fc147bc..d2a6140 100644
--- a/test/alias_target_alias.c
+++ b/test/alias_target_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
 
   CHECKI(e, GD_E_OK);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alias_target_missing.c b/test/alias_target_missing.c
index 0a56170..213876c 100644
--- a/test/alias_target_missing.c
+++ b/test/alias_target_missing.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
 
   CHECKI(e, GD_E_OK);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/alter_bit_bitnum.c b/test/alter_bit_bitnum.c
index a6f457d..a847262 100644
--- a/test/alter_bit_bitnum.c
+++ b/test/alter_bit_bitnum.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i],((i & 4) != 0));
diff --git a/test/alter_bit_numbits.c b/test/alter_bit_numbits.c
index 6ac9778..ba3121f 100644
--- a/test/alter_bit_numbits.c
+++ b/test/alter_bit_numbits.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i / 2);
diff --git a/test/alter_carray_len.c b/test/alter_carray_len.c
index 8b1861b..9a9c452 100644
--- a/test/alter_carray_len.c
+++ b/test/alter_carray_len.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,10 +50,10 @@ int main(void)
   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");
+  z = gd_array_len(D, "carray");
   n = gd_get_carray(D, "carray", GD_FLOAT64, &d);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alter_carray_type.c b/test/alter_carray_type.c
index 914ba2d..b2ce783 100644
--- a/test/alter_carray_type.c
+++ b/test/alter_carray_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,10 +50,10 @@ int main(void)
   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");
+  z = gd_array_len(D, "carray");
   n = gd_get_carray(D, "carray", GD_FLOAT64, &d);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alter_clincom.c b/test/alter_clincom.c
new file mode 100644
index 0000000..cff94ed
--- /dev/null
+++ b/test/alter_clincom.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "lincom LINCOM 2 data 1 0 data 1 0\n";
+  int32_t data_data[256];
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+#ifdef GD_NO_C99_API
+  const double m[4] = {1, 2, 3, 4};
+  const double b[4] = {8, 7, 6, 5};
+#else
+  const double complex m[2] = {1 + _Complex_I * 2, 3 + _Complex_I * 4};
+  const double complex b[2] = {8 + _Complex_I * 7, 6 + _Complex_I * 5};
+#endif
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_clincom(D, "lincom", 0, NULL, m, b);
+  error = gd_error(D);
+  gd_entry(D, "lincom", &E);
+
+  CHECKX(E.flags, GD_EN_COMPSCAL | GD_EN_CALC);
+  CHECKI(E.EN(lincom,n_fields), 2);
+#ifdef GD_NO_C99_API
+  CHECKC(E.EN(lincom,cm)[0], m);
+  CHECKC(E.EN(lincom,cm)[1], m + 2);
+  CHECKC(E.EN(lincom,cb)[0], b);
+  CHECKC(E.EN(lincom,cb)[1], b + 2);
+#else
+  CHECKC(E.EN(lincom,cm)[0], m[0]);
+  CHECKC(E.EN(lincom,cm)[1], m[1]);
+  CHECKC(E.EN(lincom,cb)[0], b[0]);
+  CHECKC(E.EN(lincom,cb)[1], b[1]);
+#endif
+  gd_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_const.c b/test/alter_const.c
index 58a52db..dfd0657 100644
--- a/test/alter_const.c
+++ b/test/alter_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ int main(void)
   error = gd_error(D);
   n = gd_get_constant(D, "const", GD_FLOAT64, &d);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alter_const_c2r.c b/test/alter_const_c2r.c
index dda81ab..e715292 100644
--- a/test/alter_const_c2r.c
+++ b/test/alter_const_c2r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ int main(void)
   error = gd_error(D);
   n = gd_get_constant(D, "const", GD_FLOAT64, &d);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alter_const_r2c.c b/test/alter_const_r2c.c
new file mode 100644
index 0000000..accfa3f
--- /dev/null
+++ b/test/alter_const_r2c.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST FLOAT64 8.3\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  double d;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_const(D, "const", GD_COMPLEX128);
+  error = gd_error(D);
+  n = gd_get_constant(D, "const", GD_FLOAT64, &d);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKF(d, 8.3);
+
+  return r;
+}
diff --git a/test/alter_const_r2r.c b/test/alter_const_r2r.c
new file mode 100644
index 0000000..ea9489b
--- /dev/null
+++ b/test/alter_const_r2r.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST FLOAT32 8.3\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  double d;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_const(D, "const", GD_FLOAT64);
+  error = gd_error(D);
+  n = gd_get_constant(D, "const", GD_FLOAT64, &d);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKF(d, 8.3);
+
+  return r;
+}
diff --git a/test/alter_cpolynom.c b/test/alter_cpolynom.c
index b3c2bd5..7a50012 100644
--- a/test/alter_cpolynom.c
+++ b/test/alter_cpolynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -68,7 +68,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i) {
     int x = i + 40;
diff --git a/test/alter_cpolynom_null.c b/test/alter_cpolynom_null.c
new file mode 100644
index 0000000..02f3466
--- /dev/null
+++ b/test/alter_cpolynom_null.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW INT32 8\n"
+    "polynom POLYNOM data 1;2 2;3 1;9\n";
+  int fd, i, ret, error, n, error2, r = 0;
+  gd_entry_t E;
+#ifdef GD_NO_C99_API
+  const double a[2][2] = {{1, 2}, {2, 3}};
+#endif
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_cpolynom(D, "polynom", 1, NULL, NULL);
+  error = gd_error(D);
+
+  CHECKI(error,0);
+
+  n = gd_entry(D, "polynom", &E);
+  error2 = gd_error(D);
+
+  gd_discard(D);
+
+  CHECKS(E.field, "polynom");
+  CHECKI(E.field_type, GD_POLYNOM_ENTRY);
+  CHECKI(E.EN(polynom,poly_ord), 1);
+  CHECKX(E.flags, GD_EN_COMPSCAL | GD_EN_CALC);
+  CHECKS(E.in_fields[0], "data"); 
+
+  for (i = 0; i < 2; ++i) {
+#ifdef GD_NO_C99_API
+    CHECKCi(i,E.EN(polynom,ca)[i], a[i]);
+#else
+    CHECKCi(i,E.EN(polynom,ca)[i], i + 1 + _Complex_I * (i + 2));
+#endif
+  }
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error2,0);
+  CHECKI(n,0);
+  CHECKI(ret,0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_crecip.c b/test/alter_crecip.c
index e5490db..f6f6567 100644
--- a/test/alter_crecip.c
+++ b/test/alter_crecip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKFi(i,c[i], creal(v) / (i + 41.));
diff --git a/test/alter_crecip89.c b/test/alter_crecip89.c
index f10cf07..39acb92 100644
--- a/test/alter_crecip89.c
+++ b/test/alter_crecip89.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   error = gd_error(D);
   n = gd_entry(D, "div", &E);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/alter_crecip89_null.c b/test/alter_crecip89_null.c
new file mode 100644
index 0000000..e077b1a
--- /dev/null
+++ b/test/alter_crecip89_null.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define GD_C89_API
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "div RECIP data 230.\n";
+  int32_t data_data[256];
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_crecip(D, "div", "phase", NULL);
+  error = gd_error(D);
+  n = gd_entry(D, "div", &E);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,0);
+  CHECKI(ret,0);
+  CHECKX(E.flags, GD_EN_CALC);
+  CHECKF(E.EN(recip,dividend), 230.);
+  CHECKS(E.in_fields[0], "phase");
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_crecip_zero.c b/test/alter_crecip_zero.c
index 1360596..dcef1c6 100644
--- a/test/alter_crecip_zero.c
+++ b/test/alter_crecip_zero.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKFi(i,c[i], 230. / (i + 41.));
diff --git a/test/alter_divide.c b/test/alter_divide.c
index fcbffac..68fc83a 100644
--- a/test/alter_divide.c
+++ b/test/alter_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKFi(i,c[i], (i + 40.) / (i + 41.));
diff --git a/test/alter_entry.c b/test/alter_entry.c
index ca27e51..f5f734b 100644
--- a/test/alter_entry.c
+++ b/test/alter_entry.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/alter_entry_affix.c b/test/alter_entry_affix.c
index d9d312b..37d2617 100644
--- a/test/alter_entry_affix.c
+++ b/test/alter_entry_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/alter_entry_hidden.c b/test/alter_entry_hidden.c
index 9712f80..294bb29 100644
--- a/test/alter_entry_hidden.c
+++ b/test/alter_entry_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test field modifying */
 #include "test.h"
 
 int main(void)
@@ -49,19 +48,19 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   gd_entry(D, "data", &E);
-  E.hidden = 1;
+  E.flags = GD_EN_HIDDEN;
   ret = gd_alter_entry(D, "data", &E, 0);
   error = gd_error(D);
   n = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
   rmdir(filedir);
 
   CHECKI(error, 0);
-  CHECKI(n, 2);
+  CHECKI(n, 1);
   CHECKI(ret, 0);
   gd_free_entry_strings(&E);
 
diff --git a/test/alter_entry_lincom.c b/test/alter_entry_lincom.c
new file mode 100644
index 0000000..a058b91
--- /dev/null
+++ b/test/alter_entry_lincom.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "lincom LINCOM a 1 2\n";
+  int fd, ret, error, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+
+  gd_entry(D, "lincom", &E);
+  E.EN(lincom,n_fields) = 2;
+  E.EN(lincom,m[0]) = 3;
+  E.EN(lincom,b[0]) = 4;
+  E.EN(lincom,m[1]) = 5;
+  E.EN(lincom,b[1]) = 6;
+  E.in_fields[1] = "b";
+  ret = gd_alter_entry(D, "lincom", &E, 0);
+  error = gd_error(D);
+
+  E.in_fields[1] = NULL;
+  gd_free_entry_strings(&E);
+  memset(&E, 0, sizeof(E));
+  gd_entry(D, "lincom", &E);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKS(E.in_fields[0], "a");
+  CHECKS(E.in_fields[1], "b");
+  CHECKI(E.EN(lincom,n_fields), 2);
+  CHECKF(E.EN(lincom,m[0]), 3);
+  CHECKF(E.EN(lincom,b[0]), 4);
+  CHECKF(E.EN(lincom,m[1]), 5);
+  CHECKF(E.EN(lincom,b[1]), 6);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_recode.c b/test/alter_entry_recode.c
index fcb7da2..a71d33c 100644
--- a/test/alter_entry_recode.c
+++ b/test/alter_entry_recode.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/alter_entry_recode_recalc.c b/test/alter_entry_recode_recalc.c
new file mode 100644
index 0000000..995803b
--- /dev/null
+++ b/test/alter_entry_recode_recalc.c
@@ -0,0 +1,98 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "data RAW UINT8 a\n"
+    "a CONST UINT8 8\n"
+    "b CONST UINT8 11\n";
+  unsigned char data_data[256];
+  uint16_t d;
+  int fd, i, ret, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_RAW_ENTRY;
+  E.EN(raw,data_type) = GD_UINT16;
+  E.EN(raw,spf) = 0;
+  E.scalar[0] = "b";
+
+  ret = gd_alter_entry(D, "data", &E, 1);
+  error = gd_error(D);
+  n = gd_nframes(D);
+  CHECKI(error, 0);
+  CHECKI(n, 32);
+  CHECKI(ret, 0);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKXi(i, d, i * 8 / 11);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alter_entry_scalar1.c b/test/alter_entry_scalar1.c
new file mode 100644
index 0000000..d49932c
--- /dev/null
+++ b/test/alter_entry_scalar1.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data BIT in 3 3\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_BIT_ENTRY;
+  E.EN(bit,bitnum) = 4;
+  E.EN(bit,numbits) = 3;
+  E.in_fields[0] = "in";
+  E.scalar[0] = "";
+
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+
+  n = gd_entry(D, "data", &E);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,0);
+  CHECKI(ret,0);
+  CHECKI(E.EN(bit,bitnum), 4);
+  CHECKP(E.scalar[0]);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_scalar2a.c b/test/alter_entry_scalar2a.c
index 92dad32..eb3b30c 100644
--- a/test/alter_entry_scalar2a.c
+++ b/test/alter_entry_scalar2a.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   gd_free_entry_strings(&E);
   n = gd_entry(D, "data", &E);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alter_entry_scalar2n.c b/test/alter_entry_scalar2n.c
index 674c087..bd3a84a 100644
--- a/test/alter_entry_scalar2n.c
+++ b/test/alter_entry_scalar2n.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   gd_free_entry_strings(&E);
   n = gd_entry(D, "data", &E);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/alter_entry_scalar3.c b/test/alter_entry_scalar3.c
index 12b1362..62d5e53 100644
--- a/test/alter_entry_scalar3.c
+++ b/test/alter_entry_scalar3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
   gd_free_entry_strings(&E);
   n = gd_entry(D, "data", &E);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alter_entry_scalar3c.c b/test/alter_entry_scalar3c.c
new file mode 100644
index 0000000..558d2d3
--- /dev/null
+++ b/test/alter_entry_scalar3c.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data BIT in c1 3\nc1 CONST INT64 3\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+
+  memset(&E, 0, sizeof(E));
+  E.field_type = GD_BIT_ENTRY;
+  E.EN(bit,bitnum) = -1;
+  E.EN(bit,numbits) = 3;
+  E.in_fields[0] = "in";
+
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+
+  n = gd_entry(D, "data", &E);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,0);
+  CHECKI(ret,0);
+  CHECKI(E.EN(bit,bitnum), 3);
+  CHECKP(E.scalar[0]);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_scalar4.c b/test/alter_entry_scalar4.c
index b85542c..de57af9 100644
--- a/test/alter_entry_scalar4.c
+++ b/test/alter_entry_scalar4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   gd_free_entry_strings(&E);
   n = gd_entry(D, "data", &E);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/alter_entry_scalar_amb.c b/test/alter_entry_scalar_amb.c
new file mode 100644
index 0000000..c6194b4
--- /dev/null
+++ b/test/alter_entry_scalar_amb.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/VERSION 7\nphase PHASE INDEX c\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_entry(D, "phase", &E);
+  free(E.scalar[0]);
+  E.scalar[0] = "2";
+  ret = gd_alter_entry(D, "phase", &E, 0);
+  error = gd_error(D);
+  CHECKI(ret, -1);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  E.scalar[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alter_index.c b/test/alter_index.c
new file mode 100644
index 0000000..e67e6fe
--- /dev/null
+++ b/test/alter_index.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  int ret, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+
+  memset(&E, 0, sizeof(E));
+
+  E.field_type = GD_INDEX_ENTRY;
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL);
+  ret = gd_alter_entry(D, "INDEX", &E, 0);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_FIELD_TYPE);
+  CHECKI(ret, -1);
+
+  return r;
+}
diff --git a/test/alter_lincom_23.c b/test/alter_lincom_23.c
index 7e270c8..c382005 100644
--- a/test/alter_lincom_23.c
+++ b/test/alter_lincom_23.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], (40 + i) * 6 + 6);
diff --git a/test/alter_lincom_32.c b/test/alter_lincom_32.c
index 7e4ba2a..c1d44a0 100644
--- a/test/alter_lincom_32.c
+++ b/test/alter_lincom_32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], (40 + i) * 6 + 6);
diff --git a/test/alter_lincom_input.c b/test/alter_lincom_input.c
index d117db9..802d610 100644
--- a/test/alter_lincom_input.c
+++ b/test/alter_lincom_input.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i * 2 + 81);
diff --git a/test/alter_lincom_offset.c b/test/alter_lincom_offset.c
index 87878b1..183f029 100644
--- a/test/alter_lincom_offset.c
+++ b/test/alter_lincom_offset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i * 2 + 86);
diff --git a/test/alter_lincom_slope.c b/test/alter_lincom_slope.c
index a72de69..cd72252 100644
--- a/test/alter_lincom_slope.c
+++ b/test/alter_lincom_slope.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i * 5 + 203);
diff --git a/test/alter_linterp.c b/test/alter_linterp.c
index bed7d48..73043bd 100644
--- a/test/alter_linterp.c
+++ b/test/alter_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
   int32_t data_data[256];
   int32_t c[8];
   gd_entry_t e;
-  int fd, i, ret, error, error2, n, unlink_table, r = 0;
+  int fd, i, ret, e1, e2, e3, n, unlink_table, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -69,13 +69,27 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_getdata(D, "lut", 5, 0, 1, 0, GD_NULL, NULL);
   ret = gd_alter_linterp(D, "lut", NULL, "table1", 0);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, 0);
+
   gd_entry(D, "lut", &e);
-  error2 = gd_error(D);
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+  CHECKS(e.in_fields[0], "data");
+  CHECKS(e.EN(linterp,table), "table1");
+  gd_free_entry_strings(&e);
+
   n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (i + 40) * 10);
 
-  gd_close(D);
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
 
   unlink(data);
   unlink_table = unlink(table);
@@ -83,17 +97,7 @@ int main(void)
   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
index 83d40f5..ad0bb8a 100644
--- a/test/alter_linterp_move.c
+++ b/test/alter_linterp_move.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test field modifying */
 #include "test.h"
 
 #include <stdlib.h>
@@ -42,7 +41,7 @@ int main(void)
   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;
+  int fd, i, ret, e1, e2, n, unlink_table, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -69,10 +68,15 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   ret = gd_alter_linterp(D, "lut", NULL, "table1", 1);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(e1,0);
+  CHECKI(ret,0);
+
   n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c);
+  CHECKI(n,8);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], (i + 40) * 5);
@@ -83,9 +87,6 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,0);
-  CHECKI(n,8);
-  CHECKI(ret,0);
   CHECKI(unlink_table,-1);
 
   return r;
diff --git a/test/alter_mplex.c b/test/alter_mplex.c
index a7e7860..e9bf7de 100644
--- a/test/alter_mplex.c
+++ b/test/alter_mplex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i, c[i], 38 + 3 * ((i + 2) / 3));
diff --git a/test/alter_mspec.c b/test/alter_mspec.c
index c131ff6..d664390 100644
--- a/test/alter_mspec.c
+++ b/test/alter_mspec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "data/phase", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i + 42);
diff --git a/test/alter_mspec_affix.c b/test/alter_mspec_affix.c
index 3945c21..2eb7a5e 100644
--- a/test/alter_mspec_affix.c
+++ b/test/alter_mspec_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "AdataZ/phase", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i + 42);
diff --git a/test/alter_multiply.c b/test/alter_multiply.c
index 9854434..ae03c34 100644
--- a/test/alter_multiply.c
+++ b/test/alter_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], (i + 40) * (i + 41));
diff --git a/test/alter_phase.c b/test/alter_phase.c
index 82e873c..867ace5 100644
--- a/test/alter_phase.c
+++ b/test/alter_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "phase", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i + 42);
diff --git a/test/alter_polynom_coeff.c b/test/alter_polynom_coeff.c
index 0c44125..a1e3419 100644
--- a/test/alter_polynom_coeff.c
+++ b/test/alter_polynom_coeff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,12 +67,12 @@ int main(void)
   n = gd_entry(D, "polynom", &E);
   error2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   CHECKS(E.field, "polynom");
   CHECKI(E.field_type, GD_POLYNOM_ENTRY);
   CHECKI(E.EN(polynom,poly_ord), 2);
-  CHECKI(E.comp_scal, 0);
+  CHECKX(E.flags, GD_EN_CALC);
   CHECKS(E.in_fields[0], "data"); 
 
   for (i = 0; i < 3; ++i) 
diff --git a/test/alter_polynom_input.c b/test/alter_polynom_input.c
index 3278372..f6d6558 100644
--- a/test/alter_polynom_input.c
+++ b/test/alter_polynom_input.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i) {
     const int x = i + 41;
diff --git a/test/alter_polynom_ord.c b/test/alter_polynom_ord.c
index e7628b0..8fcca17 100644
--- a/test/alter_polynom_ord.c
+++ b/test/alter_polynom_ord.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_INT32, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i) {
     int x = i + 40;
diff --git a/test/alter_raw_spf.c b/test/alter_raw_spf.c
index afa51ce..4f9da9f 100644
--- a/test/alter_raw_spf.c
+++ b/test/alter_raw_spf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/alter_raw_type.c b/test/alter_raw_type.c
index 193a73f..1e5e2d4 100644
--- a/test/alter_raw_type.c
+++ b/test/alter_raw_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/alter_recip.c b/test/alter_recip.c
index 113cfb1..44def49 100644
--- a/test/alter_recip.c
+++ b/test/alter_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKFi(i,c[i], 1093. / (i + 41.));
diff --git a/test/alter_recip_zero.c b/test/alter_recip_zero.c
index 159bd31..a38fba4 100644
--- a/test/alter_recip_zero.c
+++ b/test/alter_recip_zero.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKFi(i,c[i], 230. / (i + 41.));
diff --git a/test/alter_spec.c b/test/alter_spec.c
index c0c979b..06b00fe 100644
--- a/test/alter_spec.c
+++ b/test/alter_spec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/alter_spec_affix.c b/test/alter_spec_affix.c
index aba034c..e574d9f 100644
--- a/test/alter_spec_affix.c
+++ b/test/alter_spec_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/alter_spec_meta.c b/test/alter_spec_meta.c
index 1a3f32d..6c44432 100644
--- a/test/alter_spec_meta.c
+++ b/test/alter_spec_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "data/phase", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], i + 42);
diff --git a/test/alter_spec_polynom.c b/test/alter_spec_polynom.c
new file mode 100644
index 0000000..0640d5c
--- /dev/null
+++ b/test/alter_spec_polynom.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "polynom POLYNOM a 3 5 7 9\n";
+  int fd, i, ret, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_spec(D, "polynom POLYNOM b 1 2 3\n", 0);
+  error = gd_error(D);
+
+  gd_entry(D, "polynom", &E);
+
+  CHECKI(E.field_type, GD_POLYNOM_ENTRY);
+  CHECKS(E.in_fields[0], "b");
+  CHECKI(E.EN(polynom,poly_ord), 2);
+  for (i = 0; i < 3; ++i)
+    CHECKFi(i, E.EN(polynom,a)[i], i + 1);
+ 
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(ret, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_window.c b/test/alter_window.c
index adc3c8c..c47e014 100644
--- a/test/alter_window.c
+++ b/test/alter_window.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], (i > 3) ? i + 40 : 0);
diff --git a/test/ascii_add.c b/test/ascii_add.c
index 0a756f3..24b85c2 100644
--- a/test/ascii_add.c
+++ b/test/ascii_add.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   if (unlink(data)) {
     perror("unlink");
diff --git a/test/ascii_get.c b/test/ascii_get.c
index c96738d..0c416b3 100644
--- a/test/ascii_get.c
+++ b/test/ascii_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/ascii_get_complex.c b/test/ascii_get_complex.c
new file mode 100644
index 0000000..4cae9f1
--- /dev/null
+++ b/test/ascii_get_complex.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+  double c[16];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE* stream;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i;%g\n", i, 0.1 * i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 16; ++i)
+    CHECKFi(i,c[i], (i % 2) ? 0.1 * (40 + (i /2)) : 40 + (i / 2));
+
+  return r;
+}
diff --git a/test/ascii_get_get.c b/test/ascii_get_get.c
index dded3ec..d028f0b 100644
--- a/test/ascii_get_get.c
+++ b/test/ascii_get_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
   error2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/ascii_get_here.c b/test/ascii_get_here.c
new file mode 100644
index 0000000..9efb45c
--- /dev/null
+++ b/test/ascii_get_here.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  int fd, i, n1, n2, e1, e2, r = 0;
+  DIRFILE *D;
+  FILE* stream;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i\n", i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  e1 = gd_error(D);
+
+  CHECKI(n1, 40);
+  CHECKI(e1, 0);
+
+  n2 = gd_getdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+
+  CHECKI(n2, 8);
+  CHECKI(e2, 0);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+
+  return r;
+}
diff --git a/test/ascii_get_sub.c b/test/ascii_get_sub.c
new file mode 100644
index 0000000..ffc226f
--- /dev/null
+++ b/test/ascii_get_sub.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *data = "dirfile/sub/data.txt";
+  const char *format1_data = "data RAW UINT8 8\n";
+  const char *format_data = "/INCLUDE sub/format1\n";
+  unsigned char c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE* stream;
+
+  memset(c, 0, 8);
+  rmdirfile();
+
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i\n", i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/ascii_nframes.c b/test/ascii_nframes.c
index a3a8b08..610c4c9 100644
--- a/test/ascii_nframes.c
+++ b/test/ascii_nframes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_nframes(D);
   m = gd_nframes(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/ascii_put.c b/test/ascii_put.c
index 4bdc6c2..165d3ce 100644
--- a/test/ascii_put.c
+++ b/test/ascii_put.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *data = "dirfile/data.txt";
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8];
-  int d, n, error;
+  int d, n, e1, e2;
   int fd, i, r = 0;
   struct stat buf;
   FILE* stream;
@@ -56,9 +55,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(e1,0);
+  CHECKI(n,8);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf))
     return 1;
@@ -81,8 +83,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,0);
-  CHECKI(n,8);
-
   return r;
 }
diff --git a/test/ascii_put_here.c b/test/ascii_put_here.c
new file mode 100644
index 0000000..ee79215
--- /dev/null
+++ b/test/ascii_put_here.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  int d, n1, n2, e1, e2, e3;
+  int fd, i, r = 0;
+  struct stat buf;
+  FILE* stream;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_TEXT_ENCODED | GD_VERBOSE);
+  n1 = gd_seek(D, "data", 5, 0, GD_SEEK_SET | GD_SEEK_WRITE);
+  e1 = gd_error(D);
+  CHECKI(e1,0);
+  CHECKI(n1,40);
+
+  n2 = gd_putdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2,0);
+  CHECKI(n2,8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  if (stat(data, &buf))
+    return 1;
+
+  stream = fopen(data, "r");
+  i = 0;
+  for (;;) {
+    fscanf(stream, "%i", &d);
+    if (feof(stream))
+      break;
+    if (i < 40 || i > 48) {
+      CHECKI(d, 0);
+    } else
+      CHECKI(d, i);
+    i++;
+  }
+  fclose(stream);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/ascii_seek.c b/test/ascii_seek.c
new file mode 100644
index 0000000..3c7f974
--- /dev/null
+++ b/test/ascii_seek.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE* stream;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i\n", i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  CHECKI(n, 40);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/ascii_seek_far.c b/test/ascii_seek_far.c
new file mode 100644
index 0000000..be4aa77
--- /dev/null
+++ b/test/ascii_seek_far.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE* stream;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i\n", i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  CHECKI(n, 256);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/ascii_sync.c b/test/ascii_sync.c
new file mode 100644
index 0000000..7df3fcf
--- /dev/null
+++ b/test/ascii_sync.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  int d, n, e1, e2;
+  int fd, i, r = 0;
+  struct stat buf;
+  FILE* stream;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_TEXT_ENCODED | GD_VERBOSE);
+  gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  n = gd_flush(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1,0);
+  CHECKI(n,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf))
+    return 1;
+
+  stream = fopen(data, "r");
+  i = 0;
+  for (;;) {
+    fscanf(stream, "%i", &d);
+    if (feof(stream))
+      break;
+    if (i < 40 || i > 48) {
+      CHECKI(d, 0);
+    } else
+      CHECKI(d, i);
+    i++;
+  }
+  fclose(stream);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/bof.c b/test/bof.c
index 9a47fec..915722e 100644
--- a/test/bof.c
+++ b/test/bof.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_bof(D, "data");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/bof_bit.c b/test/bof_bit.c
new file mode 100644
index 0000000..4609552
--- /dev/null
+++ b/test/bof_bit.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "data RAW UINT16 2\n"
+    "bit BIT data 1\n"
+    "/FRAMEOFFSET 35\n";
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, strlen(data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_bof(D, "bit");
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 70);
+
+  return r;
+}
diff --git a/test/bof_index.c b/test/bof_index.c
new file mode 100644
index 0000000..26cea8a
--- /dev/null
+++ b/test/bof_index.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 2\n/FRAMEOFFSET 35\n";
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, strlen(data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_bof(D, "INDEX");
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+
+  return r;
+}
diff --git a/test/bof_lincom.c b/test/bof_lincom.c
index 4019260..6cae2e0 100644
--- a/test/bof_lincom.c
+++ b/test/bof_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   error3 = gd_error(D);
   bof_lincom2 = gd_bof(D, "lincom2");
   error4 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/bof_phase.c b/test/bof_phase.c
index ba6075b..0879374 100644
--- a/test/bof_phase.c
+++ b/test/bof_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   error3 = gd_error(D);
   bof_lincom2 = gd_bof(D, "lincom2");
   error4 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/bof_phase_neg.c b/test/bof_phase_neg.c
new file mode 100644
index 0000000..31c6aff
--- /dev/null
+++ b/test/bof_phase_neg.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "data RAW UINT16 5\n"
+    "phase PHASE data 3\n"
+    "/FRAMEOFFSET 35\n"
+    "mult MULTIPLY phase2 phase\n"
+    "mult2 MULTIPLY phase phase2\n"
+    "INCLUDE format1\n";
+  const char *format1_data = "data2 RAW UINT8 3\n"
+    "FRAMEOFFSET 43\n"
+    "phase2 PHASE data2 1000\n";
+  int fd, error1, error2, error3, error4, r = 0;
+  off_t bof_phase, bof_phase2, bof_mult, bof_mult2;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  bof_phase = gd_bof(D, "phase");
+  error1 = gd_error(D);
+  bof_phase2 = gd_bof(D, "phase2");
+  error2 = gd_error(D);
+  bof_mult = gd_bof(D, "mult");
+  error3 = gd_error(D);
+  bof_mult2 = gd_bof(D, "mult2");
+  error4 = gd_error(D);
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(bof_phase, 172);
+  CHECKI(error2, 0);
+  CHECKI(bof_phase2, 0);
+  CHECKI(error3, 0);
+  CHECKI(bof_mult, 103); /* = floor(172 * 3 / 5) */
+  CHECKI(error4, 0);
+  CHECKI(bof_mult2, 172);
+
+  return r;
+}
diff --git a/test/bzip_add.c b/test/bzip_add.c
new file mode 100644
index 0000000..a0d140f
--- /dev/null
+++ b/test/bzip_add.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.bz2";
+  gd_entry_t e;
+  int e1, e2, e3, unlink_data, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_BZIP2_ENCODED);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_BZIP2_ENCODED);
+#endif
+  gd_add_raw(D, "data", GD_UINT8, 2, 0);
+  e1 = gd_error(D);
+
+  /* check */
+  e2 = gd_entry(D, "data", &e);
+#ifdef USE_BZIP2
+  CHECKI(e2, 0);
+  if (e2 == 0) {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+#else
+  CHECKI(e2, -1);
+#endif
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  unlink_data = unlink(data);
+
+#ifdef USE_BZIP2
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+#endif
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_get.c b/test/bzip_get.c
index cda0558..2b39026 100644
--- a/test/bzip_get.c
+++ b/test/bzip_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,8 +43,11 @@ int main(void)
   uint16_t c[8];
   char command[4096];
   uint16_t data_data[256];
-  int fd, n, error, i, r = 0;
+  int fd, n, error, r = 0;
   DIRFILE *D;
+#ifdef USE_BZIP2
+  int i;
+#endif
 
   memset(c, 0, 8);
   rmdirfile();
@@ -74,7 +77,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(bzip2data);
   unlink(format);
diff --git a/test/bzip_get_far.c b/test/bzip_get_far.c
new file mode 100644
index 0000000..e2b345e
--- /dev/null
+++ b/test/bzip_get_far.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *bz2data = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(bz2data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(error, 0);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+#endif
+  CHECKI(n, 0);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_get_get.c b/test/bzip_get_get.c
index a5b311f..6149d13 100644
--- a/test/bzip_get_get.c
+++ b/test/bzip_get_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -33,7 +33,7 @@ int main(void)
   uint16_t c1[8], c2[8];
   char command[4096];
   uint16_t data_data[256];
-  int fd, i, n1, error1, n2, error2, r = 0;
+  int fd, i, n1, e1, e2, n2, e3, r = 0;
   DIRFILE *D;
 
   memset(c1, 0, 16);
@@ -59,27 +59,29 @@ int main(void)
 
   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);
+  CHECKI(n1, 8);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
-  error2 = gd_error(D);
-  gd_close(D);
-
-  unlink(gzipdata);
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error1, 0);
-  CHECKI(error2, 0);
-  CHECKI(n1, 8);
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
   CHECKI(n2, 8);
   for (i = 0; i < 8; ++i) {
     CHECKIi(i,c1[i], 40 + i);
     CHECKIi(i,c2[i], 40 + i);
   }
 
+  gd_discard(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
   return r;
 #endif
 }
diff --git a/test/bzip_get_get2.c b/test/bzip_get_get2.c
new file mode 100644
index 0000000..42c6787
--- /dev/null
+++ b/test/bzip_get_get2.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_BZIP2 || !defined TEST_BZIP2
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *bz2data = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, error1, n2, error2, r = 0;
+  DIRFILE *D;
+
+  memset(c1, 0, 16);
+  memset(c2, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1);
+  error1 = gd_error(D);
+  n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2);
+  error2 = gd_error(D);
+  gd_discard(D);
+
+  unlink(bz2data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKUi(i,c1[i], i);
+    CHECKUi(i,c2[i], i);
+  }
+
+  return r;
+#endif
+}
diff --git a/test/bzip_get_put.c b/test/bzip_get_put.c
new file mode 100644
index 0000000..246fac3
--- /dev/null
+++ b/test/bzip_get_put.c
@@ -0,0 +1,173 @@
+/* Copyright (C) 2014, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_bz2 = "dirfile/data.bz2";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  const unsigned char bz2data[425] = {
+    0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26,
+    0x53, 0x59, 0xb6, 0xb5, 0xee, 0x95, 0x00, 0x00,
+    0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xb0, 0x00, 0xc5, 0x52, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+    0x30, 0x09, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x04,
+    0xc0, 0x04, 0x98, 0x00, 0x26, 0x00, 0x02, 0x60,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x02, 0x4c, 0x00, 0x13, 0x00,
+    0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x08,
+    0x0c, 0x10, 0x14, 0x18, 0x1c, 0x20, 0x24, 0x28,
+    0x2c, 0x30, 0x34, 0x38, 0x3c, 0x40, 0x44, 0x48,
+    0x4c, 0x50, 0x54, 0x58, 0x5c, 0x60, 0x64, 0x68,
+    0x6c, 0x70, 0x74, 0x78, 0x7c, 0x80, 0x84, 0x88,
+    0x8c, 0x90, 0x94, 0x98, 0x9c, 0xa0, 0xa4, 0xa8,
+    0xac, 0xb0, 0xb4, 0xb8, 0xbc, 0xc0, 0xc4, 0xc8,
+    0xcc, 0xd0, 0xd4, 0xd8, 0xdc, 0xe0, 0xe4, 0xe8,
+    0xec, 0xf0, 0xf4, 0xf8, 0xfd, 0x01, 0x05, 0x09,
+    0x0d, 0x11, 0x15, 0x19, 0x1d, 0x21, 0x25, 0x29,
+    0x2d, 0x31, 0x35, 0x39, 0x3d, 0x41, 0x45, 0x49,
+    0x4d, 0x51, 0x55, 0x59, 0x5d, 0x61, 0x65, 0x69,
+    0x6d, 0x71, 0x75, 0x79, 0x7d, 0x81, 0x85, 0x89,
+    0x8d, 0x91, 0x85, 0x89, 0x8d, 0x91, 0x95, 0x99,
+    0x9d, 0xa1, 0xa5, 0xa9, 0xad, 0xb1, 0xb5, 0xb9,
+    0xbd, 0xc1, 0xc5, 0xc9, 0xcd, 0xd1, 0xd5, 0xd9,
+    0xdd, 0xe1, 0xe5, 0xe9, 0xed, 0xf1, 0xf5, 0xf9,
+    0xfe, 0x02, 0x06, 0x0a, 0x0e, 0x12, 0x16, 0x1a,
+    0x1e, 0x22, 0x26, 0x2a, 0x2e, 0x32, 0x36, 0x3a,
+    0x3e, 0x42, 0x46, 0x4a, 0x56, 0x5a, 0x5e, 0x62,
+    0x66, 0x6a, 0x6e, 0x72, 0x76, 0x7a, 0x7e, 0x82,
+    0x86, 0x8a, 0x8e, 0x92, 0x96, 0x9a, 0x9e, 0xa2,
+    0xa6, 0xaa, 0xae, 0xb2, 0xb6, 0xba, 0xbe, 0xc2,
+    0xc6, 0xca, 0xce, 0xd2, 0xd6, 0xda, 0xde, 0xe2,
+    0xe6, 0xea, 0xee, 0xf2, 0xf6, 0xfa, 0xff, 0x03,
+    0x07, 0x0b, 0x0f, 0x13, 0x17, 0x1b, 0x17, 0x1b,
+    0x1f, 0x23, 0x27, 0x2b, 0x2f, 0x33, 0x37, 0x3b,
+    0x3f, 0x43, 0x47, 0x4b, 0x4f, 0x53, 0x57, 0x5b,
+    0x5f, 0x63, 0x67, 0x6b, 0x6f, 0x73, 0x77, 0x7b,
+    0x7f, 0x83, 0x87, 0x8b, 0x8f, 0x93, 0x97, 0x9b,
+    0x9f, 0xa3, 0xa7, 0xab, 0xaf, 0xb3, 0xb7, 0xbb,
+    0xbf, 0xc3, 0xc7, 0xcb, 0xcf, 0xd3, 0xd7, 0xdb,
+    0xdf, 0xe3, 0xe7, 0xeb, 0xef, 0xf3, 0xf4, 0x5d,
+    0xc9, 0x14, 0xe1, 0x42, 0x42, 0xda, 0xd7, 0xba,
+    0x54
+  };
+  uint8_t c[8], d[8];
+#ifdef USE_BZIP2
+  uint8_t b;
+  char command[4096];
+#endif
+  int fd, i, m, n, e1, e2, e3, unlink_data, unlink_databz2, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    d[i] = (uint8_t)(80 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_bz2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, bz2data, 425);
+  close(fd);
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  m = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
+  e2 = gd_error(D);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+#ifdef USE_BZIP2
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &b, sizeof(uint8_t))) {
+        if (i < 40 || i >= 48) {
+          CHECKIi(i, b, i);
+        } else
+          CHECKIi(i, b, i + 40);
+        i++;
+      }
+      CHECKI(i, 256);
+      close(fd);
+    }
+  }
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 40 + i);
+#endif
+
+  unlink_data = unlink(data);
+  unlink_databz2 = unlink(data_bz2);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_databz2, -1);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_databz2, 0);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(e2, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(m, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/bzip_move_from.c b/test/bzip_move_from.c
index e073f93..05f4cc6 100644
--- a/test/bzip_move_from.c
+++ b/test/bzip_move_from.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test move */
 #include "test.h"
 
 #include <stdlib.h>
@@ -44,11 +43,14 @@ int main(void)
     "/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;
+  int fd, ret, e1, e2, ge_ret, unlink_data, unlink_bz2data, r = 0;
   char command[4096];
   gd_entry_t E;
   DIRFILE *D;
+#ifdef USE_BZIP2
   uint16_t d;
+  int i = 0;
+#endif
 
   rmdirfile();
   mkdir(filedir, 0777);
@@ -79,9 +81,12 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
 #endif
   ret = gd_move(D, "data", 1, 1);
-  error = gd_error(D);
+  e1 = gd_error(D);
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  CHECKI(ge_ret, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
 #ifdef USE_BZIP2
   fd = open(data, O_RDONLY | O_BINARY);
@@ -106,15 +111,13 @@ int main(void)
 
 #ifdef USE_BZIP2
   CHECKI(ret, 0);
-  CHECKI(error, GD_E_OK);
-  CHECKI(ge_ret, 0);
+  CHECKI(e1, GD_E_OK);
   CHECKI(E.fragment_index, 1);
   CHECKI(unlink_data, 0);
   CHECKI(unlink_bz2data, -1);
 #else
   CHECKI(ret, -1);
-  CHECKI(error, GD_E_UNSUPPORTED);
-  CHECKI(ge_ret, 0);
+  CHECKI(e1, GD_E_UNSUPPORTED);
   CHECKI(E.fragment_index, 0);
   CHECKI(unlink_data, -1);
   CHECKI(unlink_bz2data, 0);
diff --git a/test/bzip_move_to.c b/test/bzip_move_to.c
new file mode 100644
index 0000000..b6dc4ed
--- /dev/null
+++ b/test/bzip_move_to.c
@@ -0,0 +1,111 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_bz2 = "dirfile/data.bz2";
+  const char *data_raw = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n";
+  uint8_t data_in[256];
+  DIRFILE *D;
+#ifdef USE_BZIP2
+  uint8_t d;
+  char command[4096];
+  int i;
+#endif
+  int fd, e1, e2, unlink_raw, r = 0;
+  struct stat buf;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  for (fd = 0; fd < 256; ++fd)
+    data_in[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_in, 256);
+  close(fd);
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR);
+#endif
+  gd_alter_encoding(D, GD_BZIP2_ENCODED, 0, 1);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+#ifdef USE_BZIP2
+  if (stat(data_bz2, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(stat(data_raw, &buf), -1);
+#else
+  if (stat(data_raw, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(stat(data_bz2, &buf), -1);
+#endif
+
+#ifdef USE_BZIP2
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    fprintf(stderr, "command failed: %s\n", command);
+    r = 1;
+  } else {
+    fd = open(data_raw, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 256);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_raw = unlink(data_raw);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_raw, 0);
+#ifdef USE_BZIP2
+  CHECKI(e1, GD_E_OK);
+#else
+  CHECKI(e1, GD_E_UNSUPPORTED);
+#endif
+
+  return r;
+}
diff --git a/test/bzip_nframes.c b/test/bzip_nframes.c
index a45688c..c0f2f23 100644
--- a/test/bzip_nframes.c
+++ b/test/bzip_nframes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
 #endif
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(gzipdata);
   unlink(format);
diff --git a/test/bzip_put.c b/test/bzip_put.c
new file mode 100644
index 0000000..9006025
--- /dev/null
+++ b/test/bzip_put.c
@@ -0,0 +1,115 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_bz2 = "dirfile/data.bz2";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+#ifdef USE_BZIP2
+  char command[4096];
+  uint8_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, unlink_data, unlink_bz2, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_bz2, &buf);
+#ifdef USE_BZIP2
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_BZIP2
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_bz2 = unlink(data_bz2);
+  CHECKI(unlink_bz2, -1);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/bzip_put_back.c b/test/bzip_put_back.c
new file mode 100644
index 0000000..15e425f
--- /dev/null
+++ b/test/bzip_put_back.c
@@ -0,0 +1,101 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if ! (defined TEST_BZIP2) || ! (defined USE_BZIP2)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_bz2 = "dirfile/data.bz2";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+
+  n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_bz2, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_put_endian.c b/test/bzip_put_endian.c
new file mode 100644
index 0000000..0476998
--- /dev/null
+++ b/test/bzip_put_endian.c
@@ -0,0 +1,117 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_bz2 = "dirfile/data.bz2";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n"
+#ifdef WORDS_BIGENDIAN
+  "ENDIAN little\n";
+#else
+  "ENDIAN big\n";
+#endif
+  uint16_t c[8];
+#ifdef USE_BZIP2
+  char command[4096];
+  uint16_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint16_t)(0x102 * i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_bz2, &buf);
+#ifdef USE_BZIP2
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_BZIP2
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint16_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, 0x201 * (i - 40));
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/bzip_put_get.c b/test/bzip_put_get.c
new file mode 100644
index 0000000..1b4eb7a
--- /dev/null
+++ b/test/bzip_put_get.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d[8];
+  int fd, i, m, n, e1, e2, e3, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
+  e2 = gd_error(D);
+
+  for (i = 0; i < m; ++i)
+    CHECKIi(i, d[i], c[i]);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(e2, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(m, 0);
+#endif
+  
+  return r;
+#endif
+}
diff --git a/test/bzip_put_pad.c b/test/bzip_put_pad.c
new file mode 100644
index 0000000..7b4e11e
--- /dev/null
+++ b/test/bzip_put_pad.c
@@ -0,0 +1,103 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if ! (defined TEST_BZIP2) || ! (defined USE_BZIP2)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_bz2 = "dirfile/data.bz2";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+  n2 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_bz2, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_put_sub.c b/test/bzip_put_sub.c
new file mode 100644
index 0000000..efdbd9e
--- /dev/null
+++ b/test/bzip_put_sub.c
@@ -0,0 +1,111 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if ! (defined TEST_BZIP2) || ! (defined USE_BZIP2)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *data_bz2 = "dirfile/sub/data.bz2";
+  const char *data = "dirfile/sub/data";
+  const char *format_data = "/INCLUDE sub/format1\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+
+  n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_bz2, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_seek.c b/test/bzip_seek.c
new file mode 100644
index 0000000..35975aa
--- /dev/null
+++ b/test/bzip_seek.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_BZIP2 || !defined TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *bzip2data = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  char command[4096];
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  error = gd_error(D);
+
+  CHECKI(n, 40);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(bzip2data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_seek_far.c b/test/bzip_seek_far.c
new file mode 100644
index 0000000..65aea84
--- /dev/null
+++ b/test/bzip_seek_far.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_BZIP2 || !defined TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *bzip2data = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  char command[4096];
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  error = gd_error(D);
+
+  CHECKI(n, 256);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(bzip2data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_sync.c b/test/bzip_sync.c
new file mode 100644
index 0000000..1d1383e
--- /dev/null
+++ b/test/bzip_sync.c
@@ -0,0 +1,93 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_BZIP2 || !defined USE_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_bz2 = "dirfile/data.bz2";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE);
+  gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  n = gd_flush(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_bz2, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/close.c b/test/close_close.c
similarity index 100%
rename from test/close.c
rename to test/close_close.c
diff --git a/test/close_discard.c b/test/close_discard.c
index 0deaf91..5bc78bb 100644
--- a/test/close_discard.c
+++ b/test/close_discard.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
   ret = gd_discard(D);
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_nfields(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_complex128_complex64.c b/test/convert_complex128_complex64.c
index 2ad1ad1..ea82149 100644
--- a/test/convert_complex128_complex64.c
+++ b/test/convert_complex128_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -71,7 +71,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_complex128_float64.c b/test/convert_complex128_float64.c
index 8fed12e..751dbd5 100644
--- a/test/convert_complex128_float64.c
+++ b/test/convert_complex128_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n2 = gd_get_constant(D, "data", GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/convert_complex128_int64.c b/test/convert_complex128_int64.c
index 5593cb0..2e22ee1 100644
--- a/test/convert_complex128_int64.c
+++ b/test/convert_complex128_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n2 = gd_get_constant(D, "data", GD_INT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/convert_complex128_uint64.c b/test/convert_complex128_uint64.c
index c28e6fe..b5954e1 100644
--- a/test/convert_complex128_uint64.c
+++ b/test/convert_complex128_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n2 = gd_get_constant(D, "data", GD_UINT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/convert_complex64_complex128.c b/test/convert_complex64_complex128.c
index 1992383..d4c84d9 100644
--- a/test/convert_complex64_complex128.c
+++ b/test/convert_complex64_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_complex64_float64.c b/test/convert_complex64_float64.c
index a084481..8702b9c 100644
--- a/test/convert_complex64_float64.c
+++ b/test/convert_complex64_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n2 = gd_get_constant(D, "data", GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/convert_complex64_int64.c b/test/convert_complex64_int64.c
index ba087cd..0786021 100644
--- a/test/convert_complex64_int64.c
+++ b/test/convert_complex64_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n2 = gd_get_constant(D, "data", GD_INT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/convert_complex64_uint64.c b/test/convert_complex64_uint64.c
index e749544..23c0bed 100644
--- a/test/convert_complex64_uint64.c
+++ b/test/convert_complex64_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n2 = gd_get_constant(D, "data", GD_UINT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/convert_float32_complex128.c b/test/convert_float32_complex128.c
index b515d78..378954c 100644
--- a/test/convert_float32_complex128.c
+++ b/test/convert_float32_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_float32_complex64.c b/test/convert_float32_complex64.c
index 43bd1ee..100b5fc 100644
--- a/test/convert_float32_complex64.c
+++ b/test/convert_float32_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_float32_float64.c b/test/convert_float32_float64.c
index 6d40682..82d6ced 100644
--- a/test/convert_float32_float64.c
+++ b/test/convert_float32_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_int16.c b/test/convert_float32_int16.c
index 49296b8..acc565e 100644
--- a/test/convert_float32_int16.c
+++ b/test/convert_float32_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_int32.c b/test/convert_float32_int32.c
index 1416b2c..eb1b11d 100644
--- a/test/convert_float32_int32.c
+++ b/test/convert_float32_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_int64.c b/test/convert_float32_int64.c
index fe1af6b..3302eb8 100644
--- a/test/convert_float32_int64.c
+++ b/test/convert_float32_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_int8.c b/test/convert_float32_int8.c
index 030cec1..601f42d 100644
--- a/test/convert_float32_int8.c
+++ b/test/convert_float32_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_uint16.c b/test/convert_float32_uint16.c
index 7d1cd74..4d1d9a8 100644
--- a/test/convert_float32_uint16.c
+++ b/test/convert_float32_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_uint32.c b/test/convert_float32_uint32.c
index 71244b8..859ec79 100644
--- a/test/convert_float32_uint32.c
+++ b/test/convert_float32_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_uint64.c b/test/convert_float32_uint64.c
index 6bbc08a..fe1728a 100644
--- a/test/convert_float32_uint64.c
+++ b/test/convert_float32_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float32_uint8.c b/test/convert_float32_uint8.c
index 6652fde..4d6e76a 100644
--- a/test/convert_float32_uint8.c
+++ b/test/convert_float32_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_complex128.c b/test/convert_float64_complex128.c
index 5576028..473ef7a 100644
--- a/test/convert_float64_complex128.c
+++ b/test/convert_float64_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_float64_complex64.c b/test/convert_float64_complex64.c
index 99d5ef5..60cdacd 100644
--- a/test/convert_float64_complex64.c
+++ b/test/convert_float64_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_float64_float32.c b/test/convert_float64_float32.c
index 6986a01..c6b2bf3 100644
--- a/test/convert_float64_float32.c
+++ b/test/convert_float64_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_int16.c b/test/convert_float64_int16.c
index 5e7bcdf..ed54692 100644
--- a/test/convert_float64_int16.c
+++ b/test/convert_float64_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_int32.c b/test/convert_float64_int32.c
index 909dd40..c3dd05b 100644
--- a/test/convert_float64_int32.c
+++ b/test/convert_float64_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_int64.c b/test/convert_float64_int64.c
index 59a84c8..981899f 100644
--- a/test/convert_float64_int64.c
+++ b/test/convert_float64_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_int8.c b/test/convert_float64_int8.c
index 7657f06..a9c6f0f 100644
--- a/test/convert_float64_int8.c
+++ b/test/convert_float64_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_uint16.c b/test/convert_float64_uint16.c
index beaf983..9079eb4 100644
--- a/test/convert_float64_uint16.c
+++ b/test/convert_float64_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_uint32.c b/test/convert_float64_uint32.c
index 9df3d8d..f5c8e71 100644
--- a/test/convert_float64_uint32.c
+++ b/test/convert_float64_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_uint64.c b/test/convert_float64_uint64.c
index 173ffc5..c9d9865 100644
--- a/test/convert_float64_uint64.c
+++ b/test/convert_float64_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_float64_uint8.c b/test/convert_float64_uint8.c
index 7785fc8..cc019d5 100644
--- a/test/convert_float64_uint8.c
+++ b/test/convert_float64_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_complex128.c b/test/convert_int16_complex128.c
index d9562b2..53ec7af 100644
--- a/test/convert_int16_complex128.c
+++ b/test/convert_int16_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int16_complex64.c b/test/convert_int16_complex64.c
index f00a3ce..fd8fd45 100644
--- a/test/convert_int16_complex64.c
+++ b/test/convert_int16_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int16_float32.c b/test/convert_int16_float32.c
index 70c3124..fd7d860 100644
--- a/test/convert_int16_float32.c
+++ b/test/convert_int16_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_float64.c b/test/convert_int16_float64.c
index fb32a2c..251342b 100644
--- a/test/convert_int16_float64.c
+++ b/test/convert_int16_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_int32.c b/test/convert_int16_int32.c
index 81fdb76..a217345 100644
--- a/test/convert_int16_int32.c
+++ b/test/convert_int16_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_int64.c b/test/convert_int16_int64.c
index 41a5ced..3c985a6 100644
--- a/test/convert_int16_int64.c
+++ b/test/convert_int16_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_int8.c b/test/convert_int16_int8.c
index 574ccb7..5ead07d 100644
--- a/test/convert_int16_int8.c
+++ b/test/convert_int16_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_uint16.c b/test/convert_int16_uint16.c
index d3cc2f5..87e0923 100644
--- a/test/convert_int16_uint16.c
+++ b/test/convert_int16_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_uint32.c b/test/convert_int16_uint32.c
index 678e647..275cf80 100644
--- a/test/convert_int16_uint32.c
+++ b/test/convert_int16_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_uint64.c b/test/convert_int16_uint64.c
index 76f4233..ed60806 100644
--- a/test/convert_int16_uint64.c
+++ b/test/convert_int16_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int16_uint8.c b/test/convert_int16_uint8.c
index 31a65f9..f57a696 100644
--- a/test/convert_int16_uint8.c
+++ b/test/convert_int16_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_complex128.c b/test/convert_int32_complex128.c
index 2c221e5..dc6e8b9 100644
--- a/test/convert_int32_complex128.c
+++ b/test/convert_int32_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int32_complex64.c b/test/convert_int32_complex64.c
index 44e9ee0..0fd722a 100644
--- a/test/convert_int32_complex64.c
+++ b/test/convert_int32_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int32_float32.c b/test/convert_int32_float32.c
index fb891cb..71e5aae 100644
--- a/test/convert_int32_float32.c
+++ b/test/convert_int32_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_float64.c b/test/convert_int32_float64.c
index 1df0ede..4a9087f 100644
--- a/test/convert_int32_float64.c
+++ b/test/convert_int32_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_int16.c b/test/convert_int32_int16.c
index b63131a..bd58c4a 100644
--- a/test/convert_int32_int16.c
+++ b/test/convert_int32_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_int64.c b/test/convert_int32_int64.c
index 57d36dd..96358fa 100644
--- a/test/convert_int32_int64.c
+++ b/test/convert_int32_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_int8.c b/test/convert_int32_int8.c
index 1610c25..eebe2ae 100644
--- a/test/convert_int32_int8.c
+++ b/test/convert_int32_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_uint16.c b/test/convert_int32_uint16.c
index 9790ff1..5a1c9a0 100644
--- a/test/convert_int32_uint16.c
+++ b/test/convert_int32_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_uint32.c b/test/convert_int32_uint32.c
index 433da6a..1083661 100644
--- a/test/convert_int32_uint32.c
+++ b/test/convert_int32_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_uint64.c b/test/convert_int32_uint64.c
index dc53606..b2fc4fb 100644
--- a/test/convert_int32_uint64.c
+++ b/test/convert_int32_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int32_uint8.c b/test/convert_int32_uint8.c
index 345eae3..d14c40c 100644
--- a/test/convert_int32_uint8.c
+++ b/test/convert_int32_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_complex128.c b/test/convert_int64_complex128.c
index 9408b4f..b95a729 100644
--- a/test/convert_int64_complex128.c
+++ b/test/convert_int64_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int64_complex64.c b/test/convert_int64_complex64.c
index 0828bcb..be6982b 100644
--- a/test/convert_int64_complex64.c
+++ b/test/convert_int64_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int64_float32.c b/test/convert_int64_float32.c
index 05729cb..6a367a3 100644
--- a/test/convert_int64_float32.c
+++ b/test/convert_int64_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_float64.c b/test/convert_int64_float64.c
index 99ac47f..bba0c94 100644
--- a/test/convert_int64_float64.c
+++ b/test/convert_int64_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_int16.c b/test/convert_int64_int16.c
index 1b02322..ca695cf 100644
--- a/test/convert_int64_int16.c
+++ b/test/convert_int64_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_int32.c b/test/convert_int64_int32.c
index 09a0616..4ad74d8 100644
--- a/test/convert_int64_int32.c
+++ b/test/convert_int64_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_int8.c b/test/convert_int64_int8.c
index 863917d..04bd504 100644
--- a/test/convert_int64_int8.c
+++ b/test/convert_int64_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_uint16.c b/test/convert_int64_uint16.c
index d94af54..1941566 100644
--- a/test/convert_int64_uint16.c
+++ b/test/convert_int64_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_uint32.c b/test/convert_int64_uint32.c
index a0bef2b..1d9b8cf 100644
--- a/test/convert_int64_uint32.c
+++ b/test/convert_int64_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_uint64.c b/test/convert_int64_uint64.c
index 8f38764..98b3798 100644
--- a/test/convert_int64_uint64.c
+++ b/test/convert_int64_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int64_uint8.c b/test/convert_int64_uint8.c
index 246ae3c..4d0e9ee 100644
--- a/test/convert_int64_uint8.c
+++ b/test/convert_int64_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_complex128.c b/test/convert_int8_complex128.c
index 041d0af..c476511 100644
--- a/test/convert_int8_complex128.c
+++ b/test/convert_int8_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int8_complex64.c b/test/convert_int8_complex64.c
index a77049b..c3f142a 100644
--- a/test/convert_int8_complex64.c
+++ b/test/convert_int8_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_int8_float32.c b/test/convert_int8_float32.c
index fa1b7f6..8f03ca6 100644
--- a/test/convert_int8_float32.c
+++ b/test/convert_int8_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_float64.c b/test/convert_int8_float64.c
index b11420e..43bd87e 100644
--- a/test/convert_int8_float64.c
+++ b/test/convert_int8_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_int16.c b/test/convert_int8_int16.c
index 8c0bc6e..31a61f9 100644
--- a/test/convert_int8_int16.c
+++ b/test/convert_int8_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_int32.c b/test/convert_int8_int32.c
index 34993b8..0916a78 100644
--- a/test/convert_int8_int32.c
+++ b/test/convert_int8_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_int64.c b/test/convert_int8_int64.c
index 19112cc..501eda6 100644
--- a/test/convert_int8_int64.c
+++ b/test/convert_int8_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_uint16.c b/test/convert_int8_uint16.c
index 6c6b93a..a47656b 100644
--- a/test/convert_int8_uint16.c
+++ b/test/convert_int8_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_uint32.c b/test/convert_int8_uint32.c
index 22efe90..a12c78c 100644
--- a/test/convert_int8_uint32.c
+++ b/test/convert_int8_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_uint64.c b/test/convert_int8_uint64.c
index 26445c7..2f904c2 100644
--- a/test/convert_int8_uint64.c
+++ b/test/convert_int8_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_int8_uint8.c b/test/convert_int8_uint8.c
index 326d546..a4a1fe0 100644
--- a/test/convert_int8_uint8.c
+++ b/test/convert_int8_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_complex128.c b/test/convert_uint16_complex128.c
index 178ec27..10550eb 100644
--- a/test/convert_uint16_complex128.c
+++ b/test/convert_uint16_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint16_complex64.c b/test/convert_uint16_complex64.c
index c3dcedc..685c28b 100644
--- a/test/convert_uint16_complex64.c
+++ b/test/convert_uint16_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint16_float32.c b/test/convert_uint16_float32.c
index ee3cee9..fdc88bf 100644
--- a/test/convert_uint16_float32.c
+++ b/test/convert_uint16_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_float64.c b/test/convert_uint16_float64.c
index 0731c7d..f4d575f 100644
--- a/test/convert_uint16_float64.c
+++ b/test/convert_uint16_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_int16.c b/test/convert_uint16_int16.c
index e28eb72..576383c 100644
--- a/test/convert_uint16_int16.c
+++ b/test/convert_uint16_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_int32.c b/test/convert_uint16_int32.c
index 147ccc5..dbc164b 100644
--- a/test/convert_uint16_int32.c
+++ b/test/convert_uint16_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_int64.c b/test/convert_uint16_int64.c
index 4811ce0..d83802b 100644
--- a/test/convert_uint16_int64.c
+++ b/test/convert_uint16_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_int8.c b/test/convert_uint16_int8.c
index f2376ba..b0b4c89 100644
--- a/test/convert_uint16_int8.c
+++ b/test/convert_uint16_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_uint32.c b/test/convert_uint16_uint32.c
index aca283c..cfc0558 100644
--- a/test/convert_uint16_uint32.c
+++ b/test/convert_uint16_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_uint64.c b/test/convert_uint16_uint64.c
index 0b2c6d2..3ec192c 100644
--- a/test/convert_uint16_uint64.c
+++ b/test/convert_uint16_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint16_uint8.c b/test/convert_uint16_uint8.c
index 294ba5c..01cd6ff 100644
--- a/test/convert_uint16_uint8.c
+++ b/test/convert_uint16_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_complex128.c b/test/convert_uint32_complex128.c
index 8861fdf..efdb8c3 100644
--- a/test/convert_uint32_complex128.c
+++ b/test/convert_uint32_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint32_complex64.c b/test/convert_uint32_complex64.c
index 6749c2a..583cb30 100644
--- a/test/convert_uint32_complex64.c
+++ b/test/convert_uint32_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint32_float32.c b/test/convert_uint32_float32.c
index a6ee729..5611b72 100644
--- a/test/convert_uint32_float32.c
+++ b/test/convert_uint32_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_float64.c b/test/convert_uint32_float64.c
index 056d90e..833ca76 100644
--- a/test/convert_uint32_float64.c
+++ b/test/convert_uint32_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_int16.c b/test/convert_uint32_int16.c
index b0f288a..69f211b 100644
--- a/test/convert_uint32_int16.c
+++ b/test/convert_uint32_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_int32.c b/test/convert_uint32_int32.c
index b0762f2..6697211 100644
--- a/test/convert_uint32_int32.c
+++ b/test/convert_uint32_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_int64.c b/test/convert_uint32_int64.c
index 165540f..8323e60 100644
--- a/test/convert_uint32_int64.c
+++ b/test/convert_uint32_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_int8.c b/test/convert_uint32_int8.c
index 072d48e..a8be846 100644
--- a/test/convert_uint32_int8.c
+++ b/test/convert_uint32_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_uint16.c b/test/convert_uint32_uint16.c
index 7b746f6..466307f 100644
--- a/test/convert_uint32_uint16.c
+++ b/test/convert_uint32_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_uint64.c b/test/convert_uint32_uint64.c
index 073836e..049a480 100644
--- a/test/convert_uint32_uint64.c
+++ b/test/convert_uint32_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint32_uint8.c b/test/convert_uint32_uint8.c
index b1d8112..fd7bad4 100644
--- a/test/convert_uint32_uint8.c
+++ b/test/convert_uint32_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_complex128.c b/test/convert_uint64_complex128.c
index 8c3deb0..a24a4c5 100644
--- a/test/convert_uint64_complex128.c
+++ b/test/convert_uint64_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint64_complex64.c b/test/convert_uint64_complex64.c
index dc4e06a..3c16823 100644
--- a/test/convert_uint64_complex64.c
+++ b/test/convert_uint64_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint64_float32.c b/test/convert_uint64_float32.c
index 83a60a4..5b52d20 100644
--- a/test/convert_uint64_float32.c
+++ b/test/convert_uint64_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_float64.c b/test/convert_uint64_float64.c
index 6c7480e..ac40225 100644
--- a/test/convert_uint64_float64.c
+++ b/test/convert_uint64_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_int16.c b/test/convert_uint64_int16.c
index a18a32a..5a12715 100644
--- a/test/convert_uint64_int16.c
+++ b/test/convert_uint64_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_int32.c b/test/convert_uint64_int32.c
index cf3c960..7f77e09 100644
--- a/test/convert_uint64_int32.c
+++ b/test/convert_uint64_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_int64.c b/test/convert_uint64_int64.c
index 696f92e..6bcfb7e 100644
--- a/test/convert_uint64_int64.c
+++ b/test/convert_uint64_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_int8.c b/test/convert_uint64_int8.c
index 9f1039c..e0bfbb1 100644
--- a/test/convert_uint64_int8.c
+++ b/test/convert_uint64_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_uint16.c b/test/convert_uint64_uint16.c
index fd70f38..627c524 100644
--- a/test/convert_uint64_uint16.c
+++ b/test/convert_uint64_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_uint32.c b/test/convert_uint64_uint32.c
index d01edf8..4ee2c32 100644
--- a/test/convert_uint64_uint32.c
+++ b/test/convert_uint64_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint64_uint8.c b/test/convert_uint64_uint8.c
index 2d2aa9d..3f95b8d 100644
--- a/test/convert_uint64_uint8.c
+++ b/test/convert_uint64_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_complex128.c b/test/convert_uint8_complex128.c
index f4f9d32..240247c 100644
--- a/test/convert_uint8_complex128.c
+++ b/test/convert_uint8_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     double v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex double v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint8_complex64.c b/test/convert_uint8_complex64.c
index b4fb472..03dd9d7 100644
--- a/test/convert_uint8_complex64.c
+++ b/test/convert_uint8_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -77,7 +77,8 @@ int main(void)
     float v[] = {40 + i, 0};
     CHECKCi(i,c + 2 * i, v);
 #else
-    CHECKCi(i,c[i], 40 + i);
+    _Complex float v = 40 + i;
+    CHECKCi(i,c[i], v);
 #endif
   }
 
diff --git a/test/convert_uint8_float32.c b/test/convert_uint8_float32.c
index 8775b6b..17b40e8 100644
--- a/test/convert_uint8_float32.c
+++ b/test/convert_uint8_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_float64.c b/test/convert_uint8_float64.c
index ace524b..4e3a097 100644
--- a/test/convert_uint8_float64.c
+++ b/test/convert_uint8_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_int16.c b/test/convert_uint8_int16.c
index 2fa87b1..f804500 100644
--- a/test/convert_uint8_int16.c
+++ b/test/convert_uint8_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_int32.c b/test/convert_uint8_int32.c
index 4299405..2adccc7 100644
--- a/test/convert_uint8_int32.c
+++ b/test/convert_uint8_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_int64.c b/test/convert_uint8_int64.c
index 4c4ead4..c73abab 100644
--- a/test/convert_uint8_int64.c
+++ b/test/convert_uint8_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_int8.c b/test/convert_uint8_int8.c
index 7ea9bb6..c750476 100644
--- a/test/convert_uint8_int8.c
+++ b/test/convert_uint8_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_uint16.c b/test/convert_uint8_uint16.c
index ce05591..51a4a83 100644
--- a/test/convert_uint8_uint16.c
+++ b/test/convert_uint8_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_uint32.c b/test/convert_uint8_uint32.c
index 9a470a5..01a5125 100644
--- a/test/convert_uint8_uint32.c
+++ b/test/convert_uint8_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/convert_uint8_uint64.c b/test/convert_uint8_uint64.c
index 6c94a81..71db28a 100644
--- a/test/convert_uint8_uint64.c
+++ b/test/convert_uint8_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/creat.c b/test/creat.c
index 95d142b..16d4342 100644
--- a/test/creat.c
+++ b/test/creat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Creating a dirfile should succeed cleanly */
 #include "test.h"
 
 #include <stdlib.h>
@@ -32,20 +31,22 @@ int main(void)
 {
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
-  int error, unlink_ret, rmdir_ret, r = 0;
+  int e1, e2, unlink_ret, rmdir_ret, r = 0;
   DIRFILE *D;
 
   rmdirfile();
   D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
-  error = gd_error(D);
-  gd_close(D);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   unlink_ret = unlink(format);
   rmdir_ret = rmdir(filedir);
 
   CHECKI(unlink_ret, 0);
   CHECKI(rmdir_ret, 0);
-  CHECKI(error, GD_E_OK);
   
   return r;
 }
diff --git a/test/creat_excl.c b/test/creat_excl.c
index 6f854e9..caff259 100644
--- a/test/creat_excl.c
+++ b/test/creat_excl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -40,7 +40,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/creat_rdonly.c b/test/creat_rdonly.c
index 33e2683..109d636 100644
--- a/test/creat_rdonly.c
+++ b/test/creat_rdonly.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Creating a read-only dirfile should fail cleanly */
 #include "test.h"
 
 #include <stdlib.h>
@@ -32,20 +31,24 @@ int main(void)
 {
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
-  int error, unlink_ret, rmdir_ret, r = 0;
+  int e1, e2, unlink_ret, rmdir_ret, r = 0;
   DIRFILE *D;
 
   rmdirfile();
-  D = gd_open(filedir, GD_RDONLY | GD_CREAT);
-  error = gd_error(D);
-  gd_close(D);
+  D = gd_open(filedir, GD_RDONLY | GD_CREAT | GD_VERBOSE);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  e2 = gd_add_spec(D, "test CONST UINT8 1", 0);
+  CHECKI(e2, 0);
+
+  gd_discard(D);
 
   unlink_ret = unlink(format);
   rmdir_ret = rmdir(filedir);
 
-  CHECKI(unlink_ret, -1);
-  CHECKI(rmdir_ret, -1);
-  CHECKI(error, GD_E_ACCMODE);
+  CHECKI(unlink_ret, 0);
+  CHECKI(rmdir_ret, 0);
 
   return r;
 }
diff --git a/test/creat_rdonly_exists.c b/test/creat_rdonly_exists.c
new file mode 100644
index 0000000..06b02be
--- /dev/null
+++ b/test/creat_rdonly_exists.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_CREAT);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  gd_add_spec(D, "test CONST UINT8 1", 0);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_ACCMODE);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist.c b/test/cvlist.c
index 23b3331..757573b 100644
--- a/test/cvlist.c
+++ b/test/cvlist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
     for (fd = 0; fd < 3; ++fd)
       CHECKUi(fd,field_list[fd], fd + 1);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_array.c b/test/cvlist_array.c
index 5080a1c..a24bb04 100644
--- a/test/cvlist_array.c
+++ b/test/cvlist_array.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,7 +67,7 @@ int main(void)
         CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1));
     }
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_array0.c b/test/cvlist_array0.c
new file mode 100644
index 0000000..63195c5
--- /dev/null
+++ b/test/cvlist_array0.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data4 RAW UINT8 1\n";
+  int fd, error, r = 0;
+  gd_carray_t *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (gd_carray_t*)gd_carrays(D, GD_UINT8);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKU(field_list[0].n, 0);
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array_free.c b/test/cvlist_array_free.c
new file mode 100644
index 0000000..f342386
--- /dev/null
+++ b/test/cvlist_array_free.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 CARRAY UINT8 1 2 3 4 5\n"
+    "data2 CARRAY UINT8 2 4 6 8 10 12\n"
+    "data4 RAW UINT8 1\n";
+  int fd, e1, e2, r = 0;
+  size_t i;
+  struct uint8_carrays {
+    size_t n;
+    uint8_t *d;
+  } *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8);
+  e1 = gd_error(D);
+
+  CHECKI(e1, 0);
+
+  if (!r)
+    for (fd = 0; fd < 2; ++fd) {
+      CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1));
+    }
+
+  gd_add_spec(D, "data3 CARRAY UINT8 3 6 9 12 15 18 21", 0);
+
+  field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8);
+  e2 = gd_error(D);
+
+  CHECKI(e2, 0);
+
+  if (!r)
+    for (fd = 0; fd < 3; ++fd) {
+      CHECKUi(fd * 2000,field_list[fd].n, (size_t)(5 + fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 3000 + i,field_list[fd].d[i], (fd + 1) * (i + 1));
+    }
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array_hidden.c b/test/cvlist_array_hidden.c
index 6db4de0..49e8b33 100644
--- a/test/cvlist_array_hidden.c
+++ b/test/cvlist_array_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
         CHECKUi(fd * 1000 + i,field_list[fd].d[i], (2 * fd + 1) * (i + 1));
     }
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_array_meta.c b/test/cvlist_array_meta.c
index 7b8e378..8cc340b 100644
--- a/test/cvlist_array_meta.c
+++ b/test/cvlist_array_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -68,7 +68,7 @@ int main(void)
     }
 
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_array_meta0.c b/test/cvlist_array_meta0.c
new file mode 100644
index 0000000..50c9547
--- /dev/null
+++ b/test/cvlist_array_meta0.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent CARRAY UINT8 1\n"
+    "META parent data4 LINTERP UINT8 1\n";
+  int fd, r = 0;
+  size_t error;
+  gd_carray_t *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (gd_carray_t *)gd_mcarrays(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+  CHECKI(field_list[0].n, 0);
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array_meta_free.c b/test/cvlist_array_meta_free.c
new file mode 100644
index 0000000..c12abdb
--- /dev/null
+++ b/test/cvlist_array_meta_free.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent CARRAY UINT8 1\n"
+    "parent/data1 CARRAY UINT8 1 2 3 4 5\n"
+    "parent/data2 CARRAY UINT8 2 4 6 8 10 12\n"
+    "META parent data4 LINTERP UINT8 1\n";
+  int fd, r = 0;
+  size_t i, error;
+  struct uint8_carrays {
+    size_t n;
+    uint8_t *d;
+  } *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 2; ++fd) {
+      CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1));
+    }
+
+  gd_add_spec(D, "parent/data3 CARRAY UINT8 3 6 9 12 15 18 21", 0);
+
+  field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 3; ++fd) {
+      CHECKUi(fd * 2000,field_list[fd].n, (size_t)(5 + fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 3000 + i,field_list[fd].d[i], (fd + 1) * (i + 1));
+    }
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array_meta_hidden.c b/test/cvlist_array_meta_hidden.c
index 6b19dd6..6dce09c 100644
--- a/test/cvlist_array_meta_hidden.c
+++ b/test/cvlist_array_meta_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
     }
 
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_hidden.c b/test/cvlist_hidden.c
index 7ce56fd..6676749 100644
--- a/test/cvlist_hidden.c
+++ b/test/cvlist_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
     for (fd = 0; fd < 2; ++fd)
       CHECKUi(fd,field_list[fd], 2 * fd + 1);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_invalid.c b/test/cvlist_invalid.c
index e5026e2..00be856 100644
--- a/test/cvlist_invalid.c
+++ b/test/cvlist_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_constants(D, GD_UINT8);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/cvlist_meta.c b/test/cvlist_meta.c
index 7a89cdd..76f5149 100644
--- a/test/cvlist_meta.c
+++ b/test/cvlist_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
     for (fd = 0; fd < 3; ++fd)
       CHECKUi(fd,field_list[fd], fd + 1);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_meta0.c b/test/cvlist_meta0.c
new file mode 100644
index 0000000..0a7da23
--- /dev/null
+++ b/test/cvlist_meta0.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent CONST UINT8 1\n"
+    "META parent data4 LINTERP UINT8 1\n";
+  int fd, error, r = 0;
+  uint8_t *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (uint8_t *)gd_mconstants(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKP(field_list);
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_meta_hidden.c b/test/cvlist_meta_hidden.c
index e322008..10eea48 100644
--- a/test/cvlist_meta_hidden.c
+++ b/test/cvlist_meta_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
     for (fd = 0; fd < 2; ++fd)
       CHECKUi(fd,field_list[fd], 2 * fd + 1);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/cvlist_meta_invalid.c b/test/cvlist_meta_invalid.c
index aa01526..d3eb146 100644
--- a/test/cvlist_meta_invalid.c
+++ b/test/cvlist_meta_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_mconstants(D, "parent", GD_UINT8);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/del.c b/test/del.c
deleted file mode 100644
index 4ce4d09..0000000
--- a/test/del.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-/* Attempt to 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *format_data = "data RAW UINT8 8\n";
-  unsigned char c[8];
-  unsigned char data_data[256];
-  int fd, ret, error1, n, error2, r = 0;
-  DIRFILE *D;
-
-  memset(c, 0, 8);
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  for (fd = 0; fd < 256; ++fd)
-    data_data[fd] = (unsigned char)fd;
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
-  write(fd, data_data, 256);
-  close(fd);
-
-  D = gd_open(filedir, GD_RDWR);
-  ret = gd_delete(D, "data", 0);
-  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_alias.c b/test/del_alias.c
new file mode 100644
index 0000000..9d7e3e7
--- /dev/null
+++ b/test/del_alias.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "/ALIAS alias data\n";
+  int fd, ret, error1, error2, error3, r = 0;
+  gd_entype_t t1, t2;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  t1 = gd_entry_type(D, "alias");
+  error1 = gd_error(D);
+  CHECKI(error1, GD_E_OK);
+  CHECKU(t1, GD_RAW_ENTRY);
+
+  ret = gd_delete(D, "alias", 0);
+  error2 = gd_error(D);
+  CHECKI(error2, GD_E_OK);
+  CHECKI(ret, 0);
+
+  t2 = gd_entry_type(D, "alias");
+  error3 = gd_error(D);
+  CHECKU(t2, GD_NO_ENTRY);
+  CHECKI(error3, GD_E_BAD_CODE);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/del_carray.c b/test/del_carray.c
index 67cc416..4cbd1f6 100644
--- a/test/del_carray.c
+++ b/test/del_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   ret = gd_delete(D, "data", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_carray_deref.c b/test/del_carray_deref.c
index 43d6923..cc00af5 100644
--- a/test/del_carray_deref.c
+++ b/test/del_carray_deref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   ret = gd_delete(D, "data", GD_DEL_DEREF);
   error = gd_error(D);
   spf = gd_spf(D, "raw");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_const.c b/test/del_const.c
index f2bf6fa..c6e6205 100644
--- a/test/del_const.c
+++ b/test/del_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   ret = gd_delete(D, "data", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_const_deref.c b/test/del_const_deref.c
index d23b611..40ac08c 100644
--- a/test/del_const_deref.c
+++ b/test/del_const_deref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -34,10 +34,21 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *format_data = "data CONST UINT8 13\n"
-    "raw RAW UINT8 data\n";
+    "raw RAW UINT8 data\n"
+    "lincom LINCOM raw data data\n"
+    "polynom POLYNOM lincom data data\n"
+    "recip RECIP polynom data\n"
+    "bit BIT recip data data\n"
+    "phase PHASE bit data\n"
+    "window WINDOW phase bit GT data\n"
+    "mplex MPLEX window phase data data\n"
+    ;
   int fd, ret, error, r = 0;
   unsigned int spf;
+  int nb, bn, s, cv, p;
+  double m0, b0, a0, a1, d, t;
   DIRFILE *D;
+  gd_entry_t entry;
 
   rmdirfile();
   mkdir(filedir, 0777);
@@ -49,14 +60,53 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   ret = gd_delete(D, "data", GD_DEL_DEREF);
   error = gd_error(D);
+
+  /* check */
   spf = gd_spf(D, "raw");
-  gd_close(D);
+  gd_entry(D, "lincom", &entry);
+  m0 = entry.EN(lincom,m[0]);
+  b0 = entry.EN(lincom,b[0]);
+  gd_free_entry_strings(&entry);
+  gd_entry(D, "polynom", &entry);
+  a0 = entry.EN(polynom,a[0]);
+  a1 = entry.EN(polynom,a[1]);
+  gd_free_entry_strings(&entry);
+  gd_entry(D, "recip", &entry);
+  d = entry.EN(recip,dividend);
+  gd_free_entry_strings(&entry);
+  gd_entry(D, "bit", &entry);
+  nb = entry.EN(bit,numbits);
+  bn = entry.EN(bit,bitnum);
+  gd_free_entry_strings(&entry);
+  gd_entry(D, "phase", &entry);
+  s = (int)entry.EN(phase,shift);
+  gd_free_entry_strings(&entry);
+  gd_entry(D, "window", &entry);
+  t = entry.EN(window,threshold.r);
+  gd_free_entry_strings(&entry);
+  gd_entry(D, "mplex", &entry);
+  cv = entry.EN(mplex,count_val);
+  p = entry.EN(mplex,period);
+  gd_free_entry_strings(&entry);
+
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
   CHECKI(error, GD_E_OK);
   CHECKU(spf, 13);
+  CHECKF(m0, 13.);
+  CHECKF(b0, 13.);
+  CHECKF(a0, 13.);
+  CHECKF(a1, 13.);
+  CHECKF(d, 13.);
+  CHECKI(nb, 13);
+  CHECKI(bn, 13);
+  CHECKI(s, 13);
+  CHECKF(t, 13.);
+  CHECKI(cv, 13);
+  CHECKI(p, 13);
   CHECKI(ret, 0);
 
   return r;
diff --git a/test/del_const_force.c b/test/del_const_force.c
index f1802d7..e170e6a 100644
--- a/test/del_const_force.c
+++ b/test/del_const_force.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ int main(void)
   error1 = gd_error(D);
   spf = gd_spf(D, "raw");
   error2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_data.c b/test/del_data.c
index 8163983..c334524 100644
--- a/test/del_data.c
+++ b/test/del_data.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to delete a field */
 #include "test.h"
 
 #include <stdlib.h>
@@ -36,7 +35,7 @@ int main(void)
   const char *data = "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;
+  int fd, ret, e1, n, e2, e3, unlink_data, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -55,20 +54,23 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR);
   ret = gd_delete(D, "data", GD_DEL_DATA);
-  error1 = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data);
-  error2 = gd_error(D);
-  gd_close(D);
+  e2 = gd_error(D);
+  CHECKI(n, 0);
+  CHECKI(e2, GD_E_BAD_CODE);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
 
   unlink_data = unlink(data);
   unlink(format);
   rmdir(filedir);
 
   CHECKI(unlink_data, -1);
-  CHECKI(error1, GD_E_OK);
-  CHECKI(n, 0);
-  CHECKI(ret, 0);
-  CHECKI(error2, GD_E_BAD_CODE);
 
   return r;
 }
diff --git a/test/del_data_enoent.c b/test/del_data_enoent.c
new file mode 100644
index 0000000..24bd0c2
--- /dev/null
+++ b/test/del_data_enoent.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING none\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_delete(D, "data", GD_DEL_DATA);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/del_data_open.c b/test/del_data_open.c
new file mode 100644
index 0000000..76808bc
--- /dev/null
+++ b/test/del_data_open.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* delete an open data file */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, e0, e1, n, e2, e3, unlink_data, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data);
+  e0 = gd_error(D);
+  CHECKI(e0, GD_E_OK);
+
+  ret = gd_delete(D, "data", GD_DEL_DATA);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_BAD_CODE);
+  CHECKI(n, 0);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+  CHECKI(unlink_data, -1);
+
+  return r;
+}
diff --git a/test/del_del.c b/test/del_del.c
new file mode 100644
index 0000000..7397305
--- /dev/null
+++ b/test/del_del.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, ret, e1, n, e2, e3, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", 0);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(n, 0);
+  CHECKI(e2, GD_E_BAD_CODE);
+
+  e3 = gd_discard(D);
+  CHECKI(e3, 0);
+
+  fd = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+  CHECKI(fd, 0);
+
+  return r;
+}
diff --git a/test/del_derived.c b/test/del_derived.c
index baeba99..dccb744 100644
--- a/test/del_derived.c
+++ b/test/del_derived.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   ret = gd_delete(D, "data", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_derived_after.c b/test/del_derived_after.c
index a77bad4..444b9cd 100644
--- a/test/del_derived_after.c
+++ b/test/del_derived_after.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   e1 = gd_error(D);
   n = gd_getdata(D, "lincom", 0, 0, 0, 1, GD_FLOAT64, &c);
   e2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_derived_force.c b/test/del_derived_force.c
index 8110de7..24678d9 100644
--- a/test/del_derived_force.c
+++ b/test/del_derived_force.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   ret = gd_delete(D, "data", GD_DEL_FORCE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_meta.c b/test/del_meta.c
index 13c5f7a..a1c0edf 100644
--- a/test/del_meta.c
+++ b/test/del_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   ret = gd_delete(D, "data", 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_meta_force.c b/test/del_meta_force.c
index 04afc3f..c2848fc 100644
--- a/test/del_meta_force.c
+++ b/test/del_meta_force.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
   ret = gd_delete(D, "data", GD_DEL_META);
   error = gd_error(D);
   nf = gd_nfields(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/del_ref.c b/test/del_ref.c
new file mode 100644
index 0000000..2ab6f0e
--- /dev/null
+++ b/test/del_ref.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "cata RAW UINT8 8\n"
+    "/REFERENCE data\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, ret, e1, e2, r = 0;
+  const char *ref1, *ref2;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ref1 = gd_reference(D, NULL);
+  CHECKS(ref1, "data");
+
+  ret = gd_delete(D, "data", 0);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
+  ref2 = gd_reference(D, NULL);
+  CHECKS(ref2, "cata");
+
+  e2 = gd_discard(D);
+  CHECKI(e2, 0);
+
+  fd = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+  CHECKI(fd, 0);
+
+  return r;
+}
diff --git a/test/desync.c b/test/desync.c
index 704457c..03aa6a0 100644
--- a/test/desync.c
+++ b/test/desync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n2 = gd_desync(D, 0);
   e3 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/desync_flush.c b/test/desync_flush.c
index 37e5b78..1a94c49 100644
--- a/test/desync_flush.c
+++ b/test/desync_flush.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   n1 = gd_desync(D, 0);
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/desync_path.c b/test/desync_path.c
new file mode 100644
index 0000000..e434abb
--- /dev/null
+++ b/test/desync_path.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+#if ! defined HAVE_SYMLINK
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *dira = "dirfile/a";
+  const char *dirb = "dirfile/b";
+  const char *link = "dirfile/link";
+  const char *formata = "dirfile/a/format";
+  const char *formatb = "dirfile/b/format";
+  int e1, e2, e3, n1, n2, n3, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(dira, 0777);
+  mkdir(dirb, 0777);
+  symlink("a", link);
+  close(open(formata, O_CREAT | O_EXCL | O_WRONLY, 0666));
+  /* ensure mtime ticks over */
+  sleep(1);
+  close(open(formatb, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(link, GD_RDONLY | GD_VERBOSE);
+
+  n1 = gd_desync(D, 0);
+  e1 = gd_error(D);
+  
+  /* change symlink */
+  unlink(link);
+  symlink("b", link);
+
+  n2 = gd_desync(D, 0);
+  e2 = gd_error(D);
+
+  n3 = gd_desync(D, GD_DESYNC_PATHCHECK);
+  e3 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(formata);
+  unlink(formatb);
+  unlink(link);
+  rmdir(dira);
+  rmdir(dirb);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(e3, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 0);
+  CHECKI(n3, 1);
+  return r;
+#endif
+}
diff --git a/test/desync_reopen.c b/test/desync_reopen.c
index 476ee65..66e7aa4 100644
--- a/test/desync_reopen.c
+++ b/test/desync_reopen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   n2 = gd_validate(D, "data");
   e3 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/desync_reopen_inv.c b/test/desync_reopen_inv.c
index 2dca079..fd58734 100644
--- a/test/desync_reopen_inv.c
+++ b/test/desync_reopen_inv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   n2 = gd_validate(D, "data");
   e3 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/dfes_bit.c b/test/dfes_bit.c
index d0bfee2..f212efd 100644
--- a/test/dfes_bit.c
+++ b/test/dfes_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/dfes_divide.c b/test/dfes_divide.c
index 556b920..00acec6 100644
--- a/test/dfes_divide.c
+++ b/test/dfes_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/dfes_lincom.c b/test/dfes_lincom.c
index b9ba0ac..232baab 100644
--- a/test/dfes_lincom.c
+++ b/test/dfes_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/dfes_linterp.c b/test/dfes_linterp.c
index 4d251e4..28ac940 100644
--- a/test/dfes_linterp.c
+++ b/test/dfes_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/dfes_multiply.c b/test/dfes_multiply.c
index f1db758..9443e6b 100644
--- a/test/dfes_multiply.c
+++ b/test/dfes_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/dfes_phase.c b/test/dfes_phase.c
index d89e4d5..0acb73c 100644
--- a/test/dfes_phase.c
+++ b/test/dfes_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/dfes_raw.c b/test/dfes_raw.c
index 921e4dd..7d4b351 100644
--- a/test/dfes_raw.c
+++ b/test/dfes_raw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/dfes_recip.c b/test/dfes_recip.c
index da4d388..7aef80a 100644
--- a/test/dfes_recip.c
+++ b/test/dfes_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   gd_entry(D, "data", &E);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/elist_alias.c b/test/elist_alias.c
index 4a2974b..7a7ee5b 100644
--- a/test/elist_alias.c
+++ b/test/elist_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
 
   CHECKI(i, 2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/elist_hidden.c b/test/elist_hidden.c
index 373e7b0..e920fd6 100644
--- a/test/elist_hidden.c
+++ b/test/elist_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,7 +67,7 @@ int main(void)
 
   CHECKI(i, 4);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/elist_noalias.c b/test/elist_noalias.c
index a938dca..29ed1ca 100644
--- a/test/elist_noalias.c
+++ b/test/elist_noalias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,7 +67,7 @@ int main(void)
 
   CHECKI(i, 4);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/elist_scalar.c b/test/elist_scalar.c
index d7d3819..4525551 100644
--- a/test/elist_scalar.c
+++ b/test/elist_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
 
   CHECKI(i, 2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/encode_alter.c b/test/encode_alter.c
index 9a40e5d..f6a70d2 100644
--- a/test/encode_alter.c
+++ b/test/encode_alter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
   error = gd_error(D);
   n = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(txtdata);
   unlink(data);
diff --git a/test/encode_alter_all.c b/test/encode_alter_all.c
new file mode 100644
index 0000000..795c21f
--- /dev/null
+++ b/test/encode_alter_all.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "data RAW UINT16 8\n"
+    "/ENCODING none\n"
+    "/INCLUDE format1\n";
+  const char *format1_data = "data1 RAW UINT8 8\n/ENCODING sie\n";
+  int fd, ret, error, r = 0;
+  unsigned long e0, e1, e2, e3;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e0 = gd_encoding(D, 0);
+  e1 = gd_encoding(D, 1);
+  ret = gd_alter_encoding(D, GD_TEXT_ENCODED, GD_ALL_FRAGMENTS, 0);
+  error = gd_error(D);
+  e2 = gd_encoding(D, 0);
+  e3 = gd_encoding(D, 1);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKU(e0, GD_UNENCODED);
+  CHECKU(e1, GD_SIE_ENCODED);
+  CHECKU(e2, GD_TEXT_ENCODED);
+  CHECKU(e3, GD_TEXT_ENCODED);
+
+  return r;
+}
diff --git a/test/encode_alter_open.c b/test/encode_alter_open.c
new file mode 100644
index 0000000..cead88d
--- /dev/null
+++ b/test/encode_alter_open.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *txtdata = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT16 8\nENCODING none\n";
+  const char *txt_data =
+    "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n";
+  uint16_t data_data[128];
+  uint16_t c1, c2;
+  int fd, ret, error, r = 0;
+  off_t n1, n2;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = 0x201 * fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(txtdata, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, txt_data, strlen(txt_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c1);
+  ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 0);
+  error = gd_error(D);
+  n2 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c2);
+
+  gd_discard(D);
+
+  unlink(txtdata);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKI(n1, 1);
+  CHECKI(n2, 1);
+  CHECKI(c1, 0x603);
+  CHECKI(c2, 3);
+
+  return r;
+}
diff --git a/test/encode_get.c b/test/encode_get.c
index a12443f..c547128 100644
--- a/test/encode_get.c
+++ b/test/encode_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_encoding(D, 0);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/encode_move.c b/test/encode_move.c
deleted file mode 100644
index 8bdbf2a..0000000
--- a/test/encode_move.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* 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
- */
-/* 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *txtdata = "dirfile/data.txt";
-  const char *format_data = "data RAW UINT16 8\nENCODING none\n";
-  uint16_t data_data[128];
-  uint16_t c[8];
-  int fd, i, ret, error, n, unlink_txtdata, unlink_data, r = 0;
-  DIRFILE *D;
-
-  memset(c, 0, 8);
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  for (fd = 0; fd < 128; ++fd)
-    data_data[fd] = 0x201 * fd;
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
-  write(fd, data_data, 256);
-  close(fd);
-
-  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
-  ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 1);
-  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/encode_recode.c b/test/encode_recode.c
new file mode 100644
index 0000000..d5cd86c
--- /dev/null
+++ b/test/encode_recode.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *txtdata = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT16 8\nENCODING none\n";
+  uint16_t data_data[128];
+  uint16_t c[8];
+  int fd, i, ret, e1, e2, n, unlink_txtdata, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = 0x201 * fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 1);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, 0);
+
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i], (40 + i) * 0x201);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  unlink_txtdata = unlink(txtdata);
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_txtdata, 0);
+  CHECKI(unlink_data, -1);
+
+  return r;
+}
diff --git a/test/encode_recode_open.c b/test/encode_recode_open.c
new file mode 100644
index 0000000..5bf2351
--- /dev/null
+++ b/test/encode_recode_open.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *txtdata = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT16 8\nENCODING none\n";
+  uint16_t data_data[128];
+  uint16_t c1, c2;
+  int fd, ret, e1, e2, unlink_txtdata, unlink_data, r = 0;
+  DIRFILE *D;
+  off_t n1, n2;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = 0x201 * fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c1);
+  CHECKI(n1, 1);
+  CHECKI(c1, 0x603);
+
+  ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 1);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, 0);
+
+  n2 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c2);
+  CHECKI(n2, 1);
+  CHECKI(c2, 0x603);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  unlink_txtdata = unlink(txtdata);
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_txtdata, 0);
+  CHECKI(unlink_data, -1);
+
+  return r;
+}
diff --git a/test/encode_support.c b/test/encode_support.c
new file mode 100644
index 0000000..2c84089
--- /dev/null
+++ b/test/encode_support.c
@@ -0,0 +1,89 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+/* figure out expected support */
+#ifdef USE_SLIM
+#define GD_SLIM_MODE GD_RDONLY
+#else
+#define GD_SLIM_MODE -1
+#endif
+
+#ifdef USE_GZIP
+#define GD_GZIP_MODE GD_RDWR
+#else
+#define GD_GZIP_MODE -1
+#endif
+
+#ifdef USE_BZIP2
+#define GD_BZIP2_MODE GD_RDWR
+#else
+#define GD_BZIP2_MODE -1
+#endif
+
+#ifdef USE_LZMA
+#define GD_LZMA_MODE GD_RDWR
+#else
+#define GD_LZMA_MODE -1
+#endif
+
+#ifdef USE_ZZIP
+#define GD_ZZIP_MODE GD_RDONLY
+#else
+#define GD_ZZIP_MODE -1
+#endif
+
+#ifdef USE_ZZSLIM
+#define GD_ZZSLIM_MODE GD_RDONLY
+#else
+#define GD_ZZSLIM_MODE -1
+#endif
+
+#define N 13
+int main(void)
+{
+  int i, r = 0;
+  struct {
+    unsigned long e;
+    int v;
+  } d[N] = {
+    { GD_AUTO_ENCODED,    -1 }, /* 0 */
+    { GD_UNENCODED,       GD_RDWR }, /* 1 */
+    { GD_TEXT_ENCODED,    GD_RDWR }, /* 2 */
+    { GD_SLIM_ENCODED,    GD_SLIM_MODE }, /* 3 */
+    { GD_GZIP_ENCODED,    GD_GZIP_MODE }, /* 4 */
+    { GD_BZIP2_ENCODED,   GD_BZIP2_MODE }, /* 5 */
+    { GD_LZMA_ENCODED,    GD_LZMA_MODE }, /* 6 */
+    { GD_SIE_ENCODED,     GD_RDWR }, /* 7 */
+    { GD_ZZIP_ENCODED,    GD_ZZIP_MODE }, /* 8 */
+    { GD_ZZSLIM_ENCODED,  GD_ZZSLIM_MODE }, /* 9 */
+    { GD_ENC_UNSUPPORTED, -1 }, /* 10 */
+    { GD_ENCODING,        -1 }, /* 11 */
+    { 765,                -1 }  /* 12 */
+  };
+  
+  for (i = 0; i < N; ++i) {
+    int q = gd_encoding_support(d[i].e);
+    CHECKIi(i, q, d[i].v);
+  }
+
+  return r;
+}
diff --git a/test/endian_alter.c b/test/endian_alter.c
index 3206814..ea631c9 100644
--- a/test/endian_alter.c
+++ b/test/endian_alter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
 
diff --git a/test/endian_alter_all.c b/test/endian_alter_all.c
new file mode 100644
index 0000000..9c2e63e
--- /dev/null
+++ b/test/endian_alter_all.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "data RAW UINT16 8\n"
+    "/ENDIAN little\n"
+    "/INCLUDE format1\n";
+  const char *format1_data = "data1 RAW UINT16 8\n/ENDIAN little arm\n";
+  unsigned long e0, e1, e2, e3;
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e0 = gd_endianness(D, 0);
+  e1 = gd_endianness(D, 1);
+  ret = gd_alter_endianness(D, GD_BIG_ENDIAN, GD_ALL_FRAGMENTS, 0);
+  error = gd_error(D);
+  e2 = gd_endianness(D, 0);
+  e3 = gd_endianness(D, 1);
+
+  gd_discard(D);
+
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(ret, 0);
+  CHECKU(e0, GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
+  CHECKU(e1, GD_LITTLE_ENDIAN | GD_ARM_ENDIAN);
+  CHECKU(e2, GD_BIG_ENDIAN);
+  CHECKU(e3, GD_BIG_ENDIAN);
+
+  return r;
+}
diff --git a/test/endian_alter_sie.c b/test/endian_alter_sie.c
index 5040b6f..325169c 100644
--- a/test/endian_alter_sie.c
+++ b/test/endian_alter_sie.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,7 +67,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "data", 3, 0, 1, 0, GD_UINT8, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
 
diff --git a/test/endian_get.c b/test/endian_get.c
index 43e7854..534745f 100644
--- a/test/endian_get.c
+++ b/test/endian_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
   k = gd_endianness(D, 3);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   unlink(format1);
diff --git a/test/endian_move.c b/test/endian_move.c
index 8d35880..fafff56 100644
--- a/test/endian_move.c
+++ b/test/endian_move.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   error = gd_error(D);
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
 
diff --git a/test/entry_bad_code.c b/test/entry_bad_code.c
index 02f44bb..da36f23 100644
--- a/test/entry_bad_code.c
+++ b/test/entry_bad_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry(D, "not a field", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_bit.c b/test/entry_bit.c
index 2db4e5e..e165f46 100644
--- a/test/entry_bit.c
+++ b/test/entry_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_bit_scalar.c b/test/entry_bit_scalar.c
index d4dac46..ac5afd8 100644
--- a/test/entry_bit_scalar.c
+++ b/test/entry_bit_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_divide.c b/test/entry_divide.c
index 1e83ff9..84f2c74 100644
--- a/test/entry_divide.c
+++ b/test/entry_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_invalid.c b/test/entry_invalid.c
index 6c217be..c2491a6 100644
--- a/test/entry_invalid.c
+++ b/test/entry_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -36,7 +36,7 @@ int main(void)
 
   int n = gd_entry(D, "data", &E);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   CHECKI(n, -1);
diff --git a/test/entry_lincom.c b/test/entry_lincom.c
index 1ec1c99..ab6dac8 100644
--- a/test/entry_lincom.c
+++ b/test/entry_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
@@ -58,7 +58,7 @@ int main(void)
   CHECKI(n, 0);
   CHECKS(E.field, "data");
   CHECKI(E.field_type, GD_LINCOM_ENTRY);
-  CHECKI(E.comp_scal, 0);
+  CHECKX(E.flags, GD_EN_CALC);
   CHECKI(E.EN(lincom,n_fields), 3);
   CHECKS(E.in_fields[0], "in1");
   CHECKS(E.in_fields[1], "in2");
diff --git a/test/entry_lincom_scalar.c b/test/entry_lincom_scalar.c
index d441a27..5021f82 100644
--- a/test/entry_lincom_scalar.c
+++ b/test/entry_lincom_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_linterp.c b/test/entry_linterp.c
index 98838f6..b6c6405 100644
--- a/test/entry_linterp.c
+++ b/test/entry_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_mplex.c b/test/entry_mplex.c
index b7a4c1b..9900f56 100644
--- a/test/entry_mplex.c
+++ b/test/entry_mplex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -41,7 +41,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_mplex_scalar.c b/test/entry_mplex_scalar.c
index 7836d37..3ce5e1f 100644
--- a/test/entry_mplex_scalar.c
+++ b/test/entry_mplex_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_multiply.c b/test/entry_multiply.c
index 4972f5c..8d5bbff 100644
--- a/test/entry_multiply.c
+++ b/test/entry_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_phase.c b/test/entry_phase.c
index 1270435..a3d044f 100644
--- a/test/entry_phase.c
+++ b/test/entry_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_phase_scalar.c b/test/entry_phase_scalar.c
index b829142..682ecc4 100644
--- a/test/entry_phase_scalar.c
+++ b/test/entry_phase_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_polynom.c b/test/entry_polynom.c
index 8693bcf..0a28946 100644
--- a/test/entry_polynom.c
+++ b/test/entry_polynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
@@ -58,7 +58,7 @@ int main(void)
   CHECKI(n, 0);
   CHECKS(E.field, "data");
   CHECKX(E.field_type, GD_POLYNOM_ENTRY);
-  CHECKI(E.comp_scal, 0);
+  CHECKX(E.flags, GD_EN_CALC);
   CHECKI(E.EN(polynom,poly_ord), 4);
   CHECKS(E.in_fields[0], "in");
   for (fd = 0; fd < 4; ++fd)
diff --git a/test/entry_polynom_scalar.c b/test/entry_polynom_scalar.c
index 6cc3e45..5ae0f89 100644
--- a/test/entry_polynom_scalar.c
+++ b/test/entry_polynom_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
@@ -65,7 +65,7 @@ int main(void)
   CHECKI(n, 0);
   CHECKS(E.field, "data");
   CHECKX(E.field_type, GD_POLYNOM_ENTRY);
-  CHECKI(E.comp_scal, 0);
+  CHECKX(E.flags, GD_EN_CALC);
   CHECKI(E.EN(polynom,poly_ord), 4);
   CHECKS(E.in_fields[0], "in");
   CHECKS(E.scalar[0], "a0");
diff --git a/test/entry_raw.c b/test/entry_raw.c
index c09a41e..3b2b4a5 100644
--- a/test/entry_raw.c
+++ b/test/entry_raw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_raw_scalar.c b/test/entry_raw_scalar.c
index 07ddcb3..500487b 100644
--- a/test/entry_raw_scalar.c
+++ b/test/entry_raw_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_raw_scalar_code.c b/test/entry_raw_scalar_code.c
index 4a8624a..d0941c0 100644
--- a/test/entry_raw_scalar_code.c
+++ b/test/entry_raw_scalar_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Try to read RAW entry */
 #include "test.h"
 
 #include <stdlib.h>
@@ -48,13 +47,14 @@ int main(void)
 
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(E.flags, 0);
+  CHECKI(n, 0);
+  gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(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
index cea8cab..cb06ea7 100644
--- a/test/entry_raw_scalar_type.c
+++ b/test/entry_raw_scalar_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Try to read RAW entry */
 #include "test.h"
 
 #include <stdlib.h>
@@ -32,7 +31,7 @@ int main(void)
 {
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
-  const char *format_data = "const RAW UINT32 8\ndata RAW UINT8 const\n";
+  const char *format_data = "const STRING 8\ndata RAW UINT8 const\n";
   int fd, n, error, r = 0;
   DIRFILE *D;
   gd_entry_t E;
@@ -48,13 +47,14 @@ int main(void)
 
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(E.flags, 0);
+  CHECKI(n, 0);
+  gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_BAD_SCALAR);
-  CHECKI(n, -1);
-
   return r;
 }
diff --git a/test/entry_recip.c b/test/entry_recip.c
index a03c16b..0cd2379 100644
--- a/test/entry_recip.c
+++ b/test/entry_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
@@ -58,7 +58,7 @@ int main(void)
   CHECKI(n, 0);
   CHECKS(E.field, "data");
   CHECKX(E.field_type, GD_RECIP_ENTRY);
-  CHECKI(E.comp_scal, 0);
+  CHECKX(E.flags, GD_EN_CALC);
   CHECKI(E.EN(recip,dividend), 2);
   CHECKS(E.in_fields[0], "in");
   gd_free_entry_strings(&E);
diff --git a/test/entry_scalar_repr.c b/test/entry_scalar_repr.c
index 7a34695..099478b 100644
--- a/test/entry_scalar_repr.c
+++ b/test/entry_scalar_repr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_type.c b/test/entry_type.c
index 869784b..29595ef 100644
--- a/test/entry_type.c
+++ b/test/entry_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry_type(D, "data");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_type_alias.c b/test/entry_type_alias.c
index c8d362a..aabadd7 100644
--- a/test/entry_type_alias.c
+++ b/test/entry_type_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
   n = gd_entry_type(D, "alias");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_window.c b/test/entry_window.c
index 5d9b041..846754d 100644
--- a/test/entry_window.c
+++ b/test/entry_window.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/entry_window_scalar.c b/test/entry_window_scalar.c
index a259c85..c5c3a88 100644
--- a/test/entry_window_scalar.c
+++ b/test/entry_window_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_entry(D, "data", &E);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/eof.c b/test/eof.c
index fa1ec40..116feb8 100644
--- a/test/eof.c
+++ b/test/eof.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_eof(D, "data");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/eof_bit.c b/test/eof_bit.c
new file mode 100644
index 0000000..ef677c0
--- /dev/null
+++ b/test/eof_bit.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 1\nbit BIT data 0\n";
+  int fd, error, r = 0;
+  off_t n;
+  const size_t len = strlen(data);
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_eof(D, "bit");
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI((int)n, (int)len / 2);
+
+  return r;
+}
diff --git a/test/eof_index.c b/test/eof_index.c
index fb34479..4a57ce2 100644
--- a/test/eof_index.c
+++ b/test/eof_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
   error2 = gd_error(D);
   eof_mult3 = gd_eof(D, "mult3");
   error3 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/eof_lincom.c b/test/eof_lincom.c
index 1f18e23..a9558a9 100644
--- a/test/eof_lincom.c
+++ b/test/eof_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   error = gd_error(D);
   m = gd_eof(D, "lincom");
   error2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data2);
   unlink(data);
diff --git a/test/eof_phase.c b/test/eof_phase.c
index 64a2e8f..23f3e6f 100644
--- a/test/eof_phase.c
+++ b/test/eof_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_eof(D, "phase");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/eof_phase_neg.c b/test/eof_phase_neg.c
new file mode 100644
index 0000000..b51e168
--- /dev/null
+++ b/test/eof_phase_neg.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 1\nphase PHASE data 1000";
+  int fd, error, r = 0;
+  off_t n;
+  const size_t len = strlen(data);
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_eof(D, "phase");
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+
+  return r;
+}
diff --git a/test/error.c b/test/error.c
index c3705de..b9de485 100644
--- a/test/error.c
+++ b/test/error.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_error_string(D, string, 1000);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/error_error.c b/test/error_error.c
index 3dd8e81..f41de8b 100644
--- a/test/error_error.c
+++ b/test/error_error.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,23 +18,24 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Opening a non-existent dirfile should fail cleanly */
 #include "test.h"
 
 #include <string.h>
 
+#define DIRFILENAME "a non-existant dirfile"
 int main(void)
 {
-  char string[1000];
+  char *string;
   int error, r = 0;
-  DIRFILE *D = gd_open("a non_existant dirfile", 0);
+  DIRFILE *D = gd_open(DIRFILENAME, 0);
 
-  gd_error_string(D, string, 1000);
+  string = gd_error_string(D, NULL, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
-  CHECKI(error, GD_E_OPEN);
-  CHECKSp(string, "Dirfile does not exist");
+  CHECKI(error, GD_E_IO);
+  CHECKSS(string, DIRFILENAME);
 
+  free(string);
   return r;
 }
diff --git a/test/error_num.c b/test/error_num.c
index 62c9d59..08a884c 100644
--- a/test/error_num.c
+++ b/test/error_num.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   gd_validate(D, "3");
   ne1 = gd_error_count(D);
   ne2 = gd_error_count(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/error_short.c b/test/error_short.c
index 723af57..c260ea2 100644
--- a/test/error_short.c
+++ b/test/error_short.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -41,7 +41,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   gd_error_string(D, string, 2);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/error_verbose.c b/test/error_verbose.c
index b7dac3b..534ad36 100644
--- a/test/error_verbose.c
+++ b/test/error_verbose.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -29,6 +29,7 @@
 #include <fcntl.h>
 #include <string.h>
 
+#define DIRFILENAME "a non-existant dirfile"
 int main(void)
 {
 #if !defined HAVE_MKFIFO || !defined HAVE_WORKING_FORK || defined __CYGWIN__
@@ -45,20 +46,21 @@ int main(void)
 
   /* read our standard error */
   if ((pid = fork()) == 0) {
-    char string[1024];
+    char string[10000];
     stream = fopen(fifo, "r");
 
-    fgets(string, 1024, stream);
-    CHECKBOS(string, "libgetdata: Not a dirfile:");
+    fgets(string, 10000, stream);
+    CHECKBOS(string, "libgetdata:");
+    CHECKSS(string, DIRFILENAME);
     return r;
   }
 
   /* retarget stderr */
   freopen(fifo, "w", stderr);
 
-  D = gd_open("", GD_RDONLY | GD_VERBOSE);
+  D = gd_open(DIRFILENAME, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   fputs("\n", stderr);
   fflush(stderr);
@@ -68,7 +70,7 @@ int main(void)
 
   unlink(fifo);
 
-  CHECKI(error, GD_E_OPEN);
+  CHECKI(error, GD_E_IO);
 
   wait(&status);
   if (status)
diff --git a/test/error_verbose_prefix.c b/test/error_verbose_prefix.c
index dab8d87..c9b9877 100644
--- a/test/error_verbose_prefix.c
+++ b/test/error_verbose_prefix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   gd_verbose_prefix(D, "getdata-test: ");
   gd_validate(D, "data");
   e2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   fputs("\n", stderr);
   fflush(stderr);
diff --git a/test/file.c b/test/file.c
index 06befa2..e9a427f 100644
--- a/test/file.c
+++ b/test/file.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   path = gd_raw_filename(D, "data");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/file_code.c b/test/file_code.c
index 1347258..619f7ee 100644
--- a/test/file_code.c
+++ b/test/file_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   path = gd_raw_filename(D, "bata");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/file_type.c b/test/file_type.c
index 4f87f1d..eb80670 100644
--- a/test/file_type.c
+++ b/test/file_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   path = gd_raw_filename(D, "data");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/flac_add.c b/test/flac_add.c
new file mode 100644
index 0000000..52de8da
--- /dev/null
+++ b/test/flac_add.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.flac";
+  gd_entry_t e;
+  int e1, e2, e3, unlink_data, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+#ifdef USE_FLAC
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_FLAC_ENCODED);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_FLAC_ENCODED);
+#endif
+  gd_add_raw(D, "data", GD_UINT8, 2, 0);
+  e1 = gd_error(D);
+
+  /* check */
+  e2 = gd_entry(D, "data", &e);
+#ifdef USE_FLAC
+  CHECKI(e2, 0);
+  if (e2 == 0) {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+#else
+  CHECKI(e2, -1);
+#endif
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  unlink_data = unlink(data);
+
+#ifdef USE_FLAC
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+#endif
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_get_big.c b/test/flac_get_big.c
new file mode 100644
index 0000000..11c0df3
--- /dev/null
+++ b/test/flac_get_big.c
@@ -0,0 +1,91 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+#ifdef USE_FLAC
+  int i;
+#endif
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* encode */
+  snprintf(command, 4096,
+      "%s --endian=big --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_FLAC
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_BIG_ENDIAN);
+#else
+  D = gd_open(filedir, GD_RDONLY | GD_BIG_ENDIAN);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+#ifdef USE_FLAC
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i],40+i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_get_far.c b/test/flac_get_far.c
new file mode 100644
index 0000000..c7fe450
--- /dev/null
+++ b/test/flac_get_far.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  snprintf(command, 4096,
+      "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_FLAC
+  CHECKI(error, 0);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+#endif
+  CHECKI(n, 0);
+
+  return r;
+#endif
+}
diff --git a/test/flac_get_get.c b/test/flac_get_get.c
new file mode 100644
index 0000000..86a210d
--- /dev/null
+++ b/test/flac_get_get.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_FLAC || !defined TEST_FLAC
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, e1, e2, n2, e3, r = 0;
+  DIRFILE *D;
+
+  memset(c1, 0, 16);
+  memset(c2, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  snprintf(command, 4096,
+      "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1);
+  CHECKI(n1, 8);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKIi(i,c1[i], 40 + i);
+    CHECKIi(i,c2[i], 40 + i);
+  }
+
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_get_get2.c b/test/flac_get_get2.c
new file mode 100644
index 0000000..3099283
--- /dev/null
+++ b/test/flac_get_get2.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_FLAC || !defined TEST_FLAC
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, error1, n2, error2, r = 0;
+  DIRFILE *D;
+
+  memset(c1, 0, 16);
+  memset(c2, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096,
+      "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1);
+  error1 = gd_error(D);
+  n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2);
+  error2 = gd_error(D);
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKUi(i,c1[i], i);
+    CHECKUi(i,c2[i], i);
+  }
+
+  return r;
+#endif
+}
diff --git a/test/flac_get_little.c b/test/flac_get_little.c
new file mode 100644
index 0000000..bf9760e
--- /dev/null
+++ b/test/flac_get_little.c
@@ -0,0 +1,91 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+#ifdef USE_FLAC
+  int i;
+#endif
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* encode */
+  snprintf(command, 4096,
+      "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_FLAC
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_LITTLE_ENDIAN);
+#else
+  D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+#ifdef USE_FLAC
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i],40+i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_nframes.c b/test/flac_nframes.c
new file mode 100644
index 0000000..c451504
--- /dev/null
+++ b/test/flac_nframes.c
@@ -0,0 +1,90 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+#include <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_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 1\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress */
+  snprintf(command, 4096,
+      "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_FLAC
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_FLAC
+  CHECKI(error, 0);
+  CHECKI(n, 256);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/flac_put_big.c b/test/flac_put_big.c
new file mode 100644
index 0000000..06ea32f
--- /dev/null
+++ b/test/flac_put_big.c
@@ -0,0 +1,117 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_flac = "dirfile/data.flac";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+#ifdef USE_FLAC
+  char command[4096];
+  uint16_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, unlink_data, unlink_flac, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 0x0101 * i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_FLAC
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_BIG_ENDIAN | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_BIG_ENDIAN);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_flac, &buf);
+
+#ifdef USE_FLAC
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 8);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_FLAC
+  snprintf(command, 4096, "%s --silent --decode --delete-input-file "
+      "--force-raw-format --sign=signed --endian=big %s --output-name=%s",
+      FLAC, data_flac, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof d)) {
+        if (i < 40 || i > 48) {
+          CHECKXi(i, d, 0);
+        } else
+          CHECKXi(i, d, (i - 40) * 0x0101);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_flac = unlink(data_flac);
+  CHECKI(unlink_flac, -1);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_FLAC
+  CHECKI(unlink_data, 0);
+#else
+  CHECKI(unlink_data, -1);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/flac_put_complex128.c b/test/flac_put_complex128.c
new file mode 100644
index 0000000..77418e9
--- /dev/null
+++ b/test/flac_put_complex128.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define GD_C89_API
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_FLAC || !defined TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.flac";
+  double c[16];
+  double d[26];
+  off_t nf;
+  int r = 0, i, e1, e2, e3;
+  size_t n1, n2;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 16; ++i)
+    c[i] = 1.234 * i;
+
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN
+      | GD_VERBOSE | GD_CREAT | GD_EXCL);
+  gd_add_spec(D, "data RAW COMPLEX128 1", 0);
+  n1 = gd_putdata(D, "data", 5, 0, 8, 0, GD_COMPLEX128, c);
+  CHECKI(n1, 8);
+
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nf = gd_nframes(D);
+  CHECKU(nf, 13);
+
+  n2 = gd_getdata(D, "data", 0, 0, 0, 13, GD_COMPLEX128, d);
+  CHECKI(n2, 13);
+
+  e3 = gd_error(D);
+  CHECKI(e3, GD_E_OK);
+
+  for (i = 0; i < 26; ++i) {
+    if (i < 10)
+      CHECKFi(i, d[i], 0);
+    else
+      CHECKFi(i, d[i], 1.234 * (i - 10));
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_put_float64.c b/test/flac_put_float64.c
new file mode 100644
index 0000000..07bae44
--- /dev/null
+++ b/test/flac_put_float64.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_FLAC || !defined TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.flac";
+  double c[8];
+  double d[13];
+  off_t nf;
+  int r = 0, i, e1, e2, e3;
+  size_t n1, n2;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 1.234 * i;
+
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN
+      | GD_VERBOSE | GD_CREAT | GD_EXCL);
+  gd_add_spec(D, "data RAW FLOAT64 1", 0);
+  n1 = gd_putdata(D, "data", 5, 0, 8, 0, GD_FLOAT64, c);
+  CHECKI(n1, 8);
+
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nf = gd_nframes(D);
+  CHECKU(nf, 13);
+
+  n2 = gd_getdata(D, "data", 0, 0, 0, 13, GD_FLOAT64, d);
+  CHECKI(n2, 13);
+
+  e3 = gd_error(D);
+  CHECKI(e3, GD_E_OK);
+
+  for (i = 0; i < 13; ++i) {
+    if (i < 5)
+      CHECKFi(i, d[i], 0);
+    else
+      CHECKFi(i, d[i], 1.234 * (i - 5));
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_put_int32.c b/test/flac_put_int32.c
new file mode 100644
index 0000000..c3b3ec9
--- /dev/null
+++ b/test/flac_put_int32.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_FLAC || !defined TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.flac";
+  uint32_t c[8];
+  uint32_t d[13];
+  off_t nf;
+  int r = 0, e1, e2, e3;
+  size_t n1, n2;
+  unsigned i;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 0x01020304 * i;
+
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN
+      | GD_VERBOSE | GD_CREAT | GD_EXCL);
+  gd_add_spec(D, "data RAW UINT32 1", 0);
+  n1 = gd_putdata(D, "data", 5, 0, 8, 0, GD_UINT32, c);
+  CHECKI(n1, 8);
+
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nf = gd_nframes(D);
+  CHECKU(nf, 13);
+
+  n2 = gd_getdata(D, "data", 0, 0, 0, 13, GD_UINT32, d);
+  CHECKI(n2, 13);
+
+  e3 = gd_error(D);
+  CHECKI(e3, GD_E_OK);
+
+  for (i = 0; i < 13; ++i) {
+    if (i < 5)
+      CHECKXi(i, d[i], 0);
+    else
+      CHECKXi(i, d[i], 0x01020304U * (i - 5));
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_put_little.c b/test/flac_put_little.c
new file mode 100644
index 0000000..944f723
--- /dev/null
+++ b/test/flac_put_little.c
@@ -0,0 +1,118 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_flac = "dirfile/data.flac";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+#ifdef USE_FLAC
+  char command[4096];
+  uint16_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, unlink_data, unlink_flac, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 0x0101 * i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_FLAC
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN
+      | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_flac, &buf);
+
+#ifdef USE_FLAC
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 8);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_FLAC
+  snprintf(command, 4096, "%s --silent --decode --delete-input-file "
+      "--force-raw-format --sign=signed --endian=little %s --output-name=%s",
+      FLAC, data_flac, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof d)) {
+        if (i < 40 || i > 48) {
+          CHECKXi(i, d, 0);
+        } else
+          CHECKXi(i, d, (i - 40) * 0x0101);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_flac = unlink(data_flac);
+  CHECKI(unlink_flac, -1);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_FLAC
+  CHECKI(unlink_data, 0);
+#else
+  CHECKI(unlink_data, -1);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/flac_seek.c b/test/flac_seek.c
new file mode 100644
index 0000000..7fe2f33
--- /dev/null
+++ b/test/flac_seek.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* encode */
+  snprintf(command, 4096,
+      "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_FLAC
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_LITTLE_ENDIAN);
+#else
+  D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN);
+#endif
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  error = gd_error(D);
+
+#ifdef USE_FLAC
+  CHECKI(error, 0);
+  CHECKI(n, 40);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, -1);
+#endif
+
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_seek_far.c b/test/flac_seek_far.c
new file mode 100644
index 0000000..cce3a7a
--- /dev/null
+++ b/test/flac_seek_far.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *flacdata = "dirfile/data.flac";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* encode */
+  snprintf(command, 4096,
+      "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
+      "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN);
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  error = gd_error(D);
+
+#ifdef USE_FLAC
+  CHECKI(error, 0);
+  CHECKI(n, 256);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, -1);
+#endif
+
+  gd_discard(D);
+
+  unlink(flacdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flac_sync.c b/test/flac_sync.c
new file mode 100644
index 0000000..86766f8
--- /dev/null
+++ b/test/flac_sync.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_FLAC || !defined USE_FLAC
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_flac = "dirfile/data.flac";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_VERBOSE);
+  gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  n = gd_flush(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_flac, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s --silent --decode --delete-input-file "
+      "--force-raw-format --sign=signed --endian=little %s --output-name=%s",
+      FLAC, data_flac, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/flist.c b/test/flist.c
index d16106c..fc9e423 100644
--- a/test/flist.c
+++ b/test/flist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -75,7 +75,7 @@ int main(void)
 
   CHECKI(i, 4);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist0.c b/test/flist0.c
new file mode 100644
index 0000000..072ff9c
--- /dev/null
+++ b/test/flist0.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_field_list_by_type(D, GD_RAW_ENTRY);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+  CHECKP(field_list[0]);
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist2.c b/test/flist2.c
new file mode 100644
index 0000000..e4c7697
--- /dev/null
+++ b/test/flist2.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "data3 RAW UINT8 1\n";
+  int fd, i, z, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  for (z = 0; z < 2; ++z) {
+    field_list = gd_field_list(D);
+
+    error = gd_error(D);
+
+    CHECKIi(z, error, 0);
+    CHECKPNi(z, field_list);
+
+    for (i = 0; ; ++i) {
+      if (field_list[i] == NULL)
+        break;
+
+      if (strcmp(field_list[i], "data1") == 0)
+        continue;
+      else if (strcmp(field_list[i], "data2") == 0)
+        continue;
+      else if (strcmp(field_list[i], "data3") == 0)
+        continue;
+      else if (strcmp(field_list[i], "INDEX") == 0)
+        continue;
+
+      fprintf(stderr, "field_list[%i@%i] = \"%s\"\n", i, z, field_list[i]);
+      r = 1;
+    }
+
+    CHECKIi(z, i, 4);
+  }
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_hidden.c b/test/flist_hidden.c
index 110aa51..715895b 100644
--- a/test/flist_hidden.c
+++ b/test/flist_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
 
   CHECKI(i, 3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist_invalid.c b/test/flist_invalid.c
index 87a205c..d69bfc4 100644
--- a/test/flist_invalid.c
+++ b/test/flist_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_field_list(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/flist_meta.c b/test/flist_meta.c
index 3103791..14b2807 100644
--- a/test/flist_meta.c
+++ b/test/flist_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -71,7 +71,7 @@ int main(void)
 
   CHECKI(i, 3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist_meta2.c b/test/flist_meta2.c
new file mode 100644
index 0000000..d1e174a
--- /dev/null
+++ b/test/flist_meta2.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent RAW UINT8 1\n"
+    "META parent data1 LINTERP UINT8 1\n"
+    "META parent data2 LINTERP UINT8 1\n"
+    "META parent data3 LINTERP UINT8 1\n";
+  int fd, i, z, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  for (z = 0; z < 2; ++z) {
+    field_list = gd_mfield_list(D, "parent");
+
+    error = gd_error(D);
+    CHECKI(error, 0);
+    CHECKPN(field_list);
+
+    for (i = 0; field_list[i] != NULL; ++i) {
+      CHECKIi(i * 2 + z,strlen(field_list[i]), 5);
+      CHECKIi(i * 2 + z,field_list[i][0], 'd');
+      CHECKIi(i * 2 + z,field_list[i][1], 'a');
+      CHECKIi(i * 2 + z,field_list[i][2], 't');
+      CHECKIi(i * 2 + z,field_list[i][3], 'a');
+
+      if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+        fprintf(stderr, "field_list[%i@%i] = \"%s\"\n", i, z, field_list[i]);
+        r = 1;
+      }
+    }
+
+    CHECKIi(z, i, 3);
+  }
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_meta_hidden.c b/test/flist_meta_hidden.c
index cad3250..a8a4e38 100644
--- a/test/flist_meta_hidden.c
+++ b/test/flist_meta_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
 
   CHECKI(i, 2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist_meta_invalid.c b/test/flist_meta_invalid.c
index 02a83f4..f8a6274 100644
--- a/test/flist_meta_invalid.c
+++ b/test/flist_meta_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_mfield_list(D, "parent");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/flist_type.c b/test/flist_type.c
index 65ceacc..6819edb 100644
--- a/test/flist_type.c
+++ b/test/flist_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -75,7 +75,7 @@ int main(void)
 
   CHECKI(i, 3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist_type_hidden.c b/test/flist_type_hidden.c
index 2835c10..df74ae8 100644
--- a/test/flist_type_hidden.c
+++ b/test/flist_type_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,7 +67,7 @@ int main(void)
 
   CHECKI(i, 2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist_type_invalid.c b/test/flist_type_invalid.c
index 33c2147..c2d0153 100644
--- a/test/flist_type_invalid.c
+++ b/test/flist_type_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_field_list_by_type(D, GD_STRING_ENTRY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/flist_type_meta.c b/test/flist_type_meta.c
index 3fc6bd9..b5e5112 100644
--- a/test/flist_type_meta.c
+++ b/test/flist_type_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -74,7 +74,7 @@ int main(void)
 
   CHECKI(i, 3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist_type_meta_hidden.c b/test/flist_type_meta_hidden.c
index 496489f..9367fdc 100644
--- a/test/flist_type_meta_hidden.c
+++ b/test/flist_type_meta_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
 
   CHECKI(i, 2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/flist_type_meta_invalid.c b/test/flist_type_meta_invalid.c
index eb64d5a..91336ec 100644
--- a/test/flist_type_meta_invalid.c
+++ b/test/flist_type_meta_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/flush.c b/test/flush.c
deleted file mode 100644
index ff75c67..0000000
--- a/test/flush.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-/* Attempt to 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *format_data = "data RAW UINT8 8\n";
-  uint8_t c[8], d;
-  int fd, i, n, error;
-  struct stat buf;
-  DIRFILE *D;
-
-  memset(c, 0, 8);
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  for (i = 0; i < 8; ++i)
-    c[i] = (uint8_t)(40 + i);
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
-  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
-  gd_flush(D, "data");
-  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
index c2a7fe5..47fdacc 100644
--- a/test/flush_all.c
+++ b/test/flush_all.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to flush */
 #include "test.h"
 
 #include <inttypes.h>
@@ -36,7 +35,7 @@ int main(void)
   const char *data = "dirfile/data";
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
-  int fd, i, n, error;
+  int fd, i, n, e1, e2, r = 0;
   struct stat buf;
   DIRFILE *D;
 
@@ -54,23 +53,23 @@ int main(void)
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n, 8);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
-  if (stat(data, &buf))
-    return 1;
-  if (buf.st_size != 40 + 8 * sizeof(uint8_t))
-    return 1;
+  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) {
-      if (d != 0)
-        return 1;
-    } else if (d != i)
-      return 1;
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
     i++;
   }
   close(fd);
@@ -79,10 +78,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  if (error)
-    return 1;
-  if (n != 8)
-    return 1;
-
-  return 0;
+  return r;
 }
diff --git a/test/flush_amb_code.c b/test/flush_amb_code.c
new file mode 100644
index 0000000..bd52eee
--- /dev/null
+++ b/test/flush_amb_code.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, e2, i = 0, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  /* For no good, but long standing, reason, these are all valid field names,
+   * I guess... */
+  char *code[] = {"0", "0x1", "02", "3.00", "4e0", "0x5p0"};
+
+  memset(&E, 0, sizeof(E));
+  E.field = "pathological";
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.EN(polynom,poly_ord) = 5;
+  E.in_fields[0] = "INDEX";
+
+  E.scalar[0] = code[0];
+  E.scalar[1] = code[1];
+  E.scalar[2] = code[2];
+  E.scalar[3] = code[3];
+  E.scalar[4] = code[4];
+  E.scalar[5] = code[5];
+
+  E.scalar_ind[0] = -1;
+  E.scalar_ind[1] = -1;
+  E.scalar_ind[2] = -1;
+  E.scalar_ind[3] = -1;
+  E.scalar_ind[4] = -1;
+  E.scalar_ind[5] = -1;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC | GD_VERBOSE);
+
+  gd_add(D, &E);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_entry(D, "pathological", &E);
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+
+  for (i = 0; i < 6; ++i)
+    CHECKSi(i, E.scalar[i], code[i]);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flush_bad_code.c b/test/flush_bad_code.c
index 2d8c713..c4b58d4 100644
--- a/test/flush_bad_code.c
+++ b/test/flush_bad_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   gd_flush(D, "no-such-field");
 
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/flush_flush.c b/test/flush_flush.c
new file mode 100644
index 0000000..8b31ee6
--- /dev/null
+++ b/test/flush_flush.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d;
+  int fd, i, n, e1, e2, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  gd_flush(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n, 8);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flush_invalid.c b/test/flush_invalid.c
index 60bac39..e2bfa8e 100644
--- a/test/flush_invalid.c
+++ b/test/flush_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   gd_flush(D, NULL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
 
diff --git a/test/flush_lincom.c b/test/flush_lincom.c
new file mode 100644
index 0000000..7254ce7
--- /dev/null
+++ b/test/flush_lincom.c
@@ -0,0 +1,109 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *bata = "dirfile/bata";
+  const char *cata = "dirfile/cata";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "bata RAW UINT8 8\n"
+    "cata RAW UINT8 8\n"
+    "data RAW UINT8 8\n"
+    "lincom LINCOM bata 1 0 cata 1 0 data 1 0\n";
+  uint8_t c[8], d;
+  int fd, i, n, e1, e2, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "bata", 5, 0, 1, 0, GD_UINT8, c);
+
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  gd_flush(D, "lincom");
+  e1 = gd_error(D);
+  CHECKI(n, 8);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat(data)");
+    r = 1;
+  } else
+    CHECKIi(0, buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+  if (!stat(cata, &buf)) {
+    perror("stat(cata)");
+    r = 1;
+  }
+
+  if (stat(bata, &buf)) {
+    perror("stat(bata)");
+    r = 1;
+  } else
+    CHECKIi(0, buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
+    i++;
+  }
+  close(fd);
+
+  fd = open(bata, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKIi(1000 + i, d, (i < 40 || i > 48) ? 0 : i);
+    i++;
+  }
+  close(fd);
+
+  unlink(bata);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flush_lincom1.c b/test/flush_lincom1.c
new file mode 100644
index 0000000..054d184
--- /dev/null
+++ b/test/flush_lincom1.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "lincom LINCOM data 1 0\n";
+  uint8_t c[8], d;
+  int fd, i, n, e1, e2, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, c);
+  gd_flush(D, "lincom");
+  e1 = gd_error(D);
+  CHECKI(n, 8);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat(data)");
+    r = 1;
+  } else
+    CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flush_meta.c b/test/flush_meta.c
index 294a73e..e0735d3 100644
--- a/test/flush_meta.c
+++ b/test/flush_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to flush meta data */
 #include "test.h"
 
 #include <inttypes.h>
@@ -35,7 +34,7 @@ int main(void)
   const char *format = "dirfile/format";
   const char *data = "dirfile/new";
   struct stat buf;
-  int error, stat_format, r = 0;
+  int e1, e2, stat_format, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -43,18 +42,18 @@ int main(void)
       GD_VERBOSE);
   gd_add_raw(D, "new", GD_UINT8, 2, 0);
   gd_metaflush(D);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   stat_format = stat(format, &buf);
+  CHECKI(stat_format, 0);
 
   unlink(data);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(stat_format, 0);
-  CHECKI(error, GD_E_OK);
-
   return r;
 }
diff --git a/test/flush_mult.c b/test/flush_mult.c
new file mode 100644
index 0000000..8e9761b
--- /dev/null
+++ b/test/flush_mult.c
@@ -0,0 +1,90 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *cata = "dirfile/cata";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "cata RAW UINT8 8\n"
+    "data RAW UINT8 8\n"
+    "mult MULTIPLY cata data\n";
+  uint8_t c[8], d;
+  int fd, i, n, e1, e2, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  gd_flush(D, "mult");
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n, 8);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat(data)");
+    r = 1;
+  } else
+    CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+  if (!stat(cata, &buf)) {
+    perror("stat(cata)");
+    r = 1;
+  }
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flush_raw_close.c b/test/flush_raw_close.c
new file mode 100644
index 0000000..b2e51ac
--- /dev/null
+++ b/test/flush_raw_close.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d;
+  int fd, i, n, e1, e2, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  gd_raw_close(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n, 8);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flush_ref.c b/test/flush_ref.c
index 75a0b3f..c04e6d2 100644
--- a/test/flush_ref.c
+++ b/test/flush_ref.c
@@ -37,7 +37,7 @@ int main(void)
   const char *format1 = "dirfile/sub/format";
   const char *format_data = "data RAW UINT8 1\nREFERENCE data\n";
   const char *format1_data = "mata RAW UINT8 11\nREFERENCE mata\n";
-  int fd, e1, r = 0;
+  int fd, e1, e2, r = 0;
   const char *r1;
   DIRFILE *D;
 
@@ -56,7 +56,10 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   gd_include_affix(D, "sub/format", 0, "prefix_", NULL, GD_IGNORE_REFS);
   gd_rewrite_fragment(D, GD_ALL_FRAGMENTS);
-  gd_close(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
   D = gd_open(subdir, GD_RDONLY | GD_VERBOSE);
   r1 = gd_reference(D, NULL);
   CHECKS(r1, "mata");
diff --git a/test/flush_spec.c b/test/flush_spec.c
index 10fa57b..61cc250 100644
--- a/test/flush_spec.c
+++ b/test/flush_spec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
     gd_add_spec(D, spec[i], 0);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   stream = fopen(format, "rt");
   i = 0;
diff --git a/test/flush_string.c b/test/flush_string.c
new file mode 100644
index 0000000..0646549
--- /dev/null
+++ b/test/flush_string.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+#define S "a\"b\\c#d e\tf\ng"
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, e0, r = 0;
+  char s[100] = {0};
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC |
+      GD_VERBOSE);
+  gd_add_string(D, "s", S, 0);
+
+  e0 = gd_close(D);
+  CHECKI(e0, 0);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_get_string(D, "s", 100, s);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  gd_discard(D);
+
+  CHECKS(s, S);
+
+  unlink(format);
+  rmdir(filedir);
+
+
+  return r;
+}
diff --git a/test/flush_sync.c b/test/flush_sync.c
new file mode 100644
index 0000000..ceea47a
--- /dev/null
+++ b/test/flush_sync.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d;
+  int fd, i, n, e1, e2, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  gd_sync(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n, 8);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    return 1;
+  }
+  CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/foffs_alter.c b/test/foffs_alter.c
index 1b795c9..6b2b86e 100644
--- a/test/foffs_alter.c
+++ b/test/foffs_alter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   fo = gd_frameoffset(D, 0);
   nf = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/foffs_alter_all.c b/test/foffs_alter_all.c
new file mode 100644
index 0000000..ec1be70
--- /dev/null
+++ b/test/foffs_alter_all.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "/FRAMEOFFSET 13\n"
+    "/INCLUDE format1\n";
+  const char *format1_data = "data1 RAW UINT8 8\n/FRAMEOFFSET 14\n";
+  int fd, ret, error, r = 0;
+  off_t o0, o1, o2, o3;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  o0 = gd_frameoffset(D, 0);
+  o1 = gd_frameoffset(D, 1);
+  ret = gd_alter_frameoffset(D, 16, GD_ALL_FRAGMENTS, 0);
+  error = gd_error(D);
+  o2 = gd_frameoffset(D, 0);
+  o3 = gd_frameoffset(D, 1);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKI(o0, 13);
+  CHECKI(o1, 14);
+  CHECKI(o2, 16);
+  CHECKI(o3, 16);
+
+  return r;
+}
diff --git a/test/foffs_get.c b/test/foffs_get.c
index 55470f1..52e26b5 100644
--- a/test/foffs_get.c
+++ b/test/foffs_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_frameoffset(D, 0);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/foffs_move.c b/test/foffs_move.c
index 5271090..6747f57 100644
--- a/test/foffs_move.c
+++ b/test/foffs_move.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   fo = gd_frameoffset(D, 0);
   nf = gd_nframes(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/fragment_affix.c b/test/fragment_affix.c
index 2832bb8..0d8c13f 100644
--- a/test/fragment_affix.c
+++ b/test/fragment_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   ret = gd_fragment_affixes(D, 1, &prefix, &suffix);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/fragment_affix_alter.c b/test/fragment_affix_alter.c
index 666813d..37d88e1 100644
--- a/test/fragment_affix_alter.c
+++ b/test/fragment_affix_alter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   e2 = gd_error(D);
   gd_spf(D, "CdataZ");
   e3 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/fragment_affix_alter2.c b/test/fragment_affix_alter2.c
index 52f02ef..d9f3623 100644
--- a/test/fragment_affix_alter2.c
+++ b/test/fragment_affix_alter2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
   e1 = gd_error(D);
   gd_spf(D, "ABdataY");
   e2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/fragment_affix_alter_code.c b/test/fragment_affix_alter_code.c
new file mode 100644
index 0000000..37ce2c5
--- /dev/null
+++ b/test/fragment_affix_alter_code.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW INT16 11\n";
+  int fd, ret, e1, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_alter_affixes(D, 1, NULL, ".txt");
+  e1 = gd_error(D);
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret,-1);
+  CHECKI(e1,GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/fragment_affix_alter_nop.c b/test/fragment_affix_alter_nop.c
new file mode 100644
index 0000000..c37a1c2
--- /dev/null
+++ b/test/fragment_affix_alter_nop.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "B CONST UINT8 1\nINCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  char *prefix;
+  char *suffix;
+  int fd, ret, e1, e2, e3, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_alter_affixes(D, 1, "A", "Z");
+  e1 = gd_error(D);
+  gd_fragment_affixes(D, 1, &prefix, &suffix);
+  e2 = gd_error(D);
+  gd_spf(D, "AdataZ");
+  e3 = gd_error(D);
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKS(prefix,"A");
+  CHECKS(suffix,"Z");
+  CHECKI(ret,0);
+  CHECKI(e1,0);
+  CHECKI(e2,0);
+  CHECKI(e3,0);
+  free(prefix);
+  free(suffix);
+
+  return r;
+}
diff --git a/test/fragment_affix_dup.c b/test/fragment_affix_dup.c
index d9fa28a..f7e38cf 100644
--- a/test/fragment_affix_dup.c
+++ b/test/fragment_affix_dup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   e1 = gd_error(D);
   gd_fragment_affixes(D, 1, &prefix, &suffix);
   e2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/fragment_index.c b/test/fragment_index.c
index f79e4bb..de3d2ca 100644
--- a/test/fragment_index.c
+++ b/test/fragment_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   n = gd_fragment_index(D, "data");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format1);
   unlink(format);
   rmdir(filedir);
diff --git a/test/fragment_index_alias.c b/test/fragment_index_alias.c
index aed2b59..39dab25 100644
--- a/test/fragment_index_alias.c
+++ b/test/fragment_index_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   n = gd_fragment_index(D, "alias");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format1);
   unlink(format);
   rmdir(filedir);
diff --git a/test/fragment_name.c b/test/fragment_name.c
index f1ba2c1..fe0454a 100644
--- a/test/fragment_name.c
+++ b/test/fragment_name.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -35,8 +35,8 @@ int main(void)
   const char *format1 = "dirfile/format1";
   const char *format_data = "INCLUDE format1\n";
   const char *format1_data = "data RAW UINT8 11\n";
-  char *form0 = NULL;
-  char *form1 = NULL;
+  const char *form0;
+  const char *form1;
   int fd, r = 0;
   DIRFILE *D;
 
@@ -52,14 +52,8 @@ int main(void)
   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);
-
+  form0 = gd_fragmentname(D, 0);
+  form1 = gd_fragmentname(D, 1);
   /* This only checks whether the end of the returned path is what we expect.
    * This should work, since we can guarantee that both "dirfile" and "format*"
    * aren't symlinks. */
@@ -70,8 +64,12 @@ int main(void)
   CHECKEOS(form0,"dirfile\\format");
   CHECKEOS(form1,"dirfile\\format1");
 #endif
-  free(form0);
-  free(form1);
+
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
 
   return r;
 }
diff --git a/test/fragment_name_oor.c b/test/fragment_name_oor.c
index b4e2680..5fb8d4d 100644
--- a/test/fragment_name_oor.c
+++ b/test/fragment_name_oor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   form0 = gd_fragmentname(D, -3000);
   form1 = gd_fragmentname(D, 1000);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/fragment_num.c b/test/fragment_num.c
index e6cc8a9..89b1848 100644
--- a/test/fragment_num.c
+++ b/test/fragment_num.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfragments = gd_nfragments(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/fragment_parent.c b/test/fragment_parent.c
index ffbdddb..0da18ae 100644
--- a/test/fragment_parent.c
+++ b/test/fragment_parent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   parent = gd_parent_fragment(D, 2);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/get64.c b/test/get64.c
index e05a589..9492a35 100644
--- a/test/get64.c
+++ b/test/get64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKUi(i,c[i],40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_affix.c b/test/get_affix.c
index 22193e7..b24a23d 100644
--- a/test/get_affix.c
+++ b/test/get_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   n = gd_getdata(D, "AphaseZ", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format1);
diff --git a/test/get_bad_code.c b/test/get_bad_code.c
index 15af673..01f55fa 100644
--- a/test/get_bad_code.c
+++ b/test/get_bad_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_getdata(D, "no-such-field", 5, 0, 1, 0, GD_UINT8, &c);
 
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_bit.c b/test/get_bit.c
index bee8b52..a84d727 100644
--- a/test/get_bit.c
+++ b/test/get_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_carray.c b/test/get_carray.c
index 146f183..6255fde 100644
--- a/test/get_carray.c
+++ b/test/get_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_get_carray(D, "carray", GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_carray_c2r.c b/test/get_carray_c2r.c
index e10b900..fcee2a6 100644
--- a/test/get_carray_c2r.c
+++ b/test/get_carray_c2r.c
@@ -48,7 +48,7 @@ int main(void)
   n = gd_get_carray(D, "carray", GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_carray_len.c b/test/get_carray_len.c
index e0bf34e..f24f2b0 100644
--- a/test/get_carray_len.c
+++ b/test/get_carray_len.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,10 +46,10 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  n = gd_carray_len(D, "carray");
+  n = gd_array_len(D, "carray");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_carray_slice.c b/test/get_carray_slice.c
index 129c1bb..1065492 100644
--- a/test/get_carray_slice.c
+++ b/test/get_carray_slice.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_get_carray_slice(D, "carray", 2, 4, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_char.c b/test/get_char.c
index 9f98677..5e45464 100644
--- a/test/get_char.c
+++ b/test/get_char.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, (gd_type_t)'c', c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_clincom.c b/test/get_clincom.c
index 4eff3f8..d0b391f 100644
--- a/test/get_clincom.c
+++ b/test/get_clincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_COMPLEX128, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_complex128.c b/test/get_complex128.c
index 18c2057..b8d634d 100644
--- a/test/get_complex128.c
+++ b/test/get_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_complex64.c b/test/get_complex64.c
index 91b64ae..cbcd754 100644
--- a/test/get_complex64.c
+++ b/test/get_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_const.c b/test/get_const.c
index 9c1358a..dbfd0b2 100644
--- a/test/get_const.c
+++ b/test/get_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_get_constant(D, "const", GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_const_carray.c b/test/get_const_carray.c
new file mode 100644
index 0000000..f2182e8
--- /dev/null
+++ b/test/get_const_carray.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n";
+  double c;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_get_constant(D, "carray", GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKF(c, 8.3);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_const_complex.c b/test/get_const_complex.c
index 13b5687..0a8f1c7 100644
--- a/test/get_const_complex.c
+++ b/test/get_const_complex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
 #endif
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_const_repr.c b/test/get_const_repr.c
index 96a669c..e4f9cf1 100644
--- a/test/get_const_repr.c
+++ b/test/get_const_repr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_get_constant(D, "const.m", GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_cpolynom.c b/test/get_cpolynom.c
index c195a15..8d790b6 100644
--- a/test/get_cpolynom.c
+++ b/test/get_cpolynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_dim.c b/test/get_dim.c
new file mode 100644
index 0000000..91f5dab
--- /dev/null
+++ b/test/get_dim.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST UINT8 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_DIMENSION);
+  CHECKI(n, 0);
+
+  return r;
+}
diff --git a/test/get_divide.c b/test/get_divide.c
index 1f54191..f171360 100644
--- a/test/get_divide.c
+++ b/test/get_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian16.c b/test/get_endian16.c
index 0871c50..8e1ba0b 100644
--- a/test/get_endian16.c
+++ b/test/get_endian16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian32.c b/test/get_endian32.c
index 0bd5fcf..3275a58 100644
--- a/test/get_endian32.c
+++ b/test/get_endian32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian64.c b/test/get_endian64.c
index b750944..85a5f4a 100644
--- a/test/get_endian64.c
+++ b/test/get_endian64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian8.c b/test/get_endian8.c
index fca7168..8d522ad 100644
--- a/test/get_endian8.c
+++ b/test/get_endian8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_complex128_arm.c b/test/get_endian_complex128_arm.c
index 181567b..d710f70 100644
--- a/test/get_endian_complex128_arm.c
+++ b/test/get_endian_complex128_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -205,7 +205,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_complex128_big.c b/test/get_endian_complex128_big.c
index b44246f..8ad09e7 100644
--- a/test/get_endian_complex128_big.c
+++ b/test/get_endian_complex128_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -205,7 +205,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_complex128_little.c b/test/get_endian_complex128_little.c
index 8ffb539..ba1133b 100644
--- a/test/get_endian_complex128_little.c
+++ b/test/get_endian_complex128_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -205,7 +205,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_complex64_arm.c b/test/get_endian_complex64_arm.c
index 5aa8a07..59e5dda 100644
--- a/test/get_endian_complex64_arm.c
+++ b/test/get_endian_complex64_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -141,7 +141,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_complex64_big.c b/test/get_endian_complex64_big.c
index 930d29c..9236e92 100644
--- a/test/get_endian_complex64_big.c
+++ b/test/get_endian_complex64_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -141,7 +141,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_complex64_little.c b/test/get_endian_complex64_little.c
index 191fcd9..ec3b438 100644
--- a/test/get_endian_complex64_little.c
+++ b/test/get_endian_complex64_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -141,7 +141,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_float32_arm.c b/test/get_endian_float32_arm.c
index c76b6c9..bd2e6ed 100644
--- a/test/get_endian_float32_arm.c
+++ b/test/get_endian_float32_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -127,7 +127,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_float32_big.c b/test/get_endian_float32_big.c
index f84c496..16ff95a 100644
--- a/test/get_endian_float32_big.c
+++ b/test/get_endian_float32_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -127,7 +127,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_float32_little.c b/test/get_endian_float32_little.c
index 535e1db..c12b7e5 100644
--- a/test/get_endian_float32_little.c
+++ b/test/get_endian_float32_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -127,7 +127,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_float64_arm.c b/test/get_endian_float64_arm.c
index ee554b6..59acb29 100644
--- a/test/get_endian_float64_arm.c
+++ b/test/get_endian_float64_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -191,7 +191,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_float64_big.c b/test/get_endian_float64_big.c
index 7d3c7fe..f085642 100644
--- a/test/get_endian_float64_big.c
+++ b/test/get_endian_float64_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -191,7 +191,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_endian_float64_little.c b/test/get_endian_float64_little.c
index 970aa46..b689eed 100644
--- a/test/get_endian_float64_little.c
+++ b/test/get_endian_float64_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -191,7 +191,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_ff.c b/test/get_ff.c
index 5217c54..5ad011c 100644
--- a/test/get_ff.c
+++ b/test/get_ff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_float32.c b/test/get_float32.c
index ed16c3c..ebcdde2 100644
--- a/test/get_float32.c
+++ b/test/get_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_float64.c b/test/get_float64.c
index b2e1688..1960d18 100644
--- a/test/get_float64.c
+++ b/test/get_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_foffs.c b/test/get_foffs.c
index 15a8c94..a487017 100644
--- a/test/get_foffs.c
+++ b/test/get_foffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_fs.c b/test/get_fs.c
index 2c428e4..0270f9c 100644
--- a/test/get_fs.c
+++ b/test/get_fs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 0, 8, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_here.c b/test/get_here.c
index b0868fc..3035a69 100644
--- a/test/get_here.c
+++ b/test/get_here.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", GD_HERE, 0, 0, 8, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_here_foffs.c b/test/get_here_foffs.c
index 6074ac9..44ccd80 100644
--- a/test/get_here_foffs.c
+++ b/test/get_here_foffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
   e2 = gd_error(D);
   j = gd_tell(D, "data");
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_heres.c b/test/get_heres.c
index 49ad86f..30ea057 100644
--- a/test/get_heres.c
+++ b/test/get_heres.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 0, GD_HERE, 0, 8, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_index_complex.c b/test/get_index_complex.c
new file mode 100644
index 0000000..baac290
--- /dev/null
+++ b/test/get_index_complex.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  int i, n, error, r = 0;
+  double c[16];
+  DIRFILE *D;
+
+  memset(c, 0, 16 * sizeof(double));
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "INDEX", 5, 0, 8, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 16; i += 2) {
+    CHECKFi(i, c[i], 5. + i / 2);
+    CHECKFi(i, c[i + 1], 0);
+  }
+
+  return r;
+}
diff --git a/test/get_int16.c b/test/get_int16.c
index 88e6b1b..cbedea7 100644
--- a/test/get_int16.c
+++ b/test/get_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_int32.c b/test/get_int32.c
index 3419fbc..422f3fe 100644
--- a/test/get_int32.c
+++ b/test/get_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKIi(i, c[i], (0x50000028 + i * 0x02000001)  * (2 * (i % 2) - 1));
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_int64.c b/test/get_int64.c
index 87ccf25..72cb029 100644
--- a/test/get_int64.c
+++ b/test/get_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
     CHECKIi(i,c[i], (0x5000000000000028 + i * 0x0200000000000001)
         * (2 * (i % 2) - 1));
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_int8.c b/test/get_int8.c
index 3ed6a84..aee4ecc 100644
--- a/test/get_int8.c
+++ b/test/get_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_invalid.c b/test/get_invalid.c
index 2c680bb..c0a651c 100644
--- a/test/get_invalid.c
+++ b/test/get_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ int main(void)
   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);
+  gd_discard(D);
 
   CHECKI(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/get_lincom1.c b/test/get_lincom1.c
index 3402c1d..210e968 100644
--- a/test/get_lincom1.c
+++ b/test/get_lincom1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_lincom2.c b/test/get_lincom2.c
index ed0cb97..5fdb517 100644
--- a/test/get_lincom2.c
+++ b/test/get_lincom2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_lincom2s.c b/test/get_lincom2s.c
new file mode 100644
index 0000000..8fd5328
--- /dev/null
+++ b/test/get_lincom2s.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "lincom LINCOM data 1 0 phase 1 0\n"
+    "phase PHASE data 128\n"
+    "data RAW UINT8 1\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 0, 0, 1000, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 128);
+
+  return r;
+}
diff --git a/test/get_lincom3.c b/test/get_lincom3.c
index 28153e8..d7d07f1 100644
--- a/test/get_lincom3.c
+++ b/test/get_lincom3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_lincom3s.c b/test/get_lincom3s.c
new file mode 100644
index 0000000..b929a6f
--- /dev/null
+++ b/test/get_lincom3s.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "lincom LINCOM data 1 0 data 1 0 phase 1 0\n"
+    "phase PHASE data 128\n"
+    "data RAW UINT8 1\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 0, 0, 1000, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 128);
+
+  return r;
+}
diff --git a/test/get_lincom_mdt.c b/test/get_lincom_mdt.c
new file mode 100644
index 0000000..e4d61d0
--- /dev/null
+++ b/test/get_lincom_mdt.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 1 data 1 0\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 5);
+
+  return r;
+}
diff --git a/test/get_lincom_noin.c b/test/get_lincom_noin.c
index 8315f4e..dfb21a4 100644
--- a/test/get_lincom_noin.c
+++ b/test/get_lincom_noin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_lincom_non.c b/test/get_lincom_non.c
index e6bcaab..0e7670e 100644
--- a/test/get_lincom_non.c
+++ b/test/get_lincom_non.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_lincom_null.c b/test/get_lincom_null.c
index 9e1f422..1fdc92c 100644
--- a/test/get_lincom_null.c
+++ b/test/get_lincom_null.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
   n = gd_getdata(D, "lincom", 5, 0, 10, 0, GD_NULL, NULL);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_lincom_spf.c b/test/get_lincom_spf.c
index 1544870..be4a211 100644
--- a/test/get_lincom_spf.c
+++ b/test/get_lincom_spf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   n = gd_getdata(D, "lincom", 5, 0, 5, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(cata);
   unlink(data);
diff --git a/test/get_linterp.c b/test/get_linterp.c
index f7a9a1a..a1e2a9c 100644
--- a/test/get_linterp.c
+++ b/test/get_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   close(fd);
 
   t = fopen(table, "wt");
-  for (i = 0; i < 10; ++i)
+  for (i = 0; i < 2 * GD_LUT_CHUNK; ++i)
     fprintf(t, "%i %i\n", i * 6, i * 12);
   fclose(t);
 
@@ -65,7 +65,7 @@ int main(void)
   n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(table);
   unlink(data);
diff --git a/test/get_linterp1.c b/test/get_linterp1.c
new file mode 100644
index 0000000..1f53501
--- /dev/null
+++ b/test/get_linterp1.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[64];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64);
+  close(fd);
+
+  t = fopen(table, "wt");
+  fputs("0 0\n", t);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_LUT);
+  CHECKI(n, 0);
+
+  return r;
+}
diff --git a/test/get_linterp_abs.c b/test/get_linterp_abs.c
new file mode 100644
index 0000000..62083b2
--- /dev/null
+++ b/test/get_linterp_abs.c
@@ -0,0 +1,98 @@
+/* Copyright (C) 2013, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/* this tests handling absolute directories in _GD_GrabDir and also test
+ * garbage collection in _GD_ReleaseDir */
+#include "test.h"
+
+#include <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)
+{
+#if defined GD_NO_GETCWD
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *lutdir = "dirfile/lut";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/lut/table";
+  const char *format_data1 = "linterp LINTERP data ";
+  const char *format_data2 = "/dirfile/lut/table\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[64];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+  int cwd_size = 2048;
+  char *ptr, *cwd = NULL;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(lutdir, 0777);
+
+  gdtest_getcwd(ptr, cwd, cwd_size);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  gd_pathwrite(fd, cwd);
+  write(fd, format_data2, strlen(format_data2));
+  close(fd);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64);
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 30; ++i)
+    fprintf(t, "%i %i\n", i * 6, i * 12);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(lutdir);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 10);
+
+  free(cwd);
+
+  return r;
+#endif
+}
diff --git a/test/get_linterp_complex.c b/test/get_linterp_complex.c
new file mode 100644
index 0000000..da7dbc7
--- /dev/null
+++ b/test/get_linterp_complex.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n";
+  double c[2];
+  unsigned char data_data[64];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64);
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 10; ++i)
+    fprintf(t, "%i %i;%i\n", i * 6, i * 12, i * 12 + 3);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKF(c[0], 10.);
+  CHECKF(c[1], 13.);
+
+  return r;
+}
diff --git a/test/get_linterp_empty.c b/test/get_linterp_empty.c
new file mode 100644
index 0000000..56ab6f9
--- /dev/null
+++ b/test/get_linterp_empty.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[64];
+  int fd, n1, error1, n2, error2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n1 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error1 = gd_error(D);
+  n2 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error2 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(table);
+  rmdir(filedir);
+
+  CHECKI(n1, 0);
+  CHECKI(error1, GD_E_LUT);
+  CHECKI(n2, 0);
+  CHECKI(error2, GD_E_LUT);
+
+  return r;
+}
diff --git a/test/get_linterp_noin.c b/test/get_linterp_noin.c
index c291b8d..2a1f842 100644
--- a/test/get_linterp_noin.c
+++ b/test/get_linterp_noin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(table);
   unlink(format);
diff --git a/test/get_linterp_notab.c b/test/get_linterp_notab.c
index 86b7733..2059787 100644
--- a/test/get_linterp_notab.c
+++ b/test/get_linterp_notab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,16 +60,16 @@ int main(void)
   n2 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
   error2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
   rmdir(filedir);
 
   CHECKI(n1, 0);
-  CHECKI(error1, GD_E_OPEN_LINFILE);
+  CHECKI(error1, GD_E_IO);
   CHECKI(n2, 0);
-  CHECKI(error2, GD_E_OPEN_LINFILE);
+  CHECKI(error2, GD_E_IO);
 
   return r;
 }
diff --git a/test/get_linterp_sort.c b/test/get_linterp_sort.c
index a07a1e5..573ea24 100644
--- a/test/get_linterp_sort.c
+++ b/test/get_linterp_sort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(table);
   unlink(data);
diff --git a/test/get_mplex.c b/test/get_mplex.c
index c5638af..91ea4f3 100644
--- a/test/get_mplex.c
+++ b/test/get_mplex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(count);
   unlink(data);
diff --git a/test/get_mplex_bof.c b/test/get_mplex_bof.c
index 1fd7fd2..bf90d0e 100644
--- a/test/get_mplex_bof.c
+++ b/test/get_mplex_bof.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "mplex", 0, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(count);
   unlink(data);
diff --git a/test/get_mplex_complex.c b/test/get_mplex_complex.c
new file mode 100644
index 0000000..083b174
--- /dev/null
+++ b/test/get_mplex_complex.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 1 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW COMPLEX128 8\n";
+  double c[16];
+  unsigned char count_data[256];
+  double data_data[512];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd) {
+    count_data[fd] = (unsigned char)(fd % 3);
+    data_data[fd * 2] = (double)fd;
+    data_data[fd * 2 + 1] = (double)fd / 256.;
+  }
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, count_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKFi(i, c[2 * i], 40 + 3 * (i / 3));
+    CHECKFi(i, c[2 * i + 1], (40 + 3 * (i / 3)) / 256.);
+  }
+
+  return r;
+}
diff --git a/test/get_mplex_lb.c b/test/get_mplex_lb.c
index b4ebdfe..ddffcfc 100644
--- a/test/get_mplex_lb.c
+++ b/test/get_mplex_lb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(count);
   unlink(data);
diff --git a/test/get_mplex_lball.c b/test/get_mplex_lball.c
index 74768a2..e821079 100644
--- a/test/get_mplex_lball.c
+++ b/test/get_mplex_lball.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   n = gd_getdata(D, "mplex", 12, 0, 1, 0, GD_UINT8, &c);
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(count);
   unlink(data);
diff --git a/test/get_mplex_nolb.c b/test/get_mplex_nolb.c
index f914e51..68f2129 100644
--- a/test/get_mplex_nolb.c
+++ b/test/get_mplex_nolb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
   n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c);
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(count);
   unlink(data);
diff --git a/test/get_mplex_s.c b/test/get_mplex_s.c
new file mode 100644
index 0000000..a7a23d7
--- /dev/null
+++ b/test/get_mplex_s.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 1 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mplex", 0, 0, 0, 256, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 128);
+  return r;
+}
diff --git a/test/get_mplex_saved.c b/test/get_mplex_saved.c
new file mode 100644
index 0000000..9ce8d98
--- /dev/null
+++ b/test/get_mplex_saved.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 0 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char c[8], d[8];
+  unsigned char data_data[256];
+  int fd, n1, n2, i, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] %= 3;
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c);
+  e1 = gd_error(D);
+  n2 = gd_getdata(D, "mplex", 6, 0, 1, 0, GD_UINT8, &d);
+  e2 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKIi(i, c[i], 39 + 3 * ((i + 1) / 3));
+    CHECKIi(i, d[i], 48 + 3 * (i / 3));
+  }
+
+  return r;
+}
diff --git a/test/get_multiply.c b/test/get_multiply.c
index fe312b2..bd1ad8c 100644
--- a/test/get_multiply.c
+++ b/test/get_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_neg.c b/test/get_neg.c
new file mode 100644
index 0000000..cfe2bc4
--- /dev/null
+++ b/test/get_neg.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "data", -5, 0, 1, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_RANGE);
+  CHECKI(n, 0);
+
+  return r;
+}
diff --git a/test/get_none.c b/test/get_none.c
new file mode 100644
index 0000000..7b82032
--- /dev/null
+++ b/test/get_none.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 0, GD_UINT8, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+
+  return r;
+}
diff --git a/test/get_nonexistent.c b/test/get_nonexistent.c
index a03eca1..c47b354 100644
--- a/test/get_nonexistent.c
+++ b/test/get_nonexistent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/get_null.c b/test/get_null.c
index e9d7796..675a765 100644
--- a/test/get_null.c
+++ b/test/get_null.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_off64.c b/test/get_off64.c
index 6bb1fc9..433eecf 100644
--- a/test/get_off64.c
+++ b/test/get_off64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,7 +67,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_phase.c b/test/get_phase.c
index 453707d..602e237 100644
--- a/test/get_phase.c
+++ b/test/get_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "phase", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_phase_affix.c b/test/get_phase_affix.c
index 6b30a7d..c171f6a 100644
--- a/test/get_phase_affix.c
+++ b/test/get_phase_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "prephasepost", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format1);
diff --git a/test/get_polynom.c b/test/get_polynom.c
index 84bb6f7..48688cb 100644
--- a/test/get_polynom.c
+++ b/test/get_polynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_polynom_noin.c b/test/get_polynom_noin.c
index 05b74ff..bb4f9f0 100644
--- a/test/get_polynom_noin.c
+++ b/test/get_polynom_noin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_recip.c b/test/get_recip.c
index 5815f0c..bb2c72e 100644
--- a/test/get_recip.c
+++ b/test/get_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_recip_const.c b/test/get_recip_const.c
index d8eb64c..6bcc45a 100644
--- a/test/get_recip_const.c
+++ b/test/get_recip_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_recurse.c b/test/get_recurse.c
index 51adc9d..77d576f 100644
--- a/test/get_recurse.c
+++ b/test/get_recurse.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   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);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/get_rofs.c b/test/get_rofs.c
index 90a2287..b544d2b 100644
--- a/test/get_rofs.c
+++ b/test/get_rofs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -68,7 +68,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
 
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_sbit.c b/test/get_sbit.c
index 00a31ed..e047b52 100644
--- a/test/get_sbit.c
+++ b/test/get_sbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "bit", 5, 0, 10, 0, GD_INT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_sf.c b/test/get_sf.c
index ade4922..f4554fb 100644
--- a/test/get_sf.c
+++ b/test/get_sf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "data", 0, 40, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_ss.c b/test/get_ss.c
index 0d7cd83..8670825 100644
--- a/test/get_ss.c
+++ b/test/get_ss.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "data", 0, 40, 0, 8, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_string.c b/test/get_string.c
new file mode 100644
index 0000000..2b33715
--- /dev/null
+++ b/test/get_string.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2014, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "string STRING String\\ data\n";
+  int fd, n, error, r = 0;
+  char s[1000];
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_get_string(D, "string", 1000, s);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 12);
+  CHECKS(s, "String data");
+
+  return r;
+}
diff --git a/test/get_type.c b/test/get_type.c
index 7a17bcc..cb61fb4 100644
--- a/test/get_type.c
+++ b/test/get_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
 
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_uint16.c b/test/get_uint16.c
index f2caac8..10fd094 100644
--- a/test/get_uint16.c
+++ b/test/get_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_uint32.c b/test/get_uint32.c
index e2f911f..12e23ae 100644
--- a/test/get_uint32.c
+++ b/test/get_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   mkdir(filedir, 0777);
 
   for (j = 0; j < 128; ++j)
-    data_data[j] = j * 0x02000001LU;
+    data_data[j] = j * (0x02000001U);
 
   fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
   write(fd, format_data, strlen(format_data));
@@ -66,7 +66,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKUi(i,c[i], 0x50000028 + i * 0x02000001);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_uint64.c b/test/get_uint64.c
index 4669990..e963962 100644
--- a/test/get_uint64.c
+++ b/test/get_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   mkdir(filedir, 0777);
 
   for (j = 0; j < 128; ++j)
-    data_data[j] = j * 0x0200000000000001LU;
+    data_data[j] = j * (0x0200000000000001U);
 
   fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
   write(fd, format_data, strlen(format_data));
@@ -65,7 +65,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKUi(i,c[i],0x5000000000000028U + i * 0x0200000000000001U);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window.c b/test/get_window.c
index 19d44cb..7352736 100644
--- a/test/get_window.c
+++ b/test/get_window.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window_clr.c b/test/get_window_clr.c
index aeda830..23359bc 100644
--- a/test/get_window_clr.c
+++ b/test/get_window_clr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window_complex.c b/test/get_window_complex.c
new file mode 100644
index 0000000..f59fa4e
--- /dev/null
+++ b/test/get_window_complex.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "window WINDOW data data.r EQ 44\n"
+    "data RAW COMPLEX128 8\n";
+  double c[16];
+  double data_data[512];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+    data_data[2 * fd] = (double)fd;
+    data_data[2 * fd + 1] = (double)fd / 256.;
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKFi(i, c[2 * i], (i == 4) ? 40 + i : 0);
+    CHECKFi(i, c[2 * i + 1], (i == 4) ? (40 + i) / 256. : 0);
+  }
+
+  return r;
+}
diff --git a/test/get_window_ge.c b/test/get_window_ge.c
index cf2e637..253fddc 100644
--- a/test/get_window_ge.c
+++ b/test/get_window_ge.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window_gt.c b/test/get_window_gt.c
index 23198db..9f35251 100644
--- a/test/get_window_gt.c
+++ b/test/get_window_gt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window_le.c b/test/get_window_le.c
index 61ce7a7..f65c27a 100644
--- a/test/get_window_le.c
+++ b/test/get_window_le.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window_lt.c b/test/get_window_lt.c
index 54b3c6c..05bc6d8 100644
--- a/test/get_window_lt.c
+++ b/test/get_window_lt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window_ne.c b/test/get_window_ne.c
index 3cc6938..4b4b184 100644
--- a/test/get_window_ne.c
+++ b/test/get_window_ne.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_window_s.c b/test/get_window_s.c
new file mode 100644
index 0000000..96cd16b
--- /dev/null
+++ b/test/get_window_s.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "win WINDOW data phase EQ 0\n"
+    "phase PHASE data 128\n"
+    "data RAW UINT8 1\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "win", 0, 0, 1000, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 128);
+
+  return r;
+}
diff --git a/test/get_window_set.c b/test/get_window_set.c
index 3d0de94..20b5913 100644
--- a/test/get_window_set.c
+++ b/test/get_window_set.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_zero.c b/test/get_zero.c
index 2f20b4f..834e17a 100644
--- a/test/get_zero.c
+++ b/test/get_zero.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/get_zero_complex.c b/test/get_zero_complex.c
new file mode 100644
index 0000000..e7c44ad
--- /dev/null
+++ b/test/get_zero_complex.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "/FRAMEOFFSET 100\ndata RAW COMPLEX128 8\n";
+  double c[16];
+  double data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 16 * sizeof(double));
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd / 256.;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 16; ++i)
+    CHECKFi(i, c[i], 0);
+
+  return r;
+}
diff --git a/test/get_zero_float.c b/test/get_zero_float.c
new file mode 100644
index 0000000..adc0cdb
--- /dev/null
+++ b/test/get_zero_float.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "/FRAMEOFFSET 100\ndata RAW FLOAT64 8\n";
+  double c[8];
+  double data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8 * sizeof(double));
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd / 256.;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i, c[i], 0);
+
+  return r;
+}
diff --git a/test/global_flags.c b/test/global_flags.c
index 4b109dd..104c7cd 100644
--- a/test/global_flags.c
+++ b/test/global_flags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) :e2008-2011 D. V. Wiebe
+/* Copyright (C) :e2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -74,7 +74,7 @@ int main(void)
   n[6] = gd_flags(D, GD_VERBOSE, GD_VERBOSE | GD_PRETTY_PRINT);
   e[6] = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/global_name.c b/test/global_name.c
index cf0701a..fbaaa32 100644
--- a/test/global_name.c
+++ b/test/global_name.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Global metadata check */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data1 CONST UINT8 1\n";
   int fd, error, r = 0;
   DIRFILE *D;
-  char *name;
+  const char *name;
 
   rmdirfile();
   mkdir(filedir, 0777);
@@ -47,16 +46,15 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  name = strdup(gd_dirfilename(D));
+  name = gd_dirfilename(D);
   error = gd_error(D);
-  gd_close(D);
+  CHECKI(error, GD_E_OK);
+  CHECKEOS(name, "dirfile");
+
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_OK);
-  CHECKEOS(name, "dirfile");
-  free(name);
-
   return r;
 }
diff --git a/test/global_ref.c b/test/global_ref.c
index bd4e461..e87321d 100644
--- a/test/global_ref.c
+++ b/test/global_ref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Global metadata check */
 #include "test.h"
 
 #include <inttypes.h>
@@ -36,7 +35,7 @@ int main(void)
   const char *format = "dirfile/format";
   const char *format_data = "data RAW UINT8 1\n";
   int fd, error, r = 0;
-  char *ref;
+  const char *ref;
   DIRFILE *D;
 
   rmdirfile();
@@ -47,16 +46,15 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  ref = strdup(gd_reference(D, NULL));
+  ref = gd_reference(D, NULL);
   error = gd_error(D);
-  gd_close(D);
+  CHECKS(ref, "data");
+  CHECKI(error, 0);
+
+  gd_discard(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
index 7a7471b..0430ace 100644
--- a/test/global_ref_empty.c
+++ b/test/global_ref_empty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   ref = gd_reference(D, NULL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/global_ref_set.c b/test/global_ref_set.c
index 9c368f7..5277c4a 100644
--- a/test/global_ref_set.c
+++ b/test/global_ref_set.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Global metadata check */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data1 RAW UINT8 1\n"
                             "data2 RAW UINT8 1\n";
   int fd, error, r = 0;
-  char *ref;
+  const char *ref;
   DIRFILE *D;
 
   rmdirfile();
@@ -48,16 +47,16 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
-  ref = strdup(gd_reference(D, "data2"));
+
+  ref = gd_reference(D, "data2");
   error = gd_error(D);
-  gd_close(D);
+  CHECKI(error, GD_E_OK);
+  CHECKS(ref, "data2");
+
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_OK);
-  CHECKS(ref, "data2");
-  free(ref);
-
   return r;
 }
diff --git a/test/gzip_add.c b/test/gzip_add.c
index 9e8e8f7..8315dfb 100644
--- a/test/gzip_add.c
+++ b/test/gzip_add.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Add a RAW field */
 #include "test.h"
 
 #include <stdlib.h>
@@ -38,7 +37,7 @@ int main(void)
   const char *format = "dirfile/format";
   const char *data = "dirfile/data.gz";
   gd_entry_t e;
-  int e1, e2, unlink_data, r = 0;
+  int e1, e2, e3, unlink_data, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -65,7 +64,9 @@ int main(void)
   CHECKI(e2, -1);
 #endif
 
-  gd_close(D);
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
   unlink_data = unlink(data);
 
 #ifdef USE_GZIP
diff --git a/test/gzip_del.c b/test/gzip_del.c
new file mode 100644
index 0000000..b59e429
--- /dev/null
+++ b/test/gzip_del.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2013, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+/* this tests discarding OOP-writable (also temporary) RAW files */
+int main(void)
+{
+#if !(defined TEST_GZIP)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.gz";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  int fd, i, n, e1, e2, e3, unlink_data, ret, r = 0;
+  int rmdir_filedir;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#if defined USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+#if defined USE_GZIP
+  CHECKI(n, 8);
+  CHECKI(e1, GD_E_OK);
+#else
+  CHECKI(n, 0);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+#endif
+
+  ret = gd_delete(D, "data", GD_DEL_DATA);
+  e2 = gd_error(D);
+#if defined USE_GZIP
+  CHECKI(ret, 0);
+  CHECKI(e2, GD_E_OK);
+#else
+  CHECKI(ret, -1);
+  CHECKI(e2, GD_E_UNSUPPORTED);
+#endif
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir_filedir = rmdir(filedir);
+
+  CHECKI(unlink_data, -1);
+  CHECKI(rmdir_filedir, 0);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_get.c b/test/gzip_get.c
index 863485a..e469d15 100644
--- a/test/gzip_get.c
+++ b/test/gzip_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,8 +43,11 @@ int main(void)
   uint16_t c[8];
   char command[4096];
   uint16_t data_data[256];
-  int fd, i, n, error, r = 0;
+  int fd, n, error, r = 0;
   DIRFILE *D;
+#ifdef USE_GZIP
+  int i;
+#endif
 
   memset(c, 0, 8);
   rmdirfile();
@@ -74,7 +77,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(gzipdata);
   unlink(format);
diff --git a/test/gzip_get_far.c b/test/gzip_get_far.c
new file mode 100644
index 0000000..3622ba4
--- /dev/null
+++ b/test/gzip_get_far.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.gz";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(error, 0);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+#endif
+  CHECKI(n, 0);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_get_get.c b/test/gzip_get_get.c
index 5f9f36f..0818f6b 100644
--- a/test/gzip_get_get.c
+++ b/test/gzip_get_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to read UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -43,7 +42,7 @@ int main(void)
   uint16_t c1[8], c2[8];
   char command[4096];
   uint16_t data_data[256];
-  int fd, i, n1, error1, n2, error2, r = 0;
+  int fd, i, n1, e1, e2, n2, e3, r = 0;
   DIRFILE *D;
 
   memset(c1, 0, 16);
@@ -69,27 +68,29 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n1, 8);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
-  error2 = gd_error(D);
-  gd_close(D);
-
-  unlink(gzipdata);
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error1, 0);
-  CHECKI(error2, 0);
-  CHECKI(n1, 8);
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
   CHECKI(n2, 8);
   for (i = 0; i < 8; ++i) {
     CHECKUi(i,c1[i], 40 + i);
     CHECKUi(i,c2[i], 40 + i);
   }
 
+  gd_discard(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
   return r;
 #endif
 }
diff --git a/test/gzip_get_get2.c b/test/gzip_get_get2.c
index f2ed632..4e3fe3f 100644
--- a/test/gzip_get_get2.c
+++ b/test/gzip_get_get2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -72,7 +72,7 @@ int main(void)
   error1 = gd_error(D);
   n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2);
   error2 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(gzipdata);
   unlink(format);
diff --git a/test/gzip_get_put.c b/test/gzip_get_put.c
index 68969e3..6456aea 100644
--- a/test/gzip_get_put.c
+++ b/test/gzip_get_put.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -77,9 +77,12 @@ int main(void)
     0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x73,
     0x8c, 0x05, 0x29, 0x00, 0x01, 0x00, 0x00
   };
-  uint8_t b, c[8], d[8];
+  uint8_t c[8], d[8];
+#ifdef USE_GZIP
+  uint8_t b;
   char command[4096];
-  int fd, i, m, n, e1, e2, unlink_data, unlink_datagz, r = 0;
+#endif
+  int fd, i, m, n, e1, e2, e3, unlink_data, unlink_datagz, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -107,7 +110,8 @@ int main(void)
   m = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
   e2 = gd_error(D);
 
-  gd_close(D);
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
 
 #ifdef USE_GZIP
   /* uncompress */
diff --git a/test/gzip_move_from.c b/test/gzip_move_from.c
index 321f8a1..bfb385d 100644
--- a/test/gzip_move_from.c
+++ b/test/gzip_move_from.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test move */
 #include "test.h"
 
 #include <stdlib.h>
@@ -45,10 +44,13 @@ int main(void)
   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;
+  int fd, ret, ge_ret, unlink_data, unlink_gzdata, e1, e2, r = 0;
   DIRFILE *D;
   gd_entry_t E;
+#ifdef USE_GZIP
   uint16_t d;
+  int i = 0;
+#endif
 
   rmdirfile();
   mkdir(filedir, 0777);
@@ -79,9 +81,13 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
 #endif
   ret = gd_move(D, "data", 1, 1);
-  error = gd_error(D);
+  e1 = gd_error(D);
+
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  CHECKI(ge_ret, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
 #ifdef USE_GZIP
   fd = open(data, O_RDONLY | O_BINARY);
@@ -106,15 +112,13 @@ int main(void)
 
 #ifdef USE_GZIP
   CHECKI(ret, 0);
-  CHECKI(error, 0);
-  CHECKI(ge_ret, 0);
+  CHECKI(e1, 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(e1, GD_E_UNSUPPORTED);
   CHECKI(E.fragment_index, 0);
   CHECKI(unlink_data, -1);
   CHECKI(unlink_gzdata, 0);
diff --git a/test/gzip_move_to.c b/test/gzip_move_to.c
index 5d689b1..9f17e9c 100644
--- a/test/gzip_move_to.c
+++ b/test/gzip_move_to.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to gzip compress a file */
 #include "test.h"
 
 #include <stdlib.h>
@@ -40,7 +39,7 @@ int main(void)
   char command[4096];
   int i;
 #endif
-  int fd, error, unlink_raw, r = 0;
+  int fd, e1, e2, unlink_raw, r = 0;
   struct stat buf;
 
   rmdirfile();
@@ -63,9 +62,10 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
 #endif
   gd_alter_encoding(D, GD_GZIP_ENCODED, 0, 1);
-  error = gd_error(D);
+  e1 = gd_error(D);
 
-  gd_discard(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
 #ifdef USE_GZIP
   if (stat(data_gz, &buf)) {
@@ -107,9 +107,9 @@ int main(void)
 
   CHECKI(unlink_raw, 0);
 #ifdef USE_GZIP
-  CHECKI(error, GD_E_OK);
+  CHECKI(e1, GD_E_OK);
 #else
-  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(e1, GD_E_UNSUPPORTED);
 #endif
 
   return r;
diff --git a/test/gzip_nframes.c b/test/gzip_nframes.c
index 3680857..b360050 100644
--- a/test/gzip_nframes.c
+++ b/test/gzip_nframes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
 #endif
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(gzipdata);
   unlink(format);
diff --git a/test/gzip_put.c b/test/gzip_put.c
index f88b3af..e1f8ef8 100644
--- a/test/gzip_put.c
+++ b/test/gzip_put.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -46,7 +45,7 @@ int main(void)
   uint8_t d;
 #endif
   struct stat buf;
-  int fd, i, n, error, stat_data, unlink_data, r = 0;
+  int fd, i, n, e1, e2, stat_data, unlink_data, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -66,9 +65,10 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED);
 #endif
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
 
-  gd_discard(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   stat_data = stat(data_gz, &buf);
 #ifdef USE_GZIP
@@ -108,11 +108,11 @@ int main(void)
 
 #ifdef USE_GZIP
   CHECKI(unlink_data, 0);
-  CHECKI(error, GD_E_OK);
+  CHECKI(e1, GD_E_OK);
   CHECKI(n, 8);
 #else
   CHECKI(unlink_data, -1);
-  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(e1, GD_E_UNSUPPORTED);
   CHECKI(n, 0);
 #endif
 
diff --git a/test/gzip_put_back.c b/test/gzip_put_back.c
new file mode 100644
index 0000000..ed21b59
--- /dev/null
+++ b/test/gzip_put_back.c
@@ -0,0 +1,110 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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)
+{
+#if ! (defined TEST_GZIP) || ! (defined USE_GZIP)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_gz = "dirfile/data.gz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+
+  n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_gz, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_put_endian.c b/test/gzip_put_endian.c
new file mode 100644
index 0000000..13199ca
--- /dev/null
+++ b/test/gzip_put_endian.c
@@ -0,0 +1,126 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_gz = "dirfile/data.gz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n"
+#ifdef WORDS_BIGENDIAN
+  "ENDIAN little\n";
+#else
+  "ENDIAN big\n";
+#endif
+  uint16_t c[8];
+#ifdef USE_GZIP
+  char command[4096];
+  uint16_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint16_t)(0x102 * i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_gz, &buf);
+#ifdef USE_GZIP
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_GZIP
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint16_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, 0x201 * (i - 40));
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/gzip_put_get.c b/test/gzip_put_get.c
index 3d0fe9c..b7a0988 100644
--- a/test/gzip_put_get.c
+++ b/test/gzip_put_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -40,7 +39,7 @@ int main(void)
   const char *data = "dirfile/data.gz";
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d[8];
-  int fd, i, m, n, e1, e2, unlink_data, r = 0;
+  int fd, i, m, n, e1, e2, e3, unlink_data, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -64,7 +63,11 @@ int main(void)
   m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
   e2 = gd_error(D);
 
-  gd_close(D);
+  for (i = 0; i < m; ++i)
+    CHECKIi(i, d[i], c[i]);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
 
   unlink_data = unlink(data);
   unlink(format);
@@ -84,9 +87,6 @@ int main(void)
   CHECKI(m, 0);
 #endif
   
-  for (i = 0; i < m; ++i)
-    CHECKIi(i, d[i], c[i]);
-
   return r;
 #endif
 }
diff --git a/test/gzip_put_nframes.c b/test/gzip_put_nframes.c
new file mode 100644
index 0000000..81d0085
--- /dev/null
+++ b/test/gzip_put_nframes.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+uint32_t d[100];
+
+int main(void)
+{
+#ifndef USE_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.gz";
+  int i, e1, e2, r = 0;
+  size_t n1, n2;
+  off_t nf1, nf2;
+  DIRFILE *D;
+
+  for (i = 0; i < 100; ++i)
+    d[i] = i;
+
+  rmdirfile();
+
+  D = gd_open(filedir,
+      GD_RDWR | GD_GZIP_ENCODED | GD_CREAT | GD_EXCL | GD_VERBOSE);
+
+  gd_add_raw(D, "data", GD_UINT32, 1, 0);
+
+  n1 = gd_putdata(D, "data", 0, 0, 0, 100, GD_UINT32, d);
+  CHECKU(n1, 100);
+
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  nf1 = gd_nframes(D);
+  CHECKU(nf1, 100);
+
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+
+  n2 = gd_putdata(D, "data", 0, 100, 0, 100, GD_UINT32, d);
+  CHECKU(n2, 100);
+
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+
+  nf2 = gd_nframes(D);
+  CHECKU(nf2, 200);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_put_off.c b/test/gzip_put_off.c
new file mode 100644
index 0000000..58b6041
--- /dev/null
+++ b/test/gzip_put_off.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+uint32_t d[GD_BUFFER_SIZE];
+
+int main(void)
+{
+#ifndef USE_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.gz";
+  int i, e1, e2, r = 0;
+  size_t n1, n2;
+  off_t nf;
+  DIRFILE *D;
+
+  for (i = 0; i < GD_BUFFER_SIZE; ++i)
+    d[i] = i;
+
+  rmdirfile();
+
+  D = gd_open(filedir,
+      GD_RDWR | GD_GZIP_ENCODED | GD_CREAT | GD_EXCL | GD_VERBOSE);
+
+  gd_add_raw(D, "data", GD_UINT32, 1, 0);
+
+  n1 = gd_putdata(D, "data", 0, 0, 0, GD_BUFFER_SIZE, GD_UINT32, d);
+  CHECKU(n1, GD_BUFFER_SIZE);
+
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  gd_close(D);
+
+  for (i = 0; i < GD_BUFFER_SIZE; ++i)
+    d[i] = i + 0x100000;
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+
+  n2 = gd_putdata(D, "data", 0, GD_BUFFER_SIZE, 0, GD_BUFFER_SIZE, GD_UINT32,
+      d);
+  CHECKU(n2, GD_BUFFER_SIZE);
+
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+
+  nf = gd_nframes(D);
+  CHECKU(nf, GD_BUFFER_SIZE * 2);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_put_pad.c b/test/gzip_put_pad.c
new file mode 100644
index 0000000..64d2af7
--- /dev/null
+++ b/test/gzip_put_pad.c
@@ -0,0 +1,103 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if ! (defined TEST_GZIP) || ! (defined USE_GZIP)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_gz = "dirfile/data.gz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+  n2 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_gz, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_put_sub.c b/test/gzip_put_sub.c
new file mode 100644
index 0000000..b5f3676
--- /dev/null
+++ b/test/gzip_put_sub.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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)
+{
+#if ! (defined TEST_GZIP) || ! (defined USE_GZIP)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *data_gz = "dirfile/sub/data.gz";
+  const char *data = "dirfile/sub/data";
+  const char *format_data = "/INCLUDE sub/format1\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+
+  n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_gz, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_seek.c b/test/gzip_seek.c
new file mode 100644
index 0000000..5cf3479
--- /dev/null
+++ b/test/gzip_seek.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.gz";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(error, 0);
+  CHECKI(n, 40);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, -1);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/gzip_seek_far.c b/test/gzip_seek_far.c
new file mode 100644
index 0000000..6f8ed9e
--- /dev/null
+++ b/test/gzip_seek_far.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.gz";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(error, 0);
+
+  /* Either of these values is fine with us */
+  if (n != 256)
+    CHECKI(n, 4000);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, -1);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/gzip_seek_put.c b/test/gzip_seek_put.c
new file mode 100644
index 0000000..6be65fa
--- /dev/null
+++ b/test/gzip_seek_put.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+uint32_t d[GD_BUFFER_SIZE];
+
+int main(void)
+{
+#ifndef USE_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.gz";
+  int i, e1, e2, e3, r = 0;
+  size_t n1, n2;
+  off_t nf, n3;
+  DIRFILE *D;
+
+  for (i = 0; i < GD_BUFFER_SIZE; ++i)
+    d[i] = i;
+
+  rmdirfile();
+
+  D = gd_open(filedir,
+      GD_RDWR | GD_GZIP_ENCODED | GD_CREAT | GD_EXCL | GD_VERBOSE);
+
+  gd_add_raw(D, "data", GD_UINT32, 1, 0);
+
+  n1 = gd_putdata(D, "data", 0, 0, 0, GD_BUFFER_SIZE, GD_UINT32, d);
+  CHECKU(n1, GD_BUFFER_SIZE);
+
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  gd_close(D);
+
+  for (i = 0; i < GD_BUFFER_SIZE; ++i)
+    d[i] = i + 0x100000;
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+
+  n3 = gd_seek(D, "data", 0, GD_BUFFER_SIZE, GD_SEEK_SET | GD_SEEK_WRITE);
+  CHECKI(n3, GD_BUFFER_SIZE);
+
+  e3 = gd_error(D);
+  CHECKI(e3, GD_E_OK);
+
+  n2 = gd_putdata(D, "data", 0, GD_BUFFER_SIZE, 0, GD_BUFFER_SIZE, GD_UINT32,
+      d);
+  CHECKU(n2, GD_BUFFER_SIZE);
+
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+
+  nf = gd_nframes(D);
+  CHECKU(nf, GD_BUFFER_SIZE * 2);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_sync.c b/test/gzip_sync.c
new file mode 100644
index 0000000..1a8df0b
--- /dev/null
+++ b/test/gzip_sync.c
@@ -0,0 +1,102 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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)
+{
+#if !defined TEST_GZIP || !defined USE_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_gz = "dirfile/data.gz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+  gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  n = gd_flush(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_gz, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/header_complex.c b/test/header_complex.c
index 7a55814..3fc07ba 100644
--- a/test/header_complex.c
+++ b/test/header_complex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
 
   error = gd_error(D);
   CHECKI(error, 0);
-  CHECKIi(0,E.comp_scal, 1);
+  CHECKXi(0, E.flags, GD_EN_COMPSCAL | GD_EN_CALC);
   CHECKFi(0,E.EN(lincom,cm)[0][0], 3.3);
   CHECKFi(0,E.EN(lincom,cm)[0][1], 4.4);
   CHECKFi(0,E.EN(lincom,cb)[0][0], 5.5);
@@ -75,7 +75,7 @@ int main(void)
   error3 = gd_error(D);
   CHECKI(error3, 0);
   CHECKIi(1,E.EN(polynom,poly_ord),2);
-  CHECKIi(1,E.comp_scal,1);
+  CHECKXi(1, E.flags, GD_EN_COMPSCAL | GD_EN_CALC);
   CHECKFi(1,E.EN(polynom,ca)[0][0], ca[0]);
   CHECKFi(1,E.EN(polynom,ca)[0][1], ca[1]);
   CHECKFi(1,E.EN(polynom,ca)[1][0], ca[2]);
@@ -84,7 +84,7 @@ int main(void)
   CHECKFi(1,E.EN(polynom,ca)[2][1], ca[5]);
   gd_free_entry_strings(&E);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/header_off64t.c b/test/header_off64t.c
new file mode 100644
index 0000000..809a1e0
--- /dev/null
+++ b/test/header_off64t.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Does GetData respect _FILE_OFFSET_BITS?  This test isn't very interesting
+ * on a 64-bit system. */
+#define _FILE_OFFSET_BITS 64
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/FRAMEOFFSET 0x123456789\n";
+  int fd, error, r = 0;
+  uint64_t fo;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  fo = gd_frameoffset(D, 0);
+  CHECKI(fo, 0x123456789);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/hide.c b/test/hide.c
index f13d228..86b5777 100644
--- a/test/hide.c
+++ b/test/hide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -41,7 +41,7 @@ int main(void)
   error = gd_error(D);
   m = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/hide_hidden.c b/test/hide_hidden.c
index 67c9da6..2357107 100644
--- a/test/hide_hidden.c
+++ b/test/hide_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   h2 = gd_hidden(D, "hata");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/hide_unhide.c b/test/hide_unhide.c
index 784b011..b7dda53 100644
--- a/test/hide_unhide.c
+++ b/test/hide_unhide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -41,7 +41,7 @@ int main(void)
   error = gd_error(D);
   m = gd_nfields(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/include.c b/test/include.c
deleted file mode 100644
index 48ae58b..0000000
--- a/test/include.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* 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
- */
-/* 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *format1 = "dirfile/format1";
-  const char *format_data = "#\n";
-  const char *format1_data = "data RAW UINT8 11\n";
-  int fd, error, r = 0;
-  unsigned int spf;
-  DIRFILE *D;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format1_data, strlen(format1_data));
-  close(fd);
-
-  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
-  gd_include(D, "format1", 0, 0);
-  error = gd_error(D);
-  spf = gd_spf(D, "data");
-  gd_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
index 5a5afc4..1a72b18 100644
--- a/test/include_accmode.c
+++ b/test/include_accmode.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_include(D, "format1", 0, GD_CREAT);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/include_affix.c b/test/include_affix.c
index c8e8573..881cca1 100644
--- a/test/include_affix.c
+++ b/test/include_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   gd_include_affix(D, "format1", 0, "A", "Z", 0);
   error = gd_error(D);
   spf = gd_spf(D, "AdataZ");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/include_auto.c b/test/include_auto.c
index c77bd98..6801dbd 100644
--- a/test/include_auto.c
+++ b/test/include_auto.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test include */
 #include "test.h"
 
 #include <stdlib.h>
@@ -37,8 +36,7 @@ int main(void)
   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;
+  const char *reference;
   unsigned int spf;
   DIRFILE *D;
 
@@ -56,22 +54,21 @@ int main(void)
   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);
+  CHECKI(error1, 0);
+
+  reference = gd_reference(D, NULL);
+  CHECKS(reference, "data");
+
   error2 = gd_error(D);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  CHECKI(error2, 0);
+  CHECKU(spf, 11);
+
+  gd_discard(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
index 8355b1c..dbe1ffc 100644
--- a/test/include_cb.c
+++ b/test/include_cb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   D = gd_cbopen(filedir, GD_RDWR, callback, NULL);
   gd_include(D, "format1", 0, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/include_creat.c b/test/include_creat.c
index e74f98e..7e89228 100644
--- a/test/include_creat.c
+++ b/test/include_creat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test include */
 #include "test.h"
 
 #include <stdlib.h>
@@ -33,7 +32,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *format1 = "dirfile/format1";
-  int fd, error, unlink_format1, r = 0;
+  int fd, e1, e2, unlink_format1, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -44,14 +43,16 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   gd_include(D, "format1", 0, GD_CREAT);
-  error = gd_error(D);
-  gd_close(D);
+  e1 = gd_error(D);
+  CHECKI(e1,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   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
index 6b2099f..cb816a6 100644
--- a/test/include_ignore.c
+++ b/test/include_ignore.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test include */
 #include "test.h"
 
 #include <stdlib.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  const char *reference;
   unsigned int spf;
   DIRFILE *D;
 
@@ -55,20 +54,20 @@ int main(void)
   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));
+  reference = gd_reference(D, NULL);
+  CHECKS(reference, "data1");
+  CHECKI(error1, 0);
+
   error2 = gd_error(D);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  CHECKI(error2, 0);
+  CHECKU(spf, 11);
+
+  gd_discard(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_include.c b/test/include_include.c
new file mode 100644
index 0000000..dd9e926
--- /dev/null
+++ b/test/include_include.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "#\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_include(D, "format1", 0, 0);
+  error = gd_error(D);
+  spf = gd_spf(D, "data");
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(spf, 11);
+
+  return r;
+}
diff --git a/test/include_index.c b/test/include_index.c
index bb7efb6..c0c50fd 100644
--- a/test/include_index.c
+++ b/test/include_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   gd_include(D, "format1", 1, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/include_invalid.c b/test/include_invalid.c
index d11d95e..2b71fde 100644
--- a/test/include_invalid.c
+++ b/test/include_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_include(D, "format1", 0, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   rmdir(filedir);
diff --git a/test/include_nonexistent.c b/test/include_nonexistent.c
index 248a980..172b7ba 100644
--- a/test/include_nonexistent.c
+++ b/test/include_nonexistent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test include */
 #include "test.h"
 
 #include <stdlib.h>
@@ -46,12 +45,12 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   gd_include(D, "format1", 0, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_OPEN_INCLUDE);
+  CHECKI(error, GD_E_IO);
 
   return r;
 }
diff --git a/test/include_pc.c b/test/include_pc.c
index 829b510..dac0315 100644
--- a/test/include_pc.c
+++ b/test/include_pc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
   gd_parser_callback(D, NULL, NULL);
   gd_include(D, "format1", 0, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/include_ref.c b/test/include_ref.c
index 8cecba0..2e7746a 100644
--- a/test/include_ref.c
+++ b/test/include_ref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test include */
 #include "test.h"
 
 #include <stdlib.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  const char *reference;
   unsigned int spf;
   DIRFILE *D;
 
@@ -55,20 +54,20 @@ int main(void)
   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));
+  CHECKI(error1, 0);
+
+  reference = gd_reference(D, NULL);
   error2 = gd_error(D);
+  CHECKI(error2, 0);
+  CHECKS(reference, "data");
+
   spf = gd_spf(D, "data");
-  gd_close(D);
+  CHECKU(spf, 11);
+  gd_discard(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_sub.c b/test/include_sub.c
index a1eeaea..ff63103 100644
--- a/test/include_sub.c
+++ b/test/include_sub.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   CHECKI(n, E.fragment_index);
 
   gd_free_entry_strings(&E);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/include_syntax.c b/test/include_syntax.c
index ad870de..52b0e89 100644
--- a/test/include_syntax.c
+++ b/test/include_syntax.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   gd_include(D, "format1", 0, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/index.c b/test/index.c
deleted file mode 100644
index 969a6de..0000000
--- a/test/index.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 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
- */
-/* 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *format_data = "data RAW FLOAT64 1\n";
-  double d[1000], f1, f2, f3;
-  int i, error, r = 0;
-  DIRFILE *D;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  for (i = 0; i < 1000; ++i)
-    d[i] = 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
index ba59817..6ed8b72 100644
--- a/test/index_domain.c
+++ b/test/index_domain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   f1 = gd_framenum(D, "data", 1.09);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/index_index.c b/test/index_index.c
new file mode 100644
index 0000000..e89a579
--- /dev/null
+++ b/test/index_index.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Frameindex look-up */
+#include "test.h"
+
+#include <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>
+
+#define F(x) sqrt(((x) + 600.) / 500.)
+/* inverse of F(x) via linear interpolation between x and x+1 */
+#define G(x,y) (x + ((y - F(x)) / (F(x+1) - F(x))))
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\n";
+  double d[1000], f1, f2, f3, f4;
+  int i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 1000; ++i)
+    d[i] = F(i);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, d, 1000 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  f1 = gd_framenum(D, "data", 1.09);
+  f2 = gd_framenum(D, "data", 1.49);
+  f3 = gd_framenum(D, "data", 1.79);
+  f4 = gd_framenum(D, "data", F(128));
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKF(f1, G(   0, 1.09)); /* =   -5.96730894763915 */
+  CHECKF(f2, G( 510, 1.49)); /* =  510.050010695549 */
+  CHECKF(f3, G( 998, 1.79)); /* = 1002.04807025292 */
+  CHECKF(f4, 128.); /* exact */
+
+  return r;
+}
diff --git a/test/index_range.c b/test/index_range.c
index bb11399..a6d39e2 100644
--- a/test/index_range.c
+++ b/test/index_range.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   f1 = gd_framenum(D, "data", 1.09);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/index_s.c b/test/index_s.c
new file mode 100644
index 0000000..3e09088
--- /dev/null
+++ b/test/index_s.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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>
+
+#define F(x) sqrt(((x) + 600.) / 500.)
+/* inverse of F(x) via linear interpolation between x and x+1 */
+#define G(x,y) (x + ((y - F(x)) / (F(x+1) - F(x))))
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\n";
+  double d[1000], f1, f2, f3;
+  int i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 1000; ++i)
+    d[i] = F(i);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, d, 1000 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  f1 = gd_framenum_subset(D, "data", 1.09, 100, 8000);
+  f2 = gd_framenum_subset(D, "data", 1.49, 100, 8000);
+  f3 = gd_framenum_subset(D, "data", 1.79, 100, 8000);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKF(f1, G( 100, 1.09)); /* = -10.3339841573191 */
+  CHECKF(f2, G( 510, 1.49)); /* = 510.050010695549 */
+  CHECKF(f3, G( 998, 1.79)); /* = 995.067417578234 */
+
+  return r;
+}
diff --git a/test/index_subset.c b/test/index_subset.c
new file mode 100644
index 0000000..9af2fa6
--- /dev/null
+++ b/test/index_subset.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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>
+
+#define F(x) sqrt(((x) + 600.) / 500.)
+/* inverse of F(x) via linear interpolation between x and x+1 */
+#define G(x,y) (x + ((y - F(x)) / (F(x+1) - F(x))))
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\n";
+  double d[1000], f1, f2, f3;
+  int i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 1000; ++i)
+    d[i] = F(i);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, d, 1000 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  f1 = gd_framenum_subset(D, "data", 1.09, 100, 800);
+  f2 = gd_framenum_subset(D, "data", 1.49, 100, 800);
+  f3 = gd_framenum_subset(D, "data", 1.79, 100, 800);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKF(f1, G( 100, 1.09)); /* = -10.3339841573191 */
+  CHECKF(f2, G( 510, 1.49)); /* = 510.050010695549 */
+  CHECKF(f3, G( 798, 1.79)); /* = 995.067417578234 */
+
+  return r;
+}
diff --git a/test/legacy_error.c b/test/legacy_error.c
new file mode 100644
index 0000000..47e887c
--- /dev/null
+++ b/test/legacy_error.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2013, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <string.h>
+
+#define DIRFILENAME "a non-existant dirfile"
+int main(void)
+{
+#ifndef GD_LEGACY_API
+  return 77; /* skipped */
+#else
+  char string[1000];
+  int error, n, r = 0;
+
+  n = GetData(DIRFILENAME, "data", 5, 0, 1, 0, 'n', NULL, &error);
+
+  GetDataErrorString(string, 1000);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_IO);
+  CHECKSS(string, DIRFILENAME);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_estring.c b/test/legacy_estring.c
new file mode 100644
index 0000000..b87ebd1
--- /dev/null
+++ b/test/legacy_estring.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  n = GetData(filedir, "data", 5, 0, 1, 0, 'c', c, &error);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 40 + i);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_format.c b/test/legacy_format.c
new file mode 100644
index 0000000..b46bc60
--- /dev/null
+++ b/test/legacy_format.c
@@ -0,0 +1,156 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "bit BIT raw 5 6\n"
+    "const CONST UINT8 1\n"
+    "carray CARRAY UINT8 1 2 3\n"
+    "div DIVIDE raw bit\n"
+    "lincom LINCOM raw 1 2 phase 3 4 div 5 6\n"
+    "linterp LINTERP raw /table/path\n"
+    "mplex MPLEX raw lincom 54 94\n"
+    "mult MULTIPLY sbit bit\n"
+    "phase PHASE raw 33\n"
+    "polynom POLYNOM raw 8 9 10 11\n"
+    "raw RAW UINT8 8\n"
+    "recip RECIP sbit 3\n"
+    "sbit SBIT raw 7 8\n"
+    "window WINDOW raw phase LE 3\n"
+    "/FRAMEOFFSET 12\n";
+  int fd, i, error = 0, r = 0;
+  double three = 3.;
+  int *three_ptr = (void*)(&three);
+  struct FormatType *f;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  f = GetFormat(filedir, &error);
+  CHECKI(error, 0);
+
+  /* global metadata */
+  CHECKS(f->FileDirName, filedir);
+  CHECKI(f->frame_offset, 12);
+
+  /* reference field */
+  CHECKS(f->first_field.field, "raw");
+  CHECKI(f->first_field.type, 'c');
+  CHECKI(f->first_field.size, 1);
+  CHECKI(f->first_field.samples_per_frame, 8);
+
+  /* field metadata */
+  CHECKI(f->n_raw, 1);
+  CHECKS(f->rawEntries[0].field, "raw");
+  CHECKI(f->rawEntries[0].type, 'c');
+  CHECKI(f->rawEntries[0].size, 1);
+  CHECKI(f->rawEntries[0].samples_per_frame, 8);
+
+  CHECKI(f->n_lincom, 3);
+  CHECKS(f->lincomEntries[0].field, "lincom");
+  CHECKI(f->lincomEntries[0].n_fields, 3);
+  CHECKS(f->lincomEntries[0].in_fields[0], "raw");
+  CHECKS(f->lincomEntries[0].in_fields[1], "phase");
+  CHECKS(f->lincomEntries[0].in_fields[2], "div");
+  for (i = 0; i < 3; ++i) {
+    CHECKFi(i, f->lincomEntries[0].m[i], i * 2. + 1);
+    CHECKFi(i, f->lincomEntries[0].b[i], i * 2. + 2);
+  }
+
+  CHECKS(f->lincomEntries[1].field, "polynom");
+  CHECKI(f->lincomEntries[1].n_fields, 1);
+  CHECKS(f->lincomEntries[1].in_fields[0], "raw");
+  CHECKF(f->lincomEntries[1].m[0], 9);
+  CHECKF(f->lincomEntries[1].b[0], 8);
+
+  CHECKS(f->lincomEntries[2].field, "recip");
+  CHECKI(f->lincomEntries[2].n_fields, 1);
+  CHECKS(f->lincomEntries[2].in_fields[0], "sbit");
+  CHECKF(f->lincomEntries[2].m[0], 3);
+  CHECKF(f->lincomEntries[2].b[0], 0);
+
+  CHECKI(f->n_linterp, 1);
+  CHECKS(f->linterpEntries[0].field, "linterp");
+  CHECKS(f->linterpEntries[0].raw_field, "raw");
+  CHECKS(f->linterpEntries[0].linterp_file, "/table/path");
+
+  CHECKI(f->n_bit, 2);
+  CHECKS(f->bitEntries[0].field, "bit");
+  CHECKS(f->bitEntries[0].raw_field, "raw");
+  CHECKI(f->bitEntries[0].bitnum, 5);
+  CHECKI(f->bitEntries[0].numbits, 6);
+
+  CHECKS(f->bitEntries[1].field, "sbit");
+  CHECKS(f->bitEntries[1].raw_field, "raw");
+  CHECKI(f->bitEntries[1].bitnum, 7);
+  CHECKI(f->bitEntries[1].numbits, 8);
+
+  CHECKI(f->n_multiply, 2);
+  CHECKS(f->multiplyEntries[0].field, "div");
+  CHECKS(f->multiplyEntries[0].in_fields[0], "raw");
+  CHECKS(f->multiplyEntries[0].in_fields[1], "bit");
+
+  CHECKS(f->multiplyEntries[1].field, "mult");
+  CHECKS(f->multiplyEntries[1].in_fields[0], "sbit");
+  CHECKS(f->multiplyEntries[1].in_fields[1], "bit");
+
+  CHECKI(f->n_phase, 1);
+  CHECKS(f->phaseEntries[0].field, "phase");
+  CHECKS(f->phaseEntries[0].raw_field, "raw");
+  CHECKI(f->phaseEntries[0].shift, 33);
+
+  CHECKI(f->n_mplex, 2);
+  CHECKS(f->mplexEntries[0].field, "mplex");
+  CHECKS(f->mplexEntries[0].data_field, "raw");
+  CHECKS(f->mplexEntries[0].cnt_field, "lincom");
+  CHECKI(f->mplexEntries[0].i, 54);
+  CHECKI(f->mplexEntries[0].max_i, 94);
+
+  CHECKS(f->mplexEntries[1].field, "window");
+  CHECKS(f->mplexEntries[1].data_field, "raw");
+  CHECKS(f->mplexEntries[1].cnt_field, "phase");
+  CHECKI(f->mplexEntries[1].i, GD_WINDOP_LE);
+  CHECKI(f->mplexEntries[1].max_i, *three_ptr);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_nonexistent.c b/test/legacy_nonexistent.c
index b0660e4..db7bf37 100644
--- a/test/legacy_nonexistent.c
+++ b/test/legacy_nonexistent.c
@@ -18,8 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Reference to a non-existent dirfile from the legacy API should fail cleanly
- */
 #include "test.h"
 
 #include <stdlib.h>
@@ -38,7 +36,7 @@ int main(void)
   size_t n = GetNFrames("no such dirfile", &error, NULL);
 
   CHECKI(n,0);
-  CHECKI(error, GD_E_OPEN);
+  CHECKI(error, GD_E_IO);
 
   return r;
 #endif
diff --git a/test/lzma_get.c b/test/lzma_get.c
index bbd8041..f64160e 100644
--- a/test/lzma_get.c
+++ b/test/lzma_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(lzmadata);
   unlink(format);
diff --git a/test/lzma_nframes.c b/test/lzma_nframes.c
index 8849c74..8bbe275 100644
--- a/test/lzma_nframes.c
+++ b/test/lzma_nframes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -71,7 +71,7 @@ int main(void)
 #endif
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(xzdata);
   unlink(format);
diff --git a/test/lzma_put.c b/test/lzma_put.c
new file mode 100644
index 0000000..402ccf7
--- /dev/null
+++ b/test/lzma_put.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_lzma = "dirfile/data.lzma";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8] = {40, 41, 42, 43, 44, 45, 46, 47};
+  uint8_t data_data[256];
+  char command[4096];
+  int fd, n, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -F lzma -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDWR);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+
+  e2 = gd_discard(D);
+  CHECKI(e2, 0);
+
+  unlink(data_lzma);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_add.c b/test/lzma_xz_add.c
new file mode 100644
index 0000000..f6646ca
--- /dev/null
+++ b/test/lzma_xz_add.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.xz";
+  gd_entry_t e;
+  int e1, e2, e3, unlink_data, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_LZMA_ENCODED);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_LZMA_ENCODED);
+#endif
+  gd_add_raw(D, "data", GD_UINT8, 2, 0);
+  e1 = gd_error(D);
+
+  /* check */
+  e2 = gd_entry(D, "data", &e);
+#ifdef USE_LZMA
+  CHECKI(e2, 0);
+  if (e2 == 0) {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+#else
+  CHECKI(e2, -1);
+#endif
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  unlink_data = unlink(data);
+
+#ifdef USE_LZMA
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+#endif
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_get.c b/test/lzma_xz_get.c
new file mode 100644
index 0000000..b67a445
--- /dev/null
+++ b/test/lzma_xz_get.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *xzdata = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+  char command[4096];
+  uint16_t data_data[256];
+#ifdef USE_LZMA
+  int i;
+#endif
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i],40 + i);
+#else
+  CHECKI(error,GD_E_UNSUPPORTED);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_get_far.c b/test/lzma_xz_get_far.c
new file mode 100644
index 0000000..9ffd921
--- /dev/null
+++ b/test/lzma_xz_get_far.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *xzdata = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(error, 0);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+#endif
+  CHECKI(n, 0);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_get_get.c b/test/lzma_xz_get_get.c
new file mode 100644
index 0000000..c345210
--- /dev/null
+++ b/test/lzma_xz_get_get.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_LZMA || !defined TEST_LZMA
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *xzdata = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, e1, e2, n2, e3, r = 0;
+  DIRFILE *D;
+
+  memset(c1, 0, 16);
+  memset(c2, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1);
+  CHECKI(n1, 8);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKIi(i,c1[i], 40 + i);
+    CHECKIi(i,c2[i], 40 + i);
+  }
+
+  gd_discard(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_get_get2.c b/test/lzma_xz_get_get2.c
new file mode 100644
index 0000000..55bc185
--- /dev/null
+++ b/test/lzma_xz_get_get2.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_LZMA || !defined TEST_LZMA
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *xzdata = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, error1, n2, error2, r = 0;
+  DIRFILE *D;
+
+  memset(c1, 0, 16);
+  memset(c2, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1);
+  error1 = gd_error(D);
+  n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2);
+  error2 = gd_error(D);
+  gd_discard(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKUi(i,c1[i], i);
+    CHECKUi(i,c2[i], i);
+  }
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_get_put.c b/test/lzma_xz_get_put.c
new file mode 100644
index 0000000..cd53002
--- /dev/null
+++ b/test/lzma_xz_get_put.c
@@ -0,0 +1,157 @@
+/* Copyright (C) 2014, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_xz = "dirfile/data.xz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  const unsigned char xzdata[300] = {
+    0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04,
+    0xe6, 0xd6, 0xb4, 0x46, 0x02, 0x00, 0x21, 0x01,
+    0x16, 0x00, 0x00, 0x00, 0x74, 0x2f, 0xe5, 0xa3,
+    0xe0, 0x00, 0xff, 0x00, 0xea, 0x5d, 0x00, 0x00,
+    0x00, 0x52, 0x50, 0x0a, 0x84, 0xf9, 0x9b, 0xb2,
+    0x80, 0x21, 0xa9, 0x69, 0xd6, 0x27, 0xe0, 0x3e,
+    0x06, 0x5a, 0x5f, 0x04, 0x8d, 0x53, 0xd4, 0x04,
+    0xba, 0x39, 0x57, 0x05, 0x09, 0xc1, 0x55, 0x24,
+    0xde, 0x9d, 0xb8, 0x71, 0x59, 0x31, 0x60, 0xa1,
+    0x9f, 0xf9, 0x6f, 0x49, 0x73, 0xf2, 0xc8, 0xea,
+    0x8c, 0xba, 0x1a, 0x8b, 0x29, 0x69, 0x21, 0x80,
+    0xfe, 0x33, 0x83, 0x66, 0xaf, 0x46, 0x6d, 0xec,
+    0x9e, 0x89, 0x8a, 0x0b, 0x83, 0xf0, 0x3c, 0x0e,
+    0x89, 0x8e, 0x3f, 0xed, 0x5f, 0xe7, 0x9e, 0x90,
+    0xd9, 0x1c, 0xff, 0x32, 0xf4, 0xb2, 0xe0, 0x39,
+    0x51, 0xb2, 0xd2, 0x14, 0x15, 0xb4, 0xc5, 0x71,
+    0xba, 0xdb, 0x06, 0xe3, 0x79, 0x9a, 0x9f, 0xbb,
+    0x38, 0xc1, 0xb0, 0x00, 0xac, 0x93, 0x0b, 0xaa,
+    0x06, 0x19, 0x03, 0x12, 0x08, 0x15, 0x5b, 0x9b,
+    0xc8, 0x48, 0xf0, 0x32, 0x2e, 0xfe, 0x2d, 0xa0,
+    0x87, 0xc8, 0xf0, 0xa4, 0xe0, 0xd2, 0x51, 0xeb,
+    0x8d, 0x67, 0x56, 0x92, 0xb2, 0x4d, 0x84, 0xc5,
+    0xf1, 0x86, 0x31, 0xdf, 0x6a, 0x62, 0x5b, 0xc2,
+    0x79, 0x2d, 0xd9, 0xf7, 0x3c, 0x73, 0xba, 0x74,
+    0x74, 0x07, 0xd8, 0x3c, 0xa9, 0x56, 0x22, 0x24,
+    0xa1, 0x66, 0xf8, 0x5a, 0x84, 0x5f, 0x30, 0x67,
+    0xd2, 0xf6, 0x4b, 0x49, 0x2e, 0x7f, 0x20, 0xeb,
+    0xdb, 0xf8, 0x10, 0x0e, 0x94, 0x78, 0x77, 0xc7,
+    0x3f, 0x6b, 0xef, 0xb4, 0xcd, 0x95, 0xe2, 0x6f,
+    0xf6, 0x44, 0x6e, 0x06, 0xcf, 0x0b, 0x82, 0x1a,
+    0xcb, 0xdb, 0x7a, 0xf0, 0x57, 0x8d, 0x98, 0xff,
+    0x90, 0xc0, 0x3e, 0xe6, 0xc1, 0x12, 0x41, 0x75,
+    0xee, 0x03, 0x28, 0x96, 0xeb, 0x09, 0x37, 0x0e,
+    0x1e, 0x00, 0x00, 0x00, 0xb0, 0x3a, 0xdb, 0x65,
+    0x2f, 0x4b, 0x41, 0x72, 0x00, 0x01, 0x86, 0x02,
+    0x80, 0x02, 0x00, 0x00, 0x2d, 0x12, 0xa1, 0x9f,
+    0xb1, 0xc4, 0x67, 0xfb, 0x02, 0x00, 0x00, 0x00,
+    0x00, 0x04, 0x59, 0x5a
+  };
+  uint8_t c[8], d[8];
+#ifdef USE_LZMA
+  char command[4096];
+#endif
+  int fd, i, m, n, e1, e2, e3, unlink_data, unlink_dataxz, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    d[i] = (uint8_t)(80 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_xz, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, xzdata, 300);
+  close(fd);
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  m = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
+  e2 = gd_error(D);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+#ifdef USE_LZMA
+  /* uncompress */
+  snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    uint8_t b;
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &b, sizeof(uint8_t))) {
+        if (i < 40 || i >= 48) {
+          CHECKIi(i, b, i);
+        } else
+          CHECKIi(i, b, i + 40);
+        i++;
+      }
+      CHECKI(i, 256);
+      close(fd);
+    }
+  }
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 40 + i);
+#endif
+
+  unlink_data = unlink(data);
+  unlink_dataxz = unlink(data_xz);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_dataxz, -1);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_dataxz, 0);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(e2, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(m, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_move_to.c b/test/lzma_xz_move_to.c
new file mode 100644
index 0000000..4eb62bf
--- /dev/null
+++ b/test/lzma_xz_move_to.c
@@ -0,0 +1,111 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_xz = "dirfile/data.xz";
+  const char *data_raw = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n";
+  uint8_t data_in[256];
+  DIRFILE *D;
+#ifdef USE_LZMA
+  uint8_t d;
+  char command[4096];
+  int i;
+#endif
+  int fd, e1, e2, unlink_raw, r = 0;
+  struct stat buf;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  for (fd = 0; fd < 256; ++fd)
+    data_in[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_in, 256);
+  close(fd);
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR);
+#endif
+  gd_alter_encoding(D, GD_LZMA_ENCODED, 0, 1);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+#ifdef USE_LZMA
+  if (stat(data_xz, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(stat(data_raw, &buf), -1);
+#else
+  if (stat(data_raw, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(stat(data_xz, &buf), -1);
+#endif
+
+#ifdef USE_LZMA
+  /* uncompress */
+  snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz);
+  if (gd_system(command)) {
+    fprintf(stderr, "command failed: %s\n", command);
+    r = 1;
+  } else {
+    fd = open(data_raw, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 256);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_raw = unlink(data_raw);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_raw, 0);
+#ifdef USE_LZMA
+  CHECKI(e1, GD_E_OK);
+#else
+  CHECKI(e1, GD_E_UNSUPPORTED);
+#endif
+
+  return r;
+}
diff --git a/test/lzma_xz_nframes.c b/test/lzma_xz_nframes.c
new file mode 100644
index 0000000..bc6f592
--- /dev/null
+++ b/test/lzma_xz_nframes.c
@@ -0,0 +1,90 @@
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Retrieving the number of frames should succeed cleanly */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *xzdata = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT16 1\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  DIRFILE *D;
+  size_t n;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(error,0);
+  CHECKI(n,256);
+#else
+  CHECKI(error,GD_E_UNSUPPORTED);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_put.c b/test/lzma_xz_put.c
new file mode 100644
index 0000000..d5d664a
--- /dev/null
+++ b/test/lzma_xz_put.c
@@ -0,0 +1,115 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_xz = "dirfile/data.xz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+#ifdef USE_LZMA
+  char command[4096];
+  uint8_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, unlink_data, unlink_xz, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_xz, &buf);
+#ifdef USE_LZMA
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_LZMA
+  /* uncompress */
+  snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_xz = unlink(data_xz);
+  CHECKI(unlink_xz, -1);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_put_back.c b/test/lzma_xz_put_back.c
new file mode 100644
index 0000000..a0bab71
--- /dev/null
+++ b/test/lzma_xz_put_back.c
@@ -0,0 +1,101 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if ! (defined TEST_LZMA) || ! (defined USE_LZMA)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_xz = "dirfile/data.xz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+
+  n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_xz, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_put_endian.c b/test/lzma_xz_put_endian.c
new file mode 100644
index 0000000..fcdcaed
--- /dev/null
+++ b/test/lzma_xz_put_endian.c
@@ -0,0 +1,117 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_xz = "dirfile/data.xz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n"
+#ifdef WORDS_BIGENDIAN
+  "ENDIAN little\n";
+#else
+  "ENDIAN big\n";
+#endif
+  uint16_t c[8];
+#ifdef USE_LZMA
+  char command[4096];
+  uint16_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint16_t)(0x102 * i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  e1 = gd_error(D);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_xz, &buf);
+#ifdef USE_LZMA
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_LZMA
+  /* uncompress */
+  snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint16_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, 0x201 * (i - 40));
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_put_get.c b/test/lzma_xz_put_get.c
new file mode 100644
index 0000000..1cbe07c
--- /dev/null
+++ b/test/lzma_xz_put_get.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#ifndef TEST_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d[8];
+  int fd, i, m, n, e1, e2, e3, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
+  e2 = gd_error(D);
+
+  for (i = 0; i < m; ++i)
+    CHECKIi(i, d[i], c[i]);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(e2, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(m, 0);
+#endif
+  
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_put_pad.c b/test/lzma_xz_put_pad.c
new file mode 100644
index 0000000..c1c57fc
--- /dev/null
+++ b/test/lzma_xz_put_pad.c
@@ -0,0 +1,103 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if ! (defined TEST_LZMA) || ! (defined USE_LZMA)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_xz = "dirfile/data.xz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n1, 8);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+  n2 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n2, 8);
+
+  e3 = gd_close(D);
+  CHECKI(e3, 0);
+
+  stat_data = stat(data_xz, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 8) {
+          CHECKIi(i, d, i + 40);
+        } else if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, 0);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_seek.c b/test/lzma_xz_seek.c
new file mode 100644
index 0000000..01cfbc6
--- /dev/null
+++ b/test/lzma_xz_seek.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_LZMA || !defined USE_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *xzdata = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  CHECKI(n,40);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+
+  gd_discard(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_seek_far.c b/test/lzma_xz_seek_far.c
new file mode 100644
index 0000000..bd1c5e1
--- /dev/null
+++ b/test/lzma_xz_seek_far.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_LZMA || !defined USE_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *xzdata = "dirfile/data.xz";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  CHECKI(n,256);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+
+  gd_discard(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/lzma_xz_sync.c b/test/lzma_xz_sync.c
new file mode 100644
index 0000000..1290a38
--- /dev/null
+++ b/test/lzma_xz_sync.c
@@ -0,0 +1,93 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_LZMA || !defined USE_LZMA
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_xz = "dirfile/data.xz";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  char command[4096];
+  uint8_t d;
+  struct stat buf;
+  int fd, i, n, e1, e2, stat_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE);
+  gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  n = gd_flush(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(n, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  stat_data = stat(data_xz, &buf);
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+
+  /* uncompress */
+  snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/madd.c b/test/madd.c
index c104547..79c549a 100644
--- a/test/madd.c
+++ b/test/madd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/madd_affix.c b/test/madd_affix.c
index 1ac1fbf..0fcefa2 100644
--- a/test/madd_affix.c
+++ b/test/madd_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   /* check */
   gd_entry(D, "AdataZ/data", &e);
   e3 = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/madd_alias.c b/test/madd_alias.c
index aaf1336..f31dcc8 100644
--- a/test/madd_alias.c
+++ b/test/madd_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -25,8 +25,9 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int error, i, n, r = 0;
+  int error, i, r = 0;
   DIRFILE *D;
+  unsigned int n;
   const char *target;
 
   rmdirfile();
@@ -51,7 +52,7 @@ int main(void)
 
   CHECKI(error, GD_E_OK);
   CHECKI(i, 0);
-  CHECKI(n, 2);
+  CHECKU(n, 2);
 
   return r;
 }
diff --git a/test/madd_alias_affix.c b/test/madd_alias_affix.c
index 4a5952c..90b5a99 100644
--- a/test/madd_alias_affix.c
+++ b/test/madd_alias_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -27,7 +27,8 @@ int main(void)
   const char *format1 = "dirfile/format";
   const char *data = "dirfile/data";
   const char *target1, *target2;
-  int e1, e2, e3, e4, e5, i, n, r = 0;
+  int e1, e2, e3, e4, e5, i, r = 0;
+  unsigned int n;
   DIRFILE *D;
 
   rmdirfile();
@@ -69,7 +70,7 @@ int main(void)
   CHECKI(e4, GD_E_OK);
   CHECKI(e5, GD_E_OK);
   CHECKI(i, 1);
-  CHECKI(n, 4);
+  CHECKU(n, 4);
 
   return r;
 }
diff --git a/test/madd_bit.c b/test/madd_bit.c
index 96dd068..0fe933e 100644
--- a/test/madd_bit.c
+++ b/test/madd_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_bit_invalid.c b/test/madd_bit_invalid.c
index ac57ac7..0a4ce05 100644
--- a/test/madd_bit_invalid.c
+++ b/test/madd_bit_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_madd_bit(D, "new", "meta", "input", 1, 1);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
 
diff --git a/test/madd_carray.c b/test/madd_carray.c
index 427c1e7..525e49c 100644
--- a/test/madd_carray.c
+++ b/test/madd_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,13 +55,13 @@ int main(void)
     CHECKI(e.EN(scalar,const_type), GD_UINT8);
     gd_free_entry_strings(&e);
   }
-  n = (int)gd_carray_len(D, "new/data");
+  n = (int)gd_array_len(D, "new/data");
   CHECKI(n, 5);
   gd_get_carray(D, "new/data", GD_UINT8, &data);
   for (n = 0; n < 5; ++n)
     CHECKIi(n, data[n], 3 + n);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_clincom.c b/test/madd_clincom.c
index 93c301a..7f31302 100644
--- a/test/madd_clincom.c
+++ b/test/madd_clincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -72,7 +72,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_const.c b/test/madd_const.c
index 609a1d9..79e453b 100644
--- a/test/madd_const.c
+++ b/test/madd_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_cpolynom.c b/test/madd_cpolynom.c
index beb649b..094e8f4 100644
--- a/test/madd_cpolynom.c
+++ b/test/madd_cpolynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,13 +63,13 @@ int main(void)
     CHECKS(e.in_fields[0], "in");
     CHECKI(e.fragment_index, 0);
     CHECKI(e.EN(polynom,poly_ord), 3);
-    CHECKI(e.comp_scal, 1);
+    CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC);
     for (j = 0; j < 4; ++j)
       CHECKCi(j,e.EN(polynom,ca)[j], a[j]);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_crecip.c b/test/madd_crecip.c
index abdef86..1b8609f 100644
--- a/test/madd_crecip.c
+++ b/test/madd_crecip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,12 +55,12 @@ int main(void)
     CHECKI(e.field_type, GD_RECIP_ENTRY);
     CHECKS(e.in_fields[0], "in1");
     CHECKC(e.EN(recip,cdividend), v);
-    CHECKI(e.comp_scal, 1);
+    CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC);
     CHECKI(e.fragment_index, 0);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_crecip89.c b/test/madd_crecip89.c
index 7610f08..9d11312 100644
--- a/test/madd_crecip89.c
+++ b/test/madd_crecip89.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,12 +53,12 @@ int main(void)
     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);
+    CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC);
     CHECKI(e.fragment_index, 0);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_divide.c b/test/madd_divide.c
index 41ab1eb..2cfe669 100644
--- a/test/madd_divide.c
+++ b/test/madd_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_index.c b/test/madd_index.c
index 731a714..2b8ac7f 100644
--- a/test/madd_index.c
+++ b/test/madd_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ int main(void)
   gd_entry(D, "data/data", &e);
   ge_error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/madd_lincom.c b/test/madd_lincom.c
index e5fb6f8..b07b95c 100644
--- a/test/madd_lincom.c
+++ b/test/madd_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,11 +61,11 @@ int main(void)
     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);
+    CHECKX(e.flags, GD_EN_CALC);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_lincom_invalid.c b/test/madd_lincom_invalid.c
index 7e72a52..95e9e71 100644
--- a/test/madd_lincom_invalid.c
+++ b/test/madd_lincom_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -40,7 +40,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_madd_lincom(D, "new", "meta", 2, in_fields, m, b);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/madd_linterp.c b/test/madd_linterp.c
index ccb4400..b5a6944 100644
--- a/test/madd_linterp.c
+++ b/test/madd_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_linterp_invalid.c b/test/madd_linterp_invalid.c
index 0d5b054..3a81ec9 100644
--- a/test/madd_linterp_invalid.c
+++ b/test/madd_linterp_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_madd_linterp(D, "new", "meta", "in", "table");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/madd_mplex.c b/test/madd_mplex.c
index bdee8b1..8dab8ec 100644
--- a/test/madd_mplex.c
+++ b/test/madd_mplex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,11 +44,11 @@ int main(void)
     CHECKS(e.in_fields[1], "count");
     CHECKI(e.fragment_index, 0);
     CHECKI(e.EN(mplex,count_val), 5);
-    CHECKF(e.EN(mplex,period), 6);
+    CHECKI(e.EN(mplex,period), 6);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_multiply.c b/test/madd_multiply.c
index 47f2c1e..d29310f 100644
--- a/test/madd_multiply.c
+++ b/test/madd_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_multiply_invalid.c b/test/madd_multiply_invalid.c
index 91d57f1..3de189a 100644
--- a/test/madd_multiply_invalid.c
+++ b/test/madd_multiply_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_madd_multiply(D, "new", "meta", "in1", "in2");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/madd_phase.c b/test/madd_phase.c
index e322dde..728c4f2 100644
--- a/test/madd_phase.c
+++ b/test/madd_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_phase_invalid.c b/test/madd_phase_invalid.c
index 54fa983..147a3c9 100644
--- a/test/madd_phase_invalid.c
+++ b/test/madd_phase_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_madd_phase(D, "new", "meta", "in", 3);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/madd_polynom.c b/test/madd_polynom.c
index e1a45a8..c6e75fb 100644
--- a/test/madd_polynom.c
+++ b/test/madd_polynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,13 +55,13 @@ int main(void)
     CHECKS(e.in_fields[0], "in");
     CHECKI(e.fragment_index, 0);
     CHECKI(e.EN(polynom,poly_ord), 3);
-    CHECKI(e.comp_scal, 0);
+    CHECKX(e.flags, GD_EN_CALC);
     for (j = 0; j < 4; ++j)
       CHECKFi(j, e.EN(polynom,a)[j], a[j]);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_recip.c b/test/madd_recip.c
index 4d56a1b..de7a5a3 100644
--- a/test/madd_recip.c
+++ b/test/madd_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,12 +50,12 @@ int main(void)
     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);
+    CHECKX(e.flags, GD_EN_CALC);
     CHECKI(e.fragment_index, 0);
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_sbit.c b/test/madd_sbit.c
index fa2e393..ee288f7 100644
--- a/test/madd_sbit.c
+++ b/test/madd_sbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_spec.c b/test/madd_spec.c
index 515f37c..b7b3db1 100644
--- a/test/madd_spec.c
+++ b/test/madd_spec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_spec_directive.c b/test/madd_spec_directive.c
index 3692b2f..c7a9bdb 100644
--- a/test/madd_spec_directive.c
+++ b/test/madd_spec_directive.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -44,7 +44,7 @@ int main(void)
   n = gd_nfields(D);
   m = gd_nmfields(D, "INDEX");
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/madd_spec_invalid.c b/test/madd_spec_invalid.c
index 0faca57..bf61bfe 100644
--- a/test/madd_spec_invalid.c
+++ b/test/madd_spec_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   gd_madd_spec(D, "data RAW UINT8 2", "INDEX");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, GD_E_BAD_DIRFILE);
   return r;
diff --git a/test/madd_spec_resolv.c b/test/madd_spec_resolv.c
index 34a63f7..d376e2d 100644
--- a/test/madd_spec_resolv.c
+++ b/test/madd_spec_resolv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -25,7 +25,8 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int error, i, n, r = 0;
+  int error, i, r = 0;
+  unsigned int n;
   DIRFILE *D;
   const char *target;
 
@@ -52,7 +53,7 @@ int main(void)
 
   CHECKI(error, GD_E_OK);
   CHECKI(i, 0);
-  CHECKI(n, 2);
+  CHECKU(n, 2);
 
   return r;
 }
diff --git a/test/madd_string.c b/test/madd_string.c
index f43f3e6..d6d2d8f 100644
--- a/test/madd_string.c
+++ b/test/madd_string.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -34,7 +34,7 @@ int main(void)
 {
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
-  int error, ge_error, r = 0;
+  int error, mf_error, ge_error, r = 0;
   gd_entry_t e;
   char val[1000];
   DIRFILE *D;
@@ -44,6 +44,11 @@ int main(void)
   gd_add_phase(D, "new", "in", 3, 0);
   gd_madd_string(D, "new", "meta", "A string.");
   error = gd_error(D);
+  CHECKI(error, GD_E_OK);
+
+  gd_metaflush(D);
+  mf_error = gd_error(D);
+  CHECKI(mf_error, GD_E_OK);
 
   /* check */
   gd_entry(D, "new/meta", &e);
@@ -57,11 +62,10 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_OK);
   return r;
 }
diff --git a/test/madd_window.c b/test/madd_window.c
index 2c9aa40..847ae4e 100644
--- a/test/madd_window.c
+++ b/test/madd_window.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
     gd_free_entry_strings(&e);
   }
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/move.c b/test/move.c
deleted file mode 100644
index 44eb725..0000000
--- a/test/move.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* 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
- */
-/* 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *format1 = "dirfile/format1";
-  const char *format_data = "INCLUDE format1\ndata RAW UINT8 11";
-  const char *format1_data = "#\n";
-  int fd, ret, error, ge_ret, r = 0;
-  gd_entry_t E;
-  DIRFILE *D;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format1_data, strlen(format1_data));
-  close(fd);
-
-  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
-  ret = gd_move(D, "data", 1, 0);
-  error = gd_error(D);
-  ge_ret =  gd_entry(D, "data", &E);
-  gd_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_affix.c b/test/move_affix.c
index b719ea7..8f71b87 100644
--- a/test/move_affix.c
+++ b/test/move_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   ret = gd_move(D, "AdataB", 2, 0);
   error = gd_error(D);
   ge_ret =  gd_entry(D, "CdataD", &E);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/move_affix_dup.c b/test/move_affix_dup.c
index f0ac7f3..a58bfb5 100644
--- a/test/move_affix_dup.c
+++ b/test/move_affix_dup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
   ret = gd_move(D, "AdataB", 2, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/move_affix_meta.c b/test/move_affix_meta.c
new file mode 100644
index 0000000..52f013c
--- /dev/null
+++ b/test/move_affix_meta.c
@@ -0,0 +1,98 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "INCLUDE format1 A Z\n"
+    "data RAW UINT8 11\n"
+    "data/meta1 CONST UINT8 1\n"
+    "data/meta2 CONST UINT8 2\n"
+    "/ALIAS data/meta3 data/meta2\n";
+  const char *format1_data = "#\n";
+  int fd, ret, e1, e2, e3, e4, e5, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "data", 1, 0);
+  e1 = gd_error(D);
+
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
+  gd_entry(D, "AdataZ", &E);
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "AdataZ/meta1", &E);
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "AdataZ/meta2", &E);
+  e4 = gd_error(D);
+  CHECKI(e4, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "AdataZ/meta3", &E);
+  e5 = gd_error(D);
+  CHECKI(e5, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_affix_updb.c b/test/move_affix_updb.c
new file mode 100644
index 0000000..dfaf0e1
--- /dev/null
+++ b/test/move_affix_updb.c
@@ -0,0 +1,91 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data =
+    "INCLUDE format1 A B\n"
+    "INCLUDE format2 C D\n"
+    "phase PHASE AdataB 0\n"
+    "/ALIAS alias AdataB\n";
+  const char *format1_data =
+    "data RAW UINT8 11\n"
+    "data/meta CONST UINT8 1\n";
+  const char *format2_data = "#\n";
+  int fd, r1, r2, r3, e1, e2, e3, r = 0;
+  const char *s1;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+
+  r1 = gd_move(D, "AdataB", 2, GD_REN_UPDB);
+  e1 = gd_error(D);
+  CHECKI(r1, 0);
+  CHECKI(e1, GD_E_OK);
+
+  r2 = gd_entry(D, "CdataD", &E);
+  CHECKI(r2, 0);
+  CHECKI(E.fragment_index, 2);
+  gd_free_entry_strings(&E);
+
+  gd_validate(D, "phase");
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+
+  gd_validate(D, "CdataD/meta");
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
+
+  s1 = gd_alias_target(D, "alias");
+  CHECKS(s1, "CdataD");
+
+  r3 = gd_close(D);
+  CHECKI(r3, 0);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+
+  return r;
+}
diff --git a/test/move_alias.c b/test/move_alias.c
index bf88eb4..ca12805 100644
--- a/test/move_alias.c
+++ b/test/move_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,11 +45,11 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
-  ret = gd_move_alias(D, "alias", 1);
+  ret = gd_move(D, "alias", 1, 0);
   error = gd_error(D);
   fa =  gd_fragment_index(D, "alias");
   fd =  gd_fragment_index(D, "data");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/move_data_enc_ar.c b/test/move_data_enc_ar.c
index 30657ec..86601bc 100644
--- a/test/move_data_enc_ar.c
+++ b/test/move_data_enc_ar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   const char *format1_data = "ENCODING none\n";
   int r = 0;
   uint16_t d;
-  int fd, i, ret, error, ge_ret, unlink_data, unlink_txtdata;
+  int fd, i, ret, e1, e2, ge_ret, unlink_data, unlink_txtdata;
   FILE* stream;
   gd_entry_t E;
   DIRFILE *D;
@@ -64,10 +64,18 @@ int main(void)
   fclose(stream);
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
-  ret = gd_move(D, "data", 1, 1);
-  error = gd_error(D);
+  ret = gd_move(D, "data", 1, GD_REN_DATA);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
@@ -89,13 +97,8 @@ int main(void)
   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
index f84d8a7..388ec74 100644
--- a/test/move_data_enc_ra.c
+++ b/test/move_data_enc_ra.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test move */
 #include "test.h"
 
 #include <stdlib.h>
@@ -43,7 +42,7 @@ int main(void)
   int r = 0;
   uint16_t d;
   char line[100];
-  int fd, i, ret, error, ge_ret, unlink_data, unlink_txtdata;
+  int fd, i, ret, e1, e2, ge_ret, unlink_data, unlink_txtdata;
   FILE* stream;
   gd_entry_t E;
   DIRFILE *D;
@@ -67,10 +66,18 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
-  ret = gd_move(D, "data", 1, 1);
-  error = gd_error(D);
+  ret = gd_move(D, "data", 1, GD_REN_DATA);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   stream = fopen(txtdata, "rt");
 
@@ -94,13 +101,8 @@ int main(void)
   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
index ebe7f69..3b73158 100644
--- a/test/move_data_endian.c
+++ b/test/move_data_endian.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test move */
 #include "test.h"
 
 #include <stdlib.h>
@@ -66,10 +65,10 @@ int main(void)
   close(fd);
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
-  ret = gd_move(D, "data", 1, 1);
+  ret = gd_move(D, "data", 1, GD_REN_DATA);
   error = gd_error(D);
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/move_data_foffs.c b/test/move_data_foffs.c
index fe0615a..364ec68 100644
--- a/test/move_data_foffs.c
+++ b/test/move_data_foffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,10 +62,10 @@ int main(void)
   write(fd, data_data, 256);
   close(fd);
 
-  ret = gd_move(D, "data", 1, 1);
+  ret = gd_move(D, "data", 1, GD_REN_DATA);
   error = gd_error(D);
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/move_data_foffs_neg.c b/test/move_data_foffs_neg.c
new file mode 100644
index 0000000..239caba
--- /dev/null
+++ b/test/move_data_foffs_neg.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "/INCLUDE format1\n"
+    "data RAW UINT8 11\n"
+    "/FRAMEOFFSET 1\n";
+  const char *format1_data = "FRAMEOFFSET 0\n";
+  uint8_t d, data_data[256];
+  int fd, i, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  ret = gd_move(D, "data", 1, GD_REN_DATA);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKUi(i,d, (i < 11) ? 0 : i - 11);
+    i++;
+  }
+  close(fd);
+
+  unlink(format1);
+  unlink(format);
+  unlink(data);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_data_nop.c b/test/move_data_nop.c
index 7d778b5..f11b024 100644
--- a/test/move_data_nop.c
+++ b/test/move_data_nop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test move */
 #include "test.h"
 
 #include <stdlib.h>
@@ -61,10 +60,10 @@ int main(void)
   write(fd, data_data, 256);
   close(fd);
 
-  ret = gd_move(D, "data", 1, 1);
+  ret = gd_move(D, "data", 1, GD_REN_DATA);
   error = gd_error(D);
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/move_index.c b/test/move_index.c
index 8dc9a00..716c072 100644
--- a/test/move_index.c
+++ b/test/move_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
   ret = gd_move(D, "data", 2, 0);
   error = gd_error(D);
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/move_meta.c b/test/move_meta.c
index 3d26f68..1b16835 100644
--- a/test/move_meta.c
+++ b/test/move_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   ret = gd_move(D, "data", 1, 0);
   error = gd_error(D);
   ge_ret =  gd_entry(D, "data/meta", &E);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/move_move.c b/test/move_move.c
new file mode 100644
index 0000000..e4c5c9a
--- /dev/null
+++ b/test/move_move.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test move */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1\ndata RAW UINT8 11";
+  const char *format1_data = "#\n";
+  int fd, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "data", 1, 0);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_protect.c b/test/move_protect.c
index 8a04e58..44c9001 100644
--- a/test/move_protect.c
+++ b/test/move_protect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
   ret = gd_move(D, "data", 1, 0);
   error = gd_error(D);
   ge_ret =  gd_entry(D, "data", &E);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/move_subdir.c b/test/move_subdir.c
index 5c6b004..e316309 100644
--- a/test/move_subdir.c
+++ b/test/move_subdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test move */
 #include "test.h"
 
 #include <stdlib.h>
@@ -39,7 +38,7 @@ int main(void)
   const char *new_data = "dirfile/subdir/data";
   const char *format_data = "INCLUDE subdir/format1\ndata RAW UINT8 11\n";
   const char *format1_data = "#\n";
-  int fd, ret, error, ge_ret, unlink_data, unlink_new_data, r = 0;
+  int fd, ret, e1, e2, ge_ret, unlink_data, unlink_new_data, r = 0;
   gd_entry_t E;
   DIRFILE *D;
 
@@ -60,10 +59,18 @@ int main(void)
   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);
+  ret = gd_move(D, "data", 1, GD_REN_DATA);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, GD_E_OK);
+
+  ge_ret = gd_entry(D, "data", &E);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   unlink_data = unlink(data);
   unlink_new_data = unlink(new_data);
@@ -72,13 +79,8 @@ int main(void)
   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
deleted file mode 100644
index 7ddc93b..0000000
--- a/test/name.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-/* 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *zata = "dirfile/zata";
-  const char *format_data =
-    "early PHASE data 0\n"
-    "late PHASE data 0\n"
-    "/ALIAS bata data\n"
-    "cata RAW UINT8 8\n"
-    "data RAW UINT8 8\n"
-    "eata RAW UINT8 8\n";
-  unsigned char data_data[256];
-  int fd, ret, e1, e2, e3, e4, unlink_data, unlink_zata, r = 0;
-  const char **fl;
-  char *field_list[6];
-  char *s1, *s2, *s3;
-  DIRFILE *D;
-  gd_entry_t E;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  for (fd = 0; fd < 256; ++fd)
-    data_data[fd] = (unsigned char)fd;
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
-  write(fd, data_data, 256);
-  close(fd);
-
-  D = gd_open(filedir, GD_RDWR);
-  gd_validate(D, "early");
-  ret = gd_rename(D, "data", "zata", 0);
-  e1 = gd_error(D);
-  gd_spf(D, "early");
-  e2 = gd_error(D);
-  gd_spf(D, "late");
-  e3 = 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]);
-  field_list[4] = strdup(fl[4]);
-  field_list[5] = strdup(fl[5]);
-
-  gd_entry(D, "early", &E);
-  s1 = E.in_fields[0];
-  E.in_fields[0] = NULL;
-  gd_free_entry_strings(&E);
-
-  gd_entry(D, "late", &E);
-  s2 = E.in_fields[0];
-  E.in_fields[0] = NULL;
-  gd_free_entry_strings(&E);
-
-  gd_entry(D, "bata", &E);
-  e4 = gd_error(D);
-  s3 = strdup(gd_alias_target(D, "bata"));
-
-  gd_close(D);
-
-  unlink_data = unlink(data);
-  unlink_zata = unlink(zata);
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(e1,0);
-  CHECKI(e2,GD_E_BAD_CODE);
-  CHECKI(e3,GD_E_BAD_CODE);
-  CHECKI(e4,GD_E_BAD_CODE);
-  CHECKI(ret,0);
-  CHECKS(field_list[0], "INDEX");
-  CHECKS(field_list[1], "cata");
-  CHECKS(field_list[2], "early");
-  CHECKS(field_list[3], "eata");
-  CHECKS(field_list[4], "late");
-  CHECKS(field_list[5], "zata");
-  CHECKI(unlink_data, 0);
-  CHECKI(unlink_zata, -1);
-  CHECKS(s1, "data");
-  CHECKS(s2, "data");
-  CHECKS(s3, "data");
-
-  free(s1);
-  free(s2);
-  free(s3);
-  free(field_list[0]);
-  free(field_list[1]);
-  free(field_list[2]);
-  free(field_list[3]);
-  free(field_list[4]);
-  free(field_list[5]);
-
-  return r;
-}
diff --git a/test/name_affix.c b/test/name_affix.c
index 0c64a4e..f7b54af 100644
--- a/test/name_affix.c
+++ b/test/name_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -27,7 +27,7 @@ int main(void)
   const char *format1 = "dirfile/format1";
   const char *format_data = "/INCLUDE format1 A Z\n";
   const char *format1_data = "data RAW UINT8 8\n";
-  int fd, ret, e1, e2, r = 0;
+  int fd, r1, r2, e1, e2, e3, r = 0;
   gd_entype_t type;
   DIRFILE *D;
 
@@ -42,22 +42,28 @@ int main(void)
   write(fd, format1_data, strlen(format1_data));
   close(fd);
 
-  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
-  ret = gd_rename(D, "AdataZ", "AzataZ", 0);
+  D = gd_open(filedir, GD_RDWR);
+  r1 = gd_rename(D, "AdataZ", "BdataY", 0);
   e1 = gd_error(D);
-  type = gd_entry_type(D, "AzataZ");
+  CHECKI(r1, -1);
+  CHECKI(e1, GD_E_BAD_CODE);
+
+  r2 = gd_rename(D, "AdataZ", "AzataZ", 0);
   e2 = gd_error(D);
+  CHECKI(r2, 0);
+  CHECKI(e2, 0);
+
+  type = gd_entry_type(D, "AzataZ");
+  e3 = gd_error(D);
+  CHECKI(type, GD_RAW_ENTRY);
+  CHECKI(e3, 0);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   unlink(format1);
   rmdir(filedir);
 
-  CHECKI(e1,0);
-  CHECKI(e2,0);
-  CHECKI(ret,0);
-  CHECKI(type,GD_RAW_ENTRY);
 
   return r;
 }
diff --git a/test/name_affix_bad.c b/test/name_affix_bad.c
index d2a4aad..c670506 100644
--- a/test/name_affix_bad.c
+++ b/test/name_affix_bad.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
   ret = gd_rename(D, "AdataZ", "zata", 0);
   e1 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   unlink(format1);
diff --git a/test/name_alias.c b/test/name_alias.c
index 67aba75..5123424 100644
--- a/test/name_alias.c
+++ b/test/name_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,10 +45,16 @@ int main(void)
     "/ALIAS data cata\n"
     "eata RAW UINT8 8\n";
   unsigned char data_data[256];
-  int fd, ret, e0, e1, e2, e3, e4, e5, e6, unlink_data, unlink_zata, r = 0;
+  int fd, ret, e0, e1, e2, e3, e4, e5, e6, e7, unlink_data, unlink_zata, r = 0;
   const char **fl;
-  char *field_list[9];
-  char *s1, *s2, *s3, *s4, *s5, *s6;
+#define NFIELDS 10
+  const char *field_list[NFIELDS] = {
+    "INDEX", "aata", "bata", "cata", "early", "earlya", "eata", "late", "latea",
+    "zata"
+  };
+  char *s1, *s2, *s3, *s4;
+  const char *s5, *s6;
+  unsigned nf, i;
   DIRFILE *D;
   gd_entry_t E;
 
@@ -69,105 +75,81 @@ int main(void)
   D = gd_open(filedir, GD_RDWR);
   gd_validate(D, "early");
   gd_validate(D, "earlya");
+
   ret = gd_rename(D, "data", "zata", 0);
   e0 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e0, 0);
+
   gd_spf(D, "early");
   e1 = gd_error(D);
+  CHECKI(e1, 0);
+
   gd_spf(D, "late");
   e2 = gd_error(D);
+  CHECKI(e2, 0);
+
   gd_spf(D, "earlya");
   e3 = gd_error(D);
+  CHECKI(e3, GD_E_BAD_CODE);
+
   gd_spf(D, "latea");
   e4 = gd_error(D);
-  fl = gd_field_list(D);
+  CHECKI(e4, GD_E_BAD_CODE);
 
-  field_list[0] = strdup(fl[0]);
-  field_list[1] = strdup(fl[1]);
-  field_list[2] = strdup(fl[2]);
-  field_list[3] = strdup(fl[3]);
-  field_list[4] = strdup(fl[4]);
-  field_list[5] = strdup(fl[5]);
-  field_list[6] = strdup(fl[6]);
-  field_list[7] = strdup(fl[7]);
-  field_list[8] = strdup(fl[8]);
+  nf = gd_nfields(D);
+  CHECKU(nf, NFIELDS);
+
+  if (nf > NFIELDS)
+    nf = NFIELDS;
+
+  fl = gd_field_list(D);
+  for (i = 0; i < nf; ++i)
+    CHECKSi(i, fl[i], field_list[i]);
 
   gd_entry(D, "early", &E);
   s1 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s1, "cata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "earlya", &E);
   s2 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s2, "data");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "late", &E);
   s3 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s3, "cata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "latea", &E);
   s4 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s4, "data");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "aata", &E);
   e5 = gd_error(D);
-  s5 = strdup(gd_alias_target(D, "aata"));
+  s5 = gd_alias_target(D, "aata");
+  CHECKI(e5, 0);
+  CHECKS(s5, "cata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "bata", &E);
   e6 = gd_error(D);
-  s6 = strdup(gd_alias_target(D, "bata"));
+  s6 = gd_alias_target(D, "bata");
+  CHECKS(s6, "zata");
+  CHECKI(e6, 0);
+  gd_free_entry_strings(&E);
 
-  gd_close(D);
+  e7 = gd_close(D);
+  CHECKI(e7, 0);
 
   unlink_data = unlink(data);
   unlink_zata = unlink(zata);
   unlink(format);
   rmdir(filedir);
-
-  CHECKI(e0,0);
-  CHECKI(e1,0);
-  CHECKI(e2,0);
-  CHECKI(e3,GD_E_BAD_CODE);
-  CHECKI(e4,GD_E_BAD_CODE);
-  CHECKI(e5,0);
-  CHECKI(e6,GD_E_BAD_CODE);
-  CHECKI(ret,0);
-  CHECKS(field_list[0], "INDEX");
-  CHECKS(field_list[1], "aata");
-  CHECKS(field_list[2], "cata");
-  CHECKS(field_list[3], "early");
-  CHECKS(field_list[4], "earlya");
-  CHECKS(field_list[5], "eata");
-  CHECKS(field_list[6], "late");
-  CHECKS(field_list[7], "latea");
-  CHECKS(field_list[8], "zata");
   CHECKI(unlink_data, 0);
   CHECKI(unlink_zata, -1);
-  CHECKS(s1, "cata");
-  CHECKS(s2, "data");
-  CHECKS(s3, "cata");
-  CHECKS(s4, "data");
-  CHECKS(s5, "cata");
-  CHECKS(s6, "data");
-
-  free(field_list[0]);
-  free(field_list[1]);
-  free(field_list[2]);
-  free(field_list[3]);
-  free(field_list[4]);
-  free(field_list[5]);
-  free(field_list[6]);
-  free(field_list[7]);
-  free(field_list[8]);
-  free(s1);
-  free(s2);
-  free(s3);
-  free(s4);
-  free(s5);
-  free(s6);
 
   return r;
 }
diff --git a/test/name_dangle.c b/test/name_dangle.c
new file mode 100644
index 0000000..5cc7534
--- /dev/null
+++ b/test/name_dangle.c
@@ -0,0 +1,135 @@
+/* Copyright (C) 2008-2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *zata = "dirfile/zata";
+  const char *format_data =
+    "early MULTIPLY data data\n"
+    "/ALIAS earlya data\n"
+    "late PHASE data 0\n"
+    "/ALIAS latea data\n"
+    "cata RAW UINT8 8\n"
+    "data RAW UINT8 8\n"
+    "eata RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, e1, e2, e3, e4, e5, e6, unlink_data, unlink_zata, r = 0;
+  const char **fl;
+#define NFIELDS 6
+  const char *field_list[NFIELDS] = {
+    "INDEX", "cata", "early", "eata", "late", "zata"
+  };
+  char *s1, *s4;
+  const char *s3, *s6;
+  unsigned nf, i;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+
+  /* force-resolve the early entries */
+  gd_validate(D, "early");
+  gd_validate(D, "earlya");
+
+  ret = gd_rename(D, "data", "zata", GD_REN_DANGLE);
+  e1 = gd_error(D);
+  CHECKI(ret, 0);
+  CHECKI(e1, 0);
+
+  gd_spf(D, "early");
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_BAD_CODE);
+
+  gd_spf(D, "late");
+  e3 = gd_error(D);
+  CHECKI(e3, GD_E_BAD_CODE);
+
+  nf = gd_nfields(D);
+  CHECKI(nf, NFIELDS);
+  if (nf > NFIELDS)
+    nf = NFIELDS;
+
+  fl = gd_field_list(D);
+  for (i = 0; i < nf; ++i)
+    CHECKSi(i, fl[i], field_list[i]);
+
+  gd_entry(D, "early", &E);
+  s1 = E.in_fields[0];
+  CHECKS(s1, "data");
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "earlya", &E);
+  e4 = gd_error(D);
+  s3 = gd_alias_target(D, "earlya");
+  CHECKI(e4, GD_E_BAD_CODE);
+  CHECKS(s3, "data");
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "late", &E);
+  s4 = E.in_fields[0];
+  CHECKS(s4, "data");
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "latea", &E);
+  e5 = gd_error(D);
+  s6 = gd_alias_target(D, "earlya");
+  CHECKI(e5, GD_E_BAD_CODE);
+  CHECKS(s6, "data");
+  gd_free_entry_strings(&E);
+
+  e6 = gd_close(D);
+  CHECKI(e6, 0);
+
+  unlink_data = unlink(data);
+  unlink_zata = unlink(zata);
+  unlink(format);
+  rmdir(filedir);
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_zata, -1);
+
+  return r;
+}
diff --git a/test/name_dot5.c b/test/name_dot5.c
new file mode 100644
index 0000000..c3e5c18
--- /dev/null
+++ b/test/name_dot5.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, r1, e1, r = 0;
+  DIRFILE *D;
+  gd_entry_t E1;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+
+  /* In DSV 5 and earlier, this gives the field the valid name "d.ata" */
+  gd_dirfile_standards(D, 5);
+  r1 = gd_rename(D, "data", "d.ata", 0);
+  e1 = gd_error(D);
+  CHECKI(r1,0);
+  CHECKI(e1,0);
+
+  if (gd_entry(D, "d.ata", &E1) == 0) {
+    CHECKI(E1.flags & GD_EN_DOTTED, GD_EN_DOTTED);
+    gd_free_entry_strings(&E1);
+  } else
+    r = 1;
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/name_dot5r.c b/test/name_dot5r.c
new file mode 100644
index 0000000..9010553
--- /dev/null
+++ b/test/name_dot5r.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/VERSION 5\nda.ta RAW UINT8 8\n";
+  int fd, r1, e1, r = 0;
+  DIRFILE *D;
+  gd_entry_t E1, E2;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+
+  if (gd_entry(D, "da.ta", &E1) == 0) {
+    CHECKI(E1.flags & GD_EN_DOTTED, GD_EN_DOTTED);
+    gd_free_entry_strings(&E1);
+  } else
+    r = 1;
+
+  /* This should always work */
+  r1 = gd_rename(D, "da.ta", "data", 0);
+  e1 = gd_error(D);
+  CHECKI(r1,0);
+  CHECKI(e1,0);
+
+  if (gd_entry(D, "data", &E2) == 0) {
+    CHECKI(E2.flags & GD_EN_DOTTED, 0);
+    gd_free_entry_strings(&E2);
+  } else
+    r = 1;
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/name_dot9.c b/test/name_dot9.c
new file mode 100644
index 0000000..decd8d3
--- /dev/null
+++ b/test/name_dot9.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, r1, e1, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+
+  /* IN DSV 6 through 9, this is an invalid field name */
+  gd_dirfile_standards(D, 9);
+  r1 = gd_rename(D, "data", "d.ata", 0);
+  e1 = gd_error(D);
+  CHECKI(r1,-1);
+  CHECKI(e1,GD_E_BAD_CODE);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/name_dup.c b/test/name_dup.c
index d654a21..2ba07d3 100644
--- a/test/name_dup.c
+++ b/test/name_dup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ int main(void)
   ret = gd_rename(D, "data", "zata", 0);
   e1 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/name_meta.c b/test/name_meta.c
new file mode 100644
index 0000000..dd7c712
--- /dev/null
+++ b/test/name_meta.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2008-2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data CONST UINT8 8\n"
+    "data/meta1 CONST UINT8 8\n"
+    "data/meta2 CONST UINT8 8\n"
+    "/ALIAS data/meta3 data\n"
+    "/ALIAS data/meta4 data/meta2\n";
+  int fd, ret, e1, e2, e3, e4, e5, e6, r = 0;
+  DIRFILE *D;
+  const char *s1, *s2;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_rename(D, "data", "zata", 0);
+  e1 = gd_error(D);
+  CHECKI(ret,0);
+  CHECKI(e1,0);
+
+  gd_get_constant(D, "zata", GD_NULL, NULL);
+  e2 = gd_error(D);
+  CHECKI(e2,0);
+
+  gd_get_constant(D, "zata/meta1", GD_NULL, NULL);
+  e3 = gd_error(D);
+  CHECKI(e3,0);
+
+  gd_get_constant(D, "zata/meta2", GD_NULL, NULL);
+  e4 = gd_error(D);
+  CHECKI(e4,0);
+
+  gd_get_constant(D, "zata/meta3", GD_NULL, NULL);
+  e5 = gd_error(D);
+  s1 = gd_alias_target(D, "zata/meta3");
+  CHECKI(e5,0);
+  CHECKS(s1, "zata");
+
+  gd_get_constant(D, "zata/meta4", GD_NULL, NULL);
+  e6 = gd_error(D);
+  s2 = gd_alias_target(D, "zata/meta4");
+  CHECKI(e6,0);
+  CHECKS(s2, "zata/meta2");
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/name_move.c b/test/name_move.c
index 3b0c9ee..9987a30 100644
--- a/test/name_move.c
+++ b/test/name_move.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -29,9 +29,13 @@ int main(void)
   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;
+  int fd, ret, e1, e2, unlink_data, unlink_zata, r = 0;
   const char **fl;
-  char *field_list[4];
+#define NFIELDS 4
+  const char *field_list[NFIELDS] = {
+    "INDEX", "cata", "eata", "zata"
+  };
+  unsigned i, nf;
   DIRFILE *D;
 
   rmdirfile();
@@ -50,33 +54,29 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   ret = gd_rename(D, "data", "zata", GD_REN_DATA);
-  error = gd_error(D);
-  fl = gd_field_list(D);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(ret, 0);
 
-  field_list[0] = strdup(fl[0]);
-  field_list[1] = strdup(fl[1]);
-  field_list[2] = strdup(fl[2]);
-  field_list[3] = strdup(fl[3]);
+  nf = gd_nfields(D);
+  CHECKI(nf, NFIELDS);
+  if (nf > NFIELDS)
+    nf = NFIELDS;
 
-  gd_close(D);
+  fl = gd_field_list(D);
+  for (i = 0; i < nf; ++i)
+    CHECKSi(i, fl[i], field_list[i]);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   unlink_data = unlink(data);
   unlink_zata = unlink(zata);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(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/name_move_alias.c b/test/name_move_alias.c
index 95325b9..22d02c5 100644
--- a/test/name_move_alias.c
+++ b/test/name_move_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -29,9 +29,13 @@ int main(void)
   const char *format_data = "cata RAW UINT8 8\n/ALIAS data cata\n"
     "eata RAW UINT8 8\n";
   unsigned char data_data[256];
-  int fd, ret, error, unlink_data, unlink_zata, r = 0;
+  int fd, ret, e1, e2, unlink_data, unlink_zata, r = 0;
+  unsigned i, nf;
   const char **fl;
-  char *field_list[4];
+#define NFIELDS 4
+  const char *field_list[NFIELDS] = {
+    "INDEX", "cata", "eata", "zata"
+  };
   DIRFILE *D;
 
   rmdirfile();
@@ -50,33 +54,29 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   ret = gd_rename(D, "data", "zata", GD_REN_DATA);
-  error = gd_error(D);
-  fl = gd_field_list(D);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(ret, 0);
 
-  field_list[0] = strdup(fl[0]);
-  field_list[1] = strdup(fl[1]);
-  field_list[2] = strdup(fl[2]);
-  field_list[3] = strdup(fl[3]);
+  nf = gd_nfields(D);
+  CHECKI(nf, NFIELDS);
+  if (nf > NFIELDS)
+    nf = NFIELDS;
 
-  gd_close(D);
+  fl = gd_field_list(D);
+  for (i = 0; i < nf; ++i)
+    CHECKSi(i, fl[i], field_list[i]);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   unlink_data = unlink(data);
   unlink_zata = unlink(zata);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(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_name.c b/test/name_name.c
new file mode 100644
index 0000000..9a2d2e9
--- /dev/null
+++ b/test/name_name.c
@@ -0,0 +1,139 @@
+/* Copyright (C) 2008-2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *zata = "dirfile/zata";
+  const char *format_data =
+    "early MULTIPLY data data\n"
+    "/ALIAS earlya data\n"
+    "late PHASE data 0\n"
+    "/ALIAS latea data\n"
+    "cata RAW UINT8 8\n"
+    "data RAW UINT8 8\n"
+    "eata RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, e1, e2, e3, e4, e5, e6, unlink_data, unlink_zata, r = 0;
+  const char **fl;
+#define NFIELDS 8
+  const char *field_list[NFIELDS] = {
+    "INDEX", "cata", "early", "earlya", "eata", "late", "latea", "zata"
+  };
+  char *s1, *s2, *s5;
+  const char *s3, *s4, *s6;
+  unsigned nf, i;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+
+  /* force-resolve the early entries */
+  gd_validate(D, "early");
+  gd_validate(D, "earlya");
+
+  ret = gd_rename(D, "data", "zata", 0);
+  e1 = gd_error(D);
+  CHECKI(ret,0);
+  CHECKI(e1,0);
+
+  gd_spf(D, "early");
+  e2 = gd_error(D);
+  CHECKI(e2,GD_E_BAD_CODE);
+
+  gd_spf(D, "late");
+  e3 = gd_error(D);
+  CHECKI(e3,GD_E_BAD_CODE);
+
+  nf = gd_nfields(D);
+  CHECKI(nf, NFIELDS);
+  if (nf > NFIELDS)
+    nf = NFIELDS;
+
+  fl = gd_field_list(D);
+  for (i = 0; i < nf; ++i)
+    CHECKSi(i, fl[i], field_list[i]);
+
+  gd_entry(D, "early", &E);
+  s1 = E.in_fields[0];
+  CHECKS(s1, "data");
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "earlya", &E);
+  e4 = gd_error(D);
+  s2 = E.field;
+  s3 = gd_alias_target(D, "earlya");
+  CHECKI(e4,0);
+  CHECKS(s2, "zata");
+  CHECKS(s3, "zata");
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "late", &E);
+  s4 = E.in_fields[0];
+  CHECKS(s4, "data");
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "latea", &E);
+  e5 = gd_error(D);
+  s5 = E.field;
+  s6 = gd_alias_target(D, "earlya");
+  CHECKI(e5,0);
+  CHECKS(s5, "zata");
+  CHECKS(s6, "zata");
+  gd_free_entry_strings(&E);
+
+  e6 = gd_close(D);
+  CHECKI(e6, 0);
+
+  unlink_data = unlink(data);
+  unlink_zata = unlink(zata);
+  unlink(format);
+  rmdir(filedir);
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_zata, -1);
+
+  return r;
+}
diff --git a/test/name_updb.c b/test/name_updb.c
index f3d8524..6d9e8e8 100644
--- a/test/name_updb.c
+++ b/test/name_updb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2012 D. V. Wiebe
+/* Copyright (C) 2011-2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -28,9 +28,12 @@ int main(void)
     "early PHASE data 0\n"
     "late PHASE data 0\n"
     "/ALIAS bata data\n"
-    "data RAW UINT8 8\n";
-  int fd, e1, e2, e3, e4, r = 0;
-  char *s1, *s2, *s3;
+    "data RAW UINT8 8\n"
+    "lincom LINCOM data 1 0 INDEX 1 0 data 1 0\n"
+    "phase PHASE data2 0\n";
+  int fd, e1, e2, e3, e4, e5, e6, r = 0;
+  char *s1, *s2, *s4, *s5, *s6, *s7;
+  const char *s3;
   DIRFILE *D;
   gd_entry_t E;
 
@@ -43,26 +46,51 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR);
   gd_validate(D, "early");
+
   gd_rename(D, "data", "zata", GD_REN_UPDB);
   e1 = gd_error(D);
+  CHECKI(e1, 0);
+
   gd_spf(D, "early");
   e2 = gd_error(D);
+  CHECKI(e2, 0);
+
   gd_spf(D, "late");
   e3 = gd_error(D);
+  CHECKI(e3, 0);
 
   gd_entry(D, "early", &E);
   s1 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s1, "zata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "late", &E);
   s2 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s2, "zata");
   gd_free_entry_strings(&E);
 
-  gd_entry(D, "bata", &E);
+  gd_validate(D, "bata");
   e4 = gd_error(D);
-  s3 = strdup(gd_alias_target(D, "bata"));
+  s3 = gd_alias_target(D, "bata");
+  CHECKS(s3, "zata");
+  CHECKI(e4, 0);
+
+  gd_entry(D, "phase", &E);
+  s4 = E.in_fields[0];
+  e5 = gd_error(D);
+  CHECKI(e5, 0);
+  CHECKS(s4, "data2");
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "lincom", &E);
+  e6 = gd_error(D);
+  s5 = E.in_fields[0];
+  s6 = E.in_fields[1];
+  s7 = E.in_fields[2];
+  CHECKI(e6, 0);
+  CHECKS(s5, "zata");
+  CHECKS(s6, "INDEX");
+  CHECKS(s7, "zata");
   gd_free_entry_strings(&E);
 
   gd_discard(D);
@@ -70,17 +98,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e1,0);
-  CHECKI(e2,0);
-  CHECKI(e3,0);
-  CHECKI(e4,0);
-  CHECKS(s1, "zata");
-  CHECKS(s2, "zata");
-  CHECKS(s3, "zata");
-
-  free(s1);
-  free(s2);
-  free(s3);
-
   return r;
 }
diff --git a/test/name_updb_affix.c b/test/name_updb_affix.c
new file mode 100644
index 0000000..a58ac38
--- /dev/null
+++ b/test/name_updb_affix.c
@@ -0,0 +1,91 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "AphaseZ PHASE data 0\n"
+    "AphaseZ/meta CONST UINT8 3\n"
+    "/INCLUDE format1 A Z\n";
+  const char *format1_data = "bit BIT phase phase/meta 1\n";
+  int fd, r1, r2, r3, e1, e2, e3, e4, e5, e6, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+
+  gd_validate(D, "AbitZ");
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  gd_entry(D, "AbitZ", &E);
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+  CHECKSi(1, E.in_fields[0], "AphaseZ");
+  CHECKSi(1, E.scalar[0], "AphaseZ/meta");
+  gd_free_entry_strings(&E);
+
+  r1 = gd_rename(D, "AphaseZ", "zata", GD_REN_UPDB);
+  e3 = gd_error(D);
+  CHECKI(r1, -1);
+  CHECKI(e3, GD_E_BAD_CODE);
+
+  r2 = gd_rename(D, "AphaseZ", "zata", GD_REN_UPDB | GD_REN_FORCE);
+  e4 = gd_error(D);
+  CHECKI(r2, 0);
+  CHECKI(e4, 0);
+
+  gd_validate(D, "AbitZ");
+  e5 = gd_error(D);
+  CHECKI(e5, GD_E_BAD_SCALAR);
+
+  gd_entry(D, "AbitZ", &E);
+  e6 = gd_error(D);
+  CHECKI(e6, 0);
+  CHECKSi(2, E.in_fields[0], "AphaseZ");
+  CHECKSi(2, E.scalar[0], "AphaseZ/meta");
+  gd_free_entry_strings(&E);
+
+  r3 = gd_close(D);
+  CHECKI(r3, 0);
+
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/name_updb_alias.c b/test/name_updb_alias.c
index ba471f4..816b4d5 100644
--- a/test/name_updb_alias.c
+++ b/test/name_updb_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -34,7 +34,7 @@ int main(void)
     "cata RAW UINT8 8\n"
     "/ALIAS data cata\n";
   int fd, e0, e1, e2, e3, e4, e5, e6, r = 0;
-  char *s1, *s2, *s3, *s4, *s5, *s6;
+  const char *s1, *s2, *s3, *s4, *s5, *s6;
   gd_entry_t E;
   DIRFILE *D;
 
@@ -50,43 +50,56 @@ int main(void)
   gd_validate(D, "earlya");
   gd_rename(D, "data", "zata", GD_REN_UPDB);
   e0 = gd_error(D);
+  CHECKI(e0,0);
+
   gd_spf(D, "early");
   e1 = gd_error(D);
+  CHECKI(e1,0);
+
   gd_spf(D, "earlya");
   e2 = gd_error(D);
+  CHECKI(e2,0);
+
   gd_spf(D, "late");
   e3 = gd_error(D);
+  CHECKI(e3,0);
+
   gd_spf(D, "latea");
   e4 = gd_error(D);
+  CHECKI(e4,0);
 
   gd_entry(D, "early", &E);
   s1 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s1, "cata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "earlya", &E);
   s2 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s2, "zata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "late", &E);
   s3 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s3, "cata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "latea", &E);
   s4 = E.in_fields[0];
-  E.in_fields[0] = NULL;
+  CHECKS(s4, "zata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "aata", &E);
   e5 = gd_error(D);
-  s5 = strdup(gd_alias_target(D, "aata"));
+  s5 = gd_alias_target(D, "aata");
+  CHECKI(e5,0);
+  CHECKS(s5, "cata");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "bata", &E);
   e6 = gd_error(D);
-  s6 = strdup(gd_alias_target(D, "bata"));
+  s6 = gd_alias_target(D, "bata");
+  CHECKI(e6,0);
+  CHECKS(s6, "zata");
   gd_free_entry_strings(&E);
 
   gd_discard(D);
@@ -94,26 +107,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e0,0);
-  CHECKI(e1,0);
-  CHECKI(e2,0);
-  CHECKI(e3,0);
-  CHECKI(e4,0);
-  CHECKI(e5,0);
-  CHECKI(e6,0);
-  CHECKS(s1, "cata");
-  CHECKS(s2, "zata");
-  CHECKS(s3, "cata");
-  CHECKS(s4, "zata");
-  CHECKS(s5, "cata");
-  CHECKS(s6, "zata");
-
-  free(s1);
-  free(s2);
-  free(s3);
-  free(s4);
-  free(s5);
-  free(s6);
-
   return r;
 }
diff --git a/test/name_updb_carray.c b/test/name_updb_carray.c
new file mode 100644
index 0000000..119100f
--- /dev/null
+++ b/test/name_updb_carray.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = 
+    "phase PHASE INDEX data<3>\n"
+    "data CARRAY UINT8 8 9 10 11 12\n"
+    "lincom LINCOM INDEX data data<1>\n";
+  int fd, e1, e2, e3, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+
+  gd_rename(D, "data", "zata", GD_REN_UPDB);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  gd_entry(D, "phase", &E);
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+  CHECKS(E.scalar[0], "zata");
+  CHECKI(E.scalar_ind[0], 3);
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "lincom", &E);
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
+  CHECKS(E.scalar[0], "zata");
+  CHECKS(E.scalar[GD_MAX_LINCOM], "zata");
+  CHECKI(E.scalar_ind[0], 0);
+  CHECKI(E.scalar_ind[GD_MAX_LINCOM], 1);
+  gd_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/name_updb_const.c b/test/name_updb_const.c
index f366e4a..420f39c 100644
--- a/test/name_updb_const.c
+++ b/test/name_updb_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2012 D. V. Wiebe
+/* Copyright (C) 2011-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -26,14 +26,15 @@ int main(void)
   const char *format = "dirfile/format";
   const char *format_data = 
     "early RAW UINT8 c\n"
-    "late RAW UINT8 c\n"
+    "late LINCOM early c 0\n"
     "/ALIAS b c\n"
     "c CONST UINT8 2\n";
-  int fd, e1, e2, e3, e4, r = 0;
-  char *s1, *s2, *s3;
+  int fd, e1, e2, e3, r = 0;
+  const char *s1, *s2, *s3;
   DIRFILE *D;
   gd_entry_t E;
 
+  memset(&E, 0, sizeof(E));
   rmdirfile();
   mkdir(filedir, 0777);
 
@@ -47,22 +48,24 @@ int main(void)
   e1 = gd_error(D);
   gd_spf(D, "early");
   e2 = gd_error(D);
-  gd_spf(D, "late");
-  e3 = gd_error(D);
 
   gd_entry(D, "early", &E);
   s1 = E.scalar[0];
-  E.scalar[0] = NULL;
+  CHECKI(e1,0);
+  CHECKS(s1, "d");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "late", &E);
   s2 = E.scalar[0];
-  E.scalar[0] = NULL;
+  CHECKI(e2,0);
+  CHECKS(s2, "d");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "b", &E);
-  e4 = gd_error(D);
-  s3 = strdup(gd_alias_target(D, "b"));
+  e3 = gd_error(D);
+  s3 = gd_alias_target(D, "b");
+  CHECKI(e3,0);
+  CHECKS(s3, "d");
   gd_free_entry_strings(&E);
 
   gd_discard(D);
@@ -70,17 +73,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e1,0);
-  CHECKI(e2,0);
-  CHECKI(e3,0);
-  CHECKI(e4,0);
-  CHECKS(s1, "d");
-  CHECKS(s2, "d");
-  CHECKS(s3, "d");
-
-  free(s1);
-  free(s2);
-  free(s3);
-
   return r;
 }
diff --git a/test/name_updb_const_alias.c b/test/name_updb_const_alias.c
index 1ea7c00..34bb2e9 100644
--- a/test/name_updb_const_alias.c
+++ b/test/name_updb_const_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -31,7 +31,7 @@ int main(void)
     "e CONST UINT8 2\n"
     "/ALIAS c e\n";
   int fd, e1, e2, e3, e4, r = 0;
-  char *s1, *s2, *s3;
+  const char *s1, *s2, *s3;
   DIRFILE *D;
   gd_entry_t E;
 
@@ -46,24 +46,31 @@ int main(void)
   gd_validate(D, "early");
   gd_rename(D, "c", "d", GD_REN_UPDB);
   e1 = gd_error(D);
+  CHECKI(e1,0);
+
   gd_spf(D, "early");
   e2 = gd_error(D);
+  CHECKI(e2,0);
+
   gd_spf(D, "late");
   e3 = gd_error(D);
+  CHECKI(e3,0);
 
   gd_entry(D, "early", &E);
   s1 = E.scalar[0];
-  E.scalar[0] = NULL;
+  CHECKS(s1, "d");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "late", &E);
   s2 = E.scalar[0];
-  E.scalar[0] = NULL;
+  CHECKS(s2, "d");
   gd_free_entry_strings(&E);
 
   gd_entry(D, "b", &E);
   e4 = gd_error(D);
-  s3 = strdup(gd_alias_target(D, "b"));
+  s3 = gd_alias_target(D, "b");
+  CHECKI(e4,0);
+  CHECKS(s3, "d");
   gd_free_entry_strings(&E);
 
   gd_discard(D);
@@ -71,17 +78,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e1,0);
-  CHECKI(e2,0);
-  CHECKI(e3,0);
-  CHECKI(e4,0);
-  CHECKS(s1, "d");
-  CHECKS(s2, "d");
-  CHECKS(s3, "d");
-
-  free(s1);
-  free(s2);
-  free(s3);
-
   return r;
 }
diff --git a/test/native_bit.c b/test/native_bit.c
new file mode 100644
index 0000000..22abf86
--- /dev/null
+++ b/test/native_bit.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "bit BIT data 1\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "bit");
+  error = gd_error(D);
+  CHECKU(type, GD_UINT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_const.c b/test/native_const.c
new file mode 100644
index 0000000..526fd2b
--- /dev/null
+++ b/test/native_const.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2013, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "const");
+  error = gd_error(D);
+  CHECKU(type, GD_UINT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_index.c b/test/native_index.c
new file mode 100644
index 0000000..76168db
--- /dev/null
+++ b/test/native_index.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE);
+
+  type = gd_native_type(D, "INDEX");
+  error = gd_error(D);
+  CHECKU(type, GD_UINT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_lincom.c b/test/native_lincom.c
new file mode 100644
index 0000000..abf9a6b
--- /dev/null
+++ b/test/native_lincom.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "lincom LINCOM data 1 0\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "lincom");
+  error = gd_error(D);
+  CHECKU(type, GD_FLOAT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_lincom_cmpin.c b/test/native_lincom_cmpin.c
new file mode 100644
index 0000000..2cd24a8
--- /dev/null
+++ b/test/native_lincom_cmpin.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "lincom LINCOM data 1 0\n"
+    "data RAW COMPLEX64 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "lincom");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_lincom_cmpscal.c b/test/native_lincom_cmpscal.c
new file mode 100644
index 0000000..055c3af
--- /dev/null
+++ b/test/native_lincom_cmpscal.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "lincom LINCOM data 1;1 0\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "lincom");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_linterp.c b/test/native_linterp.c
new file mode 100644
index 0000000..45e4d8a
--- /dev/null
+++ b/test/native_linterp.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *table = "dirfile/table";
+  const char *format_data =
+    "linterp LINTERP data table\n"
+    "data RAW UINT8 11\n";
+  const char *table_data = "0 0\n1 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, table_data, strlen(table_data));
+  close(fd);
+  
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "linterp");
+  error = gd_error(D);
+  CHECKU(type, GD_FLOAT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(table);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_linterp_cmp.c b/test/native_linterp_cmp.c
new file mode 100644
index 0000000..91c1e07
--- /dev/null
+++ b/test/native_linterp_cmp.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *table = "dirfile/table";
+  const char *format_data =
+    "linterp LINTERP data table\n"
+    "data RAW UINT8 11\n";
+  const char *table_data = "0 0;1\n1 1;1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, table_data, strlen(table_data));
+  close(fd);
+  
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "linterp");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(table);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_mult.c b/test/native_mult.c
new file mode 100644
index 0000000..eee2b7d
--- /dev/null
+++ b/test/native_mult.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "mult MULTIPLY data data\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "mult");
+  error = gd_error(D);
+  CHECKU(type, GD_FLOAT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_mult1.c b/test/native_mult1.c
new file mode 100644
index 0000000..e9ecd72
--- /dev/null
+++ b/test/native_mult1.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "mult MULTIPLY cdata data\n"
+    "data RAW UINT8 11\n"
+    "cdata RAW COMPLEX128 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "mult");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_mult2.c b/test/native_mult2.c
new file mode 100644
index 0000000..3655bc2
--- /dev/null
+++ b/test/native_mult2.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "mult MULTIPLY data cdata\n"
+    "data RAW UINT8 11\n"
+    "cdata RAW COMPLEX128 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "mult");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_phase.c b/test/native_phase.c
new file mode 100644
index 0000000..0ea04bb
--- /dev/null
+++ b/test/native_phase.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "phase PHASE data 1\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "phase");
+  error = gd_error(D);
+  CHECKU(type, GD_UINT8);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_polynom.c b/test/native_polynom.c
new file mode 100644
index 0000000..78c8036
--- /dev/null
+++ b/test/native_polynom.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "polynom POLYNOM data 1 0\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "polynom");
+  error = gd_error(D);
+  CHECKU(type, GD_FLOAT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_polynom_cmpin.c b/test/native_polynom_cmpin.c
new file mode 100644
index 0000000..3c35b68
--- /dev/null
+++ b/test/native_polynom_cmpin.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "polynom POLYNOM data 1 0\n"
+    "data RAW COMPLEX128 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "polynom");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_polynom_cmpscal.c b/test/native_polynom_cmpscal.c
new file mode 100644
index 0000000..6f047f6
--- /dev/null
+++ b/test/native_polynom_cmpscal.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "polynom POLYNOM data 1;1 0\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "polynom");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_raw.c b/test/native_raw.c
new file mode 100644
index 0000000..1a33278
--- /dev/null
+++ b/test/native_raw.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "data");
+  error = gd_error(D);
+  CHECKU(type, GD_UINT8);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_recip.c b/test/native_recip.c
new file mode 100644
index 0000000..df3608f
--- /dev/null
+++ b/test/native_recip.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "recip RECIP data 1\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "recip");
+  error = gd_error(D);
+  CHECKU(type, GD_FLOAT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_recip_cmpin.c b/test/native_recip_cmpin.c
new file mode 100644
index 0000000..fd9ee0a
--- /dev/null
+++ b/test/native_recip_cmpin.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "recip RECIP data 1\n"
+    "data RAW COMPLEX128 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "recip");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_recip_cmpscal.c b/test/native_recip_cmpscal.c
new file mode 100644
index 0000000..b45aa46
--- /dev/null
+++ b/test/native_recip_cmpscal.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "recip RECIP data 1;1\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "recip");
+  error = gd_error(D);
+  CHECKU(type, GD_COMPLEX128);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_sbit.c b/test/native_sbit.c
new file mode 100644
index 0000000..3f63241
--- /dev/null
+++ b/test/native_sbit.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "sbit SBIT data 1\n"
+    "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "sbit");
+  error = gd_error(D);
+  CHECKU(type, GD_INT64);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/native_string.c b/test/native_string.c
new file mode 100644
index 0000000..d081a2c
--- /dev/null
+++ b/test/native_string.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "string STRING value\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_type_t type;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  type = gd_native_type(D, "string");
+  error = gd_error(D);
+  CHECKU(type, GD_NULL);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/nentries_alias.c b/test/nentries_alias.c
index 0ee52a0..88d75ea 100644
--- a/test/nentries_alias.c
+++ b/test/nentries_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nentries(D, NULL, GD_ALIAS_ENTRIES, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nentries_hidden.c b/test/nentries_hidden.c
index 90a2d42..6886b4c 100644
--- a/test/nentries_hidden.c
+++ b/test/nentries_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nentries(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_HIDDEN);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nentries_noalias.c b/test/nentries_noalias.c
index d27ece8..b763f84 100644
--- a/test/nentries_noalias.c
+++ b/test/nentries_noalias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nentries(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_NOALIAS);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nentries_scalar.c b/test/nentries_scalar.c
index aa0e240..f8f4195 100644
--- a/test/nentries_scalar.c
+++ b/test/nentries_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nentries(D, NULL, GD_SCALAR_ENTRIES, 0);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nfields.c b/test/nfields.c
deleted file mode 100644
index a3cc2fd..0000000
--- a/test/nfields.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-/* Retreiving the number of 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *format_data =
-    "raw1 RAW UINT8 1\n"
-    "META raw1 linterp1 LINTERP raw2 table\n"
-    "META raw1 linterp2 LINTERP raw3 table\n"
-    "META raw1 linterp3 LINTERP raw4 table\n"
-    "META raw1 const CONST UINT8 1\n"
-    "META raw1 string STRING value\n"
-    "META raw1 string2 STRING value\n"
-    "raw2 RAW UINT8 1\n"
-    "raw3 RAW UINT8 1\n"
-    "raw4 RAW UINT8 1\n"
-    "const CONST UINT8 1\n"
-    "string STRING value\n"
-    "string2 STRING value\n";
-  int fd, error, r = 0;
-  unsigned int nfields;
-  DIRFILE *D;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  nfields = gd_nfields(D);
-  error = gd_error(D);
-  gd_close(D);
-
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error, 0);
-  CHECKI(nfields, 8);
-
-  return r;
-}
diff --git a/test/nfields_hidden.c b/test/nfields_hidden.c
index eb1c6ea..65106f7 100644
--- a/test/nfields_hidden.c
+++ b/test/nfields_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nfields(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nfields_invalid.c b/test/nfields_invalid.c
index ba1d615..b023f01 100644
--- a/test/nfields_invalid.c
+++ b/test/nfields_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   n = gd_nfields(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/nfields_nfields.c b/test/nfields_nfields.c
new file mode 100644
index 0000000..a29e30e
--- /dev/null
+++ b/test/nfields_nfields.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Retreiving the number of fields of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nfields(D);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 8);
+
+  return r;
+}
diff --git a/test/nfields_type.c b/test/nfields_type.c
index 010ff59..b2fd967 100644
--- a/test/nfields_type.c
+++ b/test/nfields_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nfields_by_type(D, GD_STRING_ENTRY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nfields_type_hidden.c b/test/nfields_type_hidden.c
index c9fdd03..cba34f1 100644
--- a/test/nfields_type_hidden.c
+++ b/test/nfields_type_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nfields_by_type(D, GD_STRING_ENTRY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nfields_type_invalid.c b/test/nfields_type_invalid.c
index 3377e25..b29cc3f 100644
--- a/test/nfields_type_invalid.c
+++ b/test/nfields_type_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   n = gd_nfields_by_type(D, GD_RAW_ENTRY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/nfields_vector.c b/test/nfields_vector.c
index 0563790..4135cdc 100644
--- a/test/nfields_vector.c
+++ b/test/nfields_vector.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nvectors(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nfields_vector_hidden.c b/test/nfields_vector_hidden.c
index 42d4ffc..75cbd5a 100644
--- a/test/nfields_vector_hidden.c
+++ b/test/nfields_vector_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nvectors(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nfields_vector_invalid.c b/test/nfields_vector_invalid.c
index e3b8bf5..907751c 100644
--- a/test/nfields_vector_invalid.c
+++ b/test/nfields_vector_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -31,7 +31,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   n = gd_nvectors(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/nframes.c b/test/nframes.c
deleted file mode 100644
index 9cb1124..0000000
--- a/test/nframes.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-/* Retreiving the number of frames 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *format_data = "data RAW UINT16 1\n";
-  int fd, error, r = 0;
-  const size_t len = strlen(data);
-  off_t n;
-  DIRFILE *D;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
-  write(fd, data, len);
-  close(fd);
-
-  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  n = gd_nframes(D);
-  error = gd_error(D);
-  gd_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
index eff713d..0938196 100644
--- a/test/nframes64.c
+++ b/test/nframes64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_nframes64(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/nframes_empty.c b/test/nframes_empty.c
index 3dcd0eb..1b2f030 100644
--- a/test/nframes_empty.c
+++ b/test/nframes_empty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nframes_invalid.c b/test/nframes_invalid.c
index e4d7f1d..655b9ed 100644
--- a/test/nframes_invalid.c
+++ b/test/nframes_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKU(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/nframes_nframes.c b/test/nframes_nframes.c
new file mode 100644
index 0000000..eeb1593
--- /dev/null
+++ b/test/nframes_nframes.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Retreiving the number of frames should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 1\n";
+  int fd, error, r = 0;
+  const size_t len = strlen(data);
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, (off_t)len / 2);
+
+  return r;
+}
diff --git a/test/nframes_off64.c b/test/nframes_off64.c
index cf78345..9587645 100644
--- a/test/nframes_off64.c
+++ b/test/nframes_off64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n = gd_nframes(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/nframes_spf.c b/test/nframes_spf.c
index 875897c..a3f60f1 100644
--- a/test/nframes_spf.c
+++ b/test/nframes_spf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
     spf = gd_spf(D, "data");
     n = gd_nframes(D);
     CHECKUi(i, n, len / spf);
-    gd_close(D);
+    gd_discard(D);
   }
 
   unlink(data);
diff --git a/test/nmeta.c b/test/nmeta.c
index 58fa577..cb5def2 100644
--- a/test/nmeta.c
+++ b/test/nmeta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nmfields(D, "raw1");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_hidden.c b/test/nmeta_hidden.c
index 0f4a43e..659f6f3 100644
--- a/test/nmeta_hidden.c
+++ b/test/nmeta_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nmfields(D, "raw1");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_invalid.c b/test/nmeta_invalid.c
index f045afc..9dadea3 100644
--- a/test/nmeta_invalid.c
+++ b/test/nmeta_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   n = gd_nmfields(D, "raw1");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKU(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/nmeta_parent.c b/test/nmeta_parent.c
index 0d2e01a..72c964f 100644
--- a/test/nmeta_parent.c
+++ b/test/nmeta_parent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   nfields = gd_nmfields(D, "raw9");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_type.c b/test/nmeta_type.c
index 1c0780a..c82d625 100644
--- a/test/nmeta_type.c
+++ b/test/nmeta_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   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);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_type_hidden.c b/test/nmeta_type_hidden.c
index 4a45b9c..fe35b4f 100644
--- a/test/nmeta_type_hidden.c
+++ b/test/nmeta_type_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   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);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_type_invalid.c b/test/nmeta_type_invalid.c
index 2cb6187..be6894a 100644
--- a/test/nmeta_type_invalid.c
+++ b/test/nmeta_type_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   n = gd_nmfields_by_type(D, "raw1", GD_STRING_ENTRY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKU(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/nmeta_type_parent.c b/test/nmeta_type_parent.c
index 0611137..dd51557 100644
--- a/test/nmeta_type_parent.c
+++ b/test/nmeta_type_parent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   nfields = gd_nmfields_by_type(D, "raw9", GD_STRING_ENTRY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_vectors.c b/test/nmeta_vectors.c
index 4b2c222..cab94f9 100644
--- a/test/nmeta_vectors.c
+++ b/test/nmeta_vectors.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nmvectors(D, "raw1");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_vectors_hidden.c b/test/nmeta_vectors_hidden.c
index ecd2b18..85369b2 100644
--- a/test/nmeta_vectors_hidden.c
+++ b/test/nmeta_vectors_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   nfields = gd_nmvectors(D, "raw1");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/nmeta_vectors_invalid.c b/test/nmeta_vectors_invalid.c
index 14b2884..4b78706 100644
--- a/test/nmeta_vectors_invalid.c
+++ b/test/nmeta_vectors_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   n = gd_nmvectors(D, "raw1");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKU(n, 0);
   CHECKI(error, GD_E_BAD_DIRFILE);
diff --git a/test/nmeta_vectors_parent.c b/test/nmeta_vectors_parent.c
index c64b2c7..a5bba51 100644
--- a/test/nmeta_vectors_parent.c
+++ b/test/nmeta_vectors_parent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   nfields = gd_nmvectors(D, "raw9");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open.c b/test/open.c
deleted file mode 100644
index f0d03ed..0000000
--- a/test/open.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-/* Opening an 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 = "dirfile";
-  const char *format = "dirfile/format";
-  int error, r = 0;
-  DIRFILE *D;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
-
-  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  error = gd_error(D);
-  gd_close(D);
-
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error, 0);
-  return r;
-}
diff --git a/test/open_abs.c b/test/open_abs.c
index a054aae..b0e112d 100644
--- a/test/open_abs.c
+++ b/test/open_abs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
   strcat(path, filedir);
   D = gd_open(path, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_cb_abort.c b/test/open_cb_abort.c
index 366c3d3..e7ed55a 100644
--- a/test/open_cb_abort.c
+++ b/test/open_cb_abort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
 
   D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_cb_cont.c b/test/open_cb_cont.c
index 05b8d9a..92380db 100644
--- a/test/open_cb_cont.c
+++ b/test/open_cb_cont.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
 
   D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_cb_ignore.c b/test/open_cb_ignore.c
index 198ba6b..1bdc54a 100644
--- a/test/open_cb_ignore.c
+++ b/test/open_cb_ignore.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
 
   D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_cb_invalid.c b/test/open_cb_invalid.c
index 119d805..2be3439 100644
--- a/test/open_cb_invalid.c
+++ b/test/open_cb_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
 
   D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_cb_rescan.c b/test/open_cb_rescan.c
index 95c8409..3e74d49 100644
--- a/test/open_cb_rescan.c
+++ b/test/open_cb_rescan.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
 
   D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_cb_rescan_alloc.c b/test/open_cb_rescan_alloc.c
new file mode 100644
index 0000000..e851a92
--- /dev/null
+++ b/test/open_cb_rescan_alloc.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 gd_unused_)
+{
+  if (saw_callback)
+    return GD_SYNTAX_ABORT;
+
+  saw_callback = 1;
+
+  pdata->line = strdup("/REFERENCE data\n");
+
+  return GD_SYNTAX_RESCAN;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(saw_callback, 1);
+  CHECKI(error, GD_E_BAD_REFERENCE);
+
+  return r;
+}
diff --git a/test/open_eaccess.c b/test/open_eaccess.c
index 25052b9..cf94598 100644
--- a/test/open_eaccess.c
+++ b/test/open_eaccess.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Opening an dirfile with no read permission should fail cleanly */
 #include "test.h"
 
 #include <stdlib.h>
@@ -50,11 +49,11 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_OPEN);
+  CHECKI(error, GD_E_IO);
   return r;
 }
diff --git a/test/open_invalid.c b/test/open_invalid.c
new file mode 100644
index 0000000..a5cdc7d
--- /dev/null
+++ b/test/open_invalid.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  int e1, e2, r = 0;
+  DIRFILE *D;
+
+  D = gd_invalid_dirfile();
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  
+  gd_nframes(D);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_BAD_DIRFILE);
+
+  gd_discard(D);
+
+  return r;
+}
diff --git a/test/open_nonexistent.c b/test/open_nonexistent.c
index af91ccf..67e4f12 100644
--- a/test/open_nonexistent.c
+++ b/test/open_nonexistent.c
@@ -27,7 +27,7 @@ int main(void)
   int error, r = 0;
 
   error = gd_error(D);
-  CHECKI(error, GD_E_OPEN);
+  CHECKI(error, GD_E_IO);
   gd_discard(D);
 
   return r;
diff --git a/test/open_notdirfile.c b/test/open_notdirfile.c
index 6ab64ff..2f2a258 100644
--- a/test/open_notdirfile.c
+++ b/test/open_notdirfile.c
@@ -40,7 +40,7 @@ int main(void)
 
   rmdir(filedir);
   error = gd_error(D);
-  CHECKI(error, GD_E_OPEN);
+  CHECKI(error, GD_E_IO);
   gd_discard(D);
 
   return r;
diff --git a/test/open_open.c b/test/open_open.c
new file mode 100644
index 0000000..93fe38f
--- /dev/null
+++ b/test/open_open.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Opening an empty  dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+}
diff --git a/test/open_sym_a.c b/test/open_sym_a.c
deleted file mode 100644
index ee151b6..0000000
--- a/test/open_sym_a.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (C) 2012 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#include "test.h"
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-int main(void)
-{
-#if ! defined HAVE_SYMLINK || defined GD_NO_GETCWD
-  return 77;
-#else
-  const char *filedir = "dirfile/link";
-  const char *format = "dirfile/format";
-  char *targ;
-  int error, r = 0;
-  int cwd_size = 2048;
-  char *ptr, *cwd = NULL;
-  DIRFILE *D;
-
-  gdtest_getcwd(ptr, cwd, cwd_size);
-
-  rmdirfile();
-  mkdir("dirfile", 0777);
-  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
-
-  /* make a symlink */
-  targ = (char*)malloc(cwd_size + 8);
-  sprintf(targ, "%s/dirfile", cwd);
-
-  symlink(targ, filedir);
-  free(targ);
-
-  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  error = gd_error(D);
-  gd_close(D);
-
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error, 0);
-  free(cwd);
-  return r;
-#endif
-}
diff --git a/test/open_sym_al.c b/test/open_sym_al.c
index 48ac87f..908d56b 100644
--- a/test/open_sym_al.c
+++ b/test/open_sym_al.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_sym_at.c b/test/open_sym_at.c
index bddb7a2..6b69ed6 100644
--- a/test/open_sym_at.c
+++ b/test/open_sym_at.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_sym_c.c b/test/open_sym_c.c
index 57afe87..e7c04da 100644
--- a/test/open_sym_c.c
+++ b/test/open_sym_c.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_sym_cl.c b/test/open_sym_cl.c
index e40db2c..ed96670 100644
--- a/test/open_sym_cl.c
+++ b/test/open_sym_cl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_sym_ct.c b/test/open_sym_ct.c
index cac53ee..6a47c65 100644
--- a/test/open_sym_ct.c
+++ b/test/open_sym_ct.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_sym_d.c b/test/open_sym_d.c
new file mode 100644
index 0000000..845e161
--- /dev/null
+++ b/test/open_sym_d.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* this tests whether _GD_CanonicalPath can deal with bad intermediate
+ * symlinks */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+#if ! defined HAVE_SYMLINK || defined GD_NO_GETCWD
+  return 77;
+#else
+  const char *link = "dirfile/link";
+  const char *filedir = "dirfile/link/dirfile";
+  int error, r = 0;
+  int cwd_size = 2048;
+  char *ptr, *cwd = NULL;
+  DIRFILE *D;
+
+  gdtest_getcwd(ptr, cwd, cwd_size);
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+
+  /* make a bad symlink */
+  symlink("non_existent", link);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  ptr = gd_error_string(D, NULL, 0);
+  CHECKI(error, GD_E_IO);
+  CHECKSS(ptr, "dirfile/non_existent/dirfile");
+  free(ptr);
+
+  gd_discard(D);
+
+  unlink(link);
+  rmdir("dirfile");
+
+  free(cwd);
+  return r;
+#endif
+}
diff --git a/test/open_sym_l.c b/test/open_sym_l.c
new file mode 100644
index 0000000..c0706b1
--- /dev/null
+++ b/test/open_sym_l.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* this tests whether _GD_CanonicalPath can deal with symlink loops */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#if ! defined HAVE_SYMLINK || defined GD_NO_GETCWD
+  return 77;
+#else
+  const char *link = "dirfile/link";
+  const char *filedir = "dirfile/link/dirfile";
+  int error, r = 0;
+  int cwd_size = 2048;
+  char *ptr, *cwd = NULL;
+  DIRFILE *D;
+
+  gdtest_getcwd(ptr, cwd, cwd_size);
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+
+  /* make a bad symlink */
+  symlink("link", link);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(link);
+  rmdir("dirfile");
+
+  CHECKI(error, GD_E_IO);
+  free(cwd);
+  return r;
+#endif
+}
diff --git a/test/open_sym_p.c b/test/open_sym_p.c
index 4520568..dcea936 100644
--- a/test/open_sym_p.c
+++ b/test/open_sym_p.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_sym_pl.c b/test/open_sym_pl.c
index fd2e3a3..459547f 100644
--- a/test/open_sym_pl.c
+++ b/test/open_sym_pl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/open_sym_pt.c b/test/open_sym_pt.c
index 09a4ac4..55f714b 100644
--- a/test/open_sym_pt.c
+++ b/test/open_sym_pt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_badline.c b/test/parse_badline.c
index 8218dea..e143e61 100644
--- a/test/parse_badline.c
+++ b/test/parse_badline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_bit.c b/test/parse_bit.c
index 52dfdf0..9684f1a 100644
--- a/test/parse_bit.c
+++ b/test/parse_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_bit4.c b/test/parse_bit4.c
index 4fbd65b..432bb81 100644
--- a/test/parse_bit4.c
+++ b/test/parse_bit4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_bit_bitnum.c b/test/parse_bit_bitnum.c
index 542557f..0862c1f 100644
--- a/test/parse_bit_bitnum.c
+++ b/test/parse_bit_bitnum.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_bit_bitsize.c b/test/parse_bit_bitsize.c
index 66dc66d..33c5332 100644
--- a/test/parse_bit_bitsize.c
+++ b/test/parse_bit_bitsize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_bit_ncols.c b/test/parse_bit_ncols.c
index a8da6e4..30cc257 100644
--- a/test/parse_bit_ncols.c
+++ b/test/parse_bit_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_bit_numbits.c b/test/parse_bit_numbits.c
index ef84c53..5d9954e 100644
--- a/test/parse_bit_numbits.c
+++ b/test/parse_bit_numbits.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_bit_scalar.c b/test/parse_bit_scalar.c
index e042c11..039d06d 100644
--- a/test/parse_bit_scalar.c
+++ b/test/parse_bit_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_carray.c b/test/parse_carray.c
index 070b2a0..8f39299 100644
--- a/test/parse_carray.c
+++ b/test/parse_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_carray_long.c b/test/parse_carray_long.c
index 55c7206..fa7965e 100644
--- a/test/parse_carray_long.c
+++ b/test/parse_carray_long.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_const.c b/test/parse_const.c
index dbe3579..a7347f0 100644
--- a/test/parse_const.c
+++ b/test/parse_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_const_complex.c b/test/parse_const_complex.c
index cd28c66..896b51b 100644
--- a/test/parse_const_complex.c
+++ b/test/parse_const_complex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
 #endif
   e2 = gd_error(D);
   
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_const_ncols.c b/test/parse_const_ncols.c
index 9c617d8..4c96679 100644
--- a/test/parse_const_ncols.c
+++ b/test/parse_const_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_divide.c b/test/parse_divide.c
index 15a9014..2512e12 100644
--- a/test/parse_divide.c
+++ b/test/parse_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_double.c b/test/parse_double.c
index 3f9dd7f..4ac50a7 100644
--- a/test/parse_double.c
+++ b/test/parse_double.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   gd_get_constant(D, "hex", GD_FLOAT64, &h);
   e6 = gd_error(D);
   
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_duplicate.c b/test/parse_duplicate.c
index 520d4f8..44a2351 100644
--- a/test/parse_duplicate.c
+++ b/test/parse_duplicate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_duplicate_ignore.c b/test/parse_duplicate_ignore.c
index ab8f2c1..0b8e5be 100644
--- a/test/parse_duplicate_ignore.c
+++ b/test/parse_duplicate_ignore.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_IGNORE_DUPS | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_endian_bad.c b/test/parse_endian_bad.c
index 746b5c4..3efbb18 100644
--- a/test/parse_endian_bad.c
+++ b/test/parse_endian_bad.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_endian_big.c b/test/parse_endian_big.c
index b6c2bdf..fd44d4c 100644
--- a/test/parse_endian_big.c
+++ b/test/parse_endian_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_endian_force.c b/test/parse_endian_force.c
index be406f1..ff1671f 100644
--- a/test/parse_endian_force.c
+++ b/test/parse_endian_force.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_FORCE_ENDIAN | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_endian_little.c b/test/parse_endian_little.c
index baa7c55..ef1bc64 100644
--- a/test/parse_endian_little.c
+++ b/test/parse_endian_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_endian_slash.c b/test/parse_endian_slash.c
index 77f53fd..3daf20b 100644
--- a/test/parse_endian_slash.c
+++ b/test/parse_endian_slash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_eol.c b/test/parse_eol.c
index c43e7b2..59d78b2 100644
--- a/test/parse_eol.c
+++ b/test/parse_eol.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_foffs.c b/test/parse_foffs.c
index 7d7cd60..512d55d 100644
--- a/test/parse_foffs.c
+++ b/test/parse_foffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_foffs_include.c b/test/parse_foffs_include.c
index 0389757..f631c7b 100644
--- a/test/parse_foffs_include.c
+++ b/test/parse_foffs_include.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -88,7 +88,7 @@ int main(void)
   CHECKI(error3, 0);
   CHECKU(data_data[0], 1);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   unlink(format1);
diff --git a/test/parse_foffs_slash.c b/test/parse_foffs_slash.c
index 5a235f0..e66baab 100644
--- a/test/parse_foffs_slash.c
+++ b/test/parse_foffs_slash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_hidden.c b/test/parse_hidden.c
index c2b8773..78c7320 100644
--- a/test/parse_hidden.c
+++ b/test/parse_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_hidden_field.c b/test/parse_hidden_field.c
index 12ac204..0bd8237 100644
--- a/test/parse_hidden_field.c
+++ b/test/parse_hidden_field.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_hidden_meta.c b/test/parse_hidden_meta.c
index 6873f02..463f144 100644
--- a/test/parse_hidden_meta.c
+++ b/test/parse_hidden_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -41,7 +41,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_include.c b/test/parse_include.c
index f0d40e8..cd49370 100644
--- a/test/parse_include.c
+++ b/test/parse_include.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_absolute.c b/test/parse_include_absolute.c
index 097bce5..36413fb 100644
--- a/test/parse_include_absolute.c
+++ b/test/parse_include_absolute.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2012 D. V. Wiebe
+/* Copyright (C) 2011-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_absrel.c b/test/parse_include_absrel.c
index 566fac6..f065a85 100644
--- a/test/parse_include_absrel.c
+++ b/test/parse_include_absrel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2012 D. V. Wiebe
+/* Copyright (C) 2011-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/parse_include_affix_bad.c b/test/parse_include_affix_bad.c
new file mode 100644
index 0000000..243ab1c
--- /dev/null
+++ b/test/parse_include_affix_bad.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "data RAW UINT8 1\n"
+    "INCLUDE format1 \"\" .txt\n";
+  const char *format1_data = "zata RAW UINT8 11\n";
+  int fd, e, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  e = gd_error(D);
+  CHECKI(e, GD_E_FORMAT);
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_include_affix_ref.c b/test/parse_include_affix_ref.c
index 6130a00..ecc000c 100644
--- a/test/parse_include_affix_ref.c
+++ b/test/parse_include_affix_ref.c
@@ -55,7 +55,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   ref = gd_reference(D, NULL);
   CHECKS(ref, "AzataB");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_dir.c b/test/parse_include_dir.c
index 741fd41..e7bbf1b 100644
--- a/test/parse_include_dir.c
+++ b/test/parse_include_dir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,12 +47,12 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(subdir);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_OPEN_FRAGMENT);
+  CHECKI(error, GD_E_IO);
   return r;
 }
diff --git a/test/parse_include_loop.c b/test/parse_include_loop.c
index 9241cf3..20df193 100644
--- a/test/parse_include_loop.c
+++ b/test/parse_include_loop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   e = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_include_nonexistent.c b/test/parse_include_nonexistent.c
index 16f14ed..b203890 100644
--- a/test/parse_include_nonexistent.c
+++ b/test/parse_include_nonexistent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,11 +45,11 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,GD_E_OPEN_INCLUDE);
+  CHECKI(error,GD_E_IO);
   return r;
 }
diff --git a/test/parse_include_prefix.c b/test/parse_include_prefix.c
index 89971ea..8417903 100644
--- a/test/parse_include_prefix.c
+++ b/test/parse_include_prefix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   spf = gd_spf(D, "data");
   spfaff = gd_spf(D, "predata");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_prefix_dup.c b/test/parse_include_prefix_dup.c
index 0404872..6dfdf22 100644
--- a/test/parse_include_prefix_dup.c
+++ b/test/parse_include_prefix_dup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -43,7 +43,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   e = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_preprefix.c b/test/parse_include_preprefix.c
index 3187ec5..ea5f8c1 100644
--- a/test/parse_include_preprefix.c
+++ b/test/parse_include_preprefix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
   spf = gd_spf(D, "data");
   spf1 = gd_spf(D, "predata");
   spf2 = gd_spf(D, "prePREdata");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/parse_include_ref.c b/test/parse_include_ref.c
index 6dcadd4..37bd623 100644
--- a/test/parse_include_ref.c
+++ b/test/parse_include_ref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   ref = gd_reference(D, NULL);
   CHECKS(ref, "zata");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_relabs.c b/test/parse_include_relabs.c
index 2cf28b9..849a7c2 100644
--- a/test/parse_include_relabs.c
+++ b/test/parse_include_relabs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2012 D. V. Wiebe
+/* Copyright (C) 2011-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -71,7 +71,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/parse_include_relrel.c b/test/parse_include_relrel.c
index adadc35..04639dd 100644
--- a/test/parse_include_relrel.c
+++ b/test/parse_include_relrel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/parse_include_slash.c b/test/parse_include_slash.c
index 2a500fb..ec3fe67 100644
--- a/test/parse_include_slash.c
+++ b/test/parse_include_slash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "data");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_suffix.c b/test/parse_include_suffix.c
index 6d0738f..17333b3 100644
--- a/test/parse_include_suffix.c
+++ b/test/parse_include_suffix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   spf = gd_spf(D, "data");
   spfaff = gd_spf(D, "predatapost");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_include_sufsuffix.c b/test/parse_include_sufsuffix.c
index 2b6136a..7a2a738 100644
--- a/test/parse_include_sufsuffix.c
+++ b/test/parse_include_sufsuffix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -52,7 +52,7 @@ int main(void)
   spf = gd_spf(D, "data");
   spf1 = gd_spf(D, "predatapost");
   spf2 = gd_spf(D, "predataPOSTpost");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/parse_index.c b/test/parse_index.c
index a61e346..9c8c4a2 100644
--- a/test/parse_index.c
+++ b/test/parse_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom.c b/test/parse_lincom.c
index 9ad7060..dbfe8d6 100644
--- a/test/parse_lincom.c
+++ b/test/parse_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom_ncols1.c b/test/parse_lincom_ncols1.c
index 8562cba..d70179c 100644
--- a/test/parse_lincom_ncols1.c
+++ b/test/parse_lincom_ncols1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom_ncols2.c b/test/parse_lincom_ncols2.c
index 211f589..4df839b 100644
--- a/test/parse_lincom_ncols2.c
+++ b/test/parse_lincom_ncols2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom_nfields.c b/test/parse_lincom_nfields.c
index 2d4c4fe..2416ed7 100644
--- a/test/parse_lincom_nfields.c
+++ b/test/parse_lincom_nfields.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom_nofields.c b/test/parse_lincom_nofields.c
index 23d5d7c..50c0aa8 100644
--- a/test/parse_lincom_nofields.c
+++ b/test/parse_lincom_nofields.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom_non.c b/test/parse_lincom_non.c
index 0f656b6..49428b4 100644
--- a/test/parse_lincom_non.c
+++ b/test/parse_lincom_non.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom_non_ncols.c b/test/parse_lincom_non_ncols.c
index 42c41a0..5d72c76 100644
--- a/test/parse_lincom_non_ncols.c
+++ b/test/parse_lincom_non_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_lincom_scalar.c b/test/parse_lincom_scalar.c
index 9d2481f..723d7cf 100644
--- a/test/parse_lincom_scalar.c
+++ b/test/parse_lincom_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_linterp.c b/test/parse_linterp.c
index 6184cb2..8e17281 100644
--- a/test/parse_linterp.c
+++ b/test/parse_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_linterp_ncols.c b/test/parse_linterp_ncols.c
index 25dba8c..b4cbc83 100644
--- a/test/parse_linterp_ncols.c
+++ b/test/parse_linterp_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_literal_cmpbad.c b/test/parse_literal_cmpbad.c
new file mode 100644
index 0000000..e88165b
--- /dev/null
+++ b/test/parse_literal_cmpbad.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST COMPLEX128 1;a\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error, GD_E_FORMAT);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_literal_fltcmp.c b/test/parse_literal_fltcmp.c
new file mode 100644
index 0000000..95b571c
--- /dev/null
+++ b/test/parse_literal_fltcmp.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST FLOAT64 1;1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error, GD_E_FORMAT);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_literal_fltcmp0.c b/test/parse_literal_fltcmp0.c
new file mode 100644
index 0000000..de5474f
--- /dev/null
+++ b/test/parse_literal_fltcmp0.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST FLOAT64 1;0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  CHECKI(error, GD_E_OK);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_literal_intcmp.c b/test/parse_literal_intcmp.c
new file mode 100644
index 0000000..1724112
--- /dev/null
+++ b/test/parse_literal_intcmp.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data PHASE in1 1;1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error,GD_E_FORMAT);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_literal_intcmp0.c b/test/parse_literal_intcmp0.c
new file mode 100644
index 0000000..0e4e085
--- /dev/null
+++ b/test/parse_literal_intcmp0.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data PHASE in1 1;0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_literal_uintcmp.c b/test/parse_literal_uintcmp.c
new file mode 100644
index 0000000..bea52eb
--- /dev/null
+++ b/test/parse_literal_uintcmp.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 1;1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error,GD_E_FORMAT);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_literal_uintcmp0.c b/test/parse_literal_uintcmp0.c
new file mode 100644
index 0000000..601d2e7
--- /dev/null
+++ b/test/parse_literal_uintcmp0.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 1;0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  CHECKI(error,0);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_meta.c b/test/parse_meta.c
index e759261..b6266e7 100644
--- a/test/parse_meta.c
+++ b/test/parse_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_affix.c b/test/parse_meta_affix.c
index ba47031..6d49590 100644
--- a/test/parse_meta_affix.c
+++ b/test/parse_meta_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_meta_alias.c b/test/parse_meta_alias.c
index 04eb6c3..603dd66 100644
--- a/test/parse_meta_alias.c
+++ b/test/parse_meta_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_frag.c b/test/parse_meta_frag.c
new file mode 100644
index 0000000..bf1a42a
--- /dev/null
+++ b/test/parse_meta_frag.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "parent RAW UINT8 1\nINCLUDE format1\n";
+  const char *format1_data = "parent/child CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error, GD_E_FORMAT);
+  gd_discard(D);
+
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_meta_implicit.c b/test/parse_meta_implicit.c
index c2b63b2..09b750d 100644
--- a/test/parse_meta_implicit.c
+++ b/test/parse_meta_implicit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -55,7 +55,7 @@ int main(void)
   CHECKI(error2,0);
   CHECKI(c,1);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_implicit2.c b/test/parse_meta_implicit2.c
index 862c1bf..a56e7db 100644
--- a/test/parse_meta_implicit2.c
+++ b/test/parse_meta_implicit2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_implicit_affix.c b/test/parse_meta_implicit_affix.c
index cceb277..039a1fa 100644
--- a/test/parse_meta_implicit_affix.c
+++ b/test/parse_meta_implicit_affix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_meta_index.c b/test/parse_meta_index.c
index 9c6a8d6..65584d4 100644
--- a/test/parse_meta_index.c
+++ b/test/parse_meta_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_index2.c b/test/parse_meta_index2.c
index bc17fba..d2ae5dc 100644
--- a/test/parse_meta_index2.c
+++ b/test/parse_meta_index2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_jump.c b/test/parse_meta_jump.c
index ef5f29c..cc19fd8 100644
--- a/test/parse_meta_jump.c
+++ b/test/parse_meta_jump.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_malias.c b/test/parse_meta_malias.c
index e560afb..358b0ad 100644
--- a/test/parse_meta_malias.c
+++ b/test/parse_meta_malias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_meta.c b/test/parse_meta_meta.c
index bd11235..93cc81e 100644
--- a/test/parse_meta_meta.c
+++ b/test/parse_meta_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -41,7 +41,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_parent.c b/test/parse_meta_parent.c
index f723a64..8c51531 100644
--- a/test/parse_meta_parent.c
+++ b/test/parse_meta_parent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_meta_raw.c b/test/parse_meta_raw.c
index 894759f..0f0eced 100644
--- a/test/parse_meta_raw.c
+++ b/test/parse_meta_raw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_mplex.c b/test/parse_mplex.c
index 2d65c50..34464a0 100644
--- a/test/parse_mplex.c
+++ b/test/parse_mplex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_mplex_ncols.c b/test/parse_mplex_ncols.c
index a07889e..4e968a6 100644
--- a/test/parse_mplex_ncols.c
+++ b/test/parse_mplex_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_mplex_nomax.c b/test/parse_mplex_nomax.c
index 1f6b26a..caeb5a1 100644
--- a/test/parse_mplex_nomax.c
+++ b/test/parse_mplex_nomax.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   e1 = gd_error(D);
   e2 = gd_entry(D, "data", &E);
-  gd_close(D);
+  gd_discard(D);
   gd_free_entry_strings(&E);
 
   unlink(format);
diff --git a/test/parse_mplex_scalar.c b/test/parse_mplex_scalar.c
index a3aa0be..d510234 100644
--- a/test/parse_mplex_scalar.c
+++ b/test/parse_mplex_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_multiply.c b/test/parse_multiply.c
index 161a7dd..cc86896 100644
--- a/test/parse_multiply.c
+++ b/test/parse_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_multiply_ncols.c b/test/parse_multiply_ncols.c
index 36eca45..8c59fab 100644
--- a/test/parse_multiply_ncols.c
+++ b/test/parse_multiply_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_name.c b/test/parse_name.c
index 31d3f36..9fc166c 100644
--- a/test/parse_name.c
+++ b/test/parse_name.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_name_dot.c b/test/parse_name_dot.c
index e3d2704..a9b659b 100644
--- a/test/parse_name_dot.c
+++ b/test/parse_name_dot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_name_ext.c b/test/parse_name_ext.c
index 62b2eab..e21bcd3 100644
--- a/test/parse_name_ext.c
+++ b/test/parse_name_ext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_name_pedantic.c b/test/parse_name_pedantic.c
index ec2abf1..9c2d324 100644
--- a/test/parse_name_pedantic.c
+++ b/test/parse_name_pedantic.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_PEDANTIC);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_ncols.c b/test/parse_ncols.c
index 878ed41..208e5b2 100644
--- a/test/parse_ncols.c
+++ b/test/parse_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_octal_zero.c b/test/parse_octal_zero.c
new file mode 100644
index 0000000..73fe148
--- /dev/null
+++ b/test/parse_octal_zero.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "string STRING \\00\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error,GD_E_FORMAT);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_phase.c b/test/parse_phase.c
index 646de17..434a565 100644
--- a/test/parse_phase.c
+++ b/test/parse_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_phase_ncols.c b/test/parse_phase_ncols.c
index 0007bd9..557e823 100644
--- a/test/parse_phase_ncols.c
+++ b/test/parse_phase_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_phase_scalar.c b/test/parse_phase_scalar.c
index fda3b0a..25eca96 100644
--- a/test/parse_phase_scalar.c
+++ b/test/parse_phase_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_polynom.c b/test/parse_polynom.c
index 81863f6..1f4ac97 100644
--- a/test/parse_polynom.c
+++ b/test/parse_polynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_polynom_ncols1.c b/test/parse_polynom_ncols1.c
index edea942..0ec3de7 100644
--- a/test/parse_polynom_ncols1.c
+++ b/test/parse_polynom_ncols1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_polynom_ncols2.c b/test/parse_polynom_ncols2.c
index 2d6d214..191bf6c 100644
--- a/test/parse_polynom_ncols2.c
+++ b/test/parse_polynom_ncols2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_polynom_scalar.c b/test/parse_polynom_scalar.c
index 6f93483..5fa5626 100644
--- a/test/parse_polynom_scalar.c
+++ b/test/parse_polynom_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_protect_all.c b/test/parse_protect_all.c
index 70d0b18..7fbd8a3 100644
--- a/test/parse_protect_all.c
+++ b/test/parse_protect_all.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_protect_bad.c b/test/parse_protect_bad.c
index 52d501d..aaa49e3 100644
--- a/test/parse_protect_bad.c
+++ b/test/parse_protect_bad.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_protect_data.c b/test/parse_protect_data.c
index cb4d98d..7cd6812 100644
--- a/test/parse_protect_data.c
+++ b/test/parse_protect_data.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_protect_format.c b/test/parse_protect_format.c
index ea76b9e..8e145d4 100644
--- a/test/parse_protect_format.c
+++ b/test/parse_protect_format.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_protect_none.c b/test/parse_protect_none.c
index ec2b84d..2a60bb6 100644
--- a/test/parse_protect_none.c
+++ b/test/parse_protect_none.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_quote.c b/test/parse_quote.c
index 57f19e5..495aa29 100644
--- a/test/parse_quote.c
+++ b/test/parse_quote.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_quote_mismatch.c b/test/parse_quote_mismatch.c
index 64a1261..c8ea6b1 100644
--- a/test/parse_quote_mismatch.c
+++ b/test/parse_quote_mismatch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_raw.c b/test/parse_raw.c
index 1f4ceac..4b51329 100644
--- a/test/parse_raw.c
+++ b/test/parse_raw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_raw_char.c b/test/parse_raw_char.c
index e323a39..b186e57 100644
--- a/test/parse_raw_char.c
+++ b/test/parse_raw_char.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_raw_char_bad.c b/test/parse_raw_char_bad.c
new file mode 100644
index 0000000..098ed2d
--- /dev/null
+++ b/test/parse_raw_char_bad.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW z 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_raw_ncols.c b/test/parse_raw_ncols.c
index ef97312..6a1a608 100644
--- a/test/parse_raw_ncols.c
+++ b/test/parse_raw_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_raw_scalar.c b/test/parse_raw_scalar.c
index 39a1dc5..002073b 100644
--- a/test/parse_raw_scalar.c
+++ b/test/parse_raw_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_raw_spf.c b/test/parse_raw_spf.c
index b4793f4..e5cfaa5 100644
--- a/test/parse_raw_spf.c
+++ b/test/parse_raw_spf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_raw_type.c b/test/parse_raw_type.c
index 4d2ca56..522f3b9 100644
--- a/test/parse_raw_type.c
+++ b/test/parse_raw_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_recip.c b/test/parse_recip.c
index 984c22d..c97bc40 100644
--- a/test/parse_recip.c
+++ b/test/parse_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_ref.c b/test/parse_ref.c
index c7956e4..7c38780 100644
--- a/test/parse_ref.c
+++ b/test/parse_ref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_ref_nonexistent.c b/test/parse_ref_nonexistent.c
index 90af2fa..25c0dd8 100644
--- a/test/parse_ref_nonexistent.c
+++ b/test/parse_ref_nonexistent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_sbit.c b/test/parse_sbit.c
index 370c10d..3f93aff 100644
--- a/test/parse_sbit.c
+++ b/test/parse_sbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_scalar1.c b/test/parse_scalar1.c
new file mode 100644
index 0000000..efd18ca
--- /dev/null
+++ b/test/parse_scalar1.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/VERSION 9\ndata RAW UINT8 scalar<3>\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  CHECKI(error,GD_E_OK);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_scalar2.c b/test/parse_scalar2.c
new file mode 100644
index 0000000..c78644e
--- /dev/null
+++ b/test/parse_scalar2.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/VERSION 9\ndata RAW UINT8 scalar<3\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error,0);
+
+  gd_entry(D, "data", &E);
+  CHECKS(E.scalar[0], "scalar<3");
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_scalar_repr.c b/test/parse_scalar_repr.c
new file mode 100644
index 0000000..f655f30
--- /dev/null
+++ b/test/parse_scalar_repr.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 scalar.r\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  CHECKI(error,GD_E_OK);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_sort.c b/test/parse_sort.c
index 6b367f1..3bd945c 100644
--- a/test/parse_sort.c
+++ b/test/parse_sort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -88,7 +88,7 @@ int main(void)
   else if (field_list[11][0] != 'k')
     r = 1;
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/parse_string.c b/test/parse_string.c
index 179b33f..c20701c 100644
--- a/test/parse_string.c
+++ b/test/parse_string.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_string_ncols.c b/test/parse_string_ncols.c
index 57f5012..ee000ec 100644
--- a/test/parse_string_ncols.c
+++ b/test/parse_string_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_string_null.c b/test/parse_string_null.c
index 3dc31fe..a66710a 100644
--- a/test/parse_string_null.c
+++ b/test/parse_string_null.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_version.c b/test/parse_version.c
index 3d5648d..322fbbf 100644
--- a/test/parse_version.c
+++ b/test/parse_version.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_version_89.c b/test/parse_version_89.c
index a6859d3..3e228a9 100644
--- a/test/parse_version_89.c
+++ b/test/parse_version_89.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format1);
diff --git a/test/parse_version_98.c b/test/parse_version_98.c
index f318f26..a3361b8 100644
--- a/test/parse_version_98.c
+++ b/test/parse_version_98.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format1);
diff --git a/test/parse_version_include.c b/test/parse_version_include.c
index d6019a1..f06f468 100644
--- a/test/parse_version_include.c
+++ b/test/parse_version_include.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -51,7 +51,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_PERMISSIVE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format1);
   unlink(format);
diff --git a/test/parse_version_p8.c b/test/parse_version_p8.c
index f1aea59..5dba70e 100644
--- a/test/parse_version_p8.c
+++ b/test/parse_version_p8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format1);
diff --git a/test/parse_version_p9.c b/test/parse_version_p9.c
index 0039221..b8583af 100644
--- a/test/parse_version_p9.c
+++ b/test/parse_version_p9.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format1);
diff --git a/test/parse_version_permissive.c b/test/parse_version_permissive.c
index 5a6a86e..f6321fc 100644
--- a/test/parse_version_permissive.c
+++ b/test/parse_version_permissive.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_PERMISSIVE | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_version_slash.c b/test/parse_version_slash.c
index 36c88ce..59624b5 100644
--- a/test/parse_version_slash.c
+++ b/test/parse_version_slash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -46,7 +46,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_whitespace.c b/test/parse_whitespace.c
index 580d0f5..6b07a53 100644
--- a/test/parse_whitespace.c
+++ b/test/parse_whitespace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_window.c b/test/parse_window.c
index 0fe7ecf..4d7059a 100644
--- a/test/parse_window.c
+++ b/test/parse_window.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_window_ncols.c b/test/parse_window_ncols.c
index e805008..7922a15 100644
--- a/test/parse_window_ncols.c
+++ b/test/parse_window_ncols.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_window_op.c b/test/parse_window_op.c
index 04b4ff7..06835bb 100644
--- a/test/parse_window_op.c
+++ b/test/parse_window_op.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/parse_window_scalar.c b/test/parse_window_scalar.c
index aa2cbc1..1256fb5 100644
--- a/test/parse_window_scalar.c
+++ b/test/parse_window_scalar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/protect_alter.c b/test/protect_alter.c
index 260044f..1c36326 100644
--- a/test/protect_alter.c
+++ b/test/protect_alter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   error = gd_error(D);
   p = gd_protection(D, 0);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/protect_alter_all.c b/test/protect_alter_all.c
new file mode 100644
index 0000000..563c7ce
--- /dev/null
+++ b/test/protect_alter_all.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "INCLUDE format1\n"
+    "PROTECT format\n";
+  const char *format1_data = "PROTECT none\n";
+  int fd, ret, p0, p1, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_protection(D, GD_PROTECT_DATA, GD_ALL_FRAGMENTS);
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+
+  p0 = gd_protection(D, 0);
+  CHECKI(p0, GD_PROTECT_DATA);
+
+  p1 = gd_protection(D, 1);
+  CHECKI(p1, GD_PROTECT_DATA);
+
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/protect_get.c b/test/protect_get.c
index fb66993..edd6476 100644
--- a/test/protect_get.c
+++ b/test/protect_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   p = gd_protection(D, 0);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/put64.c b/test/put64.c
index cb30f93..41e2e11 100644
--- a/test/put64.c
+++ b/test/put64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #define _LARGEFILE64_SOURCE 1
 
 #include "test.h"
@@ -38,7 +37,7 @@ int main(void)
   const char *data = "dirfile/data";
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
-  int fd, n, error, i;
+  int fd, n, e1, e2, i, r = 0;
   struct stat buf;
   DIRFILE *D;
 
@@ -55,23 +54,23 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n, 8);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
-  if (stat(data, &buf))
-    return 1;
-  if (buf.st_size != 40 + 8 * sizeof(uint8_t))
-    return 1;
+  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) {
-      if (d != 0)
-        return 1;
-    } else if (d != i)
-      return 1;
+    CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i);
     i++;
   }
   close(fd);
@@ -80,10 +79,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  if (error)
-    return 1;
-  if (n != 8)
-    return 1;
-
-  return 0;
+  return r;
 }
diff --git a/test/put_bad_code.c b/test/put_bad_code.c
index aaaa267..83d3d82 100644
--- a/test/put_bad_code.c
+++ b/test/put_bad_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   n = gd_putdata(D, "no-such-field", 5, 0, 1, 0, GD_UINT8, &c);
 
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_bit.c b/test/put_bit.c
index 50c8e6d..14458c6 100644
--- a/test/put_bit.c
+++ b/test/put_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_putdata(D, "bit", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/put_bof.c b/test/put_bof.c
index 229a61f..cf784e4 100644
--- a/test/put_bof.c
+++ b/test/put_bof.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_carray.c b/test/put_carray.c
index f8607c1..a489dab 100644
--- a/test/put_carray.c
+++ b/test/put_carray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -25,7 +25,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0};
-  int error, r = 0, i;
+  int e1, e2, r = 0, i;
   DIRFILE *D;
 
   rmdirfile();
@@ -34,20 +34,22 @@ int main(void)
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   /* check */
   memset(val, 0, 8);
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   gd_get_carray(D, "data", GD_UINT8, &val);
-  gd_close(D);
+  gd_discard(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_client.c b/test/put_carray_client.c
new file mode 100644
index 0000000..0a49eb9
--- /dev/null
+++ b/test/put_carray_client.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0};
+  int r = 0, i;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_carray(D, "data", GD_UINT8, 8, GD_UINT8, &val, 0);
+  gd_add_spec(D, "phase PHASE INDEX data<2>", 0);
+  for (i = 0; i < 8; ++i)
+    val[i] = i * (i + 1);
+
+  gd_getdata(D, "phase", 0, 0, 0, 1, GD_UINT8, val);
+  gd_put_carray(D, "data", GD_UINT8, &val);
+  gd_getdata(D, "phase", 0, 0, 0, 1, GD_UINT8, val + 1);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(val[0], 0);
+  CHECKI(val[1], 2 * (2 + 1));
+  return r;
+}
diff --git a/test/put_carray_slice.c b/test/put_carray_slice.c
index 519029c..01af400 100644
--- a/test/put_carray_slice.c
+++ b/test/put_carray_slice.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -35,7 +35,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0};
-  int r = 0, error, i;
+  int r = 0, e1, e2, i;
   DIRFILE *D;
 
   rmdirfile();
@@ -44,14 +44,17 @@ int main(void)
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   /* check */
   memset(val, 0, 8);
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   gd_get_carray(D, "data", GD_UINT8, &val);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
@@ -61,6 +64,5 @@ int main(void)
       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
index 315ec98..923652a 100644
--- a/test/put_char.c
+++ b/test/put_char.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, (gd_type_t)'c', c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/put_clincom1.c b/test/put_clincom1.c
new file mode 100644
index 0000000..492c967
--- /dev/null
+++ b/test/put_clincom1.c
@@ -0,0 +1,99 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 1 data 1;1 0;-1\ndata RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, q, n, e1, e2, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (q = 0; q < 8; ++q)
+    c[q] = (int8_t)(39 + q * 2);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n,8);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    q = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (q < 40 || q > 48) {
+        CHECKIi(q,d,0);
+      } else {
+        /* if:
+         *   L = (1+i) D - i
+         * then:
+         *   D = (L + i) * (1 / (1+i))
+         *     = (L + i) * ((1-i) / 2)
+         *     = [ (L + 1) + (1 - L) i ] / 2
+         * so:
+         *   Re(D) = (L + 1) / 2
+         * and, if:
+         *   L = 39 + 2 (q - 40),
+         * then:
+         *   Re(D) = (40 + 2(q-40)) / 2 = 20 + q - 40 = q - 20
+         */
+        CHECKIi(q,d,q - 20);
+      }
+      q++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/put_complex128.c b/test/put_complex128.c
index e1f9fc5..b32a27e 100644
--- a/test/put_complex128.c
+++ b/test/put_complex128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write COMPLEX128 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -44,7 +43,7 @@ int main(void)
   double complex c[8], d;
   const double complex zero = 0;
 #endif
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   struct stat buf;
   DIRFILE *D;
 
@@ -67,9 +66,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n,8);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -108,8 +110,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, 0);
-  CHECKI(n,8);
-
   return r;
 }
diff --git a/test/put_complex64.c b/test/put_complex64.c
index 56afedf..cfab93a 100644
--- a/test/put_complex64.c
+++ b/test/put_complex64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write COMPLEX64 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -45,7 +44,7 @@ int main(void)
   const float complex zero = 0;
 #endif
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -67,9 +66,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(e1,0);
+  CHECKI(n,8);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -104,8 +106,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,0);
-  CHECKI(n,8);
-
   return r;
 }
diff --git a/test/put_const.c b/test/put_const.c
index 151af3d..6276c52 100644
--- a/test/put_const.c
+++ b/test/put_const.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -35,7 +35,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   uint8_t val = 0;
-  int error, r = 0;
+  int e1, e2, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -43,19 +43,21 @@ int main(void)
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   /* check */
   val = 0;
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   gd_get_constant(D, "data", GD_UINT8, &val);
-  gd_close(D);
+  gd_discard(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
index 1f89d82..360a8a6 100644
--- a/test/put_const_protect.c
+++ b/test/put_const_protect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -50,7 +50,7 @@ int main(void)
   n = gd_put_constant(D, "data", GD_UINT8, &d);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_cpolynom.c b/test/put_cpolynom.c
new file mode 100644
index 0000000..45f4def
--- /dev/null
+++ b/test/put_cpolynom.c
@@ -0,0 +1,89 @@
+/* Copyright (C) 2013, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "polynom POLYNOM data 0;1 0.5;0.5\n"
+    "data RAW INT8 8\n";
+  int8_t d;
+  double c[16];
+  struct stat buf;
+  int fd, i, n, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i) {
+    c[2 * i] = 0.5;
+    c[2 * i + 1] = 40 + i + 0.5;
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, c);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/put_crecip.c b/test/put_crecip.c
new file mode 100644
index 0000000..33c6c1e
--- /dev/null
+++ b/test/put_crecip.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "div RECIP data 0;1000.\ndata RAW INT8 8\n";
+  int8_t d;
+  double c[16];
+  struct stat buf;
+  int fd, i, n, e1, e2, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i) {
+    c[2 * i] = 0;
+    c[2 * i + 1] = (40. + i);
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "div", 5, 0, 1, 0, GD_COMPLEX128, c);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d, 1000. / i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/put_divide.c b/test/put_divide.c
index 795bb7b..41142a6 100644
--- a/test/put_divide.c
+++ b/test/put_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write DIVIDE */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
   n = gd_putdata(D, "div", 5, 0, 1, 0, GD_INT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,0);
+  CHECKI(e1,GD_E_BAD_FIELD_TYPE);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (!stat(data, &buf)) {
     perror("stat");
@@ -65,7 +67,5 @@ int main(void)
   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
index a5092ce..961ed89 100644
--- a/test/put_endian16.c
+++ b/test/put_endian16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   lseek(fd, 5 * sizeof(uint16_t), SEEK_SET);
diff --git a/test/put_endian32.c b/test/put_endian32.c
index 977ca86..e82a476 100644
--- a/test/put_endian32.c
+++ b/test/put_endian32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT32, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   lseek(fd, 5 * sizeof(uint32_t), SEEK_SET);
diff --git a/test/put_endian64.c b/test/put_endian64.c
index b1defaa..a22616e 100644
--- a/test/put_endian64.c
+++ b/test/put_endian64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   lseek(fd, 5 * sizeof(uint64_t), SEEK_SET);
diff --git a/test/put_endian8.c b/test/put_endian8.c
index ca26ab3..f929da0 100644
--- a/test/put_endian8.c
+++ b/test/put_endian8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   lseek(fd, 5 * sizeof(uint8_t), SEEK_SET);
diff --git a/test/put_endian_complex128_arm.c b/test/put_endian_complex128_arm.c
index af292cc..9afb915 100644
--- a/test/put_endian_complex128_arm.c
+++ b/test/put_endian_complex128_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
 #endif
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 10 * sizeof(double), SEEK_SET);
diff --git a/test/put_endian_complex128_big.c b/test/put_endian_complex128_big.c
index 6c4ce04..b2e52ed 100644
--- a/test/put_endian_complex128_big.c
+++ b/test/put_endian_complex128_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
 #endif
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * 2 * sizeof(double), SEEK_SET);
diff --git a/test/put_endian_complex128_little.c b/test/put_endian_complex128_little.c
index 8f8dcdb..6e39a8a 100644
--- a/test/put_endian_complex128_little.c
+++ b/test/put_endian_complex128_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
 #endif
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * 2 * sizeof(double), SEEK_SET);
diff --git a/test/put_endian_complex64_arm.c b/test/put_endian_complex64_arm.c
index bcd8ae4..4919d70 100644
--- a/test/put_endian_complex64_arm.c
+++ b/test/put_endian_complex64_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
 #endif
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * 2 * sizeof(float), SEEK_SET);
diff --git a/test/put_endian_complex64_big.c b/test/put_endian_complex64_big.c
index 507558a..6f2a7d6 100644
--- a/test/put_endian_complex64_big.c
+++ b/test/put_endian_complex64_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
 #endif
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * 2 * sizeof(float), SEEK_SET);
diff --git a/test/put_endian_complex64_little.c b/test/put_endian_complex64_little.c
index 393b29b..8d56e35 100644
--- a/test/put_endian_complex64_little.c
+++ b/test/put_endian_complex64_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
 #endif
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * 2 * sizeof(float), SEEK_SET);
diff --git a/test/put_endian_float32_arm.c b/test/put_endian_float32_arm.c
index 7f5a9c7..af44d24 100644
--- a/test/put_endian_float32_arm.c
+++ b/test/put_endian_float32_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * sizeof(float), SEEK_SET);
diff --git a/test/put_endian_float32_big.c b/test/put_endian_float32_big.c
index 240c6b4..6d7109e 100644
--- a/test/put_endian_float32_big.c
+++ b/test/put_endian_float32_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * sizeof(float), SEEK_SET);
diff --git a/test/put_endian_float32_little.c b/test/put_endian_float32_little.c
index a451e9e..d89846d 100644
--- a/test/put_endian_float32_little.c
+++ b/test/put_endian_float32_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,7 +54,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * sizeof(float), SEEK_SET);
diff --git a/test/put_endian_float64_arm.c b/test/put_endian_float64_arm.c
index e580285..0374f90 100644
--- a/test/put_endian_float64_arm.c
+++ b/test/put_endian_float64_arm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * sizeof(double), SEEK_SET);
diff --git a/test/put_endian_float64_big.c b/test/put_endian_float64_big.c
index 869d749..d341377 100644
--- a/test/put_endian_float64_big.c
+++ b/test/put_endian_float64_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * sizeof(double), SEEK_SET);
diff --git a/test/put_endian_float64_little.c b/test/put_endian_float64_little.c
index 89e4007..deaa265 100644
--- a/test/put_endian_float64_little.c
+++ b/test/put_endian_float64_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,7 +56,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY);
   lseek(fd, 5 * sizeof(double), SEEK_SET);
diff --git a/test/put_ff.c b/test/put_ff.c
index 192328b..b0b7a53 100644
--- a/test/put_ff.c
+++ b/test/put_ff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -36,7 +35,7 @@ int main(void)
   const char *data = "dirfile/data";
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
   struct stat buf;
 
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -83,8 +85,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_float32.c b/test/put_float32.c
index bfb51d8..674293c 100644
--- a/test/put_float32.c
+++ b/test/put_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write FLOAT32 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -38,7 +37,7 @@ int main(void)
   const char *format_data = "data RAW FLOAT32 8\n";
   float c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -54,9 +53,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -80,8 +82,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_float64.c b/test/put_float64.c
index 16cd776..fa8bb22 100644
--- a/test/put_float64.c
+++ b/test/put_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write FLOAT64 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -38,7 +37,7 @@ int main(void)
   const char *format_data = "data RAW FLOAT64 8\n";
   double c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -54,9 +53,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -80,8 +82,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_foffs.c b/test/put_foffs.c
index 3557a26..0aadd5e 100644
--- a/test/put_foffs.c
+++ b/test/put_foffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 with FRAMEOFFSET */
 #include "test.h"
 
 #include <inttypes.h>
@@ -38,7 +37,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_fs.c b/test/put_fs.c
index 7057a6b..d85e372 100644
--- a/test/put_fs.c
+++ b/test/put_fs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_here.c b/test/put_here.c
index d187a41..dcc0ea4 100644
--- a/test/put_here.c
+++ b/test/put_here.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
   struct stat buf;
-  int fd, i, m, n, error, r = 0;
+  int fd, i, m, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,10 +52,15 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
   m = gd_seek(D, "data", 5, 0, GD_SEEK_WRITE | GD_SEEK_SET);
+  CHECKI(m,40);
+
   n = gd_putdata(D, "data", GD_HERE, 0, 0, 8, GD_UINT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -80,9 +84,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(m,40);
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_heres.c b/test/put_heres.c
index 7ae7a36..107e268 100644
--- a/test/put_heres.c
+++ b/test/put_heres.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
   struct stat buf;
-  int fd, i, m, n, error, r = 0;
+  int fd, i, m, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,10 +52,15 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
   m = gd_seek(D, "data", 5, 0, GD_SEEK_WRITE | GD_SEEK_SET);
+  CHECKI(m,40);
+
   n = gd_putdata(D, "data", 0, GD_HERE, 0, 8, GD_UINT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -80,9 +84,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(m,40);
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_int16.c b/test/put_int16.c
index cd30069..00e65af 100644
--- a/test/put_int16.c
+++ b/test/put_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write INT16 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW INT16 8\n";
   int16_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_int32.c b/test/put_int32.c
index 9d1673f..a727503 100644
--- a/test/put_int32.c
+++ b/test/put_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write INT32 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW INT32 8\n";
   int32_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_int64.c b/test/put_int64.c
index 5aab118..5be2bcb 100644
--- a/test/put_int64.c
+++ b/test/put_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write INT64 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW INT64 8\n";
   int64_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_int8.c b/test/put_int8.c
index 3560589..7b6c29a 100644
--- a/test/put_int8.c
+++ b/test/put_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write INT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW INT8 8\n";
   int8_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_invalid.c b/test/put_invalid.c
index 1df11eb..bcac4a2 100644
--- a/test/put_invalid.c
+++ b/test/put_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ int main(void)
   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);
+  gd_discard(D);
 
   CHECKI(n,0);
 
diff --git a/test/put_lincom1.c b/test/put_lincom1.c
index 8dc81a2..0e1eb60 100644
--- a/test/put_lincom1.c
+++ b/test/put_lincom1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write LINCOM 1 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_lincom2.c b/test/put_lincom2.c
index 8112546..2f21280 100644
--- a/test/put_lincom2.c
+++ b/test/put_lincom2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write LINCOM 2 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
   n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,0);
+  CHECKI(e1,GD_E_BAD_FIELD_TYPE);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (!stat(data, &buf)) {
     perror("stat");
@@ -65,7 +67,5 @@ int main(void)
   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
index ef81809..82182a0 100644
--- a/test/put_lincom_noin.c
+++ b/test/put_lincom_noin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_linterp.c b/test/put_linterp.c
index 3d00d2f..3e8c91b 100644
--- a/test/put_linterp.c
+++ b/test/put_linterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write LINTERP */
 #include "test.h"
 
 #include <inttypes.h>
@@ -39,7 +38,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
   FILE *t;
 
@@ -61,9 +60,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -88,8 +90,5 @@ int main(void)
   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
index eae7c6c..f197bcb 100644
--- a/test/put_linterp_noin.c
+++ b/test/put_linterp_noin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(table);
   unlink(format);
diff --git a/test/put_linterp_nomono.c b/test/put_linterp_nomono.c
index 52c2933..a9e373d 100644
--- a/test/put_linterp_nomono.c
+++ b/test/put_linterp_nomono.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -62,7 +62,7 @@ int main(void)
   n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(table);
   unlink(data);
diff --git a/test/put_linterp_notab.c b/test/put_linterp_notab.c
index e07ea60..cf5df34 100644
--- a/test/put_linterp_notab.c
+++ b/test/put_linterp_notab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -54,13 +54,13 @@ int main(void)
   n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
   rmdir(filedir);
 
   CHECKI(n,0);
-  CHECKI(error,GD_E_OPEN_LINFILE);
+  CHECKI(error,GD_E_IO);
   return r;
 }
diff --git a/test/put_linterp_reverse.c b/test/put_linterp_reverse.c
index 6830597..96d1daa 100644
--- a/test/put_linterp_reverse.c
+++ b/test/put_linterp_reverse.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write LINTERP */
 #include "test.h"
 
 #include <inttypes.h>
@@ -39,7 +38,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
   FILE *t;
 
@@ -61,9 +60,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -88,8 +90,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_mplex.c b/test/put_mplex.c
index d2488ab..a41748e 100644
--- a/test/put_mplex.c
+++ b/test/put_mplex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   error = gd_error(D);
   m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(count);
   unlink(data);
diff --git a/test/put_mplex_complex.c b/test/put_mplex_complex.c
new file mode 100644
index 0000000..64669a5
--- /dev/null
+++ b/test/put_mplex_complex.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 1 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW COMPLEX128 8\n";
+  double c[16], d[16];
+  double data_data[512];
+  uint8_t count_data[256];
+  int i, n, m, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[2 * i] = i;
+    data_data[2 * i + 1] = i * 2;
+  }
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  for (i = 0; i < 256; ++i)
+    count_data[i] = i % 3;
+
+  i = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, count_data, 256);
+  close(i);
+
+  for (i = 0; i < 8; ++i) {
+    d[2 * i] = i + 3.;
+    d[2 * i + 1] = i + 4.;
+  }
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "mplex", 5, 0, 1, 0, GD_COMPLEX128, &d);
+  error = gd_error(D);
+  m = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c);
+
+  gd_discard(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKIi(i, c[2 * i], ((i % 3) == 0) ? 3 + i : 40 + i);
+    CHECKIi(i, c[2 * i + 1], ((i % 3) == 0) ? 4 + i : (40 + i) * 2);
+  }
+
+  return r;
+}
diff --git a/test/put_multiply.c b/test/put_multiply.c
index 8c43588..c9e2dbc 100644
--- a/test/put_multiply.c
+++ b/test/put_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write MULTIPLY */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
   n = gd_putdata(D, "mult", 5, 0, 1, 0, GD_INT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,0);
+  CHECKI(e1,GD_E_BAD_FIELD_TYPE);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (!stat(data, &buf)) {
     perror("stat");
@@ -65,7 +67,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,0);
-  CHECKI(error,GD_E_BAD_FIELD_TYPE);
   return r;
 }
diff --git a/test/put_nofile.c b/test/put_nofile.c
new file mode 100644
index 0000000..718370a
--- /dev/null
+++ b/test/put_nofile.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#define GD_RLIM 20
+int main(void)
+{
+#if ! defined HAVE_SETRLIMIT
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_fmt = "dirfile/ent%04i";
+
+  struct rlimit rlim = { GD_RLIM, GD_RLIM };
+  int i, e1, e2, e3, r = 0;
+  const uint8_t data[8] = {1,2,3,4,5,6,7,8};
+  char name[16];
+
+  if (setrlimit(RLIMIT_NOFILE, &rlim)) {
+    perror("setrlimit");
+    return 77;
+  }
+
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_CREAT | GD_UNENCODED | GD_RDWR);
+
+  /* now add a bunch of files */
+  for (i = 0; i < GD_RLIM; ++i) {
+    sprintf(name, "ent%04i", i);
+    gd_add_raw(D, name, GD_UINT8, 1, 0);
+    e1 = gd_error(D);
+    CHECKIi(i,e1,GD_E_OK);
+  }
+  gd_flush(D, NULL);
+
+  /* now try writing; this will pile up file descriptors */
+  for (i = 0; i < GD_RLIM; ++i) {
+    sprintf(name, "ent%04i", i);
+    gd_putdata(D, name, 0, 0, 0, 8, GD_UINT8, data);
+    e2 = gd_error(D);
+    if (e2 == GD_E_RAW_IO) {
+      /* closing everything and try again -- should work now */
+      gd_raw_close(D, NULL);
+      gd_putdata(D, name, 0, 0, 0, 8, GD_UINT8, data);
+      e3 = gd_error(D);
+      CHECKIi(i,e3,GD_E_OK);
+    } else {
+      CHECKIi(i,e2,GD_E_OK);
+    }
+  }
+
+  gd_discard(D);
+
+  for (i = 0; i < GD_RLIM; ++i) {
+    sprintf(name, data_fmt, i);
+    unlink(name);
+  }
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/put_null.c b/test/put_null.c
index 55eef54..c9a3fd4 100644
--- a/test/put_null.c
+++ b/test/put_null.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_off64.c b/test/put_off64.c
index d19e139..1dd09b2 100644
--- a/test/put_off64.c
+++ b/test/put_off64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #if (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) || __MSVCRT__
 #  define SKIP_TEST
 #else
@@ -46,7 +45,7 @@ int main(void)
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -62,9 +61,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -88,9 +90,6 @@ int main(void)
   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
index 8109c04..d0a6f2e 100644
--- a/test/put_phase.c
+++ b/test/put_phase.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +53,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +82,5 @@ int main(void)
   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
index 8e9adef..1c9518d 100644
--- a/test/put_phase_noin.c
+++ b/test/put_phase_noin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_putdata(D, "phase", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_polynom1.c b/test/put_polynom1.c
index 8dbcdc8..907be40 100644
--- a/test/put_polynom1.c
+++ b/test/put_polynom1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write POLYNOM 1 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_polynom2.c b/test/put_polynom2.c
index 5eedc4e..be56063 100644
--- a/test/put_polynom2.c
+++ b/test/put_polynom2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write POLYNOM */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
   n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,0);
+  CHECKI(e1,GD_E_BAD_FIELD_TYPE);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (!stat(data, &buf)) {
     perror("stat");
@@ -64,8 +66,5 @@ int main(void)
 
   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
index 4ad2a3b..29535cc 100644
--- a/test/put_polynom_noin.c
+++ b/test/put_polynom_noin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_protect.c b/test/put_protect.c
index 0f0017b..2a5dfa2 100644
--- a/test/put_protect.c
+++ b/test/put_protect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_rdonly.c b/test/put_rdonly.c
index ccd6d8c..148a009 100644
--- a/test/put_rdonly.c
+++ b/test/put_rdonly.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write to a read only dirfile */
 #include "test.h"
 
 #include <stdlib.h>
@@ -35,7 +34,7 @@ int main(void)
   const char *data = "dirfile/data";
   const char *format_data = "data RAW UINT8 8\n";
   unsigned char c[8];
-  int fd, n, error, unlink_data, r = 0;
+  int fd, n, e1, e2, unlink_data, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -48,16 +47,17 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_UNENCODED);
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,0);
+  CHECKI(e1,GD_E_ACCMODE);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   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
index 897cbd8..8c42349 100644
--- a/test/put_recip.c
+++ b/test/put_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write DIVIDE */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   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;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_recurse.c b/test/put_recurse.c
index bb9e56b..e98d127 100644
--- a/test/put_recurse.c
+++ b/test/put_recurse.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   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);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_repr.c b/test/put_repr.c
index 8db10a0..13c84c2 100644
--- a/test/put_repr.c
+++ b/test/put_repr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -56,13 +56,13 @@ int main(void)
   n = gd_putdata(D, "data.r", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, GD_E_BAD_REPR);
+  CHECKI(error, GD_E_BAD_CODE);
   CHECKI(n,0);
 
   return r;
diff --git a/test/put_rofs.c b/test/put_rofs.c
index 576e646..1fd962d 100644
--- a/test/put_rofs.c
+++ b/test/put_rofs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
 
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/put_sbit.c b/test/put_sbit.c
index bbe8a3b..e521ac8 100644
--- a/test/put_sbit.c
+++ b/test/put_sbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_putdata(D, "bit", 5, 0, 1, 0, GD_INT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   i = 0;
diff --git a/test/put_sf.c b/test/put_sf.c
index 4970cb5..95abf13 100644
--- a/test/put_sf.c
+++ b/test/put_sf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_ss.c b/test/put_ss.c
index 24028d5..df87795 100644
--- a/test/put_ss.c
+++ b/test/put_ss.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT8 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW UINT8 8\n";
   uint8_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_string.c b/test/put_string.c
index 978dbc9..094c9ea 100644
--- a/test/put_string.c
+++ b/test/put_string.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -35,25 +35,27 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   char string[1024] = "";
-  int error, r = 0;
+  int e1, e2, r = 0;
   DIRFILE *D;
 
   rmdirfile();
   D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
   gd_add_string(D, "data", "some string", 0);
   gd_put_string(D, "data", "some other string");
-  error = gd_error(D);
-  gd_close(D);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   /* check */
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   gd_get_string(D, "data", 1023, string);
-  gd_close(D);
+  gd_discard(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
index cd06187..c194304 100644
--- a/test/put_string_protect.c
+++ b/test/put_string_protect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   n = gd_put_string(D, "data", "some string");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_sub.c b/test/put_sub.c
new file mode 100644
index 0000000..601ac62
--- /dev/null
+++ b/test/put_sub.c
@@ -0,0 +1,98 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *data = "dirfile/sub/data";
+  const char *format_data = "/INCLUDE sub/format1\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d;
+  int fd, i, n, e1, e2, r = 0;
+  DIRFILE *D;
+  struct stat buf;
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else
+    CHECKI(buf.st_size, 48 * sizeof(uint8_t));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  if (fd < 0) {
+    perror("open");
+    r = 1;
+  } else {
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/put_type.c b/test/put_type.c
index ac3db8b..758527a 100644
--- a/test/put_type.c
+++ b/test/put_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
   n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UNKNOWN, NULL);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/put_uint16.c b/test/put_uint16.c
index 30f4f44..13912d4 100644
--- a/test/put_uint16.c
+++ b/test/put_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT16 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -38,7 +37,7 @@ int main(void)
   const char *format_data = "data RAW UINT16 8\n";
   uint16_t c[8], d;
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -54,9 +53,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -80,8 +82,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_uint32.c b/test/put_uint32.c
index 2f184df..bf8aaad 100644
--- a/test/put_uint32.c
+++ b/test/put_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write UINT32 */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "data RAW UINT32 8\n";
   uint32_t c[8], d, i;
   struct stat buf;
-  int fd, n, error, r = 0;
+  int fd, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +81,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_uint64.c b/test/put_uint64.c
index 5953e4f..4ff5155 100644
--- a/test/put_uint64.c
+++ b/test/put_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
   const char *format_data = "data RAW UINT64 8\n";
   uint64_t c[8], d, i;
   struct stat buf;
-  int fd, n, error, r = 0;
+  int fd, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +53,12 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(n,8);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (stat(data, &buf)) {
     perror("stat");
@@ -79,8 +82,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,8);
-  CHECKI(error, 0);
-
   return r;
 }
diff --git a/test/put_window.c b/test/put_window.c
index d158d69..b18435e 100644
--- a/test/put_window.c
+++ b/test/put_window.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write WINDOW */
 #include "test.h"
 
 #include <inttypes.h>
@@ -37,7 +36,7 @@ int main(void)
   const char *format_data = "window WINDOW data data EQ 3\ndata RAW INT8 8\n";
   int8_t c[8];
   struct stat buf;
-  int fd, i, n, error, r = 0;
+  int fd, i, n, e1, e2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 8);
@@ -53,9 +52,12 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
   n = gd_putdata(D, "window", 5, 0, 1, 0, GD_INT8, c);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(n,0);
+  CHECKI(e1,GD_E_BAD_FIELD_TYPE);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   if (!stat(data, &buf)) {
     perror("stat");
@@ -65,7 +67,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(n,0);
-  CHECKI(error,GD_E_BAD_FIELD_TYPE);
   return r;
 }
diff --git a/test/put_zero.c b/test/put_zero.c
index e99d71b..0f6f548 100644
--- a/test/put_zero.c
+++ b/test/put_zero.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   n = gd_putdata(D, "data", 0, 0, 0, 0, GD_UINT8, NULL);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/ref.c b/test/ref.c
index a751ecd..384d767 100644
--- a/test/ref.c
+++ b/test/ref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -74,7 +74,7 @@ int main(void)
   CHECKI(error2,0);
   CHECKI(nf,3);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   unlink(data1);
diff --git a/test/ref_none.c b/test/ref_none.c
index debe297..3fb965e 100644
--- a/test/ref_none.c
+++ b/test/ref_none.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   CHECKI(error2, 0);
   CHECKI(nf,4);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   unlink(data1);
diff --git a/test/ref_two.c b/test/ref_two.c
index 00a1116..bbf3f56 100644
--- a/test/ref_two.c
+++ b/test/ref_two.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -75,7 +75,7 @@ int main(void)
   CHECKI(error2, 0);
   CHECKI(nf,3);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   unlink(data1);
diff --git a/test/repr_a.c b/test/repr_a.c
index d8f6f83..6c885fb 100644
--- a/test/repr_a.c
+++ b/test/repr_a.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
   n = gd_getdata(D, "data.a", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_bad.c b/test/repr_bad.c
new file mode 100644
index 0000000..197c7b4
--- /dev/null
+++ b/test/repr_bad.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "data.3", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_CODE);
+  CHECKI(n, 0);
+
+  return r;
+}
diff --git a/test/repr_float32.c b/test/repr_float32.c
index 54f871b..fe888a4 100644
--- a/test/repr_float32.c
+++ b/test/repr_float32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_float64.c b/test/repr_float64.c
index a7c6f07..e30da0c 100644
--- a/test/repr_float64.c
+++ b/test/repr_float64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_i.c b/test/repr_i.c
index 4d3e3e8..02b49b1 100644
--- a/test/repr_i.c
+++ b/test/repr_i.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
   n = gd_getdata(D, "data.i", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_int16.c b/test/repr_int16.c
index bbb4972..c1a0ece 100644
--- a/test/repr_int16.c
+++ b/test/repr_int16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -74,7 +74,7 @@ int main(void)
     if (c[i] != 40 + i)
       CHECKIi(i,c[i], 40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_int32.c b/test/repr_int32.c
index 0530b60..8e7ca9f 100644
--- a/test/repr_int32.c
+++ b/test/repr_int32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i],40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_int64.c b/test/repr_int64.c
index 1a3adfa..ae71af9 100644
--- a/test/repr_int64.c
+++ b/test/repr_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i],40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_int8.c b/test/repr_int8.c
index 66ee8e8..78c01d9 100644
--- a/test/repr_int8.c
+++ b/test/repr_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKIi(i,c[i], 40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_m.c b/test/repr_m.c
index 105d9ce..d1bfb04 100644
--- a/test/repr_m.c
+++ b/test/repr_m.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
   n = gd_getdata(D, "data.m", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_r.c b/test/repr_r.c
index 2ea466d..909909e 100644
--- a/test/repr_r.c
+++ b/test/repr_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
   n = gd_getdata(D, "data.r", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_real_a.c b/test/repr_real_a.c
index 3fd9624..8cedf89 100644
--- a/test/repr_real_a.c
+++ b/test/repr_real_a.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data.a", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_real_i.c b/test/repr_real_i.c
index 48aa323..b51baed 100644
--- a/test/repr_real_i.c
+++ b/test/repr_real_i.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data.i", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_real_m.c b/test/repr_real_m.c
index a927d9c..20fc22f 100644
--- a/test/repr_real_m.c
+++ b/test/repr_real_m.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data.m", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_real_r.c b/test/repr_real_r.c
index 1743387..d0e4b08 100644
--- a/test/repr_real_r.c
+++ b/test/repr_real_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_getdata(D, "data.r", 5, 0, 8, 0, GD_FLOAT64, &c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_uint16.c b/test/repr_uint16.c
index 5d2b4f9..4c539fc 100644
--- a/test/repr_uint16.c
+++ b/test/repr_uint16.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKUi(i,c[i],40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_uint32.c b/test/repr_uint32.c
index 9fa0e02..85f484f 100644
--- a/test/repr_uint32.c
+++ b/test/repr_uint32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKUi(i,c[i],40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_uint64.c b/test/repr_uint64.c
index b4e4a6d..9a3f8c2 100644
--- a/test/repr_uint64.c
+++ b/test/repr_uint64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKUi(i,c[i],40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/repr_uint8.c b/test/repr_uint8.c
index 66c0727..a320977 100644
--- a/test/repr_uint8.c
+++ b/test/repr_uint8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   for (i = 0; i < 8; ++i)
     CHECKUi(i,c[i], 40 + i);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/seek64.c b/test/seek64.c
index 4c4365d..3f49e05 100644
--- a/test/seek64.c
+++ b/test/seek64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   n = gd_tell64(D, "data");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/seek_cur.c b/test/seek_cur.c
index 427ab7d..433d544 100644
--- a/test/seek_cur.c
+++ b/test/seek_cur.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   n = gd_tell(D, "data");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/seek_end.c b/test/seek_end.c
index b8e8743..fe80450 100644
--- a/test/seek_end.c
+++ b/test/seek_end.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_tell(D, "data");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/seek_far.c b/test/seek_far.c
new file mode 100644
index 0000000..92b9a80
--- /dev/null
+++ b/test/seek_far.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* gd_seek() */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, e1, e2, r = 0;
+  off_t m, n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  CHECKI(m, 4000);
+
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  n = gd_tell(D, "data");
+  CHECKI(n, 4000);
+
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/seek_foffs.c b/test/seek_foffs.c
index 48cf0a2..1a1272c 100644
--- a/test/seek_foffs.c
+++ b/test/seek_foffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_tell(D, "data");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/seek_foffs2.c b/test/seek_foffs2.c
index cc6d1d3..d39fca9 100644
--- a/test/seek_foffs2.c
+++ b/test/seek_foffs2.c
@@ -33,7 +33,6 @@ int main(void)
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
   const char *format_data = "FRAMEOFFSET 2\ndata RAW UINT8 1\n";
-  unsigned char c1[5], c2[5];
   unsigned char data_data[256];
   int i, fd, e, r = 0;
   off_t t, s;
diff --git a/test/seek_index.c b/test/seek_index.c
new file mode 100644
index 0000000..dadfc21
--- /dev/null
+++ b/test/seek_index.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  int e0, e1, r = 0;
+  off_t m, n1;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE);
+  m = gd_seek(D, "INDEX", 6, 0, GD_SEEK_SET);
+  e0 = gd_error(D);
+  n1 = gd_tell(D, "INDEX");
+  e1 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e0, 0);
+  CHECKI(e1, 0);
+  CHECKI(m, 6);
+  CHECKI(n1, 6);
+
+  return r;
+}
diff --git a/test/seek_lincom.c b/test/seek_lincom.c
new file mode 100644
index 0000000..277aef6
--- /dev/null
+++ b/test/seek_lincom.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "lincom LINCOM cata 1 0 data 1 0\n"
+    "/ENCODING none\n"
+    "cata RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  int fd, e0, e1, e2, e3, r = 0;
+  off_t m, n1, n2, n3;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "lincom", 6, 0, GD_SEEK_SET | GD_SEEK_WRITE);
+  e0 = gd_error(D);
+  n1 = gd_tell(D, "lincom");
+  e1 = gd_error(D);
+  n2 = gd_tell(D, "cata");
+  e2 = gd_error(D);
+  n3 = gd_tell(D, "data");
+  e3 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e0, 0);
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(e3, 0);
+  CHECKI(m, 48);
+  CHECKI(n1, 48);
+  CHECKI(n2, 48);
+  CHECKI(n3, 48);
+
+  return r;
+}
diff --git a/test/seek_mult.c b/test/seek_mult.c
new file mode 100644
index 0000000..826497d
--- /dev/null
+++ b/test/seek_mult.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "mult MULTIPLY cata data\n"
+    "/ENCODING none\n"
+    "cata RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  int fd, e0, e1, e2, e3, r = 0;
+  off_t m, n1, n2, n3;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "mult", 6, 0, GD_SEEK_SET | GD_SEEK_WRITE);
+  e0 = gd_error(D);
+  n1 = gd_tell(D, "mult");
+  e1 = gd_error(D);
+  n2 = gd_tell(D, "cata");
+  e2 = gd_error(D);
+  n3 = gd_tell(D, "data");
+  e3 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e0, 0);
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(e3, 0);
+  CHECKI(m, 48);
+  CHECKI(n1, 48);
+  CHECKI(n2, 48);
+  CHECKI(n3, 48);
+
+  return r;
+}
diff --git a/test/seek_neg.c b/test/seek_neg.c
index 4d31067..c9e1c37 100644
--- a/test/seek_neg.c
+++ b/test/seek_neg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   m = gd_seek(D, "data", -3, 0, GD_SEEK_CUR);
   e1 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/seek_phase.c b/test/seek_phase.c
new file mode 100644
index 0000000..c96c90c
--- /dev/null
+++ b/test/seek_phase.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "phase PHASE data 4\n"
+    "/ENCODING none\n"
+    "data RAW UINT8 8\n";
+  int fd, e0, e1, e2, r = 0;
+  off_t m, n1, n2;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "phase", 6, 0, GD_SEEK_SET | GD_SEEK_WRITE);
+  e0 = gd_error(D);
+  n1 = gd_tell(D, "phase");
+  e1 = gd_error(D);
+  n2 = gd_tell(D, "data");
+  e2 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e0, 0);
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(m, 48);
+  CHECKI(n1, 48);
+  CHECKI(n2, 44);
+
+  return r;
+}
diff --git a/test/seek_set.c b/test/seek_set.c
index 4c7158e..d13f3c4 100644
--- a/test/seek_set.c
+++ b/test/seek_set.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_tell(D, "data");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/seek_sub.c b/test/seek_sub.c
new file mode 100644
index 0000000..92a65b2
--- /dev/null
+++ b/test/seek_sub.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *data = "dirfile/sub/data";
+  const char *format_data = "/INCLUDE sub/format1\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, e1, e2, r = 0;
+  off_t m, n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "data", 6, 0, GD_SEEK_SET);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(m, 48);
+
+  n = gd_tell(D, "data");
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+  CHECKI(n, 48);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/sie_get_big.c b/test/sie_get_big.c
index 1671a86..79f58ca 100644
--- a/test/sie_get_big.c
+++ b/test/sie_get_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_getdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -62,7 +62,7 @@ int main(void)
   CHECKI(error, 0);
   CHECKI(n, 16);
   for (i = 0; i < 16; ++i)
-    CHECKIi(i,c[i], (i <= 8) ? 0x22 : 0x32);
+    CHECKXi(i,c[i], (i <= 8) ? 0x22 : 0x32);
 
   return r;
 }
diff --git a/test/sie_get_little.c b/test/sie_get_little.c
index bc83c48..d3505bb 100644
--- a/test/sie_get_little.c
+++ b/test/sie_get_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_getdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/sie_move_from.c b/test/sie_move_from.c
index 7e61aec..399cd01 100644
--- a/test/sie_move_from.c
+++ b/test/sie_move_from.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
     0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32
   };
   DIRFILE *D;
-  int fd, i, error, r = 0, unlink_data_sie, unlink_data_raw;
+  int fd, i, e1, e2, r = 0, unlink_data_sie, unlink_data_raw;
 
   rmdirfile();
   mkdir(filedir, 0777); 
@@ -60,25 +60,31 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   gd_alter_encoding(D, GD_UNENCODED, 0, 1);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   fd = open(data_raw, O_RDONLY | O_BINARY);
-  read(fd, check, 0x31);
-  close(fd);
+  if (fd < 0) {
+    perror("open");
+    r = 1;
+  } else {
+    read(fd, check, 0x31);
+    close(fd);
+
+    for (i = 0; i < 0x31; ++i)
+      CHECKUi(i, check[i], data_out[i]);
+  }
 
   unlink_data_sie = unlink(data_sie);
   unlink_data_raw = unlink(data_raw);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, 0);
   CHECKI(unlink_data_sie, -1);
   CHECKI(unlink_data_raw, 0);
 
-  for (i = 0; i < 0x31; ++i)
-    CHECKUi(i, check[i], data_out[i]);
-
   return r;
 }
diff --git a/test/sie_move_to.c b/test/sie_move_to.c
index 738b514..0b8f108 100644
--- a/test/sie_move_to.c
+++ b/test/sie_move_to.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -45,7 +45,7 @@ int main(void)
     0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32
   };
   DIRFILE *D;
-  int fd, i, error, r = 0, unlink_data_sie, unlink_data_raw;
+  int fd, i, e1, e2, r = 0, unlink_data_sie, unlink_data_raw;
 
   rmdirfile();
   mkdir(filedir, 0777); 
@@ -60,25 +60,26 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   gd_alter_encoding(D, GD_SIE_ENCODED, 0, 1);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
 
-  gd_close(D);
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   fd = open(data_sie, O_RDONLY | O_BINARY);
   read(fd, check, 27);
   close(fd);
 
+  for (i = 0; i < 27; ++i)
+    CHECKUi(i, check[i], data_out[i]);
+
   unlink_data_sie = unlink(data_sie);
   unlink_data_raw = unlink(data_raw);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, 0);
   CHECKI(unlink_data_sie, 0);
   CHECKI(unlink_data_raw, -1);
 
-  for (i = 0; i < 27; ++i)
-    CHECKUi(i, check[i], data_out[i]);
-
   return r;
 }
diff --git a/test/sie_nframes_big.c b/test/sie_nframes_big.c
index 1ae9fd4..9da0fa4 100644
--- a/test/sie_nframes_big.c
+++ b/test/sie_nframes_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011, 2015 D. V. Wiebe
+/* Copyright (C) 2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_nframes(D);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, 0);
   CHECKI(n, 0x31);
diff --git a/test/sie_nframes_little.c b/test/sie_nframes_little.c
index c9c1a62..9013b2b 100644
--- a/test/sie_nframes_little.c
+++ b/test/sie_nframes_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011, 2015 D. V. Wiebe
+/* Copyright (C) 2011, 2013, 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   n = gd_nframes(D);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   CHECKI(error, 0);
   CHECKI(n, 0x31);
diff --git a/test/sie_put_big.c b/test/sie_put_big.c
index b9018f9..5b81884 100644
--- a/test/sie_put_big.c
+++ b/test/sie_put_big.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Attempt to write little-endian SIE data */
 #include "test.h"
 
 #include <stdlib.h>
@@ -38,15 +37,17 @@ int main(void)
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32
   };
+#define NREC 4
   const uint8_t data_out[] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x23,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x34,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32
   };
-  uint8_t check[4 * 9];
+  uint8_t check[(NREC + 1) * 9];
   DIRFILE *D;
   int fd, i, n, error, r = 0;
+  ssize_t s;
 
   rmdirfile();
   mkdir(filedir, 0777); 
@@ -63,21 +64,22 @@ int main(void)
   n = gd_putdata(D, "data", 0, 0x11, 2, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
-  read(fd, check, 4 * 9);
+  s = read(fd, check, (NREC + 1) * 9);
   close(fd);
+  CHECKI(s, NREC * 9);
 
   unlink(data);
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error, 0);
-  CHECKI(n, 16);
-
-  for (i = 0; i < 4 * 9; ++i)
-    CHECKIi(i, check[i], data_out[i]);
+  for (i = 0; i < NREC * 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
 
   return r;
 }
diff --git a/test/sie_put_little.c b/test/sie_put_little.c
index c6bc389..4b3a2b3 100644
--- a/test/sie_put_little.c
+++ b/test/sie_put_little.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   fd = open(data, O_RDONLY | O_BINARY);
   read(fd, check, 4 * 9);
diff --git a/test/sie_put_trunc_nf.c b/test/sie_put_trunc_nf.c
index 47f13bc..894787a 100644
--- a/test/sie_put_trunc_nf.c
+++ b/test/sie_put_trunc_nf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 D. V. Wiebe
+/* Copyright (C) 2015 D. V. Wiebe
  *
  ***************************************************************************
  *
diff --git a/test/sie_seek.c b/test/sie_seek.c
new file mode 100644
index 0000000..061e540
--- /dev/null
+++ b/test/sie_seek.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  DIRFILE *D;
+  int fd, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  CHECKI(n, 40);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+
+  return r;
+}
diff --git a/test/sie_seek_far.c b/test/sie_seek_far.c
new file mode 100644
index 0000000..b7e59ea
--- /dev/null
+++ b/test/sie_seek_far.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  DIRFILE *D;
+  int fd, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  CHECKI(n, 4000);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+
+  return r;
+}
diff --git a/test/slim_get.c b/test/slim_get.c
index f2ba453..5ef2fa3 100644
--- a/test/slim_get.c
+++ b/test/slim_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
   close(fd);
 
   /* compress */
-  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
   if (gd_system(command)) {
     perror("command");
     r = 1;
@@ -79,7 +79,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(slimdata);
   unlink(format);
diff --git a/test/slim_nframes.c b/test/slim_nframes.c
index 388e187..57262dc 100644
--- a/test/slim_nframes.c
+++ b/test/slim_nframes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -60,7 +60,7 @@ int main(void)
   close(i);
 
   /* compress */
-  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
   if (gd_system(command)) {
     perror("command");
     r = 1;
@@ -73,7 +73,7 @@ int main(void)
 #endif
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(slimdata);
   unlink(format);
diff --git a/test/slim_seek.c b/test/slim_seek.c
new file mode 100644
index 0000000..7f2fee9
--- /dev/null
+++ b/test/slim_seek.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_SLIM || !defined USE_SLIM
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *slimdata = "dirfile/data.slm";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
+  if (gd_system(command)) {
+    perror("command");
+    r = 1;
+  }
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  CHECKI(n,40);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+
+  gd_discard(D);
+
+  unlink(slimdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/slim_seek_far.c b/test/slim_seek_far.c
new file mode 100644
index 0000000..39a6770
--- /dev/null
+++ b/test/slim_seek_far.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_SLIM || !defined USE_SLIM
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *slimdata = "dirfile/data.slm";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
+  if (gd_system(command)) {
+    perror("command");
+    r = 1;
+  }
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  CHECKI(n,256);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+
+  gd_discard(D);
+
+  unlink(slimdata);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/spf.c b/test/spf.c
deleted file mode 100644
index 127314e..0000000
--- a/test/spf.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
- *
- ***************************************************************************
- *
- * This file is part of the GetData project.
- *
- * GetData is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version.
- *
- * GetData is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with GetData; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-/* Retreiving the samples-per-frame of a field 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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *format_data = "data RAW UINT8 11\n";
-  int fd, error, r = 0;
-  unsigned int spf;
-  DIRFILE *D;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-  spf = gd_spf(D, "data");
-  error = gd_error(D);
-  gd_close(D);
-
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error,0);
-  CHECKI(spf,11);
-  return r;
-}
diff --git a/test/spf_alias.c b/test/spf_alias.c
index d3c5121..3b8577c 100644
--- a/test/spf_alias.c
+++ b/test/spf_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "alias");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_alias_meta.c b/test/spf_alias_meta.c
index f8620ba..2f8a3ab 100644
--- a/test/spf_alias_meta.c
+++ b/test/spf_alias_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -42,7 +42,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "alias/sub");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_alias_missing.c b/test/spf_alias_missing.c
index 53620cf..313e131 100644
--- a/test/spf_alias_missing.c
+++ b/test/spf_alias_missing.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -39,7 +39,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   spf = gd_spf(D, "alias");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_divide.c b/test/spf_divide.c
index 562d993..64811a6 100644
--- a/test/spf_divide.c
+++ b/test/spf_divide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "div");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_lincom.c b/test/spf_lincom.c
index bc59139..829939b 100644
--- a/test/spf_lincom.c
+++ b/test/spf_lincom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "lincom");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_multiply.c b/test/spf_multiply.c
index 8f24821..d8ff6bb 100644
--- a/test/spf_multiply.c
+++ b/test/spf_multiply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "lincom");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_polynom.c b/test/spf_polynom.c
index 80018ac..4293dcd 100644
--- a/test/spf_polynom.c
+++ b/test/spf_polynom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2011 D. V. Wiebe
+/* Copyright (C) 2009-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -48,7 +48,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "polynom");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_raw.c b/test/spf_raw.c
new file mode 100644
index 0000000..79ce3d4
--- /dev/null
+++ b/test/spf_raw.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Retreiving the samples-per-frame of a field should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "data");
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(spf,11);
+  return r;
+}
diff --git a/test/spf_recip.c b/test/spf_recip.c
index b896d83..2e39c53 100644
--- a/test/spf_recip.c
+++ b/test/spf_recip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   spf = gd_spf(D, "div");
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/spf_recurse.c b/test/spf_recurse.c
index ee4872f..fb94b4f 100644
--- a/test/spf_recurse.c
+++ b/test/spf_recurse.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -49,7 +49,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   spf = gd_spf(D, "lincom");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/svlist.c b/test/svlist.c
index 1ec5039..3cdc57a 100644
--- a/test/svlist.c
+++ b/test/svlist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
 
   CHECKI(i,3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/svlist0.c b/test/svlist0.c
new file mode 100644
index 0000000..1eda1bc
--- /dev/null
+++ b/test/svlist0.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data4 CONST UINT8 1\n";
+  int fd, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_strings(D);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+  CHECKP(field_list[0]);
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/svlist2.c b/test/svlist2.c
new file mode 100644
index 0000000..bab4973
--- /dev/null
+++ b/test/svlist2.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 STRING valu1\n"
+    "data2 STRING valu2\n"
+    "data3 STRING valu3\n"
+    "data4 CONST UINT8 1\n";
+  int fd, z, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  for (z = 0; z < 2; ++z) {
+    field_list = gd_strings(D);
+
+    error = gd_error(D);
+    CHECKIi(z, error, 0);
+    CHECKPNi(z, field_list);
+
+    for (i = 0; field_list[i]; ++i) {
+      int len = strlen(field_list[i]);
+      CHECKIi(i * 2 + z,len,5);
+
+      CHECKIi(i * 2 + z,field_list[i][0], 'v');
+      CHECKIi(i * 2 + z,field_list[i][1], 'a');
+      CHECKIi(i * 2 + z,field_list[i][2], 'l');
+      CHECKIi(i * 2 + z,field_list[i][3], 'u');
+
+      if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+        fprintf(stderr, "field_list[%i@%i] = \"%s\"\n", i, z, field_list[i]);
+        r = 1;
+      }
+    }
+
+    CHECKIi(z, i,3);
+  }
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/svlist_hidden.c b/test/svlist_hidden.c
index 98f53ed..8c45505 100644
--- a/test/svlist_hidden.c
+++ b/test/svlist_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -65,7 +65,7 @@ int main(void)
 
   CHECKI(i,2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/svlist_invalid.c b/test/svlist_invalid.c
index 4e70717..65a9142 100644
--- a/test/svlist_invalid.c
+++ b/test/svlist_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_strings(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error,GD_E_BAD_DIRFILE);
diff --git a/test/svlist_meta.c b/test/svlist_meta.c
index 3ad1484..839d711 100644
--- a/test/svlist_meta.c
+++ b/test/svlist_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -77,7 +77,7 @@ int main(void)
 
   CHECKI(i,3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/svlist_meta0.c b/test/svlist_meta0.c
new file mode 100644
index 0000000..9cce15a
--- /dev/null
+++ b/test/svlist_meta0.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent STRING valu1\n"
+    "META parent data4 CONST UINT8 1\n";
+  int fd, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_nfields(D);
+  gd_nmfields(D, "parent");
+  gd_nmfields_by_type(D, "parent", GD_STRING_ENTRY);
+  field_list = gd_mstrings(D, "parent");
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+  CHECKP(field_list[0]);
+
+  gd_discard(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/svlist_meta_hidden.c b/test/svlist_meta_hidden.c
index 94bcacd..3845236 100644
--- a/test/svlist_meta_hidden.c
+++ b/test/svlist_meta_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
 
   CHECKI(i,2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/svlist_meta_invalid.c b/test/svlist_meta_invalid.c
index 30fc116..61cd588 100644
--- a/test/svlist_meta_invalid.c
+++ b/test/svlist_meta_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_mstrings(D, "parent");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error,GD_E_BAD_DIRFILE);
diff --git a/test/table.c b/test/table.c
index 5d25843..6a3fb4a 100644
--- a/test/table.c
+++ b/test/table.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   path = gd_linterp_tablename(D, "linterp");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/table_code.c b/test/table_code.c
index 0121fa0..01233b9 100644
--- a/test/table_code.c
+++ b/test/table_code.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   path = gd_linterp_tablename(D, "bata");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/table_type.c b/test/table_type.c
index 4d4bc2f..41e4e55 100644
--- a/test/table_type.c
+++ b/test/table_type.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -47,7 +47,7 @@ int main(void)
   path = gd_linterp_tablename(D, "data");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/tell.c b/test/tell.c
index c9e5029..8716a80 100644
--- a/test/tell.c
+++ b/test/tell.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -59,7 +59,7 @@ int main(void)
   n = gd_tell(D, "data");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/tell64.c b/test/tell64.c
index 79ada4a..9692f22 100644
--- a/test/tell64.c
+++ b/test/tell64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   n = gd_tell64(D, "data");
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/tell_multidiv.c b/test/tell_multidiv.c
index 6d260af..701c61c 100644
--- a/test/tell_multidiv.c
+++ b/test/tell_multidiv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -57,7 +57,7 @@ int main(void)
   n = gd_tell(D, "div");
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/tell_sub.c b/test/tell_sub.c
new file mode 100644
index 0000000..8a97438
--- /dev/null
+++ b/test/tell_sub.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *data = "dirfile/sub/data";
+  const char *format_data = "/INCLUDE sub/format1\n";
+  const char *format1_data = "data RAW UINT8 8\nFRAMEOFFSET 6\n";
+  unsigned char data_data[256];
+  int fd, e1, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_tell(D, "data");
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n, 48);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/test.h b/test/test.h
index bba416c..bbf4e12 100644
--- a/test/test.h
+++ b/test/test.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2012 D. V. Wiebe
+/* Copyright (C) 2010-2015 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -20,11 +20,6 @@
  */
 #define GD_TEST
 #include "internal.h"
-#include <inttypes.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
 
 #ifdef HAVE_FLOAT_H
 #include <float.h>
@@ -71,18 +66,15 @@ int gd_system(const char* command)
 #define sleep(x) Sleep(1000 * (x))
 #endif
 
-/* path munging for WIN32/64 */
-#if defined _WIN32 || defined _WIN64
+/* path munging for format files */
 #define gd_pathwrite(x,y) do { \
   char *ptr; \
+  const char esc = '\\'; \
   for (ptr = y; *ptr != '\0'; ++ptr) { \
-    if (*ptr == '\\') write(x,ptr,1); \
+    if (*ptr == '\\' || *ptr == '#' || *ptr == ' ') write(x,&esc,1); \
     write(x,ptr,1); \
   } \
 } while (0)
-#else
-#define gd_pathwrite(x,y) write(x,y,strlen(y))
-#endif
 
 /* getcwd abstraction */
 #if defined HAVE_GETCWD || defined HAVE__GETCWD
@@ -96,7 +88,7 @@ int gd_system(const char* command)
       fprintf(stderr, "out of memory for cwd!\n"); \
       exit(1); \
     } \
-  } while (!getcwd(cwd = ptr, cwd_size));
+  } while (!getcwd(cwd = ptr, cwd_size))
 #else
 # define GD_NO_GETCWD
 #endif
@@ -144,11 +136,13 @@ int gd_system(const char* command)
 #define CHECKPN(n)     CHECK((n) == NULL,n,"%p","%s",n,"non-NULL")
 #define CHECKPNi(i,n)  CHECKi(i,(n) == NULL,n,"%p","%s",n,"non-NULL")
 #define CHECKS(n,v)    CHECK(strcmpn((n),(v)),n,"\"%s\"","\"%s\"",(n),(v));
-#define CHECKSi(n,v)   CHECKi(i,strcmpn((n),(v)),n,"\"%s\"","\"%s\"",(n),(v));
+#define CHECKSi(i,n,v) CHECKi(i,strcmpn((n),(v)),n,"\"%s\"","\"%s\"",(n),(v));
 #define CHECKSp(n,v)   CHECK(strncmp((n),(v), sizeof(v) - 1),n,"\"%s\"",\
     "\"%s\"",(n),(v));
 #define CHECKBOS(n,v)  CHECK(strncmp((n),(v),strlen(v)-1),n,"\"%s\"","\"%s\"",\
     (n),(v));
+#define CHECKSS(n,v)  CHECK(strstr((n),(v)) == NULL,n,"\"%s\"","...\"%s\"...",\
+    (n),(v));
 #define CHECKEOS(n,v)  CHECK(strcmp((n) + strlen(n) - sizeof(v) + 1,(v)),n,\
     "...\"%s\"","\"%s\"",(n) + strlen(n) - sizeof(v) + 1,(v));
 #define CHECKU(n,v)    CHECK((n) != (v),n,"%llu","%llu",\
diff --git a/test/tok_arg.c b/test/tok_arg.c
index 7659683..1a976b1 100644
--- a/test/tok_arg.c
+++ b/test/tok_arg.c
@@ -44,7 +44,7 @@ int main(void)
   tok = gd_strtok(D, NULL);
   e2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
diff --git a/test/tok_escape.c b/test/tok_escape.c
index b9e6527..55e0a02 100644
--- a/test/tok_escape.c
+++ b/test/tok_escape.c
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Parser check */
 #include "test.h"
 
 #include <stdlib.h>
@@ -41,32 +40,35 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE);
   e1 = gd_error(D);
+  CHECKI(e1,GD_E_OK);
 
   tok1 = gd_strtok(D, spec);
   e2 = gd_error(D);
+  CHECKI(e2,GD_E_OK);
+  CHECKS(tok1,"string");
+  free(tok1);
+
   tok2 = gd_strtok(D, NULL);
   e3 = gd_error(D);
+  CHECKI(e3,GD_E_OK);
+  CHECKS(tok2,"STRING");
+  free(tok2);
+
   tok3 = gd_strtok(D, NULL);
   e4 = gd_error(D);
+  CHECKI(e4,GD_E_OK);
+  CHECKS(tok3," value");
+  free(tok3);
+
   tok4 = gd_strtok(D, NULL);
   e5 = gd_error(D);
+  CHECKI(e5,GD_E_OK);
+  CHECKP(tok4);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e1,GD_E_OK);
-  CHECKI(e2,GD_E_OK);
-  CHECKI(e3,GD_E_OK);
-  CHECKI(e4,GD_E_OK);
-  CHECKI(e5,GD_E_OK);
-  CHECKS(tok1,"string");
-  CHECKS(tok2,"STRING");
-  CHECKS(tok3," value");
-  CHECKP(tok4);
-  free(tok1);
-  free(tok2);
-  free(tok3);
   return r;
 }
diff --git a/test/tok_quote.c b/test/tok_quote.c
index 626de8d..c275f7f 100644
--- a/test/tok_quote.c
+++ b/test/tok_quote.c
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Parser check */
 #include "test.h"
 
 #include <stdlib.h>
@@ -41,32 +40,35 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE);
   e1 = gd_error(D);
+  CHECKI(e1,GD_E_OK);
 
   tok1 = gd_strtok(D, spec);
   e2 = gd_error(D);
+  CHECKI(e2,GD_E_OK);
+  CHECKS(tok1,"string");
+  free(tok1);
+
   tok2 = gd_strtok(D, NULL);
   e3 = gd_error(D);
+  CHECKI(e3,GD_E_OK);
+  CHECKS(tok2,"STRING");
+  free(tok2);
+
   tok3 = gd_strtok(D, NULL);
   e4 = gd_error(D);
+  CHECKI(e4,GD_E_OK);
+  CHECKS(tok3,"value");
+  free(tok3);
+
   tok4 = gd_strtok(D, NULL);
   e5 = gd_error(D);
+  CHECKI(e5,GD_E_OK);
+  CHECKP(tok4);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e1,GD_E_OK);
-  CHECKI(e2,GD_E_OK);
-  CHECKI(e3,GD_E_OK);
-  CHECKI(e4,GD_E_OK);
-  CHECKI(e5,GD_E_OK);
-  CHECKS(tok1,"string");
-  CHECKS(tok2,"STRING");
-  CHECKS(tok3,"value");
-  CHECKP(tok4);
-  free(tok1);
-  free(tok2);
-  free(tok3);
   return r;
 }
diff --git a/test/trunc.c b/test/trunc.c
index 8e7a241..b2f8d74 100644
--- a/test/trunc.c
+++ b/test/trunc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Truncating a dirfile should succeed cleanly */
 #include "test.h"
 
 #include <stdlib.h>
@@ -33,7 +32,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int fd, error, unlink_data, stat_format, r = 0;
+  int fd, e1, e2, unlink_data, stat_format, r = 0;
   struct stat buf;
   DIRFILE *D;
 
@@ -47,8 +46,11 @@ int main(void)
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   unlink_data = unlink(data);
   CHECKI(unlink_data, -1);
@@ -60,6 +62,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,GD_E_OK);
   return r;
 }
diff --git a/test/trunc_dir.c b/test/trunc_dir.c
index bd55c3a..fb3bcfa 100644
--- a/test/trunc_dir.c
+++ b/test/trunc_dir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Truncating a dirfile should succeed cleanly */
 #include "test.h"
 
 #include <stdlib.h>
@@ -34,7 +33,7 @@ int main(void)
   const char *subdir = "dirfile/sub";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int fd, error, unlink_data, rmdir_sub, stat_format, r = 0;
+  int fd, e1, e2, unlink_data, rmdir_sub, stat_format, r = 0;
   struct stat buf;
   DIRFILE *D;
 
@@ -49,8 +48,11 @@ int main(void)
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   unlink_data = unlink(data);
   CHECKI(unlink_data, -1);
@@ -65,6 +67,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,GD_E_OK);
   return r;
 }
diff --git a/test/trunc_rdonly.c b/test/trunc_rdonly.c
index f0e1c0f..2cd5150 100644
--- a/test/trunc_rdonly.c
+++ b/test/trunc_rdonly.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Truncating a read-only dirfile should fail cleanly */
 #include "test.h"
 
 #include <stdlib.h>
@@ -33,7 +32,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int fd, error, unlink_data, r = 0;
+  int fd, e1, e2, unlink_data, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -46,8 +45,11 @@ int main(void)
   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);
+  e1 = gd_error(D);
+  CHECKI(e1,GD_E_ACCMODE);
+
+  e2 = gd_discard(D);
+  CHECKI(e2, 0);
 
   unlink_data = unlink(data);
   CHECKI(unlink_data, 0);
@@ -55,6 +57,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,GD_E_ACCMODE);
   return r;
 }
diff --git a/test/trunc_truncsub.c b/test/trunc_truncsub.c
index 3294564..389ef33 100644
--- a/test/trunc_truncsub.c
+++ b/test/trunc_truncsub.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 D. V. Wiebe
+/* Copyright (C) 2008-2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Truncating a dirfile should succeed cleanly */
 #include "test.h"
 
 #include <stdlib.h>
@@ -34,7 +33,7 @@ int main(void)
   const char *subdir = "dirfile/sub";
   const char *format = "dirfile/format";
   const char *data = "dirfile/data";
-  int fd, error, unlink_data, rmdir_sub, stat_format, r = 0;
+  int fd, e1, e2, unlink_data, rmdir_sub, stat_format, r = 0;
   struct stat buf;
   DIRFILE *D;
 
@@ -49,8 +48,11 @@ int main(void)
   close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666));
 
   D = gd_open(filedir, GD_RDWR | GD_TRUNC | GD_TRUNCSUB | GD_VERBOSE);
-  error = gd_error(D);
-  gd_close(D);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   unlink_data = unlink(data);
   CHECKI(unlink_data, -1);
@@ -65,6 +67,5 @@ int main(void)
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(error,GD_E_OK);
   return r;
 }
diff --git a/test/unclude.c b/test/unclude.c
index bec2d1d..9e13fb1 100644
--- a/test/unclude.c
+++ b/test/unclude.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test include */
 #include "test.h"
 
 #include <stdlib.h>
@@ -38,7 +37,7 @@ int main(void)
   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;
+  int fd, ret, e1, e2, unlink_format1, unlink_format2, r = 0;
   unsigned int nfields, nfragments;
   DIRFILE *D;
 
@@ -59,20 +58,24 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   ret = gd_uninclude(D, 1, 0);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(ret,0);
+  CHECKI(e1,0);
+
   nfields = gd_nfields(D);
+  CHECKI(nfields,2);
+
   nfragments = gd_nfragments(D);
-  gd_close(D);
+  CHECKI(nfragments,1);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   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);
 
diff --git a/test/unclude_del.c b/test/unclude_del.c
index 7ff463a..999248a 100644
--- a/test/unclude_del.c
+++ b/test/unclude_del.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -18,7 +18,6 @@
  * along with GetData; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-/* Test include */
 #include "test.h"
 
 #include <stdlib.h>
@@ -38,7 +37,7 @@ int main(void)
   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;
+  int fd, ret, e1, e2, unlink_format1, unlink_format2, r = 0;
   unsigned int nfields, nfragments;
   DIRFILE *D;
 
@@ -59,20 +58,24 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   ret = gd_uninclude(D, 2, 1);
-  error = gd_error(D);
+  e1 = gd_error(D);
+  CHECKI(ret,0);
+  CHECKI(e1, 0);
+
   nfields = gd_nfields(D);
+  CHECKI(nfields,3);
+
   nfragments = gd_nfragments(D);
-  gd_close(D);
+  CHECKI(nfragments,2);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   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);
 
diff --git a/test/unclude_move.c b/test/unclude_move.c
index 6231eed..ffba819 100644
--- a/test/unclude_move.c
+++ b/test/unclude_move.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -64,7 +64,7 @@ int main(void)
   error2 = gd_error(D);
   nfields = gd_nfields(D);
   nfragments = gd_nfragments(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(format2);
   unlink(format1);
diff --git a/test/unclude_open.c b/test/unclude_open.c
new file mode 100644
index 0000000..d253a13
--- /dev/null
+++ b/test/unclude_open.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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 = "dirfile";
+  const char *data = "dirfile/data";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n";
+  const char *format1_data = "data RAW UINT8 11\n/INCLUDE format2\n";
+  const char *format2_data = "c CONST UINT8 11\n";
+  int fd, ret, e1, e2, unlink_format1, unlink_format2, r = 0;
+  unsigned int nfields, nfragments;
+  unsigned char data_data[256];
+  uint8_t c = 3;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_putdata(D, "data", 0, 0, 0, 1, GD_UINT8, &c);
+  ret = gd_uninclude(D, 1, 0);
+  e1 = gd_error(D);
+  CHECKI(ret,0);
+  CHECKI(e1, 0);
+
+  nfields = gd_nfields(D);
+  CHECKI(nfields,2);
+
+  nfragments = gd_nfragments(D);
+  CHECKI(nfragments,1);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
+
+  unlink_format2 = unlink(format2);
+  unlink_format1 = unlink(format1);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_format2,0);
+  CHECKI(unlink_format1,0);
+
+  return r;
+}
diff --git a/test/version_0.c b/test/version_0.c
index 172736a..9d8ab7c 100644
--- a/test/version_0.c
+++ b/test/version_0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_0_write.c b/test/version_0_write.c
index ffe8726..ea6316d 100644
--- a/test/version_0_write.c
+++ b/test/version_0_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -33,7 +33,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *format_data = "FRAMEOFFSET RAW c 8\na&b RAW c 8";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -46,18 +46,20 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   e = gd_dirfile_standards(D, 0);
   q = gd_rewrite_fragment(D, 0);
-  gd_close(D);
+  CHECKI(e,0);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
-  gd_close(D);
+  CHECKI(c,0);
+
+  gd_discard(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
index da67d69..da27fd5 100644
--- a/test/version_1.c
+++ b/test/version_1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_1_write.c b/test/version_1_write.c
index d828f88..2424358 100644
--- a/test/version_1_write.c
+++ b/test/version_1_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -33,7 +33,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *format_data = "INCLUDE RAW c 8\nFRAMEOFFSET 1\na&b RAW c 8\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -46,18 +46,19 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   e = gd_dirfile_standards(D, 1);
   q = gd_rewrite_fragment(D, 0);
-  gd_close(D);
+  CHECKI(e,1);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
-  gd_close(D);
+  CHECKI(c,1);
+  gd_discard(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
index 6ab2190..222359b 100644
--- a/test/version_2.c
+++ b/test/version_2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_2_write.c b/test/version_2_write.c
index 84c239d..7fc9f10 100644
--- a/test/version_2_write.c
+++ b/test/version_2_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -36,7 +36,7 @@ int main(void)
     "INCLUDE RAW c 8\n"
     "a&b RAW c 8\n"
     "m MULTIPLY INCLUDE INCLUDE\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -49,18 +49,20 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   e = gd_dirfile_standards(D, 2);
   q = gd_rewrite_fragment(D, 0);
-  gd_close(D);
+  CHECKI(e,2);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
-  gd_close(D);
+  CHECKI(c,2);
+
+  gd_discard(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
index 2f10c90..84c9c8d 100644
--- a/test/version_3.c
+++ b/test/version_3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_3_write.c b/test/version_3_write.c
index 66adccb..832af0e 100644
--- a/test/version_3_write.c
+++ b/test/version_3_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -35,7 +35,7 @@ int main(void)
   const char *format1 = "dirfile/RAW";
   const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n";
   const char *format_data1 = "m MULTIPLY ENDIAN ENDIAN\na&b RAW c 8\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -52,19 +52,21 @@ int main(void)
   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);
+  CHECKI(e,3);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
-  gd_close(D);
+  CHECKI(c,3);
+
+  gd_discard(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
index 1be5a35..95cbc7d 100644
--- a/test/version_4.c
+++ b/test/version_4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -69,7 +69,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_4_write.c b/test/version_4_write.c
index 16d8464..513a4ed 100644
--- a/test/version_4_write.c
+++ b/test/version_4_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -35,7 +35,7 @@ int main(void)
   const char *format1 = "dirfile/RAW";
   const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n";
   const char *format_data1 = "VERSION PHASE ENDIAN 1\na&b RAW c 8\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -52,19 +52,21 @@ int main(void)
   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);
+  CHECKI(e,4);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
-  gd_close(D);
+  CHECKI(c,4);
+
+  gd_discard(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
index 9140ceb..a9ee9f2 100644
--- a/test/version_5.c
+++ b/test/version_5.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -71,7 +71,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_5_strict.c b/test/version_5_strict.c
index 05882e9..057ff60 100644
--- a/test/version_5_strict.c
+++ b/test/version_5_strict.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -77,7 +77,7 @@ int main(void)
   m = gd_getdata(D, "FILEFRAM", 5, 0, 8, 0, GD_UINT16, d);
   error2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_5_write.c b/test/version_5_write.c
index 915b90b..aa94659 100644
--- a/test/version_5_write.c
+++ b/test/version_5_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
     "/ENDIAN big\n"
     "a.r RAW UINT8 8\n"
     "ENCODING PHASE a.r 0\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -50,18 +50,20 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   e = gd_dirfile_standards(D, 5);
   q = gd_rewrite_fragment(D, 0);
-  gd_close(D);
+  CHECKI(e,5);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
-  gd_close(D);
+  CHECKI(c,5);
+
+  gd_discard(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
index b7db38a..60b7b17 100644
--- a/test/version_6.c
+++ b/test/version_6.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_6_strict.c b/test/version_6_strict.c
index c9e1a59..4b1ac7e 100644
--- a/test/version_6_strict.c
+++ b/test/version_6_strict.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -80,7 +80,7 @@ int main(void)
   m = gd_getdata(D, "FILEFRAM", 5, 0, 8, 0, GD_UINT16, d);
   error2 = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_6_write.c b/test/version_6_write.c
index 44df61a..9392474 100644
--- a/test/version_6_write.c
+++ b/test/version_6_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -29,7 +29,7 @@ int main(void)
     "b\\ c CONST UINT8 8\n"
     "\"a \\#r\" RAW UINT8 b\\ c\n"
     "/META \"a \\#r\" \\x64\\c\\157 PHASE \"a \\#r\" 0\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
   unsigned int s;
 
@@ -43,20 +43,22 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   e = gd_dirfile_standards(D, 6);
   q = gd_rewrite_fragment(D, 0);
-  gd_close(D);
+  CHECKI(e,6);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
   s = gd_spf(D, "a #r/dco");
-  gd_close(D);
+  CHECKI(c,6);
+  CHECKU(s,8);
+
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e,6);
-  CHECKI(q,0);
-  CHECKI(c,6);
-  CHECKU(s,8);
-
   return r;
 }
diff --git a/test/version_7.c b/test/version_7.c
index 109a578..3c6a1ca 100644
--- a/test/version_7.c
+++ b/test/version_7.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -63,7 +63,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_7_strict.c b/test/version_7_strict.c
index 9919a02..1182dee 100644
--- a/test/version_7_strict.c
+++ b/test/version_7_strict.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -73,7 +73,7 @@ int main(void)
   n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_7_write.c b/test/version_7_write.c
index 7bb038a..72f2ebe 100644
--- a/test/version_7_write.c
+++ b/test/version_7_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -33,7 +33,7 @@ int main(void)
   const char *filedir = "dirfile";
   const char *format = "dirfile/format";
   const char *format_data = "/VERSION 7\nar RAW UINT8 8\nar/q SBIT ar 0 10\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -45,19 +45,22 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   e = gd_dirfile_standards(D, 7);
+  CHECKI(e,7);
+
   q = gd_rewrite_fragment(D, 0);
-  gd_close(D);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
-  gd_close(D);
+  CHECKI(c,7);
+
+  gd_discard(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
index 520d526..e41ed08 100644
--- a/test/version_8.c
+++ b/test/version_8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -67,7 +67,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_8_strict.c b/test/version_8_strict.c
index 2e48f12..3d42bb9 100644
--- a/test/version_8_strict.c
+++ b/test/version_8_strict.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -72,7 +72,7 @@ int main(void)
   n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_8_write.c b/test/version_8_write.c
index e5217d5..0e765fa 100644
--- a/test/version_8_write.c
+++ b/test/version_8_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -37,7 +37,7 @@ int main(void)
     "ar RAW UINT8 8\n"
     "FRAMEOFFSET DIVIDE ar ar\n"
     "r RECIP ar 1.\n";
-  int fd, e, q, c, r = 0;
+  int fd, e, e2, q, c, r = 0;
   DIRFILE *D;
 
   rmdirfile();
@@ -50,18 +50,20 @@ int main(void)
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   e = gd_dirfile_standards(D, 8);
   q = gd_rewrite_fragment(D, 0);
-  gd_close(D);
+  CHECKI(e,8);
+  CHECKI(q,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
-  gd_close(D);
+  CHECKI(c,8);
+  gd_discard(D);
 
   unlink(format);
   rmdir(filedir);
 
-  CHECKI(e,8);
-  CHECKI(q,0);
-  CHECKI(c,8);
 
   return r;
 }
diff --git a/test/version_9.c b/test/version_9.c
index b81e72a..4d599d3 100644
--- a/test/version_9.c
+++ b/test/version_9.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
   l = gd_dirfile_standards(D, GD_VERSION_LATEST);
   e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
diff --git a/test/version_9_strict.c b/test/version_9_strict.c
index 8feefcc..06d9b0a 100644
--- a/test/version_9_strict.c
+++ b/test/version_9_strict.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -91,9 +91,10 @@ int main(void)
   D = gd_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
   error = gd_error(D);
   v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  CHECKI(v,GD_DIRFILE_STANDARDS_VERSION);
   n = gd_getdata(D, "ar", 4, 0, 8, 0, GD_UINT16, c);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   unlink(format);
@@ -112,7 +113,6 @@ int main(void)
   }
 
   CHECKI(n,8);
-  CHECKI(v,9);
 
   for (i = 0; i < n; ++i)
     CHECKUi(i,c[i], (i & 1) ? 4 + i : 0);
diff --git a/test/version_9_write.c b/test/version_9_write.c
index e1918a8..a316b5f 100644
--- a/test/version_9_write.c
+++ b/test/version_9_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010-2011 D. V. Wiebe
+/* Copyright (C) 2010-2011, 2013, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -53,7 +53,7 @@ int main(void)
   };
   uint16_t c[8];
   unsigned char data_data[256];
-  int fd, i, error, n, v, h1, h2, r = 0;
+  int fd, i, e1, e2, n, v, h1, h2, r = 0;
   DIRFILE *D;
 
   memset(c, 0, 16);
@@ -75,30 +75,32 @@ int main(void)
 
   D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
   h1 = gd_hidden(D, "AdYZ");
+  CHECKI(h1,1);
+
   gd_rewrite_fragment(D, GD_ALL_FRAGMENTS);
-  error = gd_error(D);
-  gd_close(D);
+  e1 = gd_error(D);
+  CHECKI(e1,0);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
   n = gd_getdata(D, "ar", 4, 0, 8, 0, GD_UINT16, c);
   h2 = gd_hidden(D, "AdYZ");
+  CHECKI(h2,1);
+  CHECKI(n,8);
+  CHECKI(v,GD_DIRFILE_STANDARDS_VERSION);
+
+  for (i = 0; i < n; ++i)
+    CHECKUi(i,c[i], (i & 1) ? 4 + i : 0);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(data);
   for (i = 0; i < 5; ++i)
     unlink(format[i]);
   rmdir(filedir);
 
-  CHECKI(error,0);
-  CHECKI(h1,1);
-  CHECKI(h2,1);
-  CHECKI(n,8);
-  CHECKI(v,9);
-
-  for (i = 0; i < n; ++i)
-    CHECKUi(i,c[i], (i & 1) ? 4 + i : 0);
-
   return r;
 }
diff --git a/test/vlist.c b/test/vlist.c
index 46d7cd7..2144d1d 100644
--- a/test/vlist.c
+++ b/test/vlist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -71,7 +71,7 @@ int main(void)
 
   CHECKI(i,4);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/vlist_alias.c b/test/vlist_alias.c
index 6b47255..062dc14 100644
--- a/test/vlist_alias.c
+++ b/test/vlist_alias.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -75,7 +75,7 @@ int main(void)
 
   CHECKI(i,5);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/vlist_hidden.c b/test/vlist_hidden.c
index c0c7fb0..6f93c67 100644
--- a/test/vlist_hidden.c
+++ b/test/vlist_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
 
   CHECKI(i,3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/vlist_invalid.c b/test/vlist_invalid.c
index 01c2219..f500827 100644
--- a/test/vlist_invalid.c
+++ b/test/vlist_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_vector_list(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
   CHECKI(error,GD_E_BAD_DIRFILE);
diff --git a/test/vlist_meta.c b/test/vlist_meta.c
index 9cf8853..2f3c525 100644
--- a/test/vlist_meta.c
+++ b/test/vlist_meta.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -74,7 +74,7 @@ int main(void)
 
   CHECKI(i,3);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/vlist_meta_hidden.c b/test/vlist_meta_hidden.c
index 5b0282a..2286257 100644
--- a/test/vlist_meta_hidden.c
+++ b/test/vlist_meta_hidden.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -66,7 +66,7 @@ int main(void)
 
   CHECKI(i,2);
 
-  gd_close(D);
+  gd_discard(D);
   unlink(format);
   rmdir(filedir);
 
diff --git a/test/vlist_meta_invalid.c b/test/vlist_meta_invalid.c
index 8fb6930..58f9b34 100644
--- a/test/vlist_meta_invalid.c
+++ b/test/vlist_meta_invalid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -38,7 +38,7 @@ int main(void)
   D = gd_open(filedir, GD_RDONLY);
   fl = gd_mvector_list(D, "parent");
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   CHECKP(fl);
 
diff --git a/test/xz_get.c b/test/xz_get.c
deleted file mode 100644
index 1dc678a..0000000
--- a/test/xz_get.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* 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
- */
-#include "test.h"
-
-int main(void)
-{
-#ifndef TEST_LZMA
-  return 77;
-#else
-  const char *filedir = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *xzdata = "dirfile/data.xz";
-  const char *format_data = "data RAW UINT16 8\n";
-  uint16_t c[8];
-  char command[4096];
-  uint16_t data_data[256];
-#ifdef USE_LZMA
-  int i;
-#endif
-  int fd, n, error, r = 0;
-  DIRFILE *D;
-
-  memset(c, 0, 8);
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  for (fd = 0; fd < 256; ++fd)
-    data_data[fd] = (unsigned char)fd;
-
-  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(fd, format_data, strlen(format_data));
-  close(fd);
-
-  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
-  write(fd, data_data, 256 * sizeof(uint16_t));
-  close(fd);
-
-  /* compress */
-  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
-  if (gd_system(command))
-    return 1;
-
-#ifdef USE_LZMA
-  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-#else
-  D = gd_open(filedir, GD_RDONLY);
-#endif
-  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
-  error = gd_error(D);
-
-  gd_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
deleted file mode 100644
index a36d9ee..0000000
--- a/test/xz_nframes.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* 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
- */
-/* Retrieving the number of frames should succeed cleanly */
-#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 = "dirfile";
-  const char *format = "dirfile/format";
-  const char *data = "dirfile/data";
-  const char *xzdata = "dirfile/data.xz";
-  const char *format_data = "data RAW UINT16 1\n";
-  char command[4096];
-  uint16_t data_data[256];
-  int i, error, r = 0;
-  DIRFILE *D;
-  size_t n;
-
-  rmdirfile();
-  mkdir(filedir, 0777);
-
-  for (i = 0; i < 256; ++i)
-    data_data[i] = (uint16_t)i;
-
-  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
-  write(i, format_data, strlen(format_data));
-  close(i);
-
-  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
-  write(i, data_data, 256 * sizeof(uint16_t));
-  close(i);
-
-  /* compress */
-  snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data);
-  if (gd_system(command))
-    return 1;
-
-#ifdef USE_LZMA
-  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
-#else
-  D = gd_open(filedir, GD_RDONLY);
-#endif
-  n = gd_nframes(D);
-  error = gd_error(D);
-  gd_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/zzip_data.c b/test/zzip_data.c
index 57b984e..5a59086 100644
--- a/test/zzip_data.c
+++ b/test/zzip_data.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -72,7 +72,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(testzip);
   unlink(format);
diff --git a/test/zzip_get.c b/test/zzip_get.c
index 9c02bb5..5e260a7 100644
--- a/test/zzip_get.c
+++ b/test/zzip_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -70,7 +70,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(rawzip);
   unlink(format);
diff --git a/test/zzip_get_get.c b/test/zzip_get_get.c
index 5fe5c1e..8623ba8 100644
--- a/test/zzip_get_get.c
+++ b/test/zzip_get_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 D. V. Wiebe
+/* Copyright (C) 2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -33,7 +33,7 @@ int main(void)
   uint16_t c1[8], c2[8];
   char command[4096];
   uint16_t data_data[256];
-  int fd, i, n1, error1, n2, error2, r = 0;
+  int fd, i, n1, e1, e2, n2, e3, r = 0;
   DIRFILE *D;
 
   memset(c1, 0, 16);
@@ -62,27 +62,30 @@ int main(void)
 
   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);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+  CHECKI(n1, 8);
+
+  e2 = gd_close(D);
+  CHECKI(e2, 0);
 
   D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
   n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
-  error2 = gd_error(D);
-  gd_close(D);
-
-  unlink(rawzip);
-  unlink(format);
-  rmdir(filedir);
-
-  CHECKI(error1, 0);
-  CHECKI(error2, 0);
-  CHECKI(n1, 8);
+  e3 = gd_error(D);
+  CHECKI(e3, 0);
   CHECKI(n2, 8);
+
   for (i = 0; i < 8; ++i) {
     CHECKIi(i,c1[i], 40 + i);
     CHECKIi(i,c2[i], 40 + i);
   }
 
+  gd_discard(D);
+
+  unlink(rawzip);
+  unlink(format);
+  rmdir(filedir);
+
   return r;
 #endif
 }
diff --git a/test/zzip_nframes.c b/test/zzip_nframes.c
index b98d3aa..9462772 100644
--- a/test/zzip_nframes.c
+++ b/test/zzip_nframes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -74,7 +74,7 @@ int main(void)
 #endif
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(rawzip);
   unlink(format);
diff --git a/test/zzip_seek.c b/test/zzip_seek.c
new file mode 100644
index 0000000..70da389
--- /dev/null
+++ b/test/zzip_seek.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_ZZIP || !defined USE_ZZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *rawzip = "dirfile/raw.zip";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  chdir(filedir);
+  snprintf(command, 4096, "%s raw data > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(data);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  CHECKI(n, 40);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(rawzip);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/zzip_seek_far.c b/test/zzip_seek_far.c
new file mode 100644
index 0000000..697c751
--- /dev/null
+++ b/test/zzip_seek_far.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined TEST_ZZIP || !defined USE_ZZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *rawzip = "dirfile/raw.zip";
+  const char *format_data = "data RAW UINT16 8\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  chdir(filedir);
+  snprintf(command, 4096, "%s raw data > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(data);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  CHECKI(n, 256);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(rawzip);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/zzslim_get.c b/test/zzslim_get.c
index a4208e3..b94eb22 100644
--- a/test/zzslim_get.c
+++ b/test/zzslim_get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 D. V. Wiebe
+/* Copyright (C) 2012-2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -58,7 +58,7 @@ int main(void)
   close(fd);
 
   /* compress, twice */
-  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
   if (gd_system(command))
     return 1;
   chdir(filedir);
@@ -77,7 +77,7 @@ int main(void)
   n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
   error = gd_error(D);
 
-  gd_close(D);
+  gd_discard(D);
 
   unlink(testzip);
   unlink(format);
diff --git a/test/zzslim_nframes.c b/test/zzslim_nframes.c
index 31bb5bc..f7fcd39 100644
--- a/test/zzslim_nframes.c
+++ b/test/zzslim_nframes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2011, 2013 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -61,7 +61,7 @@ int main(void)
   close(i);
 
   /* compress, twice */
-  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
   if (gd_system(command))
     return 1;
   chdir(filedir);
@@ -79,7 +79,7 @@ int main(void)
 #endif
   n = gd_nframes(D);
   error = gd_error(D);
-  gd_close(D);
+  gd_discard(D);
 
   unlink(rawzip);
   unlink(format);
diff --git a/test/zzslim_seek.c b/test/zzslim_seek.c
new file mode 100644
index 0000000..60846f4
--- /dev/null
+++ b/test/zzslim_seek.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined(TEST_ZZIP) || !defined(TEST_SLIM) || !defined(USE_ZZSLIM)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *dataslm = "dirfile/data.slm";
+  const char *testzip = "dirfile/test.zip";
+  const char *format_data =
+    "data RAW UINT16 8\n"
+    "/ENCODING zzslim test\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress, twice */
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
+  if (gd_system(command))
+    return 1;
+  chdir(filedir);
+  snprintf(command, 4096, "%s test data.slm > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(dataslm);
+  unlink(data);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  CHECKI(n, 40);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(testzip);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/zzslim_seek_far.c b/test/zzslim_seek_far.c
new file mode 100644
index 0000000..1e60208
--- /dev/null
+++ b/test/zzslim_seek_far.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined(TEST_ZZIP) || !defined(TEST_SLIM) || !defined(USE_ZZSLIM)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *dataslm = "dirfile/data.slm";
+  const char *testzip = "dirfile/test.zip";
+  const char *format_data =
+    "data RAW UINT16 8\n"
+    "/ENCODING zzslim test\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress, twice */
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data);
+  if (gd_system(command))
+    return 1;
+  chdir(filedir);
+  snprintf(command, 4096, "%s test data.slm > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(dataslm);
+  unlink(data);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 500, 0, GD_SEEK_SET);
+  CHECKI(n, 256);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_discard(D);
+
+  unlink(testzip);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/util/Makefile.am b/util/Makefile.am
index 6b6db35..8cff836 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2010, 2014 D. V. Wiebe
+# Copyright (C) 2008-2010, 2013, 2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -20,16 +20,8 @@
 #
 AUTOMAKE_OPTIONS = foreign
 
-if CC_WALL
-WALL=-Wall
-endif
-
-if CC_WEXTRA
-WEXTRA=-Wextra
-endif
-
 LDADD=../src/libgetdata.la
-AM_CPPFLAGS=${WALL} $(WEXTRA) -I$(top_srcdir)/src
+AM_CPPFLAGS=${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src
 
 bin_PROGRAMS=checkdirfile dirfile2ascii
 checkdirfile_SOURCES=checkdirfile.c
diff --git a/util/Makefile.in b/util/Makefile.in
index 1fe7437..21e6ffe 100644
--- a/util/Makefile.in
+++ b/util/Makefile.in
@@ -86,10 +86,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
 	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
 	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
-	$(top_srcdir)/m4/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/matlab.m4 \
-	$(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \
+	$(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \
 	$(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -200,6 +198,8 @@ CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DATE = @DATE@
+DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@
+DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@
 DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
 DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
 DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
@@ -225,8 +225,19 @@ FCFLAGS = @FCFLAGS@
 FFLAGS = @FFLAGS@
 FGETDATA_VERSION = @FGETDATA_VERSION@
 FGREP = @FGREP@
+FLAC_CPPFLAGS = @FLAC_CPPFLAGS@
+FLAC_LDFLAGS = @FLAC_LDFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
 FLIBS = @FLIBS@
+GD_CC_WALL = @GD_CC_WALL@
+GD_CC_WEXTRA = @GD_CC_WEXTRA@
+GD_CXX_WALL = @GD_CXX_WALL@
+GD_CXX_WEXTRA = @GD_CXX_WEXTRA@
 GD_DIRSEP = @GD_DIRSEP@
+GD_F77_WALL = @GD_F77_WALL@
+GD_F77_WEXTRA = @GD_F77_WEXTRA@
+GD_FC_WALL = @GD_FC_WALL@
+GD_FC_WEXTRA = @GD_FC_WEXTRA@
 GD_FDIRSEP = @GD_FDIRSEP@
 GETDATAXX_VERSION = @GETDATAXX_VERSION@
 GETDATA_DEBUG = @GETDATA_DEBUG@
@@ -274,7 +285,6 @@ MEX = @MEX@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
-NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OTOOL = @OTOOL@
@@ -289,12 +299,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_MAN3EXT = @PERL_MAN3EXT@
+PHP = @PHP@
+PHP_CONFIG = @PHP_CONFIG@
+PHP_CPPFLAGS = @PHP_CPPFLAGS@
+PHP_ldflags = @PHP_ldflags@
+PHP_libs = @PHP_libs@
 PRINTF = @PRINTF@
 PRIVATE_LIBS = @PRIVATE_LIBS@
 PYTHON = @PYTHON@
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SED = @SED@
 SEQ = @SEQ@
@@ -358,9 +372,10 @@ moduledir = @moduledir@
 oldincludedir = @oldincludedir@
 path_bunzip2 = @path_bunzip2@
 path_bzip2 = @path_bzip2@
+path_flac = @path_flac@
 path_gunzip = @path_gunzip@
 path_gzip = @path_gzip@
-path_slim = @path_slim@
+path_slimdata = @path_slimdata@
 path_unslim = @path_unslim@
 path_unzip = @path_unzip@
 path_xz = @path_xz@
@@ -368,6 +383,7 @@ path_zip = @path_zip@
 pdfdir = @pdfdir@
 perldir = @perldir@
 perlmandir = @perlmandir@
+phpdir = @phpdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -381,7 +397,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-# Copyright (C) 2008, 2010, 2014 D. V. Wiebe
+# Copyright (C) 2008-2010, 2013, 2014 D. V. Wiebe
 #
 ##########################################################################
 #
@@ -402,10 +418,8 @@ top_srcdir = @top_srcdir@
 # 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
-AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(top_srcdir)/src
+AM_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src
 checkdirfile_SOURCES = checkdirfile.c
 dirfile2ascii_SOURCES = dirfile2ascii.c
 all: all-am
diff --git a/util/checkdirfile.c b/util/checkdirfile.c
index a124f30..a5a3cd5 100644
--- a/util/checkdirfile.c
+++ b/util/checkdirfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2010, 2012 D. V. Wiebe
+/* Copyright (C) 2007-2010, 2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -82,7 +82,8 @@ int main(int argc, char* argv[])
     return 1;
   }
 
-  /* open the dirfile */
+  /* open the dirfile -- the callback will print syntax errors as
+   * found, and return the number of lines with errors in ne. */
   puts("Checking syntax...");
   dirfile = gd_cbopen(argv[1], GD_RDONLY, callback, &ne);
 
@@ -107,6 +108,10 @@ int main(int argc, char* argv[])
 
     printf("  Syntax OK.\n\n");
 
+    /* Run through every known standards version and check whether the dirfile
+     * is conformant by trying to set the loaded dirfile's version to that
+     * value
+     */
     for (i = 0; i <= GD_DIRFILE_STANDARDS_VERSION; ++i) {
       if (gd_dirfile_standards(dirfile, i) == i) {
         vers[i] = 1;
@@ -121,6 +126,7 @@ int main(int argc, char* argv[])
       printf("Dirfile conforms to Standards %s ",
           (nvers == 1) ? "Version" : "Versions");
 
+      /* pretty-print the list of conformed versions */
       for (i = 0; i <= GD_DIRFILE_STANDARDS_VERSION; ++i) {
         if (vers[i]) {
           if (first == -1)
@@ -161,7 +167,7 @@ int main(int argc, char* argv[])
 
   }
 
-  /* Check the validity of each field defined */
+  /* Check the validity of each entry defined */
   ne = 0;
   puts("\nChecking fields...");
   flist = gd_entry_list(dirfile, NULL, 0, GD_ENTRIES_HIDDEN |
@@ -186,6 +192,8 @@ int main(int argc, char* argv[])
       nfields++;
     }
 
+    /* ferret out dangling meta ALIASes by first collecting a list
+     * of all of them, and then trying to use them as field codes */
     mflist = gd_entry_list(dirfile, flist[i], GD_ALIAS_ENTRIES,
         GD_ENTRIES_HIDDEN);
     for (j = 0; mflist[j] != NULL; ++j) {
@@ -205,7 +213,8 @@ int main(int argc, char* argv[])
     }
   }
 
-  /* look for dangling aliases */
+  /* ferret out dangling ALIASes by first collecting a list
+   * of all of them, and then trying to use them as field codes */
   flist = gd_entry_list(dirfile, NULL, GD_ALIAS_ENTRIES, GD_ENTRIES_HIDDEN);
   for (i = 0; flist[i] != NULL; ++i) {
     if (gd_entry_type(dirfile, flist[i]) == GD_NO_ENTRY) {
diff --git a/util/dirfile2ascii.c b/util/dirfile2ascii.c
index 7c78f27..e5c6c19 100644
--- a/util/dirfile2ascii.c
+++ b/util/dirfile2ascii.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 2010, 2011 Matthew Truch
- * Copyright (C) 2010, 2014 D. V. Wiebe
+ * Copyright (C) 2010, 2012, 2014 D. V. Wiebe
  *
  ***************************************************************************
  *
@@ -17,24 +17,9 @@
  * along with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#ifdef HAVE_CONFIG_H
-#include "gd_config.h"
-#endif
+#include "internal.h"
 
-#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 <limits.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
@@ -61,7 +46,7 @@ struct field
 void version(void)
 {
   printf("dirfile2ascii (%s)\n"
-      "Copyright (C) 2010, 2011, 2014 Matthew Truch and others\n\n"
+      "Copyright (C) 2010, 2011, 2012, 2014 Matthew Truch and others\n\n"
       "Please send reports of bugs and other communication to:\n  %s\n\n"
       "This program comes with NO WARRANTY, not even for MERCHANTABILITY "
       "or FITNESS\n"

-- 
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